processList.vue 5.8 KB

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