processList.vue 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  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? unporcessList.length:porcessedList.length}} </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="unporcessList.length === 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="porcessedList.length === 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. };
  81. },
  82. onLoad: function(option) {
  83. this.getProcessData({
  84. "company_code": uni.getStorageSync('selectedCode'),
  85. "type": option.type,
  86. "processing_status": 0
  87. }, 0);
  88. this.companyCode = option.companyCode;
  89. this.processingStatus = 1
  90. this.type = option.type;
  91. let url = "";
  92. switch (parseInt(option.type)) {
  93. case 1:
  94. url = "报警主机"
  95. break;
  96. case 2:
  97. url = "水系统"
  98. break;
  99. case 4:
  100. url = "消防栓监测"
  101. break;
  102. case 6:
  103. url = "RTU测控终端"
  104. break;
  105. case 7:
  106. url = "电气火灾"
  107. break;
  108. case 16:
  109. url = "视频告警"
  110. break;
  111. case 17:
  112. url = "电梯报警"
  113. break;
  114. case 128:
  115. url = "井盖监测"
  116. break;
  117. case 129:
  118. url = "地磁"
  119. break;
  120. case 130:
  121. url = "门磁"
  122. break;
  123. case 131:
  124. url = "可燃气体"
  125. break;
  126. default:
  127. break;
  128. }
  129. uni.setNavigationBarTitle({
  130. title: url
  131. });
  132. },
  133. onNavigationBarButtonTap(e) {
  134. console.log(e)
  135. uni.navigateTo({
  136. url: '/pages/export/export',
  137. success: res => {},
  138. fail: () => {},
  139. complete: () => {}
  140. });
  141. },
  142. methods: {
  143. async getProcessData(params = {}, whichTab) {
  144. const res = await this.$myRequest({
  145. url: 'ComprehensiveAlarm/getIntegratedAlarmList',
  146. data: params,
  147. showLoading: true
  148. })
  149. this.unporcessList = res.data.data;
  150. console.log('this.unporcessList')
  151. console.log(this.unporcessList)
  152. if (whichTab == 0) {
  153. this.unporcessList = res.data.data;
  154. this.alarmUntreatedCount = parseInt(res.data.alarmUntreatedCount)
  155. } else {
  156. this.porcessedList = res.data.data;
  157. this.alarmUntreatedCount1 = parseInt(res.data.alarmUntreatedCount)
  158. }
  159. },
  160. tabSelect(e) {
  161. console.log(e.currentTarget);
  162. this.TabCur = e.currentTarget.dataset.id;
  163. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
  164. this.getProcessData({
  165. "company_code": uni.getStorageSync('selectedCode'),
  166. "type": this.type,
  167. "processing_status": e.currentTarget.dataset.id
  168. }, 1);
  169. },
  170. // 页面跳转
  171. goUnprocessDetail(item) {
  172. if (item.type == 1 || item.type == 3)
  173. uni.navigateTo({
  174. url: '/pages/unprocessDetail/unprocessDetail?id=' + item
  175. .id + '&type=' + this.type + '&deviceCode=' + item.device_code + '&data2=' + item.data2 +
  176. '&data3=' + item.data3 + '&data5=' + item.data5,
  177. });
  178. },
  179. goProcessedDetail(item) {
  180. uni.navigateTo({
  181. url: '/pages/processedDetail/processedDetail?id=' + item.id + '&type=' + item.type,
  182. success: res => {},
  183. fail: () => {},
  184. complete: () => {}
  185. });
  186. },
  187. }
  188. }
  189. </script>
  190. <style lang="scss">
  191. //已处理未处理消息个数样式
  192. .nav .cu-item.cur {
  193. position: relative;
  194. border-bottom: 8rpx solid;
  195. }
  196. .cu-tag.badge {
  197. top: 14rpx;
  198. right: 96rpx;
  199. }
  200. .nav .cu-item {
  201. width: 50%;
  202. margin: 0;
  203. .text-blue,
  204. .line-blue,
  205. .lines-blue {
  206. color: #4274E7
  207. }
  208. }
  209. </style>