processList.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244
  1. <template>
  2. <view class="processWrapper ">
  3. <view style="height:98rpx"></view>
  4. <view class="ding">
  5. <scroll-view scroll-x class="bg-white nav text-center">
  6. <view class="cu-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabNav"
  7. :key="index" @tap="tabSelect" :data-id="index">
  8. <view v-if="TabCur==index" class="cu-tag badge">
  9. <block class="cu-tag badge">{{TabCur? porcessedList.length:alarm_count}} </block>
  10. </view>
  11. {{item}}
  12. </view>
  13. </scroll-view>
  14. </view>
  15. <block v-if="TabCur==0">
  16. <view class="processList">
  17. <view class="cu-list menu-avatar">
  18. <view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
  19. <view class="cu-avatar lg" style="background-image:url(../../static/process-icon.png);"></view>
  20. <view class="content">
  21. <view class="pro-title">
  22. <view class="cut">{{item.owner_name}}</view>
  23. </view>
  24. <view class="pro-des ">
  25. <view class="text-cut">
  26. {{item.unitinfo}}
  27. </view>
  28. </view>
  29. <view class="pro-date ">{{item.time}}</view>
  30. </view>
  31. <view class="action" style="z-index:99">
  32. <view class="unProcess" @tap="goUnprocessDetail(item)">未处理</view>
  33. </view>
  34. </view>
  35. <view class=" text-center margin-top" v-if="alarm_count === 0">暂无数据...</view>
  36. </view>
  37. </view>
  38. </block>
  39. <block v-if="TabCur==1">
  40. <view class="processList">
  41. <view class="cu-list menu-avatar ">
  42. <view class="cu-item" v-for="(item,index) in porcessedList" :key="index">
  43. <view class="cu-avatar lg" style="background-image:url(../../static/processed-icon.png);">
  44. </view>
  45. <view class="content">
  46. <view class="pro-title">
  47. <view class="cut">{{item.owner_name}}</view>
  48. </view>
  49. <view class="pro-des ">
  50. <view class="text-cut">
  51. {{item.unitinfo}}
  52. </view>
  53. </view>
  54. <view class="pro-date ">{{item.time}}</view>
  55. </view>
  56. <view class="action" style="z-index:99">
  57. <view class="processed" @tap="goProcessedDetail(item)">已处理</view>
  58. </view>
  59. </view>
  60. <view class="text-center margin-top" v-if="alarm_count1 === 0">暂无数据...</view>
  61. </view>
  62. </view>
  63. </block>
  64. </view>
  65. </template>
  66. <script>
  67. import json from '../../data/json.js';
  68. export default {
  69. data() {
  70. return {
  71. unporcessList: [],
  72. porcessedList: [],
  73. type: '0',
  74. modalName: null,
  75. listTouchStart: 0,
  76. listTouchDirection: null,
  77. CustomBar: this.CustomBar,
  78. TabCur: 0,
  79. tabNav: ['未处理', '已处理'],
  80. alarm_count:'',
  81. alarm_count1:''
  82. };
  83. },
  84. onLoad: function(option) {
  85. this.getProcessData({
  86. "company_code": uni.getStorageSync('selectedCode'),
  87. "type": option.type,
  88. "processing_status": 0
  89. }, 0);
  90. this.companyCode = option.companyCode;
  91. this.processingStatus = 1
  92. this.type = option.type;
  93. let url = "";
  94. switch (parseInt(option.type)) {
  95. case 1:
  96. url = "报警主机"
  97. break;
  98. case 2:
  99. url = "水系统"
  100. break;
  101. case 4:
  102. url = "消防栓监测"
  103. break;
  104. case 6:
  105. url = "RTU测控终端"
  106. break;
  107. case 7:
  108. url = "电气火灾"
  109. break;
  110. case 16:
  111. url = "视频告警"
  112. break;
  113. case 17:
  114. url = "电梯报警"
  115. break;
  116. case 128:
  117. url = "井盖监测"
  118. break;
  119. case 129:
  120. url = "地磁"
  121. break;
  122. case 130:
  123. url = "门磁"
  124. break;
  125. case 131:
  126. url = "可燃气体"
  127. break;
  128. default:
  129. break;
  130. }
  131. uni.setNavigationBarTitle({
  132. title: url
  133. });
  134. },
  135. onNavigationBarButtonTap(e) {
  136. console.log(e)
  137. uni.navigateTo({
  138. url: '/pages/export/export',
  139. success: res => {},
  140. fail: () => {},
  141. complete: () => {}
  142. });
  143. },
  144. methods: {
  145. async getProcessData(params = {}, whichTab) {
  146. const res = await this.$myRequest({
  147. url: 'ComprehensiveAlarm/getIntegratedAlarmList',
  148. data: params,
  149. showLoading: true
  150. })
  151. this.unporcessList = res.data.data;
  152. // this.alarm_count=res.data.alarm_count
  153. if (whichTab == 0) {
  154. this.unporcessList = res.data.data;
  155. this.alarm_count=parseInt(res.data.alarm_count)
  156. } else {
  157. this.porcessedList = res.data.data;
  158. this.alarm_count1=parseInt(res.data.alarm_count)
  159. }
  160. },
  161. tabSelect(e) {
  162. this.unporcessList=[],
  163. this.porcessedList=[],
  164. console.log(e.currentTarget);
  165. this.TabCur = e.currentTarget.dataset.id;
  166. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
  167. this.getProcessData({
  168. "company_code": uni.getStorageSync('selectedCode'),
  169. "type": this.type,
  170. "processing_status": e.currentTarget.dataset.id
  171. }, this.TabCur);
  172. },
  173. // 页面跳转
  174. goUnprocessDetail(item) {
  175. if (item.type == 1 || item.type == 3)
  176. uni.navigateTo({
  177. url: '/pages/unprocessDetail/unprocessDetail?id=' + item
  178. .id + '&type=' + this.type + '&deviceCode=' + item.device_code + '&data2=' + item.data2 +
  179. '&data3=' + item.data3 + '&data5=' + item.data5,
  180. });
  181. },
  182. goProcessedDetail(item) {
  183. uni.navigateTo({
  184. url: '/pages/processedDetail/processedDetail?id=' + item.id + '&type=' + item.type,
  185. success: res => {},
  186. fail: () => {},
  187. complete: () => {}
  188. });
  189. },
  190. }
  191. }
  192. </script>
  193. <style lang="scss">
  194. //已处理未处理消息个数样式
  195. .nav .cu-item.cur {
  196. position: relative;
  197. border-bottom: 8rpx solid;
  198. }
  199. .cu-tag.badge {
  200. top: 14rpx;
  201. right: 96rpx;
  202. }
  203. .nav .cu-item {
  204. width: 50%;
  205. margin: 0;
  206. .text-blue,
  207. .line-blue,
  208. .lines-blue {
  209. color: #4274E7
  210. }
  211. }
  212. </style>