device-Manage.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <template>
  2. <view class="">
  3. <view class="cu-list menu-avatar">
  4. <view class="cu-item" :class="modalName=='move-box-'+ index?'move-cur':''"
  5. v-for="(item,index) in getData" :key="index" :data-target="'move-box-' + index"
  6. @tap="goDeviceDetail(item)">
  7. <view class="cu-avatar round lg" style="background-image:url(../../static/device-icon.png)"></view>
  8. <view class="content">
  9. <view class="pro-title">
  10. <view class="cut">{{item.owner_name}}</view>
  11. </view>
  12. <view class="pro-des ">
  13. <view class="text-cut">
  14. {{item.unitinfo}}
  15. </view>
  16. </view>
  17. <view class="pro-date ">{{item.install_time}}</view>
  18. </view>
  19. <view class="nav-right num">
  20. <view class="text-grey">
  21. <span class="online">{{item.device_state}}</span>
  22. <!-- <span class="offline" v-if="item.status==1">离线</span>
  23. <span class="error" v-if="item.status==2">故障</span> -->
  24. <text class="icon iconfont margin-right-xs margin-left-lg">&#xe629;</text>
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </view>
  30. </template>
  31. <script>
  32. import json from '../../data/json.js';
  33. export default {
  34. data() {
  35. return {
  36. deviceManage: json.deviceManage,
  37. modalName: null,
  38. getData:[]
  39. };
  40. },
  41. onLoad: function(option) {
  42. let url = "";
  43. switch (parseInt(option.dwtype)) {
  44. case 1:
  45. url = "火警"
  46. break;
  47. case 2:
  48. url = "水警"
  49. break;
  50. case 3:
  51. url = "烟感"
  52. break;
  53. case 4:
  54. url = "消防栓监测"
  55. break;
  56. case 5:
  57. url = "液位"
  58. break;
  59. case 6:
  60. url = "RTU测控终端"
  61. break;
  62. case 7:
  63. url = "电气火灾"
  64. break;
  65. case 16:
  66. url = "视频告警"
  67. break;
  68. case 17:
  69. url = "电梯报警"
  70. break;
  71. case 128:
  72. url = "井盖监测"
  73. break;
  74. case 129:
  75. url = "地磁"
  76. break;
  77. case 130:
  78. url = "门磁"
  79. break;
  80. case 131:
  81. url = "可燃气体"
  82. break;
  83. default:
  84. break;
  85. }
  86. uni.setNavigationBarTitle({
  87. title: "设备管理(" + url + ")",
  88. });
  89. this.getDeviceList({'company_code':uni.getStorageSync('selectedCode'),"dwtype":option.dwtype})
  90. },
  91. onNavigationBarButtonTap(e) {
  92. console.log(e)
  93. uni.navigateTo({
  94. url: '/pages/export/export',
  95. });
  96. },
  97. methods: {
  98. // 页面跳转
  99. goDeviceDetail(item) {
  100. uni.navigateTo({
  101. url: '/pages/deviceDetail/deviceDetail?id='+item.id,
  102. });
  103. },
  104. // 设备类型数据请求
  105. async getDeviceList(params = {}) {
  106. const res = await this.$myRequest({
  107. url: 'DeviceManagement/getDeviceList',
  108. data:params,
  109. showLoading: true
  110. })
  111. this.getData=res.data.data;
  112. console.log(this.getData);
  113. },
  114. }
  115. }
  116. </script>
  117. <style lang="scss">
  118. .cu-item {
  119. height: 180rpx !important
  120. }
  121. </style>