alarmRecord.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view>
  3. <view class="alarm" v-for="item in deviceAlarmRecords" :key="item.code">
  4. <text class="title">{{item.alarmName}}</text>
  5. <view class="content">
  6. <text>报警时间:{{item.startTime}}</text>
  7. <text>变量ID:{{item.variableId}}</text>
  8. <text>报警状态:{{item.status}}</text>
  9. <text>持续时长:{{item.status}}</text>
  10. </view>
  11. </view>
  12. <view class="anniu">
  13. <image class="anniu" src="../../static/设备菜单/前往列表@2x.png" @tap="back"></image>
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. deviceAlarmRecords: [],
  22. }
  23. },
  24. onLoad() {
  25. uni.request({
  26. url: 'http://127.0.0.1:9999/deviceAlarmRecord/list',
  27. method: 'GET',
  28. data: {},
  29. success: res => {
  30. this.deviceAlarmRecords = res.data.data.deviceAlarmRecords;
  31. console.log(res.data.data.deviceAlarmRecords);
  32. },
  33. })
  34. },
  35. methods: {
  36. back() {
  37. uni.navigateTo({
  38. url: '/pages/device/deviceInfo/deviceInfo'
  39. })
  40. }
  41. }
  42. }
  43. </script>
  44. <style>
  45. .anniu {
  46. width: 116rpx;
  47. height: 116rpx;
  48. float: right;
  49. margin-top: 10rpx;
  50. margin-right: 4rpx;
  51. }
  52. .alarm {
  53. width: 702rpx;
  54. height: 329rpx;
  55. background-color: white;
  56. margin-top: 30rpx;
  57. margin-left: 24rpx;
  58. border-radius: 10rpx;
  59. padding-top: 30rpx;
  60. }
  61. .content {
  62. display: flex;
  63. flex-direction: column;
  64. margin-top: 30rpx;
  65. margin-left: 30rpx;
  66. line-height: 55rpx;
  67. font-size: 28rpx;
  68. color: #444546;
  69. }
  70. .title {
  71. font-size: 36rpx;
  72. margin-left: 30rpx;
  73. color: #282828;
  74. font-weight: 600;
  75. }
  76. </style>