processList.vue 5.8 KB

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