device-Manage.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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 6:
  57. url = "RTU测控终端"
  58. break;
  59. case 7:
  60. url = "电气火灾"
  61. break;
  62. case 16:
  63. url = "视频告警"
  64. break;
  65. case 17:
  66. url = "电梯报警"
  67. break;
  68. case 128:
  69. url = "井盖监测"
  70. break;
  71. case 129:
  72. url = "地磁"
  73. break;
  74. case 130:
  75. url = "门磁"
  76. break;
  77. case 131:
  78. url = "可燃气体"
  79. break;
  80. default:
  81. break;
  82. }
  83. uni.setNavigationBarTitle({
  84. title: "设备管理(" + url + ")",
  85. });
  86. this.getDeviceList({'company_code':uni.getStorageSync('selectedCode'),"dwtype":option.dwtype})
  87. },
  88. onNavigationBarButtonTap(e) {
  89. console.log(e)
  90. uni.navigateTo({
  91. url: '/pages/export/export',
  92. });
  93. },
  94. methods: {
  95. // 页面跳转
  96. goDeviceDetail(item) {
  97. uni.navigateTo({
  98. url: '/pages/deviceDetail/deviceDetail?id='+item.id,
  99. });
  100. },
  101. // 设备类型数据请求
  102. async getDeviceList(params = {}) {
  103. const res = await this.$myRequest({
  104. url: 'DeviceManagement/getDeviceList',
  105. data:params,
  106. showLoading: true
  107. })
  108. this.getData=res.data.data;
  109. console.log(this.getData);
  110. },
  111. }
  112. }
  113. </script>
  114. <style lang="scss">
  115. .cu-item {
  116. height: 180rpx !important
  117. }
  118. </style>