processList.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240
  1. <template>
  2. <view class="processWrapper ">
  3. <view class="ding">
  4. <scroll-view scroll-x class="bg-white nav text-center">
  5. <view class="cu-item" :class="index==TabCur?'text-blue cur':''" v-for="(item,index) in tabNav" :key="index" @tap="tabSelect"
  6. :data-id="index">
  7. <view v-if="TabCur==index" class="cu-tag badge">
  8. <block class="cu-tag badge">{{TabCur?alarmUntreatedCount1:alarmUntreatedCount}} </block>
  9. </view>
  10. {{item}}
  11. </view>
  12. </scroll-view>
  13. </view>
  14. <block v-if="TabCur==0">
  15. <view class="processList">
  16. <view class="cu-list menu-avatar">
  17. <view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
  18. <view class="cu-avatar lg" style="background-image:url(../../static/process-icon.png);"></view>
  19. <view class="content">
  20. <view class="pro-title">
  21. <view class="cut">{{item.measName}}</view>
  22. </view>
  23. <view class="pro-des ">
  24. <view class="text-cut">
  25. {{item.digitalValue!=0?"动作":"复归"}}
  26. </view>
  27. </view>
  28. <view class="pro-date ">{{item.soeTime}}</view>
  29. </view>
  30. <view class="action" style="z-index:99">
  31. <view class="unProcess" v-if="type==1" @tap="goUnprocessDetail(item.id)">未处理</view>
  32. <view class="unProcess" v-else @tap="goVideoUnprocessDetail(item.id)">未处理</view>
  33. </view>
  34. </view>
  35. <view class=" text-center margin-top" v-if="alarmUntreatedCount === 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);"></view>
  44. <view class="content">
  45. <view class="pro-title">
  46. <view class="cut">{{item.measName}}</view>
  47. </view>
  48. <view class="pro-des ">
  49. <view class="text-cut">
  50. {{item.digitalValue!=0?"动作":"复归"}}
  51. </view>
  52. </view>
  53. <view class="pro-date ">{{item.soeTime}}</view>
  54. </view>
  55. <view class="action" style="z-index:99">
  56. <view class="processed" v-if="type==1" @tap="goProcessedDetail(item.id)">已处理</view>
  57. <view class="processed" v-else @tap="goVideoProcessedDetail(item.id)">已处理</view>
  58. </view>
  59. </view>
  60. <view class="text-center margin-top" v-if="alarmUntreatedCount1 === 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: json.unprocessList,
  72. unporcessList: [],
  73. porcessedList: [],
  74. type: '0',
  75. modalName: null,
  76. listTouchStart: 0,
  77. listTouchDirection: null,
  78. CustomBar: this.CustomBar,
  79. TabCur: 0,
  80. tabNav: ['未处理', '已处理'],
  81. companyCode: '',
  82. alarmUntreatedCount: '',
  83. alarmUntreatedCount1: '',
  84. processingStatus: '',
  85. };
  86. },
  87. onLoad: function(option) {
  88. console.log(option.type);
  89. console.log(option.companyCode);
  90. if (option.type == 1) {
  91. uni.setNavigationBarTitle({
  92. title: '电力检测'
  93. });
  94. } else {
  95. uni.setNavigationBarTitle({
  96. title: '视频告警'
  97. });
  98. }
  99. this.getProcessData({
  100. "companyCode": option.companyCode,
  101. "type": option.type,
  102. "processingStatus": "0"
  103. }, 0);
  104. console.log('onload里')
  105. this.companyCode = option.companyCode;
  106. this.processingStatus = 1
  107. this.type = option.type;
  108. },
  109. methods: {
  110. async getProcessData(ming = {}, whichTab) {
  111. const res = await this.$myRequest({
  112. url: 'IntegratedAlarm/getElectricAlarmUntreated',
  113. data: ming,
  114. showLoading:true
  115. })
  116. if (whichTab == 0) {
  117. this.unporcessList = res.data.data;
  118. this.alarmUntreatedCount = parseInt(res.data.alarmUntreatedCount)
  119. } else {
  120. this.porcessedList = res.data.data;
  121. this.alarmUntreatedCount1 = parseInt(res.data.alarmUntreatedCount)
  122. }
  123. // console.log(res.data)
  124. },
  125. tabSelect(e) {
  126. console.log(e.currentTarget);
  127. this.TabCur = e.currentTarget.dataset.id;
  128. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
  129. this.getProcessData({
  130. "companyCode": this.companyCode,
  131. "type": this.type,
  132. "processingStatus": e.currentTarget.dataset.id
  133. }, this.TabCur);
  134. },
  135. // 页面跳转
  136. goUnprocessDetail(id) {
  137. uni.navigateTo({
  138. url: '/pages/unprocessDetail/unprocessDetail?companyCode=' + this.companyCode + '&processingStatus=0&id=' + id +
  139. '&type=1',
  140. success: res => {},
  141. fail: () => {},
  142. complete: () => {}
  143. });
  144. },
  145. goVideoUnprocessDetail(id) {
  146. uni.navigateTo({
  147. url: '/pages/unprocessDetail/unprocessDetail?companyCode=' + this.companyCode + '&processingStatus=0&id=' + id +
  148. '&type=2',
  149. success: res => {},
  150. fail: () => {},
  151. complete: () => {}
  152. });
  153. },
  154. goProcessedDetail(id) {
  155. uni.navigateTo({
  156. url: '/pages/processedDetail/processedDetail?companyCode=' + this.companyCode + '&processingStatus=' + this.processingStatus +
  157. '&id=' + id + '&type=1',
  158. success: res => {},
  159. fail: () => {},
  160. complete: () => {}
  161. });
  162. },
  163. goVideoProcessedDetail(id) {
  164. uni.navigateTo({
  165. url: '/pages/processedDetail/processedDetail?companyCode=' + this.companyCode + '&processingStatus=' + this.processingStatus +
  166. '&id=' + id + '&type=2',
  167. success: res => {},
  168. fail: () => {},
  169. complete: () => {}
  170. });
  171. }
  172. }
  173. }
  174. </script>
  175. <style lang="scss">
  176. //已处理未处理消息个数样式
  177. .nav .cu-item.cur {
  178. position: relative;
  179. border-bottom: 8rpx solid;
  180. }
  181. .cu-tag.badge {
  182. top: 14rpx;
  183. right: 96rpx;
  184. }
  185. .nav .cu-item {
  186. width: 50%;
  187. margin: 0;
  188. .text-blue,
  189. .line-blue,
  190. .lines-blue {
  191. color: #4274E7
  192. }
  193. }
  194. </style>