processList.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  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 class="cu-tag badge" >
  8. <block class="cu-tag badge" >{{alarmUntreatedCount}}</block>
  9. </view> -->
  10. {{tabNav[index]}}
  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="item.id">
  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">未处理</view>
  33. --> </view>
  34. </view>
  35. </view>
  36. </view>
  37. </block>
  38. <block v-if="TabCur==1">
  39. <view class="processList">
  40. <view class="cu-list menu-avatar ">
  41. <view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
  42. <view class="cu-avatar lg" style="background-image:url(../../static/processed-icon.png);"></view>
  43. <view class="content">
  44. <view class="pro-title">
  45. <view class="cut">{{item.measName}}</view>
  46. </view>
  47. <view class="pro-des ">
  48. <view class="text-cut">
  49. {{item.digitalValue!=0?"动作":"复归"}}
  50. </view>
  51. </view>
  52. <view class="pro-date ">{{item.soeTime}}</view>
  53. </view>
  54. <view class="action" style="z-index:99">
  55. <view class="processed" v-if="type==1" @tap="goProcessedDetail(item.id)">已处理</view>
  56. <view class="processed" v-else @tap="goVideoProcessedDetail">已处理</view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </block>
  62. </view>
  63. </template>
  64. <script>
  65. import json from '../../data/json.js';
  66. export default {
  67. data() {
  68. return {
  69. // unporcessList: json.unprocessList,
  70. unporcessList:[],
  71. type: '0',
  72. modalName: null,
  73. listTouchStart: 0,
  74. listTouchDirection: null,
  75. CustomBar: this.CustomBar,
  76. TabCur: 0,
  77. tabNav: ['未处理', '已处理'],
  78. companyCode:'',
  79. alarmUntreatedCount:'',
  80. processingStatus:''
  81. };
  82. },
  83. onLoad: function(option) {
  84. console.log(option.type);
  85. console.log(option.companyCode);
  86. if (option.type == 1) {
  87. uni.setNavigationBarTitle({
  88. title: '电力检测'
  89. });
  90. } else {
  91. uni.setNavigationBarTitle({
  92. title: '视频告警'
  93. });
  94. }
  95. this.companyCode = option.companyCode;
  96. this.processingStatus=1
  97. this.type = 1;
  98. this.getProcessData({"companyCode":option.companyCode,"type":option.type,"processingStatus":"0"});
  99. },
  100. methods: {
  101. async getProcessData(ming={}) {
  102. const res= await this.$myRequest({
  103. url:'IntegratedAlarm/getElectricAlarmUntreated',
  104. data:ming
  105. })
  106. this.unporcessList=res.data.data;
  107. this.alarmUntreatedCount=res.data.alarmUntreatedCount
  108. console.log(res.data)
  109. },
  110. tabSelect(e) {
  111. console.log(e.currentTarget);
  112. this.TabCur = e.currentTarget.dataset.id;
  113. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
  114. this.getProcessData({"companyCode":this.companyCode,"type":"1","processingStatus":e.currentTarget.dataset.id});
  115. },
  116. // 页面跳转
  117. goUnprocessDetail(id) {
  118. uni.navigateTo({
  119. url: '/pages/unprocessDetail/unprocessDetail?companyCode='+this.companyCode+'&processingStatus=0&id='+id+'&type=1',
  120. success: res => {},
  121. fail: () => {},
  122. complete: () => {}
  123. });
  124. },
  125. goProcessedDetail(id) {
  126. uni.navigateTo({
  127. url: '/pages/processedDetail/processedDetail?companyCode='+this.companyCode+'&processingStatus='+this.processingStatus+'&id='+id+'&type=1',
  128. success: res => {},
  129. fail: () => {},
  130. complete: () => {}
  131. });
  132. },
  133. goVideoUnprocessDetail() {
  134. uni.navigateTo({
  135. url: '/pages/unprocessDetail/unprocessDetail?type=2',
  136. success: res => {},
  137. fail: () => {},
  138. complete: () => {}
  139. });
  140. },
  141. goVideoProcessedDetail() {
  142. uni.navigateTo({
  143. url: '/pages/processedDetail/processedDetail?type=2',
  144. success: res => {},
  145. fail: () => {},
  146. complete: () => {}
  147. });
  148. }
  149. }
  150. }
  151. </script>
  152. <style lang="scss">
  153. //已处理未处理消息个数样式
  154. .nav .cu-item.cur {
  155. position: relative;
  156. border-bottom: 8rpx solid;
  157. }
  158. .cu-tag.badge {
  159. top: 14rpx;
  160. right: 96rpx;
  161. }
  162. .nav .cu-item {
  163. width: 50%;
  164. margin: 0;
  165. .text-blue,
  166. .line-blue,
  167. .lines-blue {
  168. color: #4274E7
  169. }
  170. }
  171. </style>