processList.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468
  1. <template>
  2. <view class="processWrapper ">
  3. <view style="height:100rpx"></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&&!TabCur" class="cu-tag badge">
  9. <block class="cu-tag badge">{{alarmUntreatedCount}} </block>
  10. </view>
  11. {{item}}
  12. </view>
  13. </scroll-view>
  14. </view>
  15. <block v-if="TabCur==0">
  16. <view class="processList">
  17. <view class="cu-list menu-avatar">
  18. <view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
  19. <view class="cu-avatar lg" style="background-image:url(../../static/process-icon.png);"></view>
  20. <view class="content" style="width:450rpx">
  21. <view class="pro-title">
  22. <view class="cut inOneLine">{{item.measName}}</view>
  23. </view>
  24. <view class="pro-des ">
  25. <view class="text-cut inOneLine">
  26. {{item.digitalValue!=0?"动作":"复归"}}
  27. </view>
  28. </view>
  29. <view class="pro-date ">{{item.soeTime}}</view>
  30. </view>
  31. <view class="action" style="z-index:99;width:170rpx;text-align:right">
  32. <view class="unProcess" @tap="type==1?goUnprocessDetail(item):goVideoUnprocessDetail(item)">
  33. 未处理<text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text></view>
  34. </view>
  35. </view>
  36. <view class=" text-center margin-top" v-if="alarmUntreatedCount == 0">暂无数据...</view>
  37. <view v-show="isLoadMore&&alarmUntreatedCount!= 0&&this.currentPage>1">
  38. <uni-load-more :status="loadStatus"></uni-load-more>
  39. </view>
  40. </view>
  41. </view>
  42. </block>
  43. <!-- 已处理start -->
  44. <block v-if="TabCur==1">
  45. <view class="processList">
  46. <!-- 电力监测筛选 start -->
  47. <view v-if="this.type==1 " class=" padding-bottom-xs"
  48. style="border-bottom:1rpx solid rgba(221,221,221,.3)">
  49. <view class="cu-bar search filter-section">
  50. <view class="search-form border-gray round bg-white">
  51. <select name="" id="" v-model="handleStatus">
  52. <option value="0">全部</option>
  53. <option value="1">已处理</option>
  54. <option value="2">待确认</option>
  55. <option value="3">自动恢复</option>
  56. <option value="4">过期失效</option>
  57. </select>
  58. </view>
  59. <view class="action" v-if="this.handleStatus==2">
  60. <view>
  61. <checkbox-group class="block " @change="allChoose">
  62. <view class="cu-form-group">
  63. <checkbox value="all" class='round blue' :class="{'checked':allChecked}"
  64. :checked="allChecked?true:false">
  65. </checkbox>
  66. <view class="title">批量处理</view>
  67. </view>
  68. </checkbox-group>
  69. </view>
  70. </view>
  71. </view>
  72. </view>
  73. <!-- 电力监测筛选end -->
  74. <checkbox-group @change="changeCheckbox">
  75. <view class="cu-list menu-avatar " :class="this.handleStatus==2?'handle2scroll':''">
  76. <view class="cu-item" v-for="(item,index) in porcessedList" :key="index">
  77. <view class="cu-form-group checkPos">
  78. <checkbox :value="String(item.id)" class='round blue '
  79. :class="{'checked':checkedArr.includes(String(item.id))}"
  80. :checked="checkedArr.includes(String(item.id))">
  81. </checkbox>
  82. </view>
  83. <view class="cu-avatar lg" :style="{'left':handleStatus==2 ? '60rpx':'0'}"
  84. style="background-image:url(../../static/processed-icon.png);"></view>
  85. <view class="content" style="width:400rpx"
  86. :style="{'left':handleStatus==2 ? '180rpx':'120rpx'}">
  87. <view class="pro-title">
  88. <view class="cut inOneLine">{{item.measName}}</view>
  89. </view>
  90. <view class="pro-des ">
  91. <view class="text-cut inOneLine">
  92. {{item.digitalValue!=0?"动作":"复归"}}
  93. </view>
  94. </view>
  95. <view class="pro-date ">{{item.soeTime}}</view>
  96. </view>
  97. <view class="action" style="z-index:99;width:180rpx;text-align:right">
  98. <view class="processed" v-if="item.handling_status==1"
  99. @tap="type==1?goProcessedDetail(item):goVideoProcessedDetail(item)">
  100. 已处理
  101. <text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text>
  102. </view>
  103. <view style="color:#FF8125" v-if="item.handling_status==2"
  104. @tap="goProcessedDetail(item)">待确认
  105. <text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text>
  106. </view>
  107. <view style="color:#4274E7" v-if="item.handling_status==3"
  108. @tap="goProcessedDetail(item)">自动恢复
  109. <text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text>
  110. </view>
  111. <view style="color:#999999" v-if="item.handling_status==4"
  112. @tap="goProcessedDetail(item)">过期失效
  113. <text class="icon iconfont margin-left-xs margin-right-xs">&#xe629;</text>
  114. </view>
  115. </view>
  116. </view>
  117. <view class="text-center margin-top" v-if="alarmUntreatedCount1 == 0">暂无数据...</view>
  118. <view v-show="isLoadMore&&alarmUntreatedCount1 != 0&&this.currentPage>1"
  119. :style="{'padding-top':this.handleStatus==2 ? '50rpx':'','padding-bottom':this.handleStatus==2 ? '180rpx':''}">
  120. <uni-load-more :status="loadStatus"></uni-load-more>
  121. </view>
  122. </view>
  123. <view v-if="this.handleStatus==2" class="btn-area submitBottomBtn padding-lr-sm">
  124. <button class="bg-blue round margin-top" @click="$noMultipleClicks(quickConfirm)">快速确认
  125. </button>
  126. </view>
  127. </checkbox-group>
  128. </view>
  129. </block>
  130. <!-- 已处理end -->
  131. </view>
  132. </template>
  133. <script>
  134. import json from '../../data/json.js';
  135. export default {
  136. data() {
  137. return {
  138. noClick: true,
  139. allChecked: false,
  140. checkbox: [{
  141. value: 'A',
  142. checked: true
  143. }, {
  144. value: 'B',
  145. checked: true
  146. }, {
  147. value: 'C',
  148. checked: false
  149. }],
  150. handleStatus: 0,
  151. checkedArr: [],
  152. unporcessList: [],
  153. porcessedList: [],
  154. type: '0',
  155. modalName: null,
  156. listTouchStart: 0,
  157. listTouchDirection: null,
  158. CustomBar: this.CustomBar,
  159. TabCur: 0,
  160. tabNav: ['未处理', '已处理'],
  161. companyCode: '',
  162. alarmUntreatedCount: '',
  163. alarmUntreatedCount1: '',
  164. processingStatus: 0,
  165. currentPage: 1,
  166. size: 10,
  167. loadStatus: 'loading', //加载样式:more-加载前样式,loading-加载中样式,nomore-没有数据样式
  168. isLoadMore: false, //是否加载中
  169. };
  170. },
  171. watch: {
  172. handleStatus(val) {
  173. console.log('下拉框切换')
  174. this.currentPage = 1;
  175. this.porcessedList = []
  176. // this.porcessedList={};
  177. if (val == 0) {
  178. val = '1,2,3,4'
  179. }
  180. this.processingStatus = val
  181. console.log(this.processingStatus)
  182. this.getProcessData({
  183. "companyCode": this.companyCode,
  184. "type": this.type,
  185. "processingStatus": val,
  186. "currentPage": this.currentPage,
  187. "size": this.size,
  188. }, this.TabCur);
  189. }
  190. },
  191. computed: {},
  192. onReachBottom() { //上拉触底函数
  193. if (!this.isLoadMore) { //此处判断,上锁,防止重复请求
  194. this.isLoadMore = true
  195. this.currentPage += 1;
  196. this.getProcessData({
  197. "companyCode": this.companyCode,
  198. "type": this.type,
  199. "processingStatus": this.processingStatus,
  200. "currentPage": this.currentPage,
  201. "size": this.size,
  202. }, this.TabCur);
  203. }
  204. },
  205. onLoad: function(option) {
  206. this.type = option.type;
  207. this.companyCode = option.companyCode;
  208. console.log(option.type);
  209. console.log(option.companyCode);
  210. if (option.type == 1) {
  211. uni.setNavigationBarTitle({
  212. title: '电力检测'
  213. });
  214. } else {
  215. uni.setNavigationBarTitle({
  216. title: '视频告警'
  217. });
  218. }
  219. this.loadData()
  220. },
  221. methods: {
  222. loadData() {
  223. this.getProcessData({
  224. "companyCode": this.companyCode,
  225. "type": this.type,
  226. "processingStatus": this.processingStatus,
  227. "currentPage": this.currentPage,
  228. "size": this.size,
  229. }, this.TabCur);
  230. },
  231. quickConfirm() {
  232. if (!this.checkedArr.length) {
  233. uni.showToast({
  234. title: "请至少选择一条需要确认的数据",
  235. icon: "none"
  236. });
  237. return
  238. }
  239. console.log(this.checkedArr)
  240. this.quickConfirmRes({
  241. "id": this.checkedArr.toString(),
  242. "companyCode": this.companyCode,
  243. })
  244. },
  245. // 请求
  246. async quickConfirmRes(ming = {}) {
  247. const res = await this.$myRequest({
  248. url: 'IntegratedAlarm/setBatchProcessing',
  249. data: ming
  250. })
  251. if (!res.data.flag) {
  252. uni.showToast({
  253. title: "添加失败",
  254. icon: "none"
  255. });
  256. } else {
  257. uni.showToast({
  258. title: "添加成功",
  259. });
  260. }
  261. setTimeout(() => {
  262. uni.navigateTo({
  263. url: '/pages/processList/processList?companyCode=' + this.companyCode +
  264. '&type=1'
  265. });
  266. }, 1000);
  267. },
  268. // 全选事件
  269. allChoose(e) {
  270. let chooseItem = e.detail.value;
  271. // 全选
  272. if (chooseItem[0] == 'all') {
  273. this.allChecked = true;
  274. for (let item of this.porcessedList) {
  275. let itemVal = String(item.id);
  276. if (!this.checkedArr.includes(itemVal)) {
  277. this.checkedArr.push(itemVal);
  278. }
  279. }
  280. } else {
  281. // 取消全选
  282. this.allChecked = false;
  283. this.checkedArr = [];
  284. }
  285. },
  286. changeCheckbox(e) {
  287. this.checkedArr = e.detail.value;
  288. // 如果选择的数组中有值,并且长度等于列表的长度,就是全选
  289. if (this.checkedArr.length > 0 && this.checkedArr.length == this.porcessedList.length) {
  290. this.allChecked = true;
  291. } else {
  292. this.allChecked = false;
  293. }
  294. },
  295. async getProcessData(ming = {}, whichTab) {
  296. console.log('请求接口')
  297. const res = await this.$myRequest({
  298. url: 'IntegratedAlarm/getElectricAlarmUntreated',
  299. data: ming,
  300. showLoading: true
  301. })
  302. // if (whichTab ==0) {
  303. // this.unporcessList = res.data.data;
  304. // this.alarmUntreatedCount = parseInt(res.data.alarmUntreatedCount)
  305. // } else {
  306. // this.porcessedList = res.data.data;
  307. // this.alarmUntreatedCount1 = parseInt(res.data.alarmUntreatedCount)
  308. // }
  309. // console.log(this.porcessedList)
  310. this.alarmUntreatedCount1 = parseInt(res.data.alarmUntreatedCount)
  311. this.alarmUntreatedCount = parseInt(res.data.alarmUntreatedCount)
  312. if (res.data.data.length) {
  313. if (whichTab == 0) {
  314. this.unporcessList = this.unporcessList.concat(res.data.data)
  315. this.alarmUntreatedCount = parseInt(res.data.alarmUntreatedCount)
  316. } else {
  317. this.porcessedList = this.porcessedList.concat(res.data.data);
  318. this.alarmUntreatedCount1 = parseInt(res.data.alarmUntreatedCount)
  319. console.log(this.alarmUntreatedCount1)
  320. }
  321. if (res.data.data.length < this.size) { //判断接口返回数据量小于请求数据量,则表示此为最后一页
  322. this.isLoadMore = true
  323. this.loadStatus = 'nomore'
  324. } else {
  325. this.isLoadMore = false
  326. }
  327. } else {
  328. this.isLoadMore = true
  329. this.loadStatus = 'nomore'
  330. }
  331. },
  332. tabSelect(e) { //已处理未处理切换
  333. console.log('已处理未处理切换')
  334. this.currentPage = 1;
  335. this.porcessedList = [];
  336. this.unporcessList = [];
  337. console.log(e.currentTarget);
  338. this.TabCur = e.currentTarget.dataset.id;
  339. this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
  340. // this.handleStatus=0;
  341. this.processingStatus = !e.currentTarget.dataset.id ? e.currentTarget.dataset.id : '1,2,3,4',
  342. console.log(this.processingStatus)
  343. this.loadData()
  344. },
  345. // 页面跳转
  346. goUnprocessDetail(item) {
  347. uni.redirectTo({
  348. url: '/pages/processDetailEle/processDetailEle?companyCode=' + this.companyCode +
  349. '&id=' + item.id +
  350. '&type=1',
  351. });
  352. },
  353. goProcessedDetail(item) {
  354. uni.redirectTo({
  355. url: '/pages/processDetailEle/processDetailEle?companyCode=' + this.companyCode +
  356. '&id=' + item.id + '&type=1',
  357. });
  358. },
  359. goVideoUnprocessDetail(item) {
  360. uni.navigateTo({
  361. url: '/pages/processDetailVideo/processDetailVideo?companyCode=' + this.companyCode +
  362. '&id=' + item.id +
  363. '&type=2',
  364. });
  365. },
  366. goVideoProcessedDetail(item) {
  367. uni.navigateTo({
  368. url: '/pages/processDetailVideo/processDetailVideo?companyCode=' + this.companyCode +
  369. '&id=' + item.id +
  370. '&type=2',
  371. });
  372. },
  373. InputFocus(e) {
  374. this.InputBottom = e.detail.height
  375. },
  376. InputBlur(e) {
  377. this.InputBottom = 0
  378. },
  379. }
  380. }
  381. </script>
  382. <style lang="scss">
  383. .handle2scroll {
  384. // height: calc(100vh - 400rpx);
  385. // overflow-y: scroll;
  386. }
  387. //已处理未处理消息个数样式
  388. .nav .cu-item.cur {
  389. position: relative;
  390. border-bottom: 8rpx solid;
  391. }
  392. .cu-tag.badge {
  393. top: 14rpx;
  394. right: 96rpx;
  395. }
  396. .nav .cu-item {
  397. width: 50%;
  398. margin: 0;
  399. .text-blue,
  400. .line-blue,
  401. .lines-blue {
  402. color: #4274E7
  403. }
  404. }
  405. </style>