processList.vue 6.2 KB

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