alarm.vue 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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>地&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;区:</text>
  7. <text>客户名称:</text>
  8. <text>报警类型:{{item.alarmType}}</text>
  9. <text>报警时间:{{item.createTime}}</text>
  10. </view>
  11. </view>
  12. </view>
  13. </template>
  14. <script>
  15. export default {
  16. data() {
  17. return {
  18. deviceAlarmRecords: [],
  19. }
  20. },
  21. onLoad() {
  22. uni.request({
  23. url: 'http://127.0.0.1:9999/deviceAlarmRecord/list',
  24. method: 'GET',
  25. data: {},
  26. success: res => {
  27. this.deviceAlarmRecords = res.data.data.deviceAlarmRecords;
  28. console.log(res.data.data.deviceAlarmRecords);
  29. },
  30. })
  31. },
  32. methods: {
  33. }
  34. }
  35. </script>
  36. <style>
  37. .alarm {
  38. width: 702rpx;
  39. height: 329rpx;
  40. background-color: white;
  41. margin-top: 30rpx;
  42. margin-left: 24rpx;
  43. border-radius: 10rpx;
  44. padding-top: 30rpx;
  45. }
  46. .content {
  47. font-size: 28rpx;
  48. display: flex;
  49. flex-direction: column;
  50. margin-top: 30rpx;
  51. margin-left: 30rpx;
  52. line-height: 55rpx;
  53. color: #444546;
  54. }
  55. .title {
  56. font-size: 36rpx;
  57. margin-left: 30rpx;
  58. color: #282828;
  59. font-weight: 600;
  60. }
  61. </style>