소스 검색

Merge branch 'zhb/demand' of yf_zhb/MingGao_vue into master

yf_zsj 3 년 전
부모
커밋
378fe6c5bb
55개의 변경된 파일9382개의 추가작업 그리고 2668개의 파일을 삭제
  1. 2 2
      minggao/config/index.js
  2. 3 3
      minggao/index.html
  3. 1 0
      minggao/package.json
  4. 157 133
      minggao/src/assets/icon/iconfont.css
  5. BIN
      minggao/src/assets/images/cure/scd/scdIconOff.png
  6. BIN
      minggao/src/assets/images/cure/scd/scdIconOn.png
  7. BIN
      minggao/src/assets/images/home/location-blue.png
  8. BIN
      minggao/src/assets/images/home/location-fengxi.png
  9. BIN
      minggao/src/assets/images/home/location-green.png
  10. BIN
      minggao/src/assets/images/home/location-linmu.png
  11. BIN
      minggao/src/assets/images/home/location-orange.png
  12. BIN
      minggao/src/assets/images/home/location-purple.png
  13. BIN
      minggao/src/assets/images/home/location-red.png
  14. BIN
      minggao/src/assets/images/home/location-shiying.png
  15. BIN
      minggao/src/assets/images/home/location-shiyingjiance.png
  16. BIN
      minggao/src/assets/images/home/location-yellow.png
  17. BIN
      minggao/src/assets/images/home/location-zhinengcebaodeng.png
  18. 1 0
      minggao/src/assets/images/home/location.svg
  19. BIN
      minggao/src/assets/images/home/logo.jpg
  20. BIN
      minggao/src/assets/images/home/path.png
  21. 1 0
      minggao/src/assets/images/home/path.svg
  22. 43 0
      minggao/src/components/AMap/index.vue
  23. 40 44
      minggao/src/components/DateSearch/index.vue
  24. 74 0
      minggao/src/components/Icon/index.vue
  25. 32 6
      minggao/src/page/commandCenter/laboratory.vue
  26. 0 1
      minggao/src/page/commandCenter/superviseAdminDetails.vue
  27. 0 1
      minggao/src/page/commandCenter/superviseDetails.vue
  28. 6 4
      minggao/src/page/commandCenter/taskRegulator.vue
  29. 0 1
      minggao/src/page/commandCenter/taskRegulatorDetails.vue
  30. 408 373
      minggao/src/page/forecasting/cbd/Cbd.vue
  31. 401 305
      minggao/src/page/forecasting/cbd/PestsStats.vue
  32. 277 195
      minggao/src/page/forecasting/maintain/maintain.vue
  33. 1835 0
      minggao/src/page/forecasting/monthKillingLamp/index-bak.vue
  34. 2435 0
      minggao/src/page/forecasting/monthKillingLamp/index.vue
  35. 957 0
      minggao/src/page/forecasting/monthKillingLamp/scdDetail.vue
  36. 71 57
      minggao/src/page/forecasting/trap/fillinrecord.vue
  37. 15 0
      minggao/src/page/forecasting/trap/forestTrap.vue
  38. 276 226
      minggao/src/page/forecasting/trap/trap.vue
  39. 15 0
      minggao/src/page/forecasting/trap/trypetidMonitoringTrap.vue
  40. 15 0
      minggao/src/page/forecasting/trap/trypetidTrap.vue
  41. 28 8
      minggao/src/page/home/index.vue
  42. 387 0
      minggao/src/page/home/test.js
  43. 291 104
      minggao/src/page/homepage/facilitydistribute.vue
  44. 352 221
      minggao/src/page/homepage/pestdistribute.vue
  45. 505 473
      minggao/src/page/monitor/Monitor.vue
  46. 99 98
      minggao/src/page/monitoring/monitoringtask.vue
  47. 111 95
      minggao/src/page/monitoring/supervisiontask.vue
  48. 90 90
      minggao/src/page/systemmanger/harmfulBiology.vue
  49. 221 169
      minggao/src/page/systemmanger/userManger.vue
  50. 0 1
      minggao/src/page/warning/warningrecord.vue
  51. 157 57
      minggao/src/page/warning/warningset.vue
  52. 37 1
      minggao/src/router/index.js
  53. 13 0
      minggao/src/util/constants.js
  54. 21 0
      minggao/src/util/helpers.js
  55. 5 0
      minggao/yarn.lock

+ 2 - 2
minggao/config/index.js

@@ -12,10 +12,10 @@ module.exports = {
     proxyTable: {
       '/api': {
         ws: false,
-        // target: 'http://192.168.1.52:12345', //翟毅飞
+        target: 'http://192.168.1.52:12345', //翟毅飞
         //  target: 'https://www.yhswjc.com', //线上
         // target: 'http://192.168.1.77:12345', //曹世祥
-        target: 'http://114.115.147.140:12345',
+        // target: 'http://114.115.147.140:12345',
         changeOrigin: true,
         pathRewrite: {
           '^/api': '/api' //重写接口

+ 3 - 3
minggao/index.html

@@ -9,8 +9,8 @@
   <body style="margin: 0;">
     <div id="app"></div>
     <!-- built files will be auto injected -->
+    <script src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/js/ezuikit.js"></script>
+    <!-- <script src="https://webapi.amap.com/maps?v=1.4.15&key=bd1582190896ab05afb30aa8161d14c2"></script> -->
+    <script src="https://webapi.amap.com/maps?v=1.4.15&key=9ffaf42e87ed317af4e775939a95081b&plugin=AMap.PolygonEditor,AMap.MarkerCluster,AMap.InfoWindow"></script>
   </body>
-  <script src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/js/ezuikit.js"></script>
-  <!-- <script src="https://webapi.amap.com/maps?v=1.4.15&key=bd1582190896ab05afb30aa8161d14c2"></script> -->
-  <script src="https://webapi.amap.com/maps?v=2.0&key=9ffaf42e87ed317af4e775939a95081b&plugin=AMap.PolygonEditor,AMap.MarkerCluster,AMap.InfoWindow"></script>
 </html>

+ 1 - 0
minggao/package.json

@@ -11,6 +11,7 @@
   },
   "dependencies": {
     "axios": "^0.24.0",
+    "dayjs": "^1.11.7",
     "echarts": "^4.9.0",
     "element-ui": "^2.15.6",
     "less": "^4.1.2",

+ 157 - 133
minggao/src/assets/icon/iconfont.css

@@ -1,12 +1,15 @@
 @font-face {
-  font-family: 'iconfont';  /* Project id 1738837 */
-  src: url('//at.alicdn.com/t/c/font_1738837_8v4lnlb9hs7.woff2?t=1675231909556') format('woff2'),
-       url('//at.alicdn.com/t/c/font_1738837_8v4lnlb9hs7.woff?t=1675231909556') format('woff'),
-       url('//at.alicdn.com/t/c/font_1738837_8v4lnlb9hs7.ttf?t=1675231909556') format('truetype');
+  font-family: 'iconfont'; /* Project id 1738837 */
+  src: url('//at.alicdn.com/t/c/font_1738837_8v4lnlb9hs7.woff2?t=1675231909556')
+      format('woff2'),
+    url('//at.alicdn.com/t/c/font_1738837_8v4lnlb9hs7.woff?t=1675231909556')
+      format('woff'),
+    url('//at.alicdn.com/t/c/font_1738837_8v4lnlb9hs7.ttf?t=1675231909556')
+      format('truetype');
 }
 
 .iconfont {
-  font-family: "iconfont" !important;
+  font-family: 'iconfont' !important;
   font-size: 16px;
   font-style: normal;
   -webkit-font-smoothing: antialiased;
@@ -14,514 +17,535 @@
 }
 
 .icon-yujing:before {
-  content: "\e663";
+  content: '\e663';
 }
 
 .icon-yujing1:before {
-  content: "\e87a";
+  content: '\e87a';
 }
 
 .icon-ceju:before {
-  content: "\e647";
+  content: '\e647';
 }
 
 .icon-zuidahua:before {
-  content: "\e640";
+  content: '\e640';
 }
 
 .icon-zuixiaohua:before {
-  content: "\e645";
+  content: '\e645';
 }
 
 .icon-didian:before {
-  content: "\e67e";
+  content: '\e67e';
 }
 
 .icon-minggaoshouye:before {
-  content: "\e750";
+  content: '\e750';
 }
 
 .icon-shezhi1:before {
-  content: "\e63b";
+  content: '\e63b';
 }
 
 .icon-xietongzhihuidaping:before {
-  content: "\e63c";
+  content: '\e63c';
 }
 
 .icon-database-full:before {
-  content: "\e940";
+  content: '\e940';
 }
 
 .icon-gongzuoguanli-dingdanguanli:before {
-  content: "\e632";
+  content: '\e632';
 }
 
 .icon-205yonghu_yonghu6:before {
-  content: "\e63e";
+  content: '\e63e';
 }
 
 .icon-203yonghu_yonghu4:before {
-  content: "\e63f";
+  content: '\e63f';
 }
 
 .icon-mimasuo:before {
-  content: "\e678";
+  content: '\e678';
 }
 
 .icon-jurassic_user:before {
-  content: "\e6a4";
+  content: '\e6a4';
 }
 
 .icon-mima2:before {
-  content: "\e64d";
+  content: '\e64d';
 }
 
 .icon-wenjian:before {
-  content: "\e631";
+  content: '\e631';
 }
 
 .icon-tongzhi:before {
-  content: "\e64c";
+  content: '\e64c';
 }
 
 .icon-yingyongzhongxin:before {
-  content: "\e62f";
+  content: '\e62f';
 }
 
 .icon-dingwei2:before {
-  content: "\e668";
+  content: '\e668';
 }
 
 .icon-keshihuaquanjing:before {
-  content: "\e644";
+  content: '\e644';
 }
 
 .icon-sanjiao1:before {
-  content: "\e600";
+  content: '\e600';
 }
 
 .icon-sanjiao3:before {
-  content: "\e601";
+  content: '\e601';
 }
 
 .icon-qian:before {
-  content: "\e643";
+  content: '\e643';
 }
 
 .icon-ball-camera-full:before {
-  content: "\e965";
+  content: '\e965';
 }
 
 .icon-xiugai:before {
-  content: "\e62e";
+  content: '\e62e';
 }
 
 .icon-wenshidapeng:before {
-  content: "\e665";
+  content: '\e665';
 }
 
 .icon-chumiaoqi:before {
-  content: "\e62d";
+  content: '\e62d';
 }
 
 .icon-fapiao:before {
-  content: "\e6b6";
+  content: '\e6b6';
 }
 
 .icon-jiance:before {
-  content: "\e6c3";
+  content: '\e6c3';
 }
 
 .icon-shiming:before {
-  content: "\e6d3";
+  content: '\e6d3';
 }
 
 .icon-daping:before {
-  content: "\e6d8";
+  content: '\e6d8';
 }
 
 .icon-shuizhi:before {
-  content: "\e6dc";
+  content: '\e6dc';
 }
 
 .icon-shujujiankong:before {
-  content: "\e62a";
+  content: '\e62a';
 }
 
 .icon-diannao2:before {
-  content: "\e64a";
+  content: '\e64a';
 }
 
 .icon-jiantou:before {
-  content: "\e639";
+  content: '\e639';
 }
 
 .icon-shuibeng:before {
-  content: "\e627";
+  content: '\e627';
 }
 
 .icon-shuiliang:before {
-  content: "\e692";
+  content: '\e692';
 }
 
 .icon-xiaomaijingyanguangaicanshu:before {
-  content: "\e630";
+  content: '\e630';
 }
 
 .icon-shuaxin:before {
-  content: "\e63d";
+  content: '\e63d';
 }
 
 .icon-duocengturangshangqing:before {
-  content: "\eb61";
+  content: '\eb61';
 }
 
 .icon-turangshidu:before {
-  content: "\eb26";
+  content: '\eb26';
 }
 
 .icon-turangwendu:before {
-  content: "\eb23";
+  content: '\eb23';
 }
 
 .icon-daqiyali:before {
-  content: "\eb27";
+  content: '\eb27';
 }
 
 .icon-kongqiwendu:before {
-  content: "\eb3a";
+  content: '\eb3a';
 }
 
 .icon-kongqishidu:before {
-  content: "\eb3b";
+  content: '\eb3b';
 }
 
 .icon-chongzhi1:before {
-  content: "\e604";
+  content: '\e604';
 }
 
 .icon-duigou:before {
-  content: "\e712";
+  content: '\e712';
 }
 
 .icon-dengpao:before {
-  content: "\e69e";
+  content: '\e69e';
 }
 
 .icon-pingtai:before {
-  content: "\e628";
+  content: '\e628';
 }
 
 .icon-shezhi:before {
-  content: "\e679";
+  content: '\e679';
 }
 
 .icon-shouye1:before {
-  content: "\e684";
+  content: '\e684';
 }
 
 .icon-caiwuguanli:before {
-  content: "\e6b0";
+  content: '\e6b0';
 }
 
 .icon-erweima:before {
-  content: "\e626";
+  content: '\e626';
 }
 
 .icon-cell-phone:before {
-  content: "\e624";
+  content: '\e624';
 }
 
 .icon-tongji2:before {
-  content: "\e646";
+  content: '\e646';
 }
 
 .icon-iconzhengli_shouxieqianpi:before {
-  content: "\e648";
+  content: '\e648';
 }
 
 .icon-shibie:before {
-  content: "\e603";
+  content: '\e603';
 }
 
 .icon-tongji1:before {
-  content: "\e642";
+  content: '\e642';
 }
 
 .icon-keshihuadaping:before {
-  content: "\e61c";
+  content: '\e61c';
 }
 
 .icon-tuichuguanbi:before {
-  content: "\e61d";
+  content: '\e61d';
 }
 
 .icon-zhaopianchakan:before {
-  content: "\e61b";
+  content: '\e61b';
 }
 
 .icon-tubiaorenwu:before {
-  content: "\e61a";
+  content: '\e61a';
 }
 
 .icon-dingwei1:before {
-  content: "\e619";
+  content: '\e619';
 }
 
 .icon-jidiguanli:before {
-  content: "\e618";
+  content: '\e618';
 }
 
 .icon-jidimianji:before {
-  content: "\e617";
+  content: '\e617';
 }
 
 .icon-jianlishijian:before {
-  content: "\e60d";
+  content: '\e60d';
 }
 
 .icon-luxiang:before {
-  content: "\e637";
+  content: '\e637';
 }
 
 .icon-banshou:before {
-  content: "\e65c";
+  content: '\e65c';
 }
 
 .icon-chandi:before {
-  content: "\eb24";
+  content: '\eb24';
 }
 
 .icon-jichu:before {
-  content: "\eb25";
+  content: '\eb25';
 }
 
 .icon-chidao:before {
-  content: "\eb44";
+  content: '\eb44';
 }
 
 .icon-rili:before {
-  content: "\e609";
+  content: '\e609';
 }
 
 .icon-fenlei:before {
-  content: "\e616";
+  content: '\e616';
 }
 
 .icon-quanping:before {
-  content: "\e656";
+  content: '\e656';
 }
 
 .icon-saomiaoshibie380:before {
-  content: "\e686";
+  content: '\e686';
 }
 
 .icon-tianjia:before {
-  content: "\e615";
+  content: '\e615';
 }
 
 .icon-tongji:before {
-  content: "\e636";
+  content: '\e636';
 }
 
 .icon-weimingming-34:before {
-  content: "\e60b";
+  content: '\e60b';
 }
 
 .icon-chouchongbug:before {
-  content: "\e6e1";
+  content: '\e6e1';
 }
 
 .icon-loufang:before {
-  content: "\e64f";
+  content: '\e64f';
 }
 
 .icon-diannao1:before {
-  content: "\e623";
+  content: '\e623';
 }
 
 .icon-tupian-xianxing:before {
-  content: "\e635";
+  content: '\e635';
 }
 
 .icon-xiangqing-:before {
-  content: "\e608";
+  content: '\e608';
 }
 
 .icon-mianji:before {
-  content: "\e602";
+  content: '\e602';
 }
 
 .icon-dianhua2:before {
-  content: "\e611";
+  content: '\e611';
 }
 
 .icon-dingwei:before {
-  content: "\e675";
+  content: '\e675';
 }
 
 .icon-bangding:before {
-  content: "\e784";
+  content: '\e784';
 }
 
 .icon-yonghu11:before {
-  content: "\e705";
+  content: '\e705';
 }
 
 .icon-yu:before {
-  content: "\e63a";
+  content: '\e63a';
 }
 
 .icon-thermometer_icon:before {
-  content: "\e67a";
+  content: '\e67a';
 }
 
 .icon-shidu:before {
-  content: "\e60a";
+  content: '\e60a';
 }
 
 .icon-xingzhuang:before {
-  content: "\e614";
+  content: '\e614';
 }
 
 .icon-dian:before {
-  content: "\e655";
+  content: '\e655';
 }
 
 .icon-wendu:before {
-  content: "\e660";
+  content: '\e660';
 }
 
 .icon-dingshi:before {
-  content: "\e77e";
+  content: '\e77e';
 }
 
 .icon-fangzhi:before {
-  content: "\e75c";
+  content: '\e75c';
 }
 
 .icon-shouye:before {
-  content: "\e61e";
+  content: '\e61e';
 }
 
 .icon-nongchangguanli:before {
-  content: "\e62c";
+  content: '\e62c';
 }
 
 .icon-shouhou:before {
-  content: "\e80e";
+  content: '\e80e';
 }
 
 .icon-xitong:before {
-  content: "\e60f";
+  content: '\e60f';
 }
 
 .icon-shujuzhanshi:before {
-  content: "\e621";
+  content: '\e621';
 }
 
 .icon-jidi:before {
-  content: "\e672";
+  content: '\e672';
 }
 
 .icon-zhuanjia:before {
-  content: "\e607";
+  content: '\e607';
 }
 
 .icon-nongshiguanli:before {
-  content: "\e60c";
+  content: '\e60c';
 }
 
 .icon-huanjingjiance:before {
-  content: "\e610";
+  content: '\e610';
 }
 
 .icon-shebei:before {
-  content: "\e622";
+  content: '\e622';
 }
 
 .icon-cebaoguanli:before {
-  content: "\e776";
+  content: '\e776';
 }
 
 .icon-suyuan:before {
-  content: "\e6e8";
+  content: '\e6e8';
 }
 
 .icon-jiankong:before {
-  content: "\e629";
+  content: '\e629';
 }
 
 .icon-xinxi1:before {
-  content: "\e64b";
+  content: '\e64b';
 }
 
 .icon-yonghu1:before {
-  content: "\e612";
+  content: '\e612';
 }
 
 .icon-mima1:before {
-  content: "\e620";
+  content: '\e620';
 }
 
 .icon-diannao:before {
-  content: "\e605";
+  content: '\e605';
 }
 
 .icon-biaoqian:before {
-  content: "\e634";
+  content: '\e634';
 }
 
 .icon-dizhi:before {
-  content: "\e606";
+  content: '\e606';
 }
 
 .icon-shijian:before {
-  content: "\e77c";
+  content: '\e77c';
 }
 
 .icon-yemiancaozuo:before {
-  content: "\e64e";
+  content: '\e64e';
 }
 
 .icon-yonghu:before {
-  content: "\e60e";
+  content: '\e60e';
 }
 
 .icon-iconfontedit:before {
-  content: "\e61f";
+  content: '\e61f';
 }
 
 .icon-chongzhi:before {
-  content: "\e633";
+  content: '\e633';
 }
 
 .icon-jinyong:before {
-  content: "\e641";
+  content: '\e641';
 }
 
 .icon-mima:before {
-  content: "\e638";
+  content: '\e638';
 }
 
 .icon-wendang:before {
-  content: "\e613";
+  content: '\e613';
 }
 
 .icon-shanchu:before {
-  content: "\e625";
+  content: '\e625';
 }
 
 .icon-icon_huabanfuben:before {
-  content: "\e62b";
+  content: '\e62b';
 }
 
 .icon-BAI-wuzi:before {
-  content: "\e69c";
+  content: '\e69c';
 }
 
 .icon-zhuti_tiaosepan_o:before {
-  content: "\eb6e";
+  content: '\eb6e';
 }
 
+@font-face {
+  font-family: 'minggao-iconfont'; /* Project id 3992730 */
+  src: url('//at.alicdn.com/t/c/font_3992730_6mzdxu54yex.woff2?t=1680568222390')
+      format('woff2'),
+    url('//at.alicdn.com/t/c/font_3992730_6mzdxu54yex.woff?t=1680568222390')
+      format('woff'),
+    url('//at.alicdn.com/t/c/font_3992730_6mzdxu54yex.ttf?t=1680568222390')
+      format('truetype');
+}
+
+.minggao-iconfont {
+  font-family: 'minggao-iconfont' !important;
+  font-size: 16px;
+  font-style: normal;
+  -webkit-font-smoothing: antialiased;
+  -moz-osx-font-smoothing: grayscale;
+}
+
+.minggao-icontuding:before {
+  content: '\e64c';
+}

BIN
minggao/src/assets/images/cure/scd/scdIconOff.png


BIN
minggao/src/assets/images/cure/scd/scdIconOn.png


BIN
minggao/src/assets/images/home/location-blue.png


BIN
minggao/src/assets/images/home/location-fengxi.png


BIN
minggao/src/assets/images/home/location-green.png


BIN
minggao/src/assets/images/home/location-linmu.png


BIN
minggao/src/assets/images/home/location-orange.png


BIN
minggao/src/assets/images/home/location-purple.png


BIN
minggao/src/assets/images/home/location-red.png


BIN
minggao/src/assets/images/home/location-shiying.png


BIN
minggao/src/assets/images/home/location-shiyingjiance.png


BIN
minggao/src/assets/images/home/location-yellow.png


BIN
minggao/src/assets/images/home/location-zhinengcebaodeng.png


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 0
minggao/src/assets/images/home/location.svg


BIN
minggao/src/assets/images/home/logo.jpg


BIN
minggao/src/assets/images/home/path.png


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1 - 0
minggao/src/assets/images/home/path.svg


+ 43 - 0
minggao/src/components/AMap/index.vue

@@ -0,0 +1,43 @@
+<template>
+  <div id="amap-container"></div>
+</template>
+
+<script>
+import AMapLoader from '@amap/amap-jsapi-loader';
+export default {
+  data() {
+    return {};
+  },
+  mounted() {
+    console.log('mounted');
+    this.initMap();
+  },
+  methods: {
+    initMap() {
+      AMapLoader.load({
+        key: '9ffaf42e87ed317af4e775939a95081b', // 申请好的Web端开发者Key,首次调用 load 时必填
+        version: '2.0', // 指定要加载的 JSAPI 的版本,缺省时默认为 1.4.15
+        plugins: ['AMap.PolygonEditor', 'AMap.MarkerCluster', 'AMap.InfoWindow'] // 需要使用的的插件列表,如比例尺'AMap.Scale'等
+      })
+        .then(AMap => {
+          this.map = new AMap.Map('amap-container', {
+            //设置地图容器id
+            viewMode: '3D', //是否为3D地图模式
+            zoom: 5, //初始化地图级别
+            center: [105.602725, 37.076636] //初始化地图中心点位置
+          });
+        })
+        .catch(e => {
+          console.log(e);
+        });
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+#amap-container {
+  width: 100%;
+  height: 100%;
+}
+</style>

+ 40 - 44
minggao/src/components/DateSearch/index.vue

@@ -91,13 +91,13 @@ export default {
     var that = this;
     return {
       num: 1,
-      btnSelected: "1",
-      timeScreen: "1",
+      btnSelected: '4',
+      timeScreen: '1',
       queryInfo: {
-        begin: "",
-        end: "",
+        begin: '',
+        end: ''
       },
-      timeRange: "",
+      timeRange: '',
 
       pickerOptions: {
         shortcuts: [
@@ -135,35 +135,34 @@ export default {
           //   },
           // },
 
-
           {
-            text: "最近半年",
+            text: '最近半年',
             onClick(picker) {
               const end = new Date();
               const start = new Date();
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 180);
-              picker.$emit("pick", [start, end]);
+              picker.$emit('pick', [start, end]);
               that.queryInfo.begin = start;
               that.queryInfo.end = end;
-            },
+            }
           },
           {
-            text: "最近一年",
+            text: '最近一年',
             onClick(picker) {
               const end = new Date();
               const start = new Date();
               start.setTime(start.getTime() - 3600 * 1000 * 24 * 360);
-              picker.$emit("pick", [start, end]);
+              picker.$emit('pick', [start, end]);
               that.queryInfo.begin = start;
               that.queryInfo.end = end;
-            },
-          },
-        ],
-      },
+            }
+          }
+        ]
+      }
     };
   },
   mounted() {
-    this.timeBtnClick(1);
+    this.timeBtnClick(4);
   },
   methods: {
     //筛选时间
@@ -180,42 +179,40 @@ export default {
       var x = aa.getFullYear();
       var k = aa.getMonth() + 1;
       var b = aa.getDate();
-      k = k < 10 ? "0" + k : k;
-      b = b < 10 ? "0" + b : b;
+      k = k < 10 ? '0' + k : k;
+      b = b < 10 ? '0' + b : b;
       var mm =
         new Date().getMinutes() < 10
-          ? "0" + new Date().getMinutes()
+          ? '0' + new Date().getMinutes()
           : new Date().getMinutes();
-      var dayA = x + "-" + k + "-" + b;
+      var dayA = x + '-' + k + '-' + b;
       // console.log(dayA);
       // 结束
       bb = new Date(bb);
       var y = bb.getFullYear();
       var m = bb.getMonth() + 1;
       var d = bb.getDate();
-      m = m < 10 ? "0" + m : m;
-      d = d < 10 ? "0" + d : d;
-      var day = y + "-" + m + "-" + d;
+      m = m < 10 ? '0' + m : m;
+      d = d < 10 ? '0' + d : d;
+      var day = y + '-' + m + '-' + d;
       // console.log(day);
 
       this.btnSelected = i;
-      this.timeRange = "";
+      this.timeRange = '';
       if (i == 1) {
         // 24小时
         this.queryInfo.begin = parseInt((Date.now() - 24 * 3600000) / 1000);
         this.queryInfo.end = parseInt((Date.now() + 24) / 1000);
       } else if (i == 2) {
         // 近七天
-        this.queryInfo.begin = parseInt(
-          (Date.now() - 24 * 3600000 * 7) / 1000
-        );
+        this.queryInfo.begin = parseInt((Date.now() - 24 * 3600000 * 7) / 1000);
         this.queryInfo.end = parseInt((Date.now() + 24 * 3600000) / 1000);
       } else if (i == 3) {
         // 近一个月
         // this.queryInfo.begin = parseInt(
         //   (Date.now() - 24 * 3600000 * 30 * 6) / 1000
         // );
-         this.queryInfo.begin = parseInt(
+        this.queryInfo.begin = parseInt(
           (Date.now() - 24 * 3600000 * 30) / 1000
         );
         // this.queryInfo.begin = parseInt(
@@ -232,9 +229,9 @@ export default {
         );
         this.queryInfo.end = parseInt((Date.now() + 24 * 3600000) / 1000);
       }
-      console.log(this.queryInfo.begin)
-      this.$emit("dateChange", this.queryInfo);
-      this.$emit("btnSelected", this.btnSelected);
+      console.log(this.queryInfo.begin);
+      this.$emit('dateChange', this.queryInfo);
+      this.$emit('btnSelected', this.btnSelected);
     },
     DateChange() {
       console.log(this.timeRange);
@@ -247,35 +244,34 @@ export default {
           new Date(this.timeRange[1]).getTime() / 1000
         );
       } else {
-        this.btnSelected = 2;
+        this.btnSelected = 4;
         this.queryInfo.begin = parseInt(
-          (Date.now() - 24 * 3600000 * 30) / 1000
+          (Date.now() - 24 * 3600000 * 30 * 3) / 1000
         );
         this.queryInfo.end = parseInt((Date.now() + 24 * 3600000) / 1000);
       }
-      this.$emit("dateChange", this.queryInfo);
-      this.$emit("btnSelected", this.btnSelected);
+      this.$emit('dateChange', this.queryInfo);
+      this.$emit('btnSelected', this.btnSelected);
       if (this.timeRange == null) {
-        this.$emit("timeScreen", null);
+        this.$emit('timeScreen', null);
       } else {
-        this.$emit("timeScreen", this.timeScreen);
+        this.$emit('timeScreen', this.timeScreen);
       }
     },
     say() {
       this.num++;
-      console.log(this.num+"-------------------------------");
+      console.log(this.num + '-------------------------------');
       if (this.num > 5 || this.num == 5) {
-        console.log("停止");
+        console.log('停止');
         this.num = 0;
       } else {
         console.log(this.num);
         this.timeBtnClick(this.num);
       }
-      this.$emit("timeScreen", null);
-    },
-  },
+      this.$emit('timeScreen', null);
+    }
+  }
 };
 </script>
 
-<style lang='less' scoped>
-</style>
+<style lang="less" scoped></style>

+ 74 - 0
minggao/src/components/Icon/index.vue

@@ -0,0 +1,74 @@
+<script>
+import Location from '@/assets/images/home/location.svg?raw';
+
+console.log(Location, ' icon component');
+
+const allSvgIcons = {
+  location: Location
+};
+
+export default {
+  props: {
+    type: {
+      type: String,
+      default: ''
+    },
+    theme: {
+      type: String,
+      default: 'light'
+    },
+    rounded: {
+      type: Boolean,
+      default: false
+    }
+  },
+  computed: {
+    icon() {
+      if (allSvgIcons[this.type]) {
+        return {
+          type: 'svg',
+          source: allSvgIcons[this.type]
+        };
+      }
+
+      return undefined;
+    }
+  }
+};
+</script>
+
+<template>
+  <i
+    :class="`app-icon ${this.theme || ''} ${this.rounded ? 'rounded' : ''}`"
+    v-html="icon.source"
+  ></i>
+</template>
+
+<style lang="less">
+.app-icon {
+  display: flex;
+  width: 1em;
+  height: 1em;
+  align-items: center;
+  justify-content: center;
+
+  &.dark {
+    background-color: #000;
+  }
+
+  &.light {
+    background-color: #fff;
+  }
+
+  &.rounded {
+    border-radius: 50%;
+    overflow: hidden;
+  }
+}
+
+.app-icon svg {
+  width: 1em;
+  height: 1em;
+  fill: currentColor;
+}
+</style>

+ 32 - 6
minggao/src/page/commandCenter/laboratory.vue

@@ -91,29 +91,46 @@
             <span>{{ scope.row.lat || '无' }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="id" label="任务编号" width="180">
+        <el-table-column
+          prop="task_id"
+          label="任务编号"
+          width="180"
+          align="center"
+        >
         </el-table-column>
         <el-table-column
           prop="operator_user_name"
           label="任务处理人"
           width="180"
+          align="center"
         >
         </el-table-column>
         <el-table-column
           prop="actual_operator_name"
           label="实际处理人"
           width="180"
+          align="center"
         >
           <template slot-scope="scope">
             <span>{{ scope.row.actual_operator_name || '暂无' }}</span>
           </template>
         </el-table-column>
+        <el-table-column
+          prop="check_user_name"
+          label="实验室处理人"
+          width="180"
+          align="center"
+        >
+          <template slot-scope="scope">
+            <span>{{ scope.row.check_user_name || '暂无' }}</span>
+          </template>
+        </el-table-column>
         <el-table-column prop="report_time" label="带回时间">
           <template slot-scope="scope">
             <span>{{ scope.row.report_time || '暂无' }}</span>
           </template>
         </el-table-column>
-        <el-table-column prop="discern_status" label="任务状态" width="280">
+        <el-table-column prop="discern_status" label="任务状态" width="180">
           <template slot-scope="scope">
             <span v-if="scope.row.discern_status == '待接收'">
               <span
@@ -750,7 +767,7 @@ export default {
 
     // 添加有害生物
     addInsect() {
-      if (this.insectVal !== '' && this.numVal !== '') {
+      if (this.insectVal !== '' && this.numVal > 0) {
         var array = [];
         var arr = [];
         for (var i = 0; i < this.options2.length; i++) {
@@ -785,7 +802,7 @@ export default {
         if (document.getElementsByClassName('el-message').length == 0) {
           this.$message({
             type: 'info',
-            message: '请将信息填写完整!',
+            message: '请将信息填写完整,害虫数量必须大于0!',
             duration: 1500
           });
         }
@@ -812,7 +829,6 @@ export default {
 
     // 添加、删除确定事件
     confirmAxios() {
-      this.submitBtn = true;
       var array = [];
       for (var i = 0; i < this.fillList.length; i++) {
         var obj = {};
@@ -821,7 +837,7 @@ export default {
         array.push(obj);
       }
 
-      if (this.insectVal !== '' && this.numVal !== '') {
+      if (this.insectVal !== '' && this.numVal > 0) {
         array = [
           {
             pest_name: this.insectVal,
@@ -831,6 +847,13 @@ export default {
         ];
       }
 
+      if (!array.length) {
+        this.$message.error('请填写完整信息,数值请检查为大于0的整数');
+        return;
+      }
+
+      this.submitBtn = true;
+
       this.$axios({
         method: 'POST',
         url: '/api/api_gateway?method=control_center.task.discern_add',
@@ -851,6 +874,7 @@ export default {
             this.fillList = [];
             this.models = [];
             this.dialogVisible = false;
+            this.tableList();
           }
           this.insectVal = '';
           this.numVal = '';
@@ -902,6 +926,8 @@ export default {
         }
         e.target.value = 0;
       }
+
+      e.target.value = Math.floor(e.target.value);
     },
 
     // 有害生物添加

+ 0 - 1
minggao/src/page/commandCenter/superviseAdminDetails.vue

@@ -627,7 +627,6 @@ export default {
         center: [114.052758, 22.545817],
         resizeEnable: true,
         zoom: 10,
-        lang: "en",
         mapStyle: "amap://styles/fresh",
         layers: [],
       });

+ 0 - 1
minggao/src/page/commandCenter/superviseDetails.vue

@@ -493,7 +493,6 @@ export default {
         center: [114.052758, 22.545817],
         resizeEnable: true,
         zoom: 10,
-        lang: 'en',
         mapStyle: 'amap://styles/fresh',
         layers: [],
       });

+ 6 - 4
minggao/src/page/commandCenter/taskRegulator.vue

@@ -348,7 +348,7 @@
         <transition name="el-zoom-in-center">
           <el-form-item
             v-if="ruleForm.type == '有害生物监测'"
-            label="诱捕器"
+            label="设备"
             prop="checkList"
             style="width: 90%"
           >
@@ -424,7 +424,7 @@
 
     <!-- 选择诱捕器 -->
     <el-dialog
-      title="选择诱捕器"
+      title="选择设备"
       :close-on-click-modal="false"
       :close-on-press-escape="false"
       :visible.sync="deviceVisible"
@@ -491,7 +491,7 @@
         </li>
         <!-- 搜索 -->
         <li class="device_seek_list">
-          <el-button type="success" size="mini" @change="ybqSearchData"
+          <el-button type="success" size="mini" @click="ybqSearchData"
             >搜索</el-button
           >
         </li>
@@ -1195,7 +1195,7 @@ export default {
         .then(res => {
           if (res.data.data.total_item !== 0) {
             var data = res.data.data;
-            this.listSum = data.total_item;
+
             var list = [];
             data.page_list.forEach(item => {
               var obj = {};
@@ -1206,6 +1206,7 @@ export default {
             this.ybqData = list;
             console.log(this.ybqData);
           }
+          this.listSum = res.data.data.total_item;
           this.loading5 = false;
         })
         .catch(err => {
@@ -1284,6 +1285,7 @@ export default {
 
     // 新建任务 - 诱捕器 - 筛选
     ybqSearchData() {
+      console.log('ybq search data');
       this.loading5 = true;
       this.ybqData = [];
       this.page2 = 1;

+ 0 - 1
minggao/src/page/commandCenter/taskRegulatorDetails.vue

@@ -414,7 +414,6 @@ export default {
         center: [114.052758, 22.545817],
         resizeEnable: true,
         zoom: 10,
-        lang: "en",
         mapStyle: "amap://styles/fresh",
         layers: [],
       });

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 408 - 373
minggao/src/page/forecasting/cbd/Cbd.vue


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 401 - 305
minggao/src/page/forecasting/cbd/PestsStats.vue


+ 277 - 195
minggao/src/page/forecasting/maintain/maintain.vue

@@ -2,6 +2,21 @@
 <template>
   <div class="maintainbox">
     <div class="maintainbox_search">
+      <!-- <el-select
+        v-model="point_type"
+        placeholder="请选择监测点类型"
+        size="mini"
+        clearable
+        @change="search"
+      >
+        <el-option
+          v-for="item in pointTypeOptions"
+          :key="item.id"
+          :label="item.name"
+          :value="item.id"
+        >
+        </el-option>
+      </el-select> -->
       <el-input
         v-model="monitorname"
         placeholder="请输入监测点名称"
@@ -20,24 +35,34 @@
     </div>
     <el-card class="box-card" style="margin-top: 15px">
       <div class="cbdboxs_table" v-loading="loading">
-        <el-table :data="tableData" style="width: 100%" :stripe="true" :height="48*13" ref="gridTable">
+        <el-table
+          :data="tableData"
+          style="width: 100%"
+          :stripe="true"
+          :height="48 * 13"
+          ref="gridTable"
+        >
           <el-table-column prop="index" label="序号">
             <template slot-scope="scope">
-            <span>{{ ((page-1)*20)+scope.row.index}}</span>
-          </template>
+              <span>{{ (page - 1) * 20 + scope.row.index }}</span>
+            </template>
           </el-table-column>
           <el-table-column
             prop="point_name"
             label="监测点名称"
           ></el-table-column>
+          <!-- <el-table-column
+            prop="point_type_name"
+            label="监测点类型"
+          ></el-table-column> -->
           <el-table-column prop="lng" label="经度">
             <template slot-scope="scope">
-              <span>{{ ToDegrees(scope.row.lng, "lng") }}</span>
+              <span>{{ ToDegrees(scope.row.lng, 'lng') }}</span>
             </template>
           </el-table-column>
           <el-table-column prop="lat" label="纬度">
             <template slot-scope="scope">
-              <span>{{ ToDegrees(scope.row.lat, "lat") }}</span>
+              <span>{{ ToDegrees(scope.row.lat, 'lat') }}</span>
             </template>
           </el-table-column>
           <el-table-column prop="messages" label="简介"></el-table-column>
@@ -85,19 +110,42 @@
           <el-form-item label="监测点名称" prop="point_name">
             <el-input v-model="ruleForm.point_name"></el-input>
           </el-form-item>
+          <!-- <el-form-item label="监测点类型" prop="point_type">
+            <el-select
+              v-model="ruleForm.point_type"
+              placeholder="请选择监测点类型"
+              size="mini"
+            >
+              <el-option
+                v-for="item in pointTypeOptions"
+                :key="item.id"
+                :label="item.name"
+                :value="item.id"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item> -->
           <div class="addtrapbox">
             <el-form-item label="所在经度" prop="lng">
               <el-input v-model="ruleForm.lng"></el-input>
               <p style="height: 24px; padding-left: 16px">
                 <!-- {{ ToDegrees(ruleForm.lng, "lng") }} -->
-                {{ isNaN(ruleForm.lng)?ToDigital(ruleForm.lng, "lng"):ToDegrees(ruleForm.lng, "lng") }}
+                {{
+                  isNaN(ruleForm.lng)
+                    ? ToDigital(ruleForm.lng, 'lng')
+                    : ToDegrees(ruleForm.lng, 'lng')
+                }}
               </p>
             </el-form-item>
             <el-form-item label="所在纬度" prop="lat">
               <el-input v-model="ruleForm.lat"></el-input>
               <p style="height: 24px; padding-left: 16px">
                 <!-- {{ ToDegrees(ruleForm.lat, "lat") }} -->
-                {{ isNaN(ruleForm.lat)?ToDigital(ruleForm.lat, "lat"):ToDegrees(ruleForm.lat, "lat") }}
+                {{
+                  isNaN(ruleForm.lat)
+                    ? ToDigital(ruleForm.lat, 'lat')
+                    : ToDegrees(ruleForm.lat, 'lat')
+                }}
               </p>
             </el-form-item>
           </div>
@@ -113,9 +161,12 @@
       </div>
       <span slot="footer" class="dialog-footer">
         <el-button @click="resetForm('ruleForm')" size="mini">取 消</el-button>
-        <el-button type="primary" @click="submitForm('ruleForm')" size="mini"
-        :disabled="releaseTF"
-          >{{ releaseTF ? "发布中..." : "确 定" }}</el-button
+        <el-button
+          type="primary"
+          @click="submitForm('ruleForm')"
+          size="mini"
+          :disabled="releaseTF"
+          >{{ releaseTF ? '发布中...' : '确 定' }}</el-button
         >
       </span>
     </el-dialog>
@@ -163,7 +214,12 @@
         >
       </span>
     </el-dialog>
-    <el-dialog title="导入监测点" :visible.sync="downloadtf" width="500px" :close-on-click-modal="false">
+    <el-dialog
+      title="导入监测点"
+      :visible.sync="downloadtf"
+      width="500px"
+      :close-on-click-modal="false"
+    >
       <div class="downloadbox">
         <div class="downloadbox_item">
           <p class="title">导入监测点</p>
@@ -201,6 +257,7 @@
 
 <script>
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+import { pointTypeOptions } from '@/util/constants';
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -208,55 +265,61 @@ export default {
   data() {
     var checklnglat = (rule, value, callback) => {
       if (isNaN(value)) {
-        callback(new Error("请输入数字"));
+        callback(new Error('请输入数字'));
       } else {
         callback();
       }
     };
     //这里存放数据
     return {
-      monitorname: "", //搜索 监测点名称
+      // point_type: '',
+      monitorname: '', //搜索 监测点名称
       addtraptf: false, //添加框
       loading: false, //加载框
       page: 1, //页码
       total: 10, //数据总条数,
       tableData: [],
       ruleForm: {
-        point_name: "",
-        lng: "",
-        lat: "",
-        messages: "",
+        point_name: '',
+        // point_type: '',
+        lng: '',
+        lat: '',
+        messages: ''
       },
       rules: {
         point_name: [
-          { required: true, message: "请输入诱捕器名称", trigger: "blur" },
+          { required: true, message: '请输入监测点名称', trigger: 'blur' }
         ],
+        // point_type: [
+        //   { required: true, message: '请选择监测点类型', trigger: 'change' }
+        // ],
         lng: [
-          { required: true, message: "请输入经度", trigger: "blur" },
+          { required: true, message: '请输入经度', trigger: 'blur' }
           //   { validator: checklnglat, trigger: "blur" },
         ],
         lat: [
-          { required: true, message: "请输入纬度", trigger: "blur" },
+          { required: true, message: '请输入纬度', trigger: 'blur' }
           //   { validator: checklnglat, trigger: "blur" },
-        ],
+        ]
         // messages: [
         //   { required: true, message: "请输入监测点描述", trigger: "blur" },
         // ],
       },
-      addtitle: "新增监测点",
-      point_id: "",
+      addtitle: '新增监测点',
+      point_id: '',
       //地图属性
       addLocationDialogVisible: false,
       locationForm: {
-        lng: "",
-        lat: "",
+        lng: '',
+        lat: ''
       },
-      addr: "", //搜索栏地址
-      address: "", //地图上标签地址
+      addr: '', //搜索栏地址
+      address: '', //地图上标签地址
       center: [114.05, 22.55],
-      releaseTF:false,
-      downloadinput:"",
-      downloadtf:false
+      releaseTF: false,
+      downloadinput: '',
+      downloadtf: false,
+      pointTypeOptions
     };
   },
   //监听属性 类似于data概念
@@ -268,20 +331,21 @@ export default {
     getmaintainlist() {
       this.loading = true;
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=monitor_manage.maintain.checkpoint_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=monitor_manage.maintain.checkpoint_list',
         data: this.qs.stringify({
+          // point_type: this.point_type,
           page_item: 20,
           page: this.page,
-          point_name: this.monitorname, //              非必传(string)     诱剂名称 搜索项
-        }),
-      }).then((res) => {
+          point_name: this.monitorname //              非必传(string)     诱剂名称 搜索项
+        })
+      }).then(res => {
         this.loading = false;
         console.log(res.data.data);
         this.total = res.data.data.total_item;
         this.tableData = res.data.data.page_list;
         for (var i = 0; i < this.tableData.length; i++) {
-          this.tableData[i]["index"] = i + 1;
+          this.tableData[i]['index'] = i + 1;
         }
         this.$nextTick(() => {
           this.$refs.gridTable.bodyWrapper.scrollTop = 0;
@@ -289,7 +353,7 @@ export default {
       });
     },
     search() {
-      this.page = 1
+      this.page = 1;
       this.getmaintainlist();
     },
     pageChange(e) {
@@ -300,84 +364,103 @@ export default {
     },
     submitForm(formName) {
       console.log(this.ruleForm);
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate(valid => {
         if (valid) {
-          if (this.addtitle == "新增监测点") {
-            this.releaseTF = true
+          if (this.addtitle == '新增监测点') {
+            this.releaseTF = true;
             this.$axios({
-              method: "POST",
-              url: "/api/api_gateway?method=monitor_manage.maintain.checkpoint_add",
+              method: 'POST',
+              url:
+                '/api/api_gateway?method=monitor_manage.maintain.checkpoint_add',
               data: this.qs.stringify({
                 point_name: this.ruleForm.point_name, //                  非必传(num)                诱捕器id 修改项
-                lat: this.ToDegrees(this.ruleForm.lat,"lat"), //                       必传(string)               纬度
-                lng: this.ToDegrees(this.ruleForm.lng,"lng"), //                       必传(string)               经度
-                messages: this.ruleForm.messages,
-              }),
-            }).then((res) => {
-              console.log(res);
-              if (res.data.data) {
-                if (document.getElementsByClassName("el-message").length == 0) {
-                this.$message({
-                  showClose: true,
-                  message: "添加成功!",
-                  type: "success",
-                });
-                }
-                this.addtraptf = false;
-                this.getmaintainlist();
-              } else {
-                if (document.getElementsByClassName("el-message").length == 0) {
-                this.$message({
-                  showClose: true,
-                  message: "添加失败" + res.data.message,
-                  type: "warning",
-                });
+                lat: this.ToDegrees(this.ruleForm.lat, 'lat'), //                       必传(string)               纬度
+                lng: this.ToDegrees(this.ruleForm.lng, 'lng'), //                       必传(string)               经度
+                messages: this.ruleForm.messages
+                // point_type: this.ruleForm.point_type
+              })
+            })
+              .then(res => {
+                console.log(res);
+                if (res.data.data) {
+                  if (
+                    document.getElementsByClassName('el-message').length == 0
+                  ) {
+                    this.$message({
+                      showClose: true,
+                      message: '添加成功!',
+                      type: 'success'
+                    });
+                  }
+                  this.addtraptf = false;
+                  this.getmaintainlist();
+                } else {
+                  if (
+                    document.getElementsByClassName('el-message').length == 0
+                  ) {
+                    this.$message({
+                      showClose: true,
+                      message: '添加失败' + res.data.message,
+                      type: 'warning'
+                    });
+                  }
                 }
-              }
-              this.releaseTF = false
-            });
-          } else if (this.addtitle == "修改监测点") {
-            this.releaseTF = true
+                this.releaseTF = false;
+              })
+              .finally(() => {
+                this.releaseTF = false;
+              });
+          } else if (this.addtitle == '修改监测点') {
+            this.releaseTF = true;
             this.$axios({
-              method: "POST",
-              url: "/api/api_gateway?method=monitor_manage.maintain.checkpoint_modify",
+              method: 'POST',
+              url:
+                '/api/api_gateway?method=monitor_manage.maintain.checkpoint_modify',
               data: this.qs.stringify({
                 point_id: this.point_id,
                 point_name: this.ruleForm.point_name, //                  非必传(num)                诱捕器id 修改项
-                lat: this.ToDegrees(this.ruleForm.lat,"lat"), //                       必传(string)               纬度
-                lng: this.ToDegrees(this.ruleForm.lng,"lng"), //                       必传(string)               经度
-                messages: this.ruleForm.messages,
-              }),
-            }).then((res) => {
-              console.log(res);
-              if (res.data.data) {
-                if (document.getElementsByClassName("el-message").length == 0) {
-                this.$message({
-                  showClose: true,
-                  message: "修改成功!",
-                  type: "success",
-                });
-                }
-                this.addtraptf = false;
-                this.getmaintainlist();
-              } else {
-                if (document.getElementsByClassName("el-message").length == 0) {
-                this.$message({
-                  showClose: true,
-                  message: "修改失败" + res.data.message,
-                  type: "warning",
-                });
+                lat: this.ToDegrees(this.ruleForm.lat, 'lat'), //                       必传(string)               纬度
+                lng: this.ToDegrees(this.ruleForm.lng, 'lng'), //                       必传(string)               经度
+                messages: this.ruleForm.messages
+              })
+            })
+              .then(res => {
+                console.log(res);
+                if (res.data.data) {
+                  if (
+                    document.getElementsByClassName('el-message').length == 0
+                  ) {
+                    this.$message({
+                      showClose: true,
+                      message: '修改成功!',
+                      type: 'success'
+                    });
+                  }
+                  this.addtraptf = false;
+                  this.getmaintainlist();
+                } else {
+                  if (
+                    document.getElementsByClassName('el-message').length == 0
+                  ) {
+                    this.$message({
+                      showClose: true,
+                      message: '修改失败' + res.data.message,
+                      type: 'warning'
+                    });
+                  }
                 }
-              }
-              this.releaseTF = false
-            });
+                this.releaseTF = false;
+              })
+              .finally(() => {
+                this.releaseTF = false;
+              });
           }
         } else {
-          if (document.getElementsByClassName("el-message").length == 0) {
-          this.$message({
-            message: "请将信息填写完全",
-            type: "warning",
-          });
+          if (document.getElementsByClassName('el-message').length == 0) {
+            this.$message({
+              message: '请将信息填写完全',
+              type: 'warning'
+            });
           }
           return false;
         }
@@ -387,7 +470,7 @@ export default {
       this.addtraptf = false;
       this.$refs[formName].resetFields();
       for (var key in this.ruleForm) {
-        this.ruleForm[key] = "";
+        this.ruleForm[key] = '';
       }
     },
     alter(data) {
@@ -396,73 +479,73 @@ export default {
       this.ruleForm.lng = data.lng;
       this.ruleForm.lat = data.lat;
       this.ruleForm.messages = data.messages;
-      this.addtitle = "修改监测点";
+      this.addtitle = '修改监测点';
       this.addtraptf = true;
       this.point_id = data.point_id;
     },
     deletemain(data) {
-      var str = "您确定删除编号为<" + data.point_name + ">的监测点吗?";
-      this.$confirm(str, "删除监测点", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        closeOnClickModal: false,
+      var str = '您确定删除编号为<' + data.point_name + '>的监测点吗?';
+      this.$confirm(str, '删除监测点', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        closeOnClickModal: false
       })
         .then(() => {
           this.$axios({
-            method: "POST",
-            url: "/api/api_gateway?method=monitor_manage.maintain.checkpoint_delete",
+            method: 'POST',
+            url:
+              '/api/api_gateway?method=monitor_manage.maintain.checkpoint_delete',
             data: this.qs.stringify({
-              point_id: data.point_id,
-            }),
-          }).then((res) => {
+              point_id: data.point_id
+            })
+          }).then(res => {
             console.log(res);
             if (res.data.data) {
-              if (document.getElementsByClassName("el-message").length == 0) {
-              this.$message({
-                showClose: true,
-                message: "删除成功!",
-                type: "success",
-              });
+              if (document.getElementsByClassName('el-message').length == 0) {
+                this.$message({
+                  showClose: true,
+                  message: '删除成功!',
+                  type: 'success'
+                });
               }
               this.getmaintainlist();
             } else {
-              if (document.getElementsByClassName("el-message").length == 0) {
-              this.$message({
-                showClose: true,
-                message: "删除失败," + res.data.message,
-                type: "warning",
-              });
+              if (document.getElementsByClassName('el-message').length == 0) {
+                this.$message({
+                  showClose: true,
+                  message: '删除失败,' + res.data.message,
+                  type: 'warning'
+                });
               }
             }
           });
         })
         .catch(() => {
-          if (document.getElementsByClassName("el-message").length == 0) {
-          this.$message({
-            type: "info",
-            message: "已取消删除",
-          });
+          if (document.getElementsByClassName('el-message').length == 0) {
+            this.$message({
+              type: 'info',
+              message: '已取消删除'
+            });
           }
         });
     },
     init() {
-    //   console.log(document.getElementById("mapContainer2"));
-      var map = new AMap.Map("mapContainer2", {
+      //   console.log(document.getElementById("mapContainer2"));
+      var map = new AMap.Map('mapContainer2', {
         center: this.center,
         resizeEnable: true,
-        zoom: 10,
-        lang: "en",
+        zoom: 10
       });
-      AMap.plugin(["AMap.ToolBar", "AMap.Geocoder"], () => {
+      AMap.plugin(['AMap.ToolBar', 'AMap.Geocoder'], () => {
         map.addControl(new AMap.ToolBar());
         this.geocoder = new AMap.Geocoder({
-          city: "全国",
-          radius: 1000,
+          city: '全国',
+          radius: 1000
         });
       });
       setTimeout(() => {
         var marker = new AMap.Marker({
-          position: this.center,
+          position: this.center
         });
         console.log(this.center);
         marker.setMap(map);
@@ -474,45 +557,45 @@ export default {
       //位置搜索
       var marker = new AMap.Marker();
       this.geocoder.getLocation(this.addr, (status, result) => {
-        if (status === "complete" && result.geocodes.length) {
+        if (status === 'complete' && result.geocodes.length) {
           var lnglat = result.geocodes[0].location;
           marker.setPosition(lnglat);
           this.map.add(marker);
           this.map.setFitView(marker);
           this.locationForm = {
             lat: lnglat.lat,
-            lng: lnglat.lng,
+            lng: lnglat.lng
           };
         } else {
-          if (document.getElementsByClassName("el-message").length == 0) {
-          this.$message.error("根据地址查询位置失败");
+          if (document.getElementsByClassName('el-message').length == 0) {
+            this.$message.error('根据地址查询位置失败');
           }
         }
       });
     },
     // 地图点击事件
     testevent() {
-      this.map.on("click", (ev) => {
+      this.map.on('click', ev => {
         var lnglat = [ev.lnglat.lng, ev.lnglat.lat];
         this.locationForm = { lng: lnglat[0], lat: lnglat[1] };
         this.map.clearMap();
         var marker = new AMap.Marker({
-          position: lnglat,
+          position: lnglat
         });
         marker.setMap(this.map);
         this.getAddress(lnglat);
         setTimeout(() => {
           new AMap.InfoWindow({
-            content: "<h5>" + "当前选中地址" + "</h5>" + this.address,
-            offset: new AMap.Pixel(0, -32),
+            content: '<h5>' + '当前选中地址' + '</h5>' + this.address,
+            offset: new AMap.Pixel(0, -32)
           }).open(this.map, lnglat);
         }, 100);
       });
     },
     getAddress(lnglat) {
-      AMap.plugin("AMap.Geocoder", () => {
+      AMap.plugin('AMap.Geocoder', () => {
         this.geocoder.getAddress(lnglat, (status, result) => {
-          if (status === "complete" && result.info === "OK") {
+          if (status === 'complete' && result.info === 'OK') {
             this.address = result.regeocode.formattedAddress;
           }
         });
@@ -534,32 +617,32 @@ export default {
       if (this.locationForm.lat && this.locationForm.lng) {
         let lnglat = [this.locationForm.lng, this.locationForm.lat];
         var marker = new AMap.Marker({
-          position: lnglat,
+          position: lnglat
         });
         marker.setMap(this.map);
       } else {
-        if (document.getElementsByClassName("el-message").length == 0) {
-        this.$message.warning("请输入经纬度!");
+        if (document.getElementsByClassName('el-message').length == 0) {
+          this.$message.warning('请输入经纬度!');
         }
         // return fasle;
       }
     },
     dingwei(data) {
-      if (this.ruleForm.lng != "" && this.ruleForm.lng != 0) {
+      if (this.ruleForm.lng != '' && this.ruleForm.lng != 0) {
         if (isNaN(this.ruleForm.lng)) {
           this.center[0] = this.ToDigital(this.ruleForm.lng);
         } else {
           this.center[0] = this.ruleForm.lng;
         }
       }
-      if (this.ruleForm.lat != "" && this.ruleForm.lat != 0) {
+      if (this.ruleForm.lat != '' && this.ruleForm.lat != 0) {
         if (isNaN(this.ruleForm.lat)) {
           this.center[1] = this.ToDigital(this.ruleForm.lat);
         } else {
           this.center[1] = this.ruleForm.lat;
         }
       }
-      console.log(this.center)
+      console.log(this.center);
       this.addLocationDialogVisible = true;
       setTimeout(() => {
         // console.log(this.center);
@@ -568,35 +651,35 @@ export default {
     },
     //度转度°分′秒″
     ToDegrees(val, type) {
-      if (typeof val == "undefined" || val == "" || isNaN(val)) {
+      if (typeof val == 'undefined' || val == '' || isNaN(val)) {
         return val;
       }
-      val = val.toString()
-      var A = "";
-      if (type == "lng") {
-        A = val > 0 ? "E" : "W";
-      } else if (type == "lat") {
-        A = val > 0 ? "N" : "S";
+      val = val.toString();
+      var A = '';
+      if (type == 'lng') {
+        A = val > 0 ? 'E' : 'W';
+      } else if (type == 'lat') {
+        A = val > 0 ? 'N' : 'S';
       }
-      var i = val.indexOf(".");
+      var i = val.indexOf('.');
       var strDu = i < 0 ? val : val.substring(0, i); //获取度
       var strFen = 0;
       var strMiao = 0;
       if (i > 0) {
-        var strFen = "0" + val.substring(i);
-        strFen = strFen * 60 + "";
-        i = strFen.indexOf(".");
+        var strFen = '0' + val.substring(i);
+        strFen = strFen * 60 + '';
+        i = strFen.indexOf('.');
         if (i > 0) {
-          strMiao = "0" + strFen.substring(i);
+          strMiao = '0' + strFen.substring(i);
           strFen = strFen.substring(0, i); //获取分
-          strMiao = strMiao * 60 + "";
-          i = strMiao.indexOf(".");
+          strMiao = strMiao * 60 + '';
+          i = strMiao.indexOf('.');
           strMiao = strMiao.substring(0, i + 4); //取到小数点后面三位
           strMiao = parseFloat(strMiao).toFixed(2); //精确小数点后面两位
         }
       }
       // console.log(strDu, strFen, strMiao);
-      return strDu + "°" + strFen + "′" + strMiao + "″" + A;
+      return strDu + '°' + strFen + '′' + strMiao + '″' + A;
     },
     //度°分′秒″转度
     ToDigital(lnglat) {
@@ -605,26 +688,26 @@ export default {
       }
       console.log(lnglat);
       var strDu, strFen, strMiao;
-      var duindex = lnglat.indexOf("°"); //字符度的下标
-      var fenindex = lnglat.indexOf("′"); //字符分的下标
-      var miaoindex = lnglat.indexOf("″"); //字符秒的下标
+      var duindex = lnglat.indexOf('°'); //字符度的下标
+      var fenindex = lnglat.indexOf('′'); //字符分的下标
+      var miaoindex = lnglat.indexOf('″'); //字符秒的下标
       strDu = lnglat.slice(0, duindex);
       strFen = lnglat.slice(duindex + 1, fenindex);
       strMiao = lnglat.slice(fenindex + 1, miaoindex);
       // len = len > 6 || typeof len == "undefined" ? 6 : len; //精确到小数点后最多六位
       strDu =
-        typeof strDu == "undefined" || strDu == "" ? 0 : parseFloat(strDu);
+        typeof strDu == 'undefined' || strDu == '' ? 0 : parseFloat(strDu);
       strFen =
-        typeof strFen == "undefined" || strFen == ""
+        typeof strFen == 'undefined' || strFen == ''
           ? 0
           : parseFloat(strFen) / 60;
       strMiao =
-        typeof strMiao == "undefined" || strMiao == ""
+        typeof strMiao == 'undefined' || strMiao == ''
           ? 0
           : parseFloat(strMiao) / 3600;
       var digital = strDu + strFen + strMiao;
       if (digital == 0) {
-        return "";
+        return '';
       } else {
         return digital.toFixed(6);
       }
@@ -632,36 +715,34 @@ export default {
     handle(ev) {
       this.downloadinput = ev.name;
       var datas = new FormData();
-      datas.append("username", localStorage.getItem("username"));
-      datas.append("file", ev.raw);
+      datas.append('username', localStorage.getItem('username'));
+      datas.append('file', ev.raw);
       this.$axios({
-        method: "POST",
-        url: "/api/monitor_point_export",
+        method: 'POST',
+        url: '/api/monitor_point_export',
         data: datas,
-        responseType: "blob",
-      }).then((res) => {
+        responseType: 'blob'
+      }).then(res => {
         console.log(res);
-        this.downloadFile(res, "allot_result.xls");
+        this.downloadFile(res, 'allot_result.xls');
       });
     },
     download() {
       //下载模板
-      console.log(22222)
+      console.log(22222);
       // http://192.168.1.17:12345
-      window.location.href =
-        this.$deriveData +
-        "/api/monitor_point_export";
+      window.location.href = this.$deriveData + '/api/monitor_point_export';
     },
     downloadFile(res, name) {
-      let link = document.createElement("a");
+      let link = document.createElement('a');
       link.href = window.URL.createObjectURL(new Blob([res.data]));
-      link.target = "_blank";
+      link.target = '_blank';
       //文件名和格式
       link.download = name;
       document.body.appendChild(link);
       link.click();
       document.body.removeChild(link);
-    },
+    }
   },
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -675,7 +756,7 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style lang="less" scoped>
@@ -723,6 +804,7 @@ export default {
 
 // 文本域样式更改
 /deep/.el-textarea__inner {
-  font-family:  "Helvetica Neue",Helvetica,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","微软雅黑",Arial,sans-serif;
+  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB',
+    'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
 }
-</style>
+</style>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 1835 - 0
minggao/src/page/forecasting/monthKillingLamp/index-bak.vue


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 2435 - 0
minggao/src/page/forecasting/monthKillingLamp/index.vue


+ 957 - 0
minggao/src/page/forecasting/monthKillingLamp/scdDetail.vue

@@ -0,0 +1,957 @@
+<template>
+  <div style="cursor: default;width: 99%">
+    <el-button type="success" size="small" @click="goBackPage()"
+      ><i class="el-icon--left el-icon-d-arrow-left"></i>返回</el-button
+    >
+    <div class="equipInfo">
+      <div class="equipMsg">
+        <span>设备ID:{{ id }}</span
+        ><span>设备名称:{{ this.$route.params.device_name || '无' }}</span>
+        <span>位置:{{ this.$route.params.address || '无' }}</span>
+      </div>
+      <DateSearch
+        ref="timeCirculation"
+        @dateChange="dateChange"
+        @timeScreen="timeScreen"
+      ></DateSearch>
+    </div>
+    <div class="ctrl-check">
+      <el-button type="primary" size="mini" @click="$throttle(refresh, 2000)"
+        >刷新</el-button
+      >
+    </div>
+    <!-- 统计图 -->
+    <div v-if="viewSwitch">
+      <div>
+        <el-row :gutter="10">
+          <el-col :md="24" :lg="!shield ? 14 : 24">
+            <el-card class="box-card" id="box-card1">
+              <div class="charts">
+                <highcharts :options="option3"></highcharts>
+              </div>
+            </el-card>
+          </el-col>
+          <el-col :md="24" :lg="10" v-if="!shield">
+            <el-card class="box-card" id="box-card2">
+              <div class="pie">
+                <highcharts :options="option2"></highcharts>
+              </div>
+            </el-card>
+          </el-col>
+        </el-row>
+        <div class="dataTableSearch">
+          <div>
+            <el-button type="primary" size="mini" @click="deriveData()"
+              >导出</el-button
+            >
+          </div>
+        </div>
+      </div>
+      <el-card class="box-card">
+        <el-table :data="tableData" stripe style="width: 100%">
+          <el-table-column
+            v-for="(item, index) in tableHeadTxt2"
+            :key="index"
+            :prop="item[1]"
+            :label="item[0]"
+            :width="setWidth(item)"
+          >
+            <template slot-scope="scope">{{
+              scope.row[scope.column.property]
+            }}</template>
+          </el-table-column>
+        </el-table>
+        <el-pagination
+          background
+          layout="prev, pager, next, jumper"
+          :total="total"
+          :current-page="queryInfo.page"
+          @current-change="changePage"
+        ></el-pagination>
+      </el-card>
+
+      <!-- 导出对话框 -->
+      <el-dialog
+        title="导出信息"
+        :close-on-click-modal="false"
+        :visible.sync="dialogVisible"
+        width="30%"
+      >
+        <!-- <span>这是一段信息</span> -->
+
+        <!-- 下拉框和输入框 -->
+        <ul class="iptUl">
+          <li class="iptList">
+            <div class="iptTxt">
+              <span style="color: red">*</span>文件名称:
+            </div>
+            <div class="iptBox">
+              <el-input
+                placeholder="请输入文件的名称"
+                v-model="value"
+                clearable
+              >
+              </el-input>
+            </div>
+          </li>
+          <li class="iptList">
+            <div class="iptTxt">
+              <span style="color: red">*</span>下载类型:
+            </div>
+            <div class="iptBox">
+              <el-select v-model="value1" placeholder="请选择">
+                <el-option
+                  v-for="item in optionsA"
+                  :key="item.value"
+                  :label="item.label"
+                  :value="item.value"
+                >
+                </el-option>
+              </el-select>
+            </div>
+          </li>
+        </ul>
+        <!-- 下拉框和输入框 -->
+
+        <span slot="footer" class="dialog-footer">
+          <el-button @click="dialogVisible = false">取 消</el-button>
+          <el-button type="primary" @click="addData()">确 定</el-button>
+        </span>
+      </el-dialog>
+      <!-- 导出对话框 -->
+    </div>
+  </div>
+</template>
+
+<script>
+import DateSearch from '@/components/DateSearch';
+import HighCharts from 'highcharts';
+import HighchartsNoData from 'highcharts/modules/no-data-to-display';
+HighchartsNoData(HighCharts);
+import { Loading } from 'element-ui';
+import Circulation from '../../../../static/js/equipState_dict.json';
+
+export default {
+  data() {
+    return {
+      user_tag: null, //1超级管理员,2经销商,3农林政府单位,4普通用户,5销售用户
+      id: this.$route.params.e_id,
+      lineTime: '',
+      dataTime: '',
+      worms: [
+        {
+          value: 1,
+          label: '蛾子'
+        },
+        {
+          value: 2,
+          label: '蚊子'
+        }
+      ],
+      // 状态信息
+      equipStatus: {},
+      // 统计图表信息
+      equipChartData: [],
+      //总数据条数
+      total: 0,
+      // 动态表头
+      tableHeadTxt: [
+        ['设备开关', 'ds'],
+        ['工作状态', 'ws'],
+        ['雨控状态', 'rps'],
+        ['温控状态', 'tps'],
+        ['倾倒状态', 'dps'],
+        ['定时(h)', 'tt'],
+        ['电击次数', 'ct'],
+        ['温度(°C)', 'at'],
+        ['湿度(%)', 'ah'],
+        ['充电电压(v)', 'cv'],
+        ['电池电压(v)', 'bv'],
+        ['信号强度', 'csq'],
+        ['上报时间', 'addtime']
+      ],
+      tableHeadTxt2: [
+        ['设备开关', 'ds'],
+        ['工作状态', 'ws'],
+        ['雨控状态', 'rps'],
+        ['温控状态', 'tps'],
+        ['倾倒状态', 'dps'],
+        ['定时(h)', 'tt'],
+        ['电击次数', 'ct'],
+        ['温度(°C)', 'at'],
+        ['湿度(%)', 'ah'],
+        ['上报时间', 'addtime']
+      ],
+      tableHeadTxt3: [
+        ['设备开关', 'ds'],
+        ['工作状态', 'ws'],
+        ['温控状态', 'tps'],
+        ['定时(h)', 'tt'],
+        ['温度(°C)', 'at'],
+        ['湿度(%)', 'ah'],
+        ['上报时间', 'addtime']
+      ],
+      // 表格数据
+      tableData: [],
+      timeRange: '',
+      queryInfo: {
+        begin: '',
+        end: '',
+        e_id: this.$route.params.e_id,
+        d_id: this.$route.params.d_id,
+        page: 1
+      },
+      viewSwitch: 1,
+      viewSwitch2: 1,
+      //图表实时否有数据
+      isEchartData: true,
+      //表格和图表按钮样式切换参数
+      display: '0', //0代表表格、1代表图表
+      displayView: true,
+      // 表格和图表显示切换控制
+      showControl: true,
+      //echarts图表参数
+      echartOptions: [],
+      // 动态表头
+      tableHead: [],
+      // 表格数据
+      hisData: [],
+      //导出弹框
+      dialogVisible: false,
+      optionsA: [
+        {
+          value: '选项1',
+          label: '全部'
+        },
+        {
+          value: '选项2',
+          label: '时间段'
+        }
+      ],
+      value: '', //文件名称
+      value1: '', //下载类型
+      value2: '', //时间段
+      timeShow: false, //选择时间
+      loadingInstance1: {},
+      loadingInstance2: {},
+      ChartData: [
+        {
+          name: '温度(°C)',
+          dat: []
+        },
+        {
+          name: '湿度(%)',
+          dat: []
+        },
+        {
+          name: '击虫次数',
+          dat: []
+        },
+        {
+          name: '充电电压',
+          dat: []
+        },
+        {
+          name: '电池电压',
+          dat: []
+        }
+      ],
+      equipStateDict: {}, //
+      //保存一个标识,用来区分是点击还是自动获取
+      sign: null,
+      timeScreenData: null,
+      myuid: '', //用户id
+      shield: false
+    };
+  },
+  created() {
+    this.user_tag = localStorage.getItem('user_tag');
+    this.myuid = sessionStorage.getItem('myuid');
+  },
+  mounted() {
+    this.equipStateDict = Circulation;
+    this.refreshData();
+    this.loadingInstance1 = Loading.service({
+      fullscreen: false,
+      target: document.getElementById('box-card1')
+    });
+    this.loadingInstance2 = Loading.service({
+      fullscreen: false,
+      target: document.getElementById('box-card2')
+    });
+
+    // console.log(this.$route.params.device_name)
+  },
+  computed: {
+    userType: function() {
+      //获取用户类型
+      return window.sessionStorage.getItem('myuser_type');
+    },
+    option1() {
+      return {
+        chart: {
+          zoomType: 'x'
+        },
+        title: {
+          text: '环境温度、湿度、充电电压、电池电压',
+          align: 'left'
+        },
+        lang: {
+          noData: '暂无数据'
+        },
+        noData: {
+          style: {
+            fontWeight: 'bold',
+            fontSize: '15px',
+            color: '#303030'
+          }
+        },
+        subtitle: {
+          text: ''
+        },
+        xAxis: {
+          crosshair: true, //十字基准线
+          type: 'datetime',
+          dateTimeLabelFormats: {
+            //根据时间间距X轴自动显示哪种格式
+            millisecond: '%H:%M:%S.%L',
+            second: '%H:%M:%S',
+            minute: '%H:%M',
+            hour: '%H:%M',
+            day: '%m-%d',
+            week: '%m-%d',
+            month: '%Y-%m',
+            year: '%Y'
+          }
+        },
+        yAxis: {
+          title: {
+            text: ''
+          }
+        },
+        legend: {
+          // layout: 'vertical',
+          align: 'right',
+          verticalAlign: 'top'
+        },
+        plotOptions: {
+          series: {
+            label: {
+              connectorAllowed: false
+            },
+            pointStart: 2010
+          }
+        },
+        series: [
+          {
+            name: this.ChartData[0].name,
+            data: this.ChartData[0].dat
+          },
+          {
+            name: this.ChartData[1].name,
+            data: this.ChartData[1].dat
+          },
+          {
+            name: this.ChartData[3].name,
+            data: this.ChartData[3].dat
+          },
+          {
+            name: this.ChartData[4].name,
+            data: this.ChartData[4].dat
+          }
+        ],
+        colors: ['#f97000', '#00e29d', '#6cbbff', '#ff3f3f'],
+        credits: {
+          //去掉默认的highcharts.com
+          enabled: false
+        },
+        tooltip: {
+          // crosshairs: true,
+          shared: true, //折线共享
+          headerFormat: '<b>{point.x:%Y-%m-%e %H:%M:%S}</b><br>'
+        },
+        responsive: {
+          rules: [
+            {
+              condition: {
+                maxWidth: 500
+              },
+              chartOptions: {
+                legend: {
+                  layout: 'horizontal',
+                  align: 'center',
+                  verticalAlign: 'bottom'
+                }
+              }
+            }
+          ]
+        }
+      };
+    },
+    option3() {
+      return {
+        chart: {
+          zoomType: 'x'
+        },
+        title: {
+          text: '环境温度、湿度',
+          align: 'left'
+        },
+        lang: {
+          noData: '暂无数据'
+        },
+        noData: {
+          style: {
+            fontWeight: 'bold',
+            fontSize: '15px',
+            color: '#303030'
+          }
+        },
+        subtitle: {
+          text: ''
+        },
+        xAxis: {
+          crosshair: true, //十字基准线
+          type: 'datetime',
+          dateTimeLabelFormats: {
+            //根据时间间距X轴自动显示哪种格式
+            millisecond: '%H:%M:%S.%L',
+            second: '%H:%M:%S',
+            minute: '%H:%M',
+            hour: '%H:%M',
+            day: '%m-%d',
+            week: '%m-%d',
+            month: '%Y-%m',
+            year: '%Y'
+          }
+        },
+        yAxis: {
+          title: {
+            text: ''
+          }
+        },
+        legend: {
+          // layout: 'vertical',
+          align: 'right',
+          verticalAlign: 'top'
+        },
+        plotOptions: {
+          series: {
+            label: {
+              connectorAllowed: false
+            },
+            pointStart: 2010
+          }
+        },
+        series: [
+          {
+            name: this.ChartData[0].name,
+            data: this.ChartData[0].dat
+          },
+          {
+            name: this.ChartData[1].name,
+            data: this.ChartData[1].dat
+          }
+        ],
+        colors: ['#f97000', '#00e29d', '#6cbbff', '#ff3f3f'],
+        credits: {
+          //去掉默认的highcharts.com
+          enabled: false
+        },
+        tooltip: {
+          // crosshairs: true,
+          shared: true, //折线共享
+          headerFormat: '<b>{point.x:%Y-%m-%e %H:%M:%S}</b><br>'
+        },
+        responsive: {
+          rules: [
+            {
+              condition: {
+                maxWidth: 500
+              },
+              chartOptions: {
+                legend: {
+                  layout: 'horizontal',
+                  align: 'center',
+                  verticalAlign: 'bottom'
+                }
+              }
+            }
+          ]
+        }
+      };
+    },
+    option2() {
+      return {
+        chart: {
+          zoomType: 'x'
+        },
+        title: {
+          text: '击虫次数',
+          align: 'left'
+        },
+        lang: {
+          noData: '暂无数据'
+        },
+        noData: {
+          style: {
+            fontWeight: 'bold',
+            fontSize: '15px',
+            color: '#303030'
+          }
+        },
+        subtitle: {
+          text: ''
+        },
+        xAxis: {
+          crosshair: true, //十字基准线
+          type: 'datetime',
+          dateTimeLabelFormats: {
+            //根据时间间距X轴自动显示哪种格式
+            millisecond: '%H:%M:%S.%L',
+            second: '%H:%M:%S',
+            minute: '%H:%M',
+            hour: '%H:%M',
+            day: '%m-%d',
+            week: '%m-%d',
+            month: '%Y-%m',
+            year: '%Y'
+          }
+        },
+        yAxis: {
+          title: {
+            text: ''
+          },
+          allowDecimals: false //是否允许刻度有小数
+        },
+        legend: {
+          // layout: 'vertical',
+          align: 'right',
+          verticalAlign: 'top'
+        },
+        plotOptions: {
+          series: {
+            label: {
+              connectorAllowed: false
+            },
+            pointStart: 2010
+          }
+        },
+        series: [
+          {
+            name: this.ChartData[2].name,
+            data: this.ChartData[2].dat
+          }
+        ],
+        colors: ['#00e29d', '#6cbbff', '#ff3f3f'],
+        credits: {
+          //去掉默认的highcharts.com
+          enabled: false
+        },
+        tooltip: {
+          // crosshairs: true,
+          shared: true, //折线共享
+          headerFormat: '<b>{point.x:%Y-%m-%e %H:%M:%S}</b><br>'
+        },
+        responsive: {
+          rules: [
+            {
+              condition: {
+                maxWidth: 500
+              },
+              chartOptions: {
+                legend: {
+                  layout: 'horizontal',
+                  align: 'center',
+                  verticalAlign: 'bottom'
+                }
+              }
+            }
+          ]
+        }
+      };
+    }
+  },
+  methods: {
+    // 设置hightcharts配置
+    refreshData() {
+      HighCharts.setOptions({
+        // 所有语言文字相关配置都设置在 lang 里
+        lang: {
+          resetZoom: '刷新',
+          resetZoomTitle: '重置缩放比例'
+        }
+      });
+    },
+    //获取折线数据
+    getChartDataList() {
+      this.$axios({
+        method: 'POST',
+        url: '/api/api_gateway?method=forecast.worm_lamp.device_polyline_data',
+        data: this.qs.stringify({
+          device_type_id: 2,
+          d_id: this.queryInfo.d_id,
+          start_time: this.queryInfo.begin,
+          end_time: this.queryInfo.end
+        })
+      }).then(res => {
+        this.ChartData[0].dat = [];
+        this.ChartData[1].dat = [];
+        this.ChartData[2].dat = [];
+        this.ChartData[3].dat = [];
+        this.ChartData[4].dat = [];
+        if (res.data.message == '' && res.data.data.length !== 0) {
+          var data = res.data.data;
+          for (let item of data) {
+            if (item.new_tem) {
+              this.ChartData[0].dat.unshift([
+                item.addtime * 1000 + 8 * 3600000,
+                Number(item.new_tem)
+              ]);
+            } else {
+              item.temperature !== '' &&
+                this.ChartData[0].dat.unshift([
+                  item.addtime * 1000 + 8 * 3600000,
+                  Number(item.temperature)
+                ]);
+            }
+            if (item.new_hum) {
+              this.ChartData[1].dat.unshift([
+                item.addtime * 1000 + 8 * 3600000,
+                Number(item.new_hum)
+              ]);
+            } else {
+              item.humidity !== '' &&
+                this.ChartData[1].dat.unshift([
+                  item.addtime * 1000 + 8 * 3600000,
+                  Number(item.humidity)
+                ]);
+            }
+            console.log(item.others.ct);
+            this.ChartData[2].dat.unshift([
+              item.addtime * 1000 + 8 * 3600000,
+              Number(item.others.ct)
+            ]);
+            this.ChartData[3].dat.unshift([
+              item.addtime * 1000 + 8 * 3600000,
+              // Number(item.others.cv / 1000),
+              Number(item.others.cv)
+            ]);
+            this.ChartData[4].dat.unshift([
+              item.addtime * 1000 + 8 * 3600000,
+              // Number(item.others.bv / 1000),
+              Number(item.others.bv)
+            ]);
+          }
+        }
+        this.loadingInstance1.close();
+        this.loadingInstance2.close();
+      });
+    },
+    //获取表格数据
+    getHisDataList() {
+      this.$axios({
+        method: 'POST',
+        url: '/api/api_gateway?method=forecast.worm_lamp.device_history_data',
+        data: this.qs.stringify({
+          device_type_id: 2,
+          device_id: this.queryInfo.e_id,
+          start_time: this.queryInfo.begin,
+          end_time: this.queryInfo.end,
+          page: this.queryInfo.page
+        })
+      }).then(res => {
+        console.log(this.sign + '这是变量');
+        console.log(this.queryInfo.begin + '这是开始时间');
+        if (res.data.data.data.length == 0 && this.timeScreenData == null) {
+          if (this.sign == this.queryInfo.begin || this.sign == null) {
+            this.$refs.timeCirculation.say();
+            console.log('这是自动的');
+          } else {
+            console.log('这是点击的');
+          }
+          this.sign = this.queryInfo.begin; //保存一个标识,用来区分是点击还是自动获取
+        }
+        if (res.data.message == '') {
+          this.total = res.data.data.counts;
+          var data = res.data.data.data;
+          this.tableData = [];
+          if (data.length > 0) {
+            for (var i = 0; i < data.length; i++) {
+              var dht = data[i].d_h_t;
+              dht.addtime = this.formatTime(dht.addtime * 1000);
+              dht.ds = this.equipStateDict.ds.value[dht.ds]; //设备开关
+              dht.rps = this.equipStateDict.rps.value[dht.rps]; //雨控状态
+              dht.tps = this.equipStateDict.tps.value[dht.tps]; //温控状态
+              dht.tbs = this.equipStateDict.tbs.value[dht.tbs]; //灯管状态
+              dht.dps = this.equipStateDict.dps.value[dht.dps]; //倾倒状态
+              // dht.cv = dht.cv / 1000;
+              // dht.bv = dht.bv / 1000;
+              if (dht.cv < 0) {
+                dht.cv = 0;
+              } else {
+                dht.cv = dht.cv;
+              }
+
+              if (dht.bv < 0) {
+                dht.bv = 0;
+              } else {
+                dht.bv = dht.bv;
+              }
+              // dht.cv = dht.cv;
+              // dht.bv = dht.bv;
+              dht.csq = dht.csq;
+              dht.ws = this.equipStateDict.ws.value[dht.ws]; //工作状态
+              // switch (dht.ws) {
+              //   case 0:
+              //     dht.ws = "待机";
+              //     break;
+              //   case 1:
+              //     dht.ws = "工作";
+              //     break;
+              //   case 2:
+              //     dht.ws = "充电";
+              //     break;
+              // }
+              if (dht.new_hum) {
+                dht.ah = dht.new_hum;
+              }
+              if (dht.new_tem) {
+                dht.at = dht.new_tem;
+              }
+              this.tableData.push(dht);
+            }
+          }
+        }
+      });
+    },
+    // 当使用日期筛选
+    timeScreen(data) {
+      this.timeScreenData = data;
+    },
+    dateChange(data) {
+      this.queryInfo.page = 1;
+      this.queryInfo.begin = data.begin;
+      this.queryInfo.end = data.end;
+      this.getHisDataList();
+      this.getChartDataList();
+    },
+    //改变page
+    changePage(val) {
+      this.queryInfo.page = val;
+      this.getHisDataList();
+    },
+    setWidth(item) {
+      if (item[1] == 'addtime') {
+        return 180 + 'px';
+      }
+    },
+    refresh() {
+      this.$axios({
+        method: 'POST',
+        url: '/api/api_gateway?method=forecast.send_control.get_device_config',
+        data: this.qs.stringify({
+          device_type_id: 2,
+          d_id: this.queryInfo.d_id,
+          control_type: 'data'
+        })
+      }).then(res => {
+        if (res.data.message == '') {
+          this.$resetMessage.success('刷新成功');
+        } else {
+          this.$resetMessage.err('刷新失败');
+        }
+      });
+    },
+    //返回上一页
+    goBackPage() {
+      this.$router.go(-1);
+    },
+
+    // 导出数据
+    deriveData() {
+      this.dialogVisible = true;
+    },
+    //导出数据确定
+    addData() {
+      var that = this;
+      if (that.value == '' || that.value1 == '') {
+        this.$resetMessage({
+          message: '请将必填项填写完整',
+          type: 'warning',
+          duration: 1500
+        });
+      } else {
+        var begin = '';
+        var end = '';
+        // if (that.value1 == "") {
+        //   // begin = parseInt(new Date(that.value2[0]).getTime() / 1000);
+        //   // end = parseInt(new Date(that.value2[1]).getTime() / 1000);
+        //   begin = this.queryInfo.begin;
+        //   end = this.queryInfo.end;
+        // } else {
+        //   begin = "";
+        //   end = "";
+        // }
+        if (that.value1 == '选项2') {
+          begin = this.queryInfo.begin;
+          end = this.queryInfo.end;
+        } else if (that.value1 == '选项1') {
+          begin = '';
+          end = '';
+        }
+
+        console.log(begin);
+        console.log(end);
+        var username = localStorage.getItem('cUsername');
+        window.location.href =
+          this.$deriveData +
+          // "http://192.168.1.77:8002" +
+          '/api/cbd_export?device_id=' +
+          that.$route.params.d_id +
+          '&filename=' +
+          that.value +
+          '&start_time=' +
+          begin +
+          '&end_time=' +
+          end +
+          '&device_type=2' +
+          '&username=' +
+          username;
+      }
+    },
+    getwornjuri() {
+      this.$axios({
+        method: 'POST',
+        url:
+          '/api/api_gateway?method=forecast.send_control.clear_insects_permission'
+      }).then(res => {
+        if (res.data.data) {
+          console.log(res.data.data);
+          var arr = res.data.data;
+          this.shield = arr[2] == 1 ? true : false;
+        }
+      });
+    }
+  },
+  components: {
+    DateSearch
+  },
+  watch: {
+    value1(val) {
+      if (val == '选项2') {
+        this.timeShow = true;
+      }
+      if (val == '选项1') {
+        this.timeShow = false;
+      }
+    },
+    dialogVisible(val) {
+      if (val == false) {
+        this.value = '';
+        this.value1 = '';
+        this.value2 = '';
+        this.timeShow = false;
+      }
+    }
+  }
+};
+</script>
+
+<style lang="less" scoped>
+.box-card {
+  position: relative;
+}
+.equipInfo {
+  .equipMsg {
+    font-size: 14px;
+    color: #3d3d3d;
+    span {
+      margin-left: 5px;
+    }
+  }
+  display: flex;
+  justify-content: space-between;
+  margin-top: 10px;
+  margin-bottom: 8px;
+}
+
+.time-check {
+  display: flex;
+  justify-content: space-between;
+  .el-input__inner {
+    margin-left: 10px;
+    width: 222px;
+  }
+  .viewSwitch {
+    margin-left: 10px;
+  }
+}
+
+.chartsSelect {
+  text-align: right;
+  position: absolute;
+  z-index: 999;
+  left: 0;
+  right: 21px;
+}
+.charts,
+.pie {
+  height: 423px;
+}
+.equipStatus {
+  display: flex;
+  justify-content: center;
+  margin: 10px 0;
+  .equipIcon {
+    margin-right: 14%;
+  }
+  .equipParams {
+    min-width: 80px;
+    line-height: 27px;
+    p {
+      color: #a6a6a6;
+    }
+  }
+}
+
+.dataTableSearch {
+  display: flex;
+  justify-content: space-between;
+  margin: 20px 0;
+  .el-input__inner {
+    width: 222px;
+  }
+}
+
+.echarts {
+  width: 100%;
+  height: 300px;
+}
+.ctrl-check {
+  margin-bottom: 20px;
+}
+
+.iptList {
+  display: flex;
+  margin: 15px 0 15px 0;
+}
+.iptTxt {
+  text-align: right;
+  width: 20%;
+  margin: 0 5% 0 0;
+  display: inline-block;
+}
+.iptBox {
+  width: 40%;
+}
+
+// 表格文字居中
+/deep/.el-table th > .cell {
+  text-align: center;
+}
+
+/deep/.el-table .cell {
+  text-align: center;
+}
+</style>

+ 71 - 57
minggao/src/page/forecasting/trap/fillinrecord.vue

@@ -91,7 +91,7 @@
               >
                 <div class="popover-content" v-html="content"></div>
                 <span @mouseover="orglisthover(scope.row)" slot="reference"
-                  >{{ scope.row.org_name.split(",")[0] }}...</span
+                  >{{ scope.row.org_name.split(',')[0] }}...</span
                 >
               </el-popover>
             </template>
@@ -139,7 +139,7 @@
           @click="deriveclick"
           size="mini"
           :disabled="deriveTF"
-          >{{ deriveTF ? "导出中..." : "确 定" }}</el-button
+          >{{ deriveTF ? '导出中...' : '确 定' }}</el-button
         >
       </span>
     </el-dialog>
@@ -155,37 +155,39 @@ export default {
   data() {
     //这里存放数据
     return {
-      idinput: "",
-      nameinput: "",
-      inoffvalue: "",
+      idinput: '',
+      nameinput: '',
+      inoffvalue: '',
       inoffoptions: [],
-      versionsvalue: "",
+      versionsvalue: '',
       versionsoptions: [],
-      versionsvalue2: "",
+      versionsvalue2: '',
       versionsoptions2: [],
       queryInfo: {
         page: 1,
-        trap_number: "", //   设备编号 搜索项
-        point_name: "", //       设备所属监测点 搜索项
-        org_name: "", //         设备所属组织   搜索项
-        user_name: "", //        填报人名字 搜索项
-        start_time: "", //       开始时间 搜索项
-        end_time: "", //         结束时间 搜索项
+        trap_number: '', //   设备编号 搜索项
+        point_name: '', //       设备所属监测点 搜索项
+        org_name: '', //         设备所属组织   搜索项
+        user_name: '', //        填报人名字 搜索项
+        start_time: '', //       开始时间 搜索项
+        end_time: '' //         结束时间 搜索项
       },
       tableData: [],
-      device_id: "",
+      device_id: '',
       total: 10,
       loading: false,
-      timevalue: "", //时间段
+      timevalue: '', //时间段
       deriveVisible: false, //导出弹框
-      derivefilename: "", //导出文件名称
+      derivefilename: '', //导出文件名称
       defaultParams: {
-        label: "org_name",
-        value: "id",
-        children: "childrens",
+        label: 'org_name',
+        value: 'id',
+        children: 'childrens'
       },
-      content: "",
+      content: '',
       deriveTF: false,
+      pointType: '',
+      typeID: ''
     };
   },
   //监听属性 类似于data概念
@@ -198,8 +200,9 @@ export default {
       //获取设备列表
       this.loading = true;
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=monitor_manage.trap_manage.trap_pest_record",
+        method: 'POST',
+        url:
+          '/api/api_gateway?method=monitor_manage.trap_manage.trap_pest_record',
         data: this.qs.stringify({
           page_size: 20,
           page: this.queryInfo.page,
@@ -209,14 +212,15 @@ export default {
           user_name: this.queryInfo.user_name, //                   非必传(string)               填报人名字 搜索项
           start_time: this.queryInfo.start_time, //                  非必传(string)               开始时间 搜索项
           end_time: this.queryInfo.end_time, //                    非必传(string)               结束时间 搜索项
-        }),
-      }).then((res) => {
+          type_id: this.typeID
+        })
+      }).then(res => {
         this.loading = false;
         console.log(res.data.data);
         this.total = res.data.data.pest_num;
         this.tableData = res.data.data.trap_data;
         for (var i = 0; i < this.tableData.length; i++) {
-          this.tableData[i]["index"] = i + 1;
+          this.tableData[i]['index'] = i + 1;
         }
         this.$nextTick(() => {
           this.$refs.gridTable.bodyWrapper.scrollTop = 0;
@@ -236,9 +240,13 @@ export default {
     // },
     getmon2() {
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=monitor_manage.trap_manage.pest_trap_org",
-      }).then((res) => {
+        method: 'POST',
+        url: '/api/api_gateway?method=monitor_manage.trap_manage.pest_trap_org',
+        data: this.qs.stringify({
+          // type_id: this.typeID,
+          page_item: '1000000'
+        })
+      }).then(res => {
         console.log(res.data.data);
         this.versionsoptions2 = res.data.data.org_list;
         // this.versionsoptions = res.data.data.page_list; //组织
@@ -261,9 +269,9 @@ export default {
       if (e) {
         this.queryInfo.start_time = this.tabtime(e[0]);
         this.queryInfo.end_time = this.tabtime(e[1]);
-      }else{
-        this.queryInfo.start_time = ''
-        this.queryInfo.end_time = ''
+      } else {
+        this.queryInfo.start_time = '';
+        this.queryInfo.end_time = '';
       }
       this.search();
     },
@@ -272,7 +280,7 @@ export default {
       var years = times.getFullYear();
       var month = times.getMonth() + 1;
       var date = times.getDate();
-      return years + "-" + month + "-" + date;
+      return years + '-' + month + '-' + date;
     },
     pageChange(e) {
       // console.log(e)
@@ -281,24 +289,24 @@ export default {
     },
     reset() {
       //重置
-      this.idinput = "";
-      this.nameinput = "";
-      this.inoffvalue = "";
-      this.versionsvalue = "";
-      this.timevalue = "";
-      this.queryInfo.start_time = "";
-      this.queryInfo.end_time = "";
+      this.idinput = '';
+      this.nameinput = '';
+      this.inoffvalue = '';
+      this.versionsvalue = '';
+      this.timevalue = '';
+      this.queryInfo.start_time = '';
+      this.queryInfo.end_time = '';
       for (var key in this.queryInfo) {
-        this.queryInfo[key] = "";
+        this.queryInfo[key] = '';
       }
       this.queryInfo.page = 1;
-      this.versionsvalue2 = "";
+      this.versionsvalue2 = '';
       this.getcbdlist();
     },
     downloadFile(res, name) {
-      let link = document.createElement("a");
+      let link = document.createElement('a');
       link.href = window.URL.createObjectURL(new Blob([res.data]));
-      link.target = "_blank";
+      link.target = '_blank';
       //文件名和格式
       link.download = name;
       document.body.appendChild(link);
@@ -308,19 +316,19 @@ export default {
     },
     deriveclick() {
       // this.deriveVisible = false;
-      if (this.derivefilename == "") {
-        if (document.getElementsByClassName("el-message").length == 0) {
+      if (this.derivefilename == '') {
+        if (document.getElementsByClassName('el-message').length == 0) {
           this.$message({
             showClose: true,
-            message: "请填写文件名称",
-            type: "warning",
+            message: '请填写文件名称',
+            type: 'warning'
           });
         }
       } else {
         this.deriveTF = true;
         this.$axios({
-          method: "POST",
-          url: "/api/pest_export",
+          method: 'POST',
+          url: '/api/pest_export',
           data: this.qs.stringify({
             trap_number: this.queryInfo.trap_number,
             point_name: this.queryInfo.point_name,
@@ -330,24 +338,25 @@ export default {
             start_time: this.queryInfo.start_time,
             end_time: this.queryInfo.end_time,
             user_name: this.queryInfo.user_name,
-            user: localStorage.getItem("username"),
+            user: localStorage.getItem('username'),
+            type_id: this.typeID
           }),
-          responseType: "blob",
-        }).then((res) => {
+          responseType: 'blob'
+        }).then(res => {
           console.log(res);
-          this.downloadFile(res, this.derivefilename + ".xls");
+          this.downloadFile(res, this.derivefilename + '.xls');
         });
       }
     },
     orglisthover(e) {
       console.log(e.org_name);
-      var data = e.org_name.split(",");
+      var data = e.org_name.split(',');
       var str = ``;
       for (var i = 0; i < data.length; i++) {
         str += `<p>` + data[i] + `</p>`;
       }
       this.content = str;
-    },
+    }
   },
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -355,6 +364,11 @@ export default {
   beforeMount() {}, //生命周期 - 挂载之前
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
+    console.log(this.$route);
+
+    const { pointType, typeID } = this.$route.query;
+    this.pointType = pointType;
+    this.typeID = typeID;
     // this.getmon();
     this.getmon2();
     this.getcbdlist();
@@ -363,7 +377,7 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style scoped lang="less">
@@ -415,4 +429,4 @@ export default {
     cursor: pointer;
   }
 }
-</style>
+</style>

+ 15 - 0
minggao/src/page/forecasting/trap/forestTrap.vue

@@ -0,0 +1,15 @@
+<template>
+  <div>
+    <trap-component point_type="1" typeID="8"  />
+  </div>
+</template>
+<script>
+import trapComponent from './trap.vue';
+
+export default {
+  components: {
+    trapComponent
+  }
+};
+</script>
+<style lang="less" scoped></style>

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 276 - 226
minggao/src/page/forecasting/trap/trap.vue


+ 15 - 0
minggao/src/page/forecasting/trap/trypetidMonitoringTrap.vue

@@ -0,0 +1,15 @@
+<template>
+  <div>
+    <trap-component point_type="2" typeID="10" />
+  </div>
+</template>
+<script>
+import trapComponent from './trap.vue';
+
+export default {
+  components: {
+    trapComponent
+  }
+};
+</script>
+<style lang="less" scoped></style>

+ 15 - 0
minggao/src/page/forecasting/trap/trypetidTrap.vue

@@ -0,0 +1,15 @@
+<template>
+  <div>
+    <trap-component point_type="2" typeID="9" />
+  </div>
+</template>
+<script>
+import trapComponent from './trap.vue';
+
+export default {
+  components: {
+    trapComponent
+  }
+};
+</script>
+<style lang="less" scoped></style>

+ 28 - 8
minggao/src/page/home/index.vue

@@ -123,7 +123,8 @@
             <el-breadcrumb-item
               v-for="(item, index) in routerinfo"
               :key="item.pur_id"
-              ><a
+            >
+              <!-- <a
                 v-if="
                   index == routerinfo.length - 2 &&
                     item.menu != '' &&
@@ -132,7 +133,8 @@
                 :href="'/#/index/' + item.menu"
                 style="cursor: pointer"
                 >{{ item.purview_name }}</a
-              ><span v-else>{{ item.purview_name }}</span></el-breadcrumb-item
+              > -->
+              <span>{{ item.purview_name }}</span></el-breadcrumb-item
             >
           </el-breadcrumb>
         </div>
@@ -182,6 +184,7 @@
 <script>
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 import QRCode from 'qrcodejs2';
+// import testData from './test';
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {},
@@ -290,6 +293,9 @@ export default {
         method: 'POST',
         url: '/api/api_gateway?method=sysmenage.usermanager.user_info'
       }).then(res => {
+        // 测试代码 ---- start
+        // res = { data: testData };
+        // --- end
         this.indexloading = false;
         this.app_url = res.data.data.app_url;
         this.imgurl = res.data.data.theme_info.logo_url;
@@ -303,7 +309,11 @@ export default {
         });
         // this.infodata = res.data.data.children;
         this.infodata = titleList;
-        console.log(this.routerdata);
+        console.log(
+          this.routerdata,
+          this.infodata,
+          '-------------------------- get'
+        );
         // this.infodata.shift();
         localStorage.setItem('userID', res.data.data.im_user_id); // 存储当前登录账号的ID
         this.username = res.data.data.username;
@@ -402,9 +412,11 @@ export default {
     },
     routemap(routerdata) {
       var newrouter = this.$route.path;
+      const pathList = newrouter.split('/').filter(item => !!item);
+      // console.log(routerdata, 'route map', newrouter, pathList);
       var tf = routerdata.filter(item => {
         if (item.menu != '') {
-          if (newrouter.indexOf(item.menu) != -1) {
+          if (pathList.includes(item.menu)) {
             // 第一层菜单是否包含当前路由
             // var arr = [item.menu,item.pur_id]
             // console.log(item.pur_id)
@@ -422,9 +434,9 @@ export default {
           }
         }
       });
-      // console.log(tf)
+      // console.log(tf, 'route map -----');
       if (tf.length != 0) {
-        console.log(tf);
+        // console.log(tf);
         // this.menuActiveId = tf[0].pur_id.toString();
         this.routerinfo = [];
         this.routerinfo.unshift(tf[0]);
@@ -475,9 +487,9 @@ export default {
         });
         // console.log(newpath)
         this.routerinfo.unshift(newpath[0]);
-        console.log(this.routerinfo);
-      } else {
         // console.log(this.routerinfo);
+      } else {
+        // console.log(this.routerinfo, 'home');
         var obj = {
           menu: '',
           parent_perm_id: '88',
@@ -494,6 +506,14 @@ export default {
           } else if (this.$route.path == '/index/superviseLogDetails') {
             this.routerinfo.push(obj);
           }
+        } else if (
+          this.routerinfo.length === 3 &&
+          this.$route.path === '/index/fillinrecord'
+        ) {
+          this.routerinfo.push({
+            menu: '',
+            purview_name: '填报记录'
+          });
         }
       }
     },

+ 387 - 0
minggao/src/page/home/test.js

@@ -0,0 +1,387 @@
+export default {
+  errorCode: 0,
+  message: '',
+  formError: {},
+  data: {
+    username: '超级管理员',
+    real_name: '超级管理员',
+    email: '131888888@qq.com',
+    mobile: '13188888888',
+    org_list: [],
+    role_list: [
+      {
+        role_id: 34,
+        role_list: '超级管理员'
+      }
+    ],
+    app_url: '/data/szmg/app/zwjk.apk',
+    user_type: 1,
+    children: [
+      {
+        pur_id: 1,
+        purview_name: '首页',
+        parent_perm_id: 0,
+        menu: '',
+        children: [
+          {
+            pur_id: 2,
+            purview_name: '设备分布',
+            parent_perm_id: 1,
+            menu: 'facilitydistribute'
+          },
+          {
+            pur_id: 3,
+            purview_name: '有害生物分布',
+            parent_perm_id: 1,
+            menu: 'pestdistribute'
+          }
+        ]
+      },
+      {
+        pur_id: 4,
+        purview_name: '指挥中心',
+        parent_perm_id: 0,
+        menu: '',
+        children: [
+          {
+            pur_id: 5,
+            purview_name: '任务管理',
+            parent_perm_id: 4,
+            menu: 'taskRegulator'
+          },
+          {
+            pur_id: 9,
+            purview_name: '实时通讯',
+            parent_perm_id: 4,
+            menu: 'realTime'
+          },
+          {
+            pur_id: 6,
+            purview_name: '实验室识别',
+            parent_perm_id: 4,
+            menu: 'laboratory'
+          }
+          // {
+          //   pur_id: 7,
+          //   purview_name: '监督管理',
+          //   parent_perm_id: 4,
+          //   menu: 'superviseAdmin'
+          // },
+          // {
+          //   pur_id: 8,
+          //   purview_name: '监督记录',
+          //   parent_perm_id: 4,
+          //   menu: 'superviserec'
+          // },
+
+          // {
+          //   pur_id: 40,
+          //   purview_name: '监测日志',
+          //   parent_perm_id: 4,
+          //   menu: 'superviseLog'
+          // }
+        ]
+      },
+      {
+        pur_id: 10,
+        purview_name: '监测点管理',
+        parent_perm_id: 0,
+        menu: '',
+        children: [
+          {
+            pur_id: 11,
+            purview_name: '林木害虫监测点',
+            parent_perm_id: 10,
+            menu: '',
+            children: [
+              {
+                pur_id: 12,
+                purview_name: '智能测报灯',
+                parent_perm_id: 11,
+                menu: 'cbd'
+                // children: [
+                //   {
+                //     pur_id: 32,
+                //     purview_name: '查看图片',
+                //     parent_perm_id: 12,
+                //     menu: 'DataPhotos',
+                //     children: [
+                //       {
+                //         pur_id: 41,
+                //         purview_name: '短信预警',
+                //         parent_perm_id: 32,
+                //         menu: 'messageWarn'
+                //       }
+                //     ]
+                //   },
+                //   {
+                //     pur_id: 33,
+                //     purview_name: '设备控制',
+                //     parent_perm_id: 12,
+                //     menu: ''
+                //   },
+                //   {
+                //     pur_id: 34,
+                //     purview_name: '害虫统计',
+                //     parent_perm_id: 12,
+                //     menu: 'pestsStats'
+                //   },
+                //   {
+                //     pur_id: 35,
+                //     purview_name: '数据详情',
+                //     parent_perm_id: 12,
+                //     menu: 'DataDetails'
+                //   },
+                //   {
+                //     pur_id: 36,
+                //     purview_name: '设备设置',
+                //     parent_perm_id: 12,
+                //     menu: ''
+                //   }
+                // ]
+              },
+              {
+                pur_id: 13,
+                purview_name: '风吸式太阳诱惑虫灯',
+                parent_perm_id: 11,
+                menu: 'cbd'
+              },
+              {
+                pur_id: 14,
+                purview_name: '林木害虫诱捕器',
+                parent_perm_id: 11,
+                menu: 'cbd'
+              }
+            ]
+          },
+          {
+            pur_id: 14,
+            purview_name: '实蝇监测点',
+            parent_perm_id: 10,
+            menu: '',
+            children: [
+              {
+                pur_id: 15,
+                purview_name: '实蝇诱捕器',
+                parent_perm_id: 14,
+                menu: 'trap'
+              },
+              {
+                pur_id: 16,
+                purview_name: '实蝇监测智能诱捕器',
+                parent_perm_id: 14,
+                menu: 'fillinrecord'
+              }
+              // {
+              //   pur_id: 17,
+              //   purview_name: '诱剂维护',
+              //   parent_perm_id: 14,
+              //   menu: 'bait'
+              // }
+            ]
+          },
+          {
+            pur_id: 18,
+            purview_name: '现场监控',
+            parent_perm_id: 10,
+            menu: '',
+            children: [
+              {
+                pur_id: 37,
+                purview_name: '监控',
+                parent_perm_id: 18,
+                menu: 'surveillancevideo',
+                children: [
+                  {
+                    pur_id: 38,
+                    purview_name: '查看图片',
+                    parent_perm_id: 37,
+                    menu: 'photoView'
+                  },
+                  {
+                    pur_id: 39,
+                    purview_name: '设置',
+                    parent_perm_id: 37,
+                    menu: ''
+                  }
+                ]
+              }
+            ]
+          }
+          // {
+          //   pur_id: 19,
+          //   purview_name: '监测点维护',
+          //   parent_perm_id: 10,
+          //   menu: 'maintain'
+          // }
+        ]
+      },
+      {
+        pur_id: 20,
+        purview_name: '监督记录',
+        parent_perm_id: 0,
+        menu: '',
+        children: [
+          {
+            pur_id: 21,
+            purview_name: '监督记录',
+            parent_perm_id: 20,
+            menu: 'superviseModule'
+          }
+        ]
+      },
+      {
+        pur_id: 22,
+        purview_name: '数据报表',
+        parent_perm_id: 0,
+        menu: '',
+        children: [
+          {
+            pur_id: 23,
+            purview_name: '监测任务统计',
+            parent_perm_id: 22,
+            menu: 'supervisiontask'
+          },
+          {
+            pur_id: 24,
+            purview_name: '监督任务统计',
+            parent_perm_id: 22,
+            menu: 'monitoringtask'
+          },
+          {
+            pur_id: 50,
+            purview_name: '样本鉴定记录',
+            parent_perm_id: 22,
+            menu: 'sampleAppraisal'
+          },
+          {
+            pur_id: 51,
+            purview_name: '样地调查',
+            parent_perm_id: 22,
+            menu: 'samplePlot'
+          },
+          {
+            pur_id: 52,
+            purview_name: '诱捕器调查记录',
+            parent_perm_id: 22,
+            menu: 'trapRecord'
+          },
+          {
+            pur_id: 53,
+            purview_name: '踏查记录',
+            parent_perm_id: 22,
+            menu: 'fieldSurveys'
+          }
+        ]
+      },
+      {
+        pur_id: 45,
+        purview_name: '预警管理',
+        parent_perm_id: 0,
+        menu: '',
+        children: [
+          {
+            pur_id: 46,
+            purview_name: '预警记录',
+            parent_perm_id: 45,
+            menu: 'warningrecord'
+          },
+          {
+            pur_id: 47,
+            purview_name: '预警设置',
+            parent_perm_id: 45,
+            menu: 'warningset'
+          }
+        ]
+      },
+      {
+        pur_id: 25,
+        purview_name: '系统设置',
+        parent_perm_id: 0,
+        menu: '',
+        children: [
+          {
+            pur_id: 26,
+            purview_name: '组织管理',
+            parent_perm_id: 25,
+            menu: 'customsManger'
+          },
+          {
+            pur_id: 27,
+            purview_name: '角色管理',
+            parent_perm_id: 25,
+            menu: 'role'
+          },
+          {
+            pur_id: 28,
+            purview_name: '用户管理',
+            parent_perm_id: 25,
+            menu: 'userManger'
+          },
+          {
+            pur_id: 29,
+            purview_name: '有害生物信息维护',
+            parent_perm_id: 25,
+            menu: 'harmfulBiology'
+          },
+          {
+            pur_id: 30,
+            purview_name: '主题定制',
+            parent_perm_id: 25,
+            menu: 'motif'
+          },
+          {
+            pur_id: 31,
+            purview_name: '日志管理',
+            parent_perm_id: 25,
+            menu: 'dayRecord'
+          },
+          {
+            pur_id: 48,
+            purview_name: '设备运行维护',
+            parent_perm_id: 25,
+            menu: 'equipmentOPS'
+          },
+          {
+            pur_id: 49,
+            purview_name: '系数设置',
+            parent_perm_id: 25,
+            menu: 'coefficientset'
+          }
+        ]
+      },
+      {
+        pur_id: 42,
+        purview_name: 'APP',
+        parent_perm_id: 0,
+        menu: '',
+        children: [
+          {
+            pur_id: 43,
+            purview_name: '我的任务',
+            parent_perm_id: 42,
+            menu: ''
+          },
+          {
+            pur_id: 44,
+            purview_name: '监督',
+            parent_perm_id: 42,
+            menu: ''
+          }
+        ]
+      }
+    ],
+    user_login_time: 1680485153,
+    myuid: 4,
+    id: 81,
+    theme_info: {
+      logo_url: '/data/szmg/img/base_photo/20230207091244.jpg',
+      sys_name: '智网监测',
+      copyright_info: '智网监测'
+    },
+    im_user_id: '1642571565000320'
+  },
+  params: {
+    token: 'Tl8bGyk9EP-TuuVigNvPTTg56ld9XsCfW8QwgHvEqSs='
+  }
+};

+ 291 - 104
minggao/src/page/homepage/facilitydistribute.vue

@@ -15,9 +15,25 @@
     <div class="amap-demo" id="mapContainer2"></div>
     <div class="searchbox">
       <el-select
+        v-model="point_type"
+        placeholder="请选择"
+        size="mini"
+        clearable
+        @change="handlePointTypeChange"
+      >
+        <el-option
+          v-for="item in pointTypeOptions"
+          :key="item.id"
+          :label="item.name"
+          :value="item.id"
+        >
+        </el-option>
+      </el-select>
+      <el-select
         v-model="typevalue"
         placeholder="请选择设备类型"
         size="mini"
+        clearable
         @change="search"
       >
         <el-option
@@ -32,6 +48,8 @@
         v-model="versionsvalue2"
         placeholder="请选择隶属组织"
         size="mini"
+        clearable
+        filterable
         @change="search"
       >
         <el-option
@@ -46,6 +64,7 @@
         v-model="statevalue"
         placeholder="请选择设备状态"
         size="mini"
+        clearable
         @change="search"
       >
         <el-option
@@ -56,10 +75,13 @@
         >
         </el-option>
       </el-select>
+
       <el-select
         v-model="inoffvalue"
         placeholder="请选择所在监测点"
         size="mini"
+        clearable
+        filterable
         @change="search"
       >
         <el-option
@@ -82,13 +104,23 @@
       <el-button @click="reset" size="mini">重置</el-button>
     </div>
     <div class="tallybox">
-      <div class="tallybox_item">
-        <img src="../../../static/images/homepage/cbd.png" alt="" />
-        <p>
-          智能测报灯:<span style="color: #27c2ff">{{ cbdnum }}台</span>
-        </p>
+      <div class="tallybox_item" v-for="key in sortDeviceIndexs" :key="key">
+        <!-- <img src="../../../static/images/homepage/cbd.png" alt="" /> -->
+        <!-- <d-icon type="location"></d-icon> -->
+        <template v-if="deviceTypeDataSource[key]">
+          <i
+            class="minggao-iconfont minggao-icontuding"
+            :style="{ color: deviceTypeDataSource[key].colour }"
+          ></i>
+          <p>
+            {{ deviceTypeDataSource[key].type_name }}:<span
+              :style="{ color: deviceTypeDataSource[key].colour || '#27c2ff' }"
+              >{{ deviceTypeDataSource[key].num }}台</span
+            >
+          </p>
+        </template>
       </div>
-      <div class="tallybox_item">
+      <!-- <div class="tallybox_item">
         <img src="../../../static/images/homepage/ybq.png" alt="" />
         <p>
           实蝇诱捕器:<span style="color: #ff00ff">{{ ybqnum }}台</span>
@@ -99,77 +131,87 @@
         <p>
           监控设备:<span style="color: #e94c3e">{{ jknum }}台</span>
         </p>
-      </div>
+      </div> -->
     </div>
-    <div
-      class="tracklistbox"
-      v-loading="trackloading"
-      element-loading-text="拼命加载中"
-      element-loading-spinner="el-icon-loading"
-      element-loading-background="rgba(0, 0, 0, 0.8)"
-    >
-      <el-date-picker
-        v-model="tracktime"
-        type="date"
-        size="mini"
-        placeholder="选择日期"
-        @change="timechange"
+
+    <div class="path-box">
+      <div
+        class="tracklistbox"
+        :class="{ hide: !pathBoxVisible }"
+        v-loading="trackloading"
+        element-loading-text="拼命加载中"
+        element-loading-spinner="el-icon-loading"
+        element-loading-background="rgba(0, 0, 0, 0.8)"
       >
-      </el-date-picker>
-      <div class="tracklist">
-        <div class="tracklist_tilte" v-if="tracklistdata.length == 0">
-          暂无数据
-        </div>
-        <div
-          class="tracklist_item"
-          v-for="(item, index) in tracklistdata"
-          :key="index"
+        <el-date-picker
+          v-model="tracktime"
+          type="date"
+          size="mini"
+          placeholder="选择日期"
+          @change="timechange"
         >
-          <div class="tracklist_item_text">
-            <p
-              :style="{
-                'background-color':
-                  tracklistdata_backups[trackpage] &&
-                  tracklistdata_backups[trackpage][index] &&
-                  tracklistdata_backups[trackpage][index].color
-              }"
-            >
-              {{ item.user_name.slice(0, 1) }}
-            </p>
-            <p>{{ item.user_name }}</p>
+        </el-date-picker>
+        <div class="tracklist">
+          <div class="tracklist_tilte" v-if="tracklistdata.length == 0">
+            暂无数据
           </div>
           <div
-            :class="
-              (tracklistdata_backups[trackpage] &&
-                tracklistdata_backups[trackpage][index] &&
-                tracklistdata_backups[trackpage][index].type &&
-                'tracklist_btn tracklist_btn_none') ||
-                'tracklist_btn'
-            "
-            @click="seeteack(item, index)"
+            class="tracklist_item"
+            v-for="(item, index) in tracklistdata"
+            :key="index"
           >
-            {{
-              (tracklistdata_backups[trackpage] &&
-                tracklistdata_backups[trackpage][index] &&
-                tracklistdata_backups[trackpage][index].type &&
-                '关闭') ||
-                '查看轨迹'
-            }}
+            <div class="tracklist_item_text">
+              <p
+                :style="{
+                  'background-color':
+                    tracklistdata_backups[trackpage] &&
+                    tracklistdata_backups[trackpage][index] &&
+                    tracklistdata_backups[trackpage][index].color
+                }"
+              >
+                {{ item.user_name.slice(0, 1) }}
+              </p>
+              <p>{{ item.user_name }}</p>
+            </div>
+            <div
+              :class="
+                (tracklistdata_backups[trackpage] &&
+                  tracklistdata_backups[trackpage][index] &&
+                  tracklistdata_backups[trackpage][index].type &&
+                  'tracklist_btn tracklist_btn_none') ||
+                  'tracklist_btn'
+              "
+              @click="seeteack(item, index)"
+            >
+              {{
+                (tracklistdata_backups[trackpage] &&
+                  tracklistdata_backups[trackpage][index] &&
+                  tracklistdata_backups[trackpage][index].type &&
+                  '关闭') ||
+                  '查看轨迹'
+              }}
+            </div>
           </div>
         </div>
+        <el-pagination
+          v-if="tracklistdata.length"
+          background
+          layout="prev, pager, next"
+          :total="total"
+          :key="pagekey"
+          :page-size="5"
+          :small="true"
+          :pager-count="3"
+          @current-change="handleCurrentChange"
+        >
+        </el-pagination>
       </div>
-      <el-pagination
-        v-if="tracklistdata.length"
-        background
-        layout="prev, pager, next"
-        :total="total"
-        :key="pagekey"
-        :page-size="5"
-        :small="true"
-        :pager-count="3"
-        @current-change="handleCurrentChange"
-      >
-      </el-pagination>
+      <img
+        src="~@/assets/images/home/path.png"
+        alt=""
+        class="path-box__action"
+        @click="pathBoxVisible = !pathBoxVisible"
+      />
     </div>
     <div class="piebox">
       <p
@@ -180,7 +222,8 @@
         style="cursor: pointer"
       ></p>
       <div class="tishi" :style="{ width: width }" v-if="baseinfo.length == 0">
-        <p>请点击设备标点,查看设备详情</p>
+        <!-- <p>请点击设备标点,查看设备详情</p> -->
+        <p>暂无数据</p>
       </div>
       <div
         v-else
@@ -308,14 +351,28 @@
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 import * as echarts from 'echarts';
 import '../../../node_modules/echarts/map/js/china';
+import DIcon from '@/components/Icon';
+import { normalization } from '@/util/helpers';
+import {
+  map,
+  assign,
+  filter,
+  orderBy,
+  findIndex,
+  intersectionWith
+} from 'lodash-es';
+import { pointTypeOptions, sortDeviceTypeIDList } from '@/util/constants';
+
 export default {
   //import引入的组件需要注入到对象中才能使用
-  components: {},
+  components: { DIcon },
   data() {
     //这里存放数据
     return {
       pietf: false,
       width: '0px',
+      point_type: '', //监测点类型 1 表示 林木害虫监测点。2 表示 实蝇监测点
+      pointTypeOptions: pointTypeOptions,
       inoffvalue: '', //监测点 选择
       inoffoptions: [], //监测点列表
       versionsvalue2: '', //隶属组织 选择
@@ -350,7 +407,7 @@ export default {
       loading: false,
       device_type_id: 0,
       myVideo2: {},
-      pestboxloading: true,
+      pestboxloading: false,
       center: [114.052758, 22.545817],
       cbdnum: 0,
       jknum: 0,
@@ -391,11 +448,21 @@ export default {
       tracklistdata_backups: {},
       arealistmouse: {},
       trackloading: true,
-      isShowMonitorInfo: false
+      isShowMonitorInfo: false,
+      // 新增字段
+      deviceTypeDataSource: {},
+      pathBoxVisible: false
     };
   },
   //监听属性 类似于data概念
-  computed: {},
+  computed: {
+    sortDeviceIndexs() {
+      return intersectionWith(
+        sortDeviceTypeIDList,
+        map(this.typeoptions, 'type_id')
+      );
+    }
+  },
   //监控data中的数据变化
   watch: {
     pietf: function(val) {
@@ -462,15 +529,17 @@ export default {
       }
     },
     initmap() {
-      // console.log();
+      console.log('----------- init map');
       var map = new AMap.Map(document.getElementById('mapContainer2'), {
         center: this.center,
         resizeEnable: true,
         zoom: 12.5,
-        lang: 'en',
+        // lang: 'en',
         mapStyle: 'amap://styles/fresh',
         layers: []
       });
+
+      console.log(map, 'init map -------------------- init sdsdsa');
       //new AMap.TileLayer.Satellite(),new AMap.TileLayer.RoadNet()
       AMap.plugin(['AMap.ToolBar', 'AMap.Geocoder'], () => {
         map.addControl(new AMap.ToolBar());
@@ -487,10 +556,10 @@ export default {
       //   console.log(e);
       // });
       this.map = map;
-      this.pestboxloading = false;
+      this.getbaselist();
     },
     getbaselist() {
-      // this.pestboxloading = true
+      this.pestboxloading = true;
       this.$axios({
         method: 'POST',
         url:
@@ -503,6 +572,7 @@ export default {
           type_id: this.typevalue //                   非必传(num)                  3测报灯  4诱捕器  6监控 搜索项
         })
       }).then(res => {
+        this.pestboxloading = false;
         // this.init(res.data.data);
         console.log(res.data.data);
         var resdata = res.data.data;
@@ -510,8 +580,13 @@ export default {
         this.cbdnum = 0;
         this.jknum = 0;
         this.ybqnum = 0;
-        this.map.clearMap();
+        // this.map.clearMap();
+        this.map && this.map.clearMap();
         this.mouseTool.close(true);
+
+        //rest pestNum
+        this.resetdeviceTypeNum();
+
         if (resdata.huizhou) {
           for (var i = 0; i < resdata.huizhou.length; i++) {
             this.setmak(resdata.huizhou[i]);
@@ -536,29 +611,67 @@ export default {
         // this.map.add(marker);
       });
     },
+    resetdeviceTypeNum() {
+      for (const key in this.deviceTypeDataSource) {
+        this.deviceTypeDataSource[key].num = 0;
+      }
+    },
     setmak(data) {
+      // console.log(
+      //   data.device_type_id,
+      //   'set mark',
+      //   !this.deviceTypeDataSource[data.device_type_id],
+      //   this.deviceTypeDataSource
+      // );
+      if (
+        data.device_type_id === 6 ||
+        !this.deviceTypeDataSource[data.device_type_id]
+      ) {
+        return;
+      }
+
       var icon = '';
-      if (data.device_type_id == 3) {
-        //测报灯
-        icon = '../../../static/images/homepage/cbd.png';
-        this.cbdnum++;
-      } else if (data.device_type_id == 4) {
-        //诱捕器
-        icon = '../../../static/images/homepage/ybq.png';
-        this.ybqnum++;
-      } else if (data.device_type_id == 6) {
-        //监控
-        icon = '../../../static/images/homepage/jk.png';
-        this.jknum++;
+      if (
+        data.device_type_id &&
+        this.deviceTypeDataSource[data.device_type_id]
+      ) {
+        this.deviceTypeDataSource[data.device_type_id].num++;
+      }
 
-        if (!this.isShowMonitorInfo) {
-          this.isShowMonitorInfo = true;
-        }
+      if (data.device_type_id == 2) {
+        // 风吸式太阳诱虫灯
+        icon = require('../../assets/images/home/location-fengxi.png');
+        // this.cbdnum++;
+      } else if (data.device_type_id == 3) {
+        //智能测报灯
+        icon = require('../../assets/images/home/location-zhinengcebaodeng.png');
+        // this.ybqnum++;
+      } else if (data.device_type_id == 8) {
+        //林木害虫诱捕器
+        icon = require('../../assets/images/home/location-linmu.png');
+        // this.ybqnum++;
+      } else if (data.device_type_id == 9) {
+        //实蝇诱捕器
+        icon = require('../../assets/images/home/location-shiying.png');
+        // this.ybqnum++;
+      } else if (data.device_type_id == 10) {
+        //实蝇监测智能诱捕器
+        icon = require('../../assets/images/home/location-shiyingjiance.png');
+        // this.ybqnum++;
       }
+      // else if (data.device_type_id == 6) {
+      //   //监控
+      //   icon = '../../../static/images/homepage/jk.png';
+      //   this.jknum++;
+
+      //   if (!this.isShowMonitorInfo) {
+      //     this.isShowMonitorInfo = true;
+      //   }
+      // }
 
       var iconInstance = new AMap.Icon({
-        size: new AMap.Size(18, 23), // 图标尺寸
-        imageSize: new AMap.Size(9, 10),
+        size: new AMap.Size(20, 20), // 图标尺寸
+        imageSize: new AMap.Size(20, 20),
         image: icon // Icon的图像
       });
 
@@ -574,23 +687,31 @@ export default {
         type_id: data.device_type_id
       });
       marker.on('click', e => {
-        console.log(e.target._originOpts.title);
-        this.device_type_id = e.target._originOpts.type_id;
+        console.log(e);
+        const data = e.target._originOpts ? e.target._originOpts : e.target.De;
+        this.device_type_id = data.type_id;
         this.pietf = true;
         // if(this.device_type_id == 6){
-        this.getbaseinfo(e.target._originOpts.d_id);
+        this.getbaseinfo(data.d_id);
       });
       this.map.add(marker);
     },
     search() {
       this.getbaselist();
     },
+    handlePointTypeChange() {
+      this.typevalue = '';
+      this.gettype().then(() => {
+        this.search();
+      });
+    },
     reset() {
       this.inoffvalue = '';
       this.versionsvalue2 = '';
       this.statevalue = '';
       this.typevalue = '';
       this.idinput = '';
+      this.point_type = '';
       this.getbaselist();
     },
     // getmon() {
@@ -617,15 +738,31 @@ export default {
       });
     },
     gettype() {
-      this.$axios({
+      return this.$axios({
         method: 'POST',
         url:
-          '/api/api_gateway?method=monitor_manage.home_map.home_map_device_type'
+          '/api/api_gateway?method=monitor_manage.home_map.home_map_device_type',
+        data: this.qs.stringify({
+          point_type: this.point_type
+        })
       }).then(res => {
         // console.log(res.data.data);
-        this.typeoptions = res.data.data;
-        this.initmap();
-        this.getbaselist();
+        this.typeoptions = orderBy(
+          filter(res.data.data, item => item.type_id !== 6) || [],
+          item => {
+            return findIndex(sortDeviceTypeIDList, i => i === item.type_id);
+          }
+        );
+        // orderBy();
+
+        const deviceData = map(
+          filter(this.typeoptions, item => item.type_id !== 6),
+          item => {
+            return assign({}, item, { num: 0 });
+          }
+        );
+
+        this.deviceTypeDataSource = normalization(deviceData, 'type_id');
       });
     },
     getbaseinfo(d_id) {
@@ -641,6 +778,10 @@ export default {
         // console.log(res.data.data);
         this.loading = false;
         this.baseinfo = res.data.data;
+        if (!this.baseinfo.length) {
+          return;
+        }
+
         if (this.baseinfo[0].device_info) {
           // console.log(this.baseinfo[0].device_info.hlsHd)
           let hlsHd = this.baseinfo[0].device_info.hlsHd;
@@ -963,10 +1104,14 @@ export default {
     this.gettype();
     this.getmon2();
     this.gettracklist_data();
+    setTimeout(() => {
+      this.initmap();
+    }, 1000);
   },
   beforeUpdate() {}, //生命周期 - 更新之前
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {
+    this.map && this.map.destroy();
     if (this.myVideo2[`myPlayer`]) {
       this.myVideo2[`myPlayer`].stop();
     }
@@ -1034,10 +1179,15 @@ export default {
     left: 15px;
     background-color: rgba(255, 255, 255, 0.8);
     padding: 10px;
+    max-height: 220px;
+    overflow-y: auto;
+
     .tallybox_item {
       margin-bottom: 10px;
       display: flex;
       color: #333;
+      align-items: center;
+
       img {
         margin-right: 10px;
       }
@@ -1045,11 +1195,16 @@ export default {
   }
   .tracklistbox {
     position: absolute;
-    top: 180px;
+    top: 266px;
     left: 15px;
     background-color: rgba(255, 255, 255, 0.8);
     padding: 10px;
     width: 200px;
+
+    &.hide {
+      width: 0;
+      padding: 0;
+    }
     // height: 500px;
     .el-date-editor {
       width: 200px;
@@ -1104,6 +1259,38 @@ export default {
       }
     }
   }
+
+  .path-box {
+    display: flex;
+    position: absolute;
+    transition: width 1s ease;
+    left: 0;
+    top: 280px;
+    overflow: hidden;
+
+    &__action {
+      width: 20px;
+      height: 20px;
+      padding: 20px 10px;
+      background-color: chocolate;
+      color: #fff;
+      line-height: 50px;
+      text-align: center;
+      font-size: 25px;
+      background: chocolate;
+      cursor: pointer;
+    }
+
+    .tracklistbox {
+      position: static;
+      top: 0px;
+      left: 0px;
+      transition: all 1s ease;
+      background-color: rgba(255, 255, 255, 1);
+      overflow: hidden;
+    }
+  }
+
   .piebox {
     position: absolute;
     top: 0;

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 352 - 221
minggao/src/page/homepage/pestdistribute.vue


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 505 - 473
minggao/src/page/monitor/Monitor.vue


+ 99 - 98
minggao/src/page/monitoring/monitoringtask.vue

@@ -6,6 +6,7 @@
         v-model="uservalue"
         multiple
         filterable
+        clearable
         placeholder="请选择任务监督人"
         size="mini"
         collapse-tags
@@ -35,7 +36,7 @@
         size="mini"
         @click="download"
         :disabled="disabled"
-        >{{ disabled ? "下载中..." : "下载统计结果" }}</el-button
+        >{{ disabled ? '下载中...' : '下载统计结果' }}</el-button
       >
     </div>
     <el-card class="box-card">
@@ -50,17 +51,17 @@
 
 <script>
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
-import * as echarts from "echarts";
+import * as echarts from 'echarts';
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {},
   data() {
     //这里存放数据
     return {
-      monvalue: "", //月份
+      monvalue: '', //月份
       useroptions: [], //监测人员名单
       uservalue: [],
-      disabled: false,
+      disabled: false
     };
   },
   //监听属性 类似于data概念
@@ -72,12 +73,12 @@ export default {
     //监督人员列表
     getuserlist() {
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=control_center.task.task_user_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=control_center.task.task_user_list',
         data: this.qs.stringify({
-          user_type: "supervisor",
-        }),
-      }).then((res) => {
+          user_type: 'supervisor'
+        })
+      }).then(res => {
         // console.log(res.data.data);
         this.useroptions = res.data.data;
       });
@@ -85,19 +86,19 @@ export default {
     //任务列表 data_report.report.task_report
     gettasklist(start_time, end_time) {
       //   console.log(JSON.stringify(this.uservalue));
-      var operator_user_id_list = "";
+      var operator_user_id_list = '';
       if (this.uservalue.length != 0) {
         operator_user_id_list = JSON.stringify(this.uservalue);
       }
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=data_report.report.supervisor_report",
+        method: 'POST',
+        url: '/api/api_gateway?method=data_report.report.supervisor_report',
         data: this.qs.stringify({
-          operator_user_id_list, // 非必填  任务处理人id数组  ['1', '2']
+          supervisor_user_id_list: operator_user_id_list, // 非必填  任务处理人id数组  ['1', '2']
           start_time, //月份
-          end_time, //结束
-        }),
-      }).then((res) => {
+          end_time //结束
+        })
+      }).then(res => {
         console.log(res.data.data);
         // this.useroptions = res.data.data;
         var tasklist = res.data.data;
@@ -113,104 +114,104 @@ export default {
     init(userlist, offtask) {
       let categoryData = userlist;
       let chartdata = offtask;
-      let backgroundColor = "rgba(255,255,255,1)";
+      let backgroundColor = 'rgba(255,255,255,1)';
       let itemcolor = {
-        type: "linear",
+        type: 'linear',
         colorStops: [
           {
             offset: 0,
-            color: "rgba(6, 120, 157,1)",
+            color: 'rgba(6, 120, 157,1)'
           },
           {
             offset: 0.5,
-            color: "rgba(6, 120, 157,0.2)",
+            color: 'rgba(6, 120, 157,0.2)'
           },
           {
             offset: 1,
-            color: "rgba(6, 120, 157,1)",
-          },
-        ],
+            color: 'rgba(6, 120, 157,1)'
+          }
+        ]
       };
 
       var option = {
         textStyle: {
-          color: "#c0c3cd",
-          fontSize: 14,
+          color: '#c0c3cd',
+          fontSize: 14
         },
         toolbox: {
           show: false,
           feature: {
             saveAsImage: {
-              backgroundColor: "#031245",
+              backgroundColor: '#031245'
             },
-            restore: {},
+            restore: {}
           },
           iconStyle: {
-            borderColor: "#c0c3cd",
-          },
+            borderColor: '#c0c3cd'
+          }
         },
         legend: {
           top: 10,
           itemWidth: 8,
           itemHeight: 8,
-          icon: "circle",
-          left: "center",
+          icon: 'circle',
+          left: 'center',
           padding: 0,
           textStyle: {
-            color: "#c0c3cd",
+            color: '#c0c3cd',
             fontSize: 14,
-            padding: [2, 0, 0, 0],
-          },
+            padding: [2, 0, 0, 0]
+          }
         },
-        color: ["#00D7E9", "rgba(0, 215, 233, 0.9)"],
+        color: ['#00D7E9', 'rgba(0, 215, 233, 0.9)'],
         grid: {
           containLabel: true,
           left: 40,
           right: 20,
           bottom: 40,
-          top: 40,
+          top: 40
         },
         xAxis: {
           axisLine: {
             lineStyle: {
-              color: "#999",
+              color: '#999'
             },
-            show: true,
+            show: true
           },
           axisLabel: {
-            color: "#333",
+            color: '#333',
             fontSize: 14,
             interval: 0,
-            rotate:-50
+            rotate: -50
           },
 
           data: categoryData,
-          type: "category",
+          type: 'category'
         },
         yAxis: {
           nameTextStyle: {
-            color: "#c0c3cd",
+            color: '#c0c3cd',
             padding: [0, 0, -10, 0],
-            fontSize: 14,
+            fontSize: 14
           },
           axisLabel: {
-            color: "#333",
-            fontSize: 14,
+            color: '#333',
+            fontSize: 14
           },
           axisTick: {
             lineStyle: {
-              color: "#668092",
-              width: 1,
+              color: '#668092',
+              width: 1
             },
-            show: true,
+            show: true
           },
-          name: "",
+          name: ''
         },
         series: [
           {
             data: chartdata,
-            type: "bar",
-            barMaxWidth: "auto",
+            type: 'bar',
+            barMaxWidth: 'auto',
             barWidth: 20,
             itemStyle: {
               color: {
@@ -218,52 +219,52 @@ export default {
                 y: 1,
                 x2: 0,
                 y2: 0,
-                type: "linear",
+                type: 'linear',
                 colorStops: [
                   {
                     offset: 0,
-                    color: "#00D7E9",
+                    color: '#00D7E9'
                   },
                   {
                     offset: 1,
-                    color: "rgba(0, 167, 233,0.3)",
-                  },
-                ],
-              },
+                    color: 'rgba(0, 167, 233,0.3)'
+                  }
+                ]
+              }
             },
             label: {
               show: true,
-              position: "top",
+              position: 'top',
               distance: 10,
-              color: "#00D7E9",
-            },
+              color: '#00D7E9'
+            }
           },
           {
-            data: [1, 1, 1, 1, 1, 1],
-            type: "pictorialBar",
-            barMaxWidth: "20",
-            symbol: "diamond",
-            symbolOffset: [0, "50%"],
-            symbolSize: [20, 10],
+            data: (userlist || []).map(i => 1),
+            type: 'pictorialBar',
+            barMaxWidth: '20',
+            symbol: 'diamond',
+            symbolOffset: [0, '50%'],
+            symbolSize: [20, 10]
           },
           {
             data: chartdata,
-            type: "pictorialBar",
-            barMaxWidth: "20",
+            type: 'pictorialBar',
+            barMaxWidth: '20',
 
-            symbolPosition: "end",
-            symbol: "diamond",
-            symbolOffset: [0, "-50%"],
+            symbolPosition: 'end',
+            symbol: 'diamond',
+            symbolOffset: [0, '-50%'],
             symbolSize: [20, 12],
-            zlevel: 2,
-          },
+            zlevel: 2
+          }
         ],
         tooltip: {
           show: true,
-          formatter: "{b}:{c0}",
-        },
+          formatter: '{b}:{c0}'
+        }
       };
-      echarts.init(document.getElementById("mychartpie")).setOption(option);
+      echarts.init(document.getElementById('mychartpie')).setOption(option);
     },
     pickerchange() {
       this.searchchilk();
@@ -275,14 +276,14 @@ export default {
       this.gettasklist(start_time, end_time);
     },
     timetag(i) {
-      var time = "";
+      var time = '';
       if (this.monvalue) {
         if (this.monvalue.length != 0) {
           time =
             this.monvalue[i].getFullYear() +
-            "-" +
+            '-' +
             (this.monvalue[i].getMonth() + 1 < 10
-              ? "0" + (this.monvalue[i].getMonth() + 1)
+              ? '0' + (this.monvalue[i].getMonth() + 1)
               : this.monvalue[i].getMonth() + 1);
         }
       }
@@ -290,36 +291,36 @@ export default {
       return time;
     },
     download(start_time, end_time) {
-      //   var operator_user_id_list = "";
-      //   if (this.uservalue.length != 0) {
-      //     operator_user_id_list = JSON.stringify(this.uservalue);
-      //   }
+      var operator_user_id_list = '';
+      if (this.uservalue.length != 0) {
+        operator_user_id_list = JSON.stringify(this.uservalue);
+      }
       this.disabled = true;
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=data_report.report.supervisor_export",
-        // data: this.qs.stringify({
-        //   operator_user_id_list, // 非必填  任务处理人id数组  ['1', '2']
-        //   start_time, //月份
-        //   end_time, //结束
-        // }),
-        responseType: "blob",
-      }).then((res) => {
+        method: 'POST',
+        url: '/api/api_gateway?method=data_report.report.supervisor_export',
+        data: this.qs.stringify({
+          supervisor_user_id_list: operator_user_id_list, // 非必填  任务处理人id数组  ['1', '2']
+          start_time, //月份
+          end_time //结束
+        }),
+        responseType: 'blob'
+      }).then(res => {
         console.log(res.data.data);
-        this.downloadFile(res, "监督任务统计.xls");
+        this.downloadFile(res, '监督任务统计.xls');
       });
     },
     downloadFile(res, name) {
-      let link = document.createElement("a");
+      let link = document.createElement('a');
       link.href = window.URL.createObjectURL(new Blob([res.data]));
-      link.target = "_blank";
+      link.target = '_blank';
       //文件名和格式
       link.download = name;
       document.body.appendChild(link);
       link.click();
       document.body.removeChild(link);
       this.disabled = false;
-    },
+    }
   },
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -334,7 +335,7 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style lang="less" scoped>
@@ -385,4 +386,4 @@ export default {
     cursor: pointer;
   }
 }
-</style>
+</style>

+ 111 - 95
minggao/src/page/monitoring/supervisiontask.vue

@@ -6,6 +6,7 @@
         v-model="uservalue"
         multiple
         filterable
+        clearable
         placeholder="请选择任务监测人"
         size="mini"
         collapse-tags
@@ -35,7 +36,7 @@
         size="mini"
         @click="download"
         :disabled="disabled"
-        >{{ disabled ? "下载中..." : "下载统计结果" }}</el-button
+        >{{ disabled ? '下载中...' : '下载统计结果' }}</el-button
       >
     </div>
     <el-card class="box-card">
@@ -50,17 +51,17 @@
 
 <script>
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
-import * as echarts from "echarts";
+import * as echarts from 'echarts';
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {},
   data() {
     //这里存放数据
     return {
-      monvalue: "", //月份
+      monvalue: '', //月份
       useroptions: [], //监测人员名单
       uservalue: [],
-      disabled: false,
+      disabled: false
     };
   },
   //监听属性 类似于data概念
@@ -72,12 +73,12 @@ export default {
     //监督人员列表
     getuserlist() {
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=control_center.task.task_user_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=control_center.task.task_user_list',
         data: this.qs.stringify({
-          user_type: "operator",
-        }),
-      }).then((res) => {
+          user_type: 'operator'
+        })
+      }).then(res => {
         // console.log(res.data.data);
         this.useroptions = res.data.data;
       });
@@ -85,19 +86,19 @@ export default {
     //任务列表 data_report.report.task_report
     gettasklist(start_time, end_time) {
       //   console.log(JSON.stringify(this.uservalue));
-      var operator_user_id_list = "";
+      var operator_user_id_list = '';
       if (this.uservalue.length != 0) {
         operator_user_id_list = JSON.stringify(this.uservalue);
       }
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=data_report.report.task_report",
+        method: 'POST',
+        url: '/api/api_gateway?method=data_report.report.task_report',
         data: this.qs.stringify({
           operator_user_id_list, // 非必填  任务处理人id数组  ['1', '2']
           start_time, //月份
-          end_time, //结束
-        }),
-      }).then((res) => {
+          end_time //结束
+        })
+      }).then(res => {
         console.log(res.data.data);
         // this.useroptions = res.data.data;
         var tasklist = res.data.data;
@@ -130,53 +131,53 @@ export default {
         tooltip: {},
         legend: {
           show: true,
-          top: "8%",
-          selectedMode: false, //取消图例上的点击事件
+          top: '8%',
+          selectedMode: false //取消图例上的点击事件
         },
         grid: {
-          left: "3%",
-          right: "3%",
-          bottom: "5%",
-          top: "20%",
-          containLabel: true,
+          left: '3%',
+          right: '3%',
+          bottom: '5%',
+          top: '20%',
+          containLabel: true
         },
         xAxis: {
-          type: "category",
+          type: 'category',
           data: userlist,
           axisLine: {
             lineStyle: {
-              color: "#999",
+              color: '#999'
             },
-            show: true,
+            show: true
           },
           axisLabel: {
-            color: "#333",
+            color: '#333',
             fontSize: 14,
             interval: 0,
-            rotate:-50
+            rotate: -50
           },
           nameTextStyle: {
-            color: "#ff0",
+            color: '#ff0',
             padding: [0, 0, -10, 0],
-            fontSize: 14,
-          },
+            fontSize: 14
+          }
         },
         yAxis: {
-          type: "value",
+          type: 'value',
           axisLine: {
             lineStyle: {
-              color: "#333",
-              width: 1,
+              color: '#333',
+              width: 1
               // "type": "dashed"
             },
-            show: true,
-          },
+            show: true
+          }
         },
         series: [
           {
-            name: "已完成任务数量",
-            type: "bar",
-            stack: "account",
+            name: '已完成任务数量',
+            type: 'bar',
+            stack: 'account',
             barWidth: 26,
             itemStyle: {
               color: {
@@ -184,98 +185,113 @@ export default {
                 y: 0,
                 x2: 0,
                 y2: 1,
-                type: "linear",
+                type: 'linear',
                 global: false,
                 colorStops: [
                   {
                     offset: 0,
-                    color: "rgb(164,215,251,0.3)",
+                    color: 'rgb(164,215,251,0.3)'
                   },
                   {
                     offset: 1,
-                    color: "#369ef6",
-                  },
-                ],
-              },
+                    color: '#369ef6'
+                  }
+                ]
+              }
             },
-            data: offtask,
+            data: offtask
           },
           {
-            name: "未完成任务数量",
-            type: "bar",
-            stack: "account",
+            name: '未完成任务数量',
+            type: 'bar',
+            stack: 'account',
             barWidth: 26,
             itemStyle: {
               color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-                { offset: 0, color: "rgb(251,220,155,0.3)" },
-                { offset: 1, color: "#ed9163" },
-              ]),
+                { offset: 0, color: 'rgb(251,220,155,0.3)' },
+                { offset: 1, color: '#ed9163' }
+              ])
             },
-            data: nonetask,
+            data: nonetask
           },
           {
-            name: "逾期完成任务数量",
-            type: "bar",
-            stack: "account",
+            name: '逾期完成任务数量',
+            type: 'bar',
+            stack: 'account',
             barWidth: 26,
             itemStyle: {
               color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
-                { offset: 0, color: "rgb(254,173,161,0.3)" },
-                { offset: 1, color: "#fd7371" },
-              ]),
+                { offset: 0, color: 'rgb(254,173,161,0.3)' },
+                { offset: 1, color: '#fd7371' }
+              ])
             },
-            data: overdueoff,
+            data: overdueoff
           },
           {
             z: 3,
-            type: "pictorialBar",
-            symbolPosition: "end",
+            type: 'pictorialBar',
+            symbolPosition: 'end',
             data: offtask,
-            symbol: "diamond",
-            symbolOffset: [0, "-50%"],
+            symbol: 'diamond',
+            symbolOffset: [0, '-50%'],
             symbolSize: [26, 10],
             symbolRotate: 0,
             itemStyle: {
               normal: {
                 borderWidth: 0,
-                color: "#369ef6",
-              },
+                color: '#369ef6'
+              }
             },
+            tooltip: {
+              formatter(params, ticker) {
+                return '';
+              }
+            }
           },
           {
             z: 3,
-            type: "pictorialBar",
-            symbolPosition: "end",
+            type: 'pictorialBar',
+            symbolPosition: 'end',
             data: sumlist2,
-            symbol: "diamond",
-            symbolOffset: [0, "-50%"],
+            symbol: 'diamond',
+            symbolOffset: [0, '-50%'],
             symbolSize: [26, 10],
             symbolRotate: 0,
             itemStyle: {
               normal: {
                 borderWidth: 0,
-                color: "#e76422",
-              },
+                color: '#e76422'
+              }
             },
+            tooltip: {
+              formatter(params, ticker) {
+                return '';
+              }
+            }
           },
           {
             z: 3,
-            type: "pictorialBar",
-            symbolPosition: "end",
+            type: 'pictorialBar',
+            symbolPosition: 'end',
             data: sumlist,
-            symbol: "diamond",
-            symbolOffset: [0, "-50%"],
+            symbol: 'diamond',
+            symbolOffset: [0, '-50%'],
             symbolSize: [26, 10],
             itemStyle: {
               normal: {
                 borderWidth: 0,
-                color: "#fd7371",
-              },
+                color: '#fd7371'
+              }
             },
-          },
-        ],
+            tooltip: {
+              formatter(params, ticker) {
+                return '';
+              }
+            }
+          }
+        ]
       };
-      echarts.init(document.getElementById("mychartpie")).setOption(option);
+      echarts.init(document.getElementById('mychartpie')).setOption(option);
     },
     pickerchange() {
       this.searchchilk();
@@ -287,50 +303,50 @@ export default {
       this.gettasklist(start_time, end_time);
     },
     timetag(i) {
-      var time = "";
+      var time = '';
       if (this.monvalue) {
         if (this.monvalue.length != 0) {
           time =
             this.monvalue[i].getFullYear() +
-            "-" +
+            '-' +
             (this.monvalue[i].getMonth() + 1 < 10
-              ? "0" + (this.monvalue[i].getMonth() + 1)
+              ? '0' + (this.monvalue[i].getMonth() + 1)
               : this.monvalue[i].getMonth() + 1);
         }
       }
       return time;
     },
     download(start_time, end_time) {
-      var operator_user_id_list = "";
+      var operator_user_id_list = '';
       if (this.uservalue.length != 0) {
         operator_user_id_list = JSON.stringify(this.uservalue);
       }
       this.disabled = true;
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=data_report.report.task_export",
+        method: 'POST',
+        url: '/api/api_gateway?method=data_report.report.task_export',
         data: this.qs.stringify({
           operator_user_id_list, // 非必填  任务处理人id数组  ['1', '2']
           start_time, //月份
-          end_time, //结束
+          end_time //结束
         }),
-        responseType: "blob",
-      }).then((res) => {
+        responseType: 'blob'
+      }).then(res => {
         console.log(res.data.data);
-        this.downloadFile(res, "监测任务统计.xls");
+        this.downloadFile(res, '监测任务统计.xls');
       });
     },
     downloadFile(res, name) {
-      let link = document.createElement("a");
+      let link = document.createElement('a');
       link.href = window.URL.createObjectURL(new Blob([res.data]));
-      link.target = "_blank";
+      link.target = '_blank';
       //文件名和格式
       link.download = name;
       document.body.appendChild(link);
       link.click();
       document.body.removeChild(link);
       this.disabled = false;
-    },
+    }
   },
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -345,7 +361,7 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style lang="less" scoped>
@@ -396,4 +412,4 @@ export default {
     cursor: pointer;
   }
 }
-</style>
+</style>

+ 90 - 90
minggao/src/page/systemmanger/harmfulBiology.vue

@@ -118,7 +118,7 @@
                   text-overflow: ellipsis;
                 "
               >
-                {{ scope.row.describe || "无" }}
+                {{ scope.row.describe || '无' }}
               </p>
             </el-popover>
           </template>
@@ -129,7 +129,7 @@
           label="备注"
         >
           <template slot-scope="scope">
-            <span>{{ scope.row.messages || "无" }}</span>
+            <span>{{ scope.row.messages || '无' }}</span>
           </template>
         </el-table-column>
         <el-table-column prop="create_time" label="添加时间"> </el-table-column>
@@ -233,7 +233,7 @@
             size="small"
             type="primary"
             @click="submitForm"
-            >{{ submitBtn == true ? "发布中..." : "发布" }}</el-button
+            >{{ submitBtn == true ? '发布中...' : '发布' }}</el-button
           >
           <el-button size="small" @click="cancel">取消</el-button>
         </el-form-item>
@@ -250,61 +250,61 @@ export default {
     //这里存放数据
     return {
       fullHeight: document.documentElement.clientHeight - 116, //
-      input: "", // 搜索
+      input: '', // 搜索
       page: 1, //当前页码
       pageSum: 0, // 总数量
 
       // 列表
       tableData: [
         {
-          ind: "1",
-          name: "冥蛾引诱剂",
-          judge: "是",
-          judge2: "是",
-          remark: "这是一个有害虫类",
-          addDate: "2016-05-02 10:00:00",
-          endDate: "2021-01-06 10:00:00",
-        },
+          ind: '1',
+          name: '冥蛾引诱剂',
+          judge: '是',
+          judge2: '是',
+          remark: '这是一个有害虫类',
+          addDate: '2016-05-02 10:00:00',
+          endDate: '2021-01-06 10:00:00'
+        }
       ],
       loading: false, // 加载
 
       // 编辑、 添加
-      tltData: "添加有害生物",
+      tltData: '添加有害生物',
       addrInsectVisible: false,
       form: {
-        name: "", //有害生物名称
-        judge: "", // 检疫性有害生物
-        judge2: "", //是否外来入侵物种
-        remark: "", // 备注
-        level: "1",
-        describe: "",
+        name: '', //有害生物名称
+        judge: '', // 检疫性有害生物
+        judge2: '', //是否外来入侵物种
+        remark: '', // 备注
+        level: '1',
+        describe: ''
       },
       rules: {
         name: [
-          { required: true, message: "请输入有害生物名称", trigger: "blur" },
+          { required: true, message: '请输入有害生物名称', trigger: 'blur' }
           //   { min: 3, max: 5, message: "长度在 1 到 15 个字符", trigger: "blur" },
         ],
         judge: [
-          { required: true, message: "请选检疫性有害生物", trigger: "blur" },
+          { required: true, message: '请选择检疫性有害生物', trigger: 'blur' }
           //   { min: 3, max: 5, message: "长度在 1 到 15 个字符", trigger: "blur" },
         ],
         judge2: [
           {
             required: true,
-            message: "请选择是否外来入侵物种",
-            trigger: "blur",
-          },
+            message: '请选择是否外来入侵物种',
+            trigger: 'blur'
+          }
         ],
         level: [
-          { required: true, message: "请选择有害生物等级", trigger: "change" },
+          { required: true, message: '请选择有害生物等级', trigger: 'change' }
         ],
         describe: [
-          { required: true, message: "请填写活动形式", trigger: "blur" },
-        ],
+          { required: true, message: '请填写有害生物描述', trigger: 'blur' }
+        ]
       },
       insectObj: {},
       isClick: true, // 防止重复弹框
-      submitBtn: false, // 防止弹框确定按钮重复请求
+      submitBtn: false // 防止弹框确定按钮重复请求
     };
   },
   //监听属性 类似于data概念
@@ -317,7 +317,7 @@ export default {
         this.fullHeight = val;
         this.timer = true;
         let that = this;
-        setTimeout(function () {
+        setTimeout(function() {
           //防止过度调用监测事件,导致卡顿
           that.timer = false;
         }, 400);
@@ -326,16 +326,16 @@ export default {
 
     addrInsectVisible(val) {
       if (val == false) {
-        console.log("gsjdgsjdgjsgdjsgdghj");
-        this.form.name = ""; // 有害生物名称
-        this.form.judge = ""; // 检疫性有害生物
-        this.form.judge2 = ""; // 是否外来入侵物种
-        this.form.remark = ""; // 备注
-        this.form.level = "";
-        this.form.describe = "";
+
+        this.form.name = ''; // 有害生物名称
+        this.form.judge = ''; // 检疫性有害生物
+        this.form.judge2 = ''; // 是否外来入侵物种
+        this.form.remark = ''; // 备注
+        this.form.level = '';
+        this.form.describe = '';
         // this.$refs["form"].resetFields();
       }
-    },
+    }
   },
   //方法集合
   methods: {
@@ -358,22 +358,22 @@ export default {
 
     // 添加有害生物
     addrHarmfulBiology() {
-      this.tltData = "添加有害生物";
+      this.tltData = '添加有害生物';
       this.addrInsectVisible = true;
     },
 
     // 获取有害生物列表
     harmfulBiologyList() {
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=sysmenage.maintain.pest_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=sysmenage.maintain.pest_list',
         data: this.qs.stringify({
           page: this.page,
-          page_item: "20",
-          pest_name: this.input,
-        }),
+          page_item: '20',
+          pest_name: this.input
+        })
       })
-        .then((res) => {
+        .then(res => {
           if (res.data.data.total_item !== 0) {
             var data = res.data.data;
             this.pageSum = data.total_item;
@@ -391,7 +391,7 @@ export default {
           });
           this.loading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.loading = false;
         });
     },
@@ -406,49 +406,49 @@ export default {
 
     // 编辑
     actionFunc(data) {
-      this.tltData = "编辑有害生物";
+      this.tltData = '编辑有害生物';
       this.insectObj = data;
       this.form = {
         name: data.pest_name, //有害生物名称
         judge: data.quarantine, // 检疫性有害生物
         judge2: data.alien_specie, //是否外来入侵物种
         remark: data.messages, // 备注
-        level: data.level == "" ? "1" : data.level,
-        describe: data.describe,
+        level: data.level == '' ? '1' : data.level,
+        describe: data.describe
       };
       this.addrInsectVisible = true;
     },
 
     // 删除
     deleteFunc(data) {
-      this.$confirm("此操作将永久删除, 是否继续?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
+      this.$confirm('此操作将永久删除, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       })
         .then(() => {
           this.$axios({
-            method: "POST",
-            url: "/api/api_gateway?method=sysmenage.maintain.pest_delete",
+            method: 'POST',
+            url: '/api/api_gateway?method=sysmenage.maintain.pest_delete',
             data: this.qs.stringify({
-              pest_id: data.pest_id,
-            }),
-          }).then((res) => {
+              pest_id: data.pest_id
+            })
+          }).then(res => {
             console.log(res.data.data);
             if (res.data.data == true) {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
-                  type: "success",
-                  message: "成功",
-                  duration: 1500,
+                  type: 'success',
+                  message: '成功',
+                  duration: 1500
                 });
               }
             } else {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
-                  type: "error",
-                  message: "失败",
-                  duration: 1500,
+                  type: 'error',
+                  message: '失败',
+                  duration: 1500
                 });
               }
             }
@@ -456,10 +456,10 @@ export default {
           });
         })
         .catch(() => {
-          if (document.getElementsByClassName("el-message").length == 0) {
+          if (document.getElementsByClassName('el-message').length == 0) {
             this.$message({
-              type: "info",
-              message: "已取消删除",
+              type: 'info',
+              message: '已取消删除'
             });
           }
         });
@@ -467,21 +467,21 @@ export default {
 
     // 添加 - 编辑 确定
     submitForm() {
-      this.$refs["form"].validate((valid) => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           this.submitBtn = true;
-          if (this.tltData == "添加有害生物") {
-            var url = "/api/api_gateway?method=sysmenage.maintain.pest_add";
+          if (this.tltData == '添加有害生物') {
+            var url = '/api/api_gateway?method=sysmenage.maintain.pest_add';
             var postData = this.qs.stringify({
               pest_name: this.form.name,
               alien_specie: this.form.judge2,
               quarantine: this.form.judge,
               messages: this.form.remark,
               level: this.form.level,
-              describe: this.form.describe,
+              describe: this.form.describe
             });
-          } else if (this.tltData == "编辑有害生物") {
-            var url = "/api/api_gateway?method=sysmenage.maintain.pest_modify";
+          } else if (this.tltData == '编辑有害生物') {
+            var url = '/api/api_gateway?method=sysmenage.maintain.pest_modify';
             var postData = this.qs.stringify({
               pest_id: this.insectObj.pest_id,
               pest_name: this.form.name,
@@ -489,31 +489,31 @@ export default {
               quarantine: this.form.judge,
               messages: this.form.remark,
               level: this.form.level,
-              describe: this.form.describe,
+              describe: this.form.describe
             });
           }
           this.$axios({
-            method: "POST",
+            method: 'POST',
             url,
-            data: postData,
+            data: postData
           })
-            .then((res) => {
-              if (res.data.message == "") {
-                if (document.getElementsByClassName("el-message").length == 0) {
+            .then(res => {
+              if (res.data.message == '') {
+                if (document.getElementsByClassName('el-message').length == 0) {
                   this.$message({
-                    type: "success",
-                    message: "成功",
-                    duration: 1500,
+                    type: 'success',
+                    message: '成功',
+                    duration: 1500
                   });
                 }
               }
 
-              this.$refs["form"].resetFields();
+              this.$refs['form'].resetFields();
               this.addrInsectVisible = false;
               this.harmfulBiologyList();
               this.submitBtn = false;
             })
-            .catch((err) => {
+            .catch(err => {
               this.submitBtn = false;
             });
         } else {
@@ -522,9 +522,9 @@ export default {
       });
     },
     cancel() {
-      this.$refs["form"].resetFields();
+      this.$refs['form'].resetFields();
       this.addrInsectVisible = false;
-    },
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
@@ -539,7 +539,7 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style lang="less" scoped>
@@ -578,8 +578,8 @@ export default {
 
 // 文本域样式更改
 /deep/.el-textarea__inner {
-  font-family: "Helvetica Neue", Helvetica, "PingFang SC", "Hiragino Sans GB",
-    "Microsoft YaHei", "微软雅黑", Arial, sans-serif;
+  font-family: 'Helvetica Neue', Helvetica, 'PingFang SC', 'Hiragino Sans GB',
+    'Microsoft YaHei', '微软雅黑', Arial, sans-serif;
 }
 
 /deep/.el-button--info {

+ 221 - 169
minggao/src/page/systemmanger/userManger.vue

@@ -64,20 +64,26 @@
                 <span>{{ (page - 1) * 20 + scope.row.ind }}</span>
               </template>
             </el-table-column>
-            <el-table-column prop="real_name" label="姓名" width="190">
+            <el-table-column prop="real_name" label="姓名" min-width="120">
             </el-table-column>
-            <el-table-column prop="username" label="账号名称" width="200">
+            <el-table-column prop="username" label="账号名称" min-width="120">
             </el-table-column>
-            <el-table-column prop="mobile" label="手机号" width="120">
+            <el-table-column
+              prop="mobile"
+              label="手机号"
+              align="center"
+              min-width="120"
+            >
               <template slot-scope="scope">
-                <span>{{ scope.row.mobile || "无" }}</span>
+                <span>{{ scope.row.mobile || '无' }}</span>
               </template>
             </el-table-column>
             <el-table-column
               :show-overflow-tooltip="true"
               prop="org_list"
               label="隶属组织"
-              width="280"
+              min-width="160"
+              align="center"
             >
               <template slot-scope="scope">
                 <span v-if="scope.row.org_list.length == 1">{{
@@ -95,7 +101,7 @@
                   <span @mouseover="orglisthover(scope.row)" slot="reference"
                     >{{
                       scope.row.org_list.length == 0
-                        ? "暂无组织"
+                        ? '暂无组织'
                         : scope.row.org_list[0].org_name
                     }}...</span
                   >
@@ -106,7 +112,8 @@
               :show-overflow-tooltip="true"
               prop="role_list"
               label="用户角色"
-              width="280"
+              min-width="100"
+              align="center"
             >
               <template slot-scope="scope">
                 <span v-if="scope.row.role_list.length == 1">{{
@@ -124,14 +131,29 @@
                   <span @mouseover="orglisthover2(scope.row)" slot="reference"
                     >{{
                       scope.row.role_list.length == 0
-                        ? "暂无组织"
+                        ? '暂无组织'
                         : scope.row.role_list[0].role_list
                     }}...</span
                   >
                 </el-popover>
               </template>
             </el-table-column>
-            <el-table-column prop="state" label="状态" width="120">
+            <el-table-column
+              prop="is_check"
+              label="是否实验室人员"
+              width="120"
+              align="center"
+            >
+              <template slot-scope="scope">
+                {{ !scope.row.is_check ? '否' : '是' }}
+              </template>
+            </el-table-column>
+            <el-table-column
+              prop="state"
+              label="状态"
+              width="120"
+              align="center"
+            >
               <template slot-scope="scope">
                 <span v-if="scope.row.state == '正常'">
                   <span
@@ -179,7 +201,7 @@
                   "
                   href="javascript:;"
                   @click="outUse(scope.row)"
-                  >{{ scope.row.state == "已停用" ? "启用" : "停用" }}</a
+                  >{{ scope.row.state == '已停用' ? '启用' : '停用' }}</a
                 >
                 <i class="line"></i>
                 <a
@@ -227,6 +249,7 @@
           <el-input
             style="width: 80%"
             size="mini"
+            :disabled="tltData !== '添加用户'"
             v-model.trim="form.user"
           ></el-input>
         </el-form-item>
@@ -264,7 +287,7 @@
               label: 'org_name',
               value: 'id',
               children: 'childrens',
-              checkStrictly: true,
+              checkStrictly: true
             }"
             :clearable="true"
             placeholder="请选择隶属组织"
@@ -284,7 +307,7 @@
               label: 'role_name',
               multiple: true,
               emitPath: false,
-              checkStrictly: true,
+              checkStrictly: true
             }"
             :clearable="true"
             placeholder="请选择角色"
@@ -322,6 +345,12 @@
             <el-option label="停用" value="4"></el-option>
           </el-select>
         </el-form-item>
+        <el-form-item label="是否实验室人员: " prop="is_check">
+          <el-radio-group v-model="form.is_check">
+            <el-radio :label="0">否</el-radio>
+            <el-radio :label="1">是</el-radio>
+          </el-radio-group>
+        </el-form-item>
 
         <el-form-item>
           <el-button
@@ -329,7 +358,7 @@
             size="small"
             type="primary"
             @click="submitForm"
-            >{{ submitBtn == true ? "发布中..." : "发布" }}</el-button
+            >{{ submitBtn == true ? '发布中...' : '发布' }}</el-button
           >
           <el-button size="small" @click="resetForm">取消</el-button>
         </el-form-item>
@@ -339,34 +368,36 @@
 </template>
 
 <script>
+import { flatMapDeepDataList } from '@/util/helpers';
+
 export default {
   //import引入的组件需要注入到对象中才能使用
   components: {},
   data() {
     //input验证 - 密码框 - 禁止输入汉字
     const checkPath = (rule, value, callback) => {
-      var reg = new RegExp("[\\u4E00-\\u9FFF]+", "g");
-      if (value == "") {
-        callback(new Error("请输入密码"));
+      var reg = new RegExp('[\\u4E00-\\u9FFF]+', 'g');
+      if (value == '') {
+        callback(new Error('请输入密码'));
       }
 
       if (reg.test(value)) {
-        callback(new Error("密码不能包含汉字!"));
+        callback(new Error('密码不能包含汉字!'));
       }
 
-      if (value.indexOf("#") !== -1 || value.indexOf("@") !== -1) {
+      if (value.indexOf('#') !== -1 || value.indexOf('@') !== -1) {
         callback();
       } else {
-        callback(new Error("密码必须包含*#@_字符之一"));
+        callback(new Error('密码必须包含*#@_字符之一'));
       }
     };
     // input验证 - 验证手机号
     var checkphone = (rule, value, callback) => {
-      if (value == "") {
-        callback(new Error("请输入手机号"));
+      if (value == '') {
+        callback(new Error('请输入手机号'));
       } else if (!this.isCellPhone(value)) {
         //引入methods中封装的检查手机格式的方法
-        callback(new Error("请输入正确的手机号!"));
+        callback(new Error('请输入正确的手机号!'));
       } else {
         callback();
       }
@@ -380,13 +411,13 @@ export default {
       // 树形图
       data: [],
       defaultProps: {
-        children: "childrens",
-        label: "org_name",
+        children: 'childrens',
+        label: 'org_name'
       },
 
       // 搜索
-      nameVal: "",
-      phoneVal: "",
+      nameVal: '',
+      phoneVal: '',
 
       // 表格
       tableData: [],
@@ -396,60 +427,62 @@ export default {
       pageSum: 0, // 总数量
 
       // 弹框
-      tltData: "添加用户",
+      tltData: '添加用户',
       userVisible: false,
       form: {
-        user: "", //账号
-        password: "", // 密码
-        name: "", // 姓名
+        user: '', //账号
+        password: '', // 密码
+        name: '', // 姓名
         judge: [], // 隶属组织
         role: [], //角色
-        phone: "", // 手机号码
-        mailbox: "", //邮箱
-        state: "", // 账号状态
+        phone: '', // 手机号码
+        mailbox: '', //邮箱
+        state: '', // 账号状态
+        is_check: 0 // 是否实验室人员
       },
       rules: {
         user: [
-          { required: true, message: "请输入账号", trigger: "blur" },
+          { required: true, message: '请输入账号', trigger: 'blur' },
           {
             min: 3,
             max: 20,
-            message: "账号长度在 3 到 20 位之间",
-            trigger: "blur",
-          },
+            message: '账号长度在 3 到 20 位之间',
+            trigger: 'blur'
+          }
         ],
         password: [
-          { required: true, validator: checkPath, trigger: "blur" },
+          { required: true, validator: checkPath, trigger: 'blur' }
           // { validator: checkPath, trigger: "blur" }
         ],
         name: [
-          { required: true, message: "请输入姓名", trigger: "blur" },
+          { required: true, message: '请输入姓名', trigger: 'blur' }
           //   { min: 3, max: 5, message: "长度在 1 到 15 个字符", trigger: "blur" },
         ],
         judge: [
-          { required: true, message: "隶属组织,可多选", trigger: "change" },
+          { required: true, message: '隶属组织,可多选', trigger: 'change' }
           //   { min: 3, max: 5, message: "长度在 1 到 15 个字符", trigger: "blur" },
         ],
         role: [
           {
             required: true,
-            message: "请选择角色,可多选",
-            trigger: "change",
-          },
+            message: '请选择角色,可多选',
+            trigger: 'change'
+          }
           //   { min: 3, max: 5, message: "长度在 1 到 30 个字符", trigger: "blur" },
         ],
-        phone: [{ required: true, validator: checkphone, trigger: "blur" }],
+        phone: [{ required: true, validator: checkphone, trigger: 'blur' }]
       },
       roleData: [], // 角色下拉框
       refreshItem: 0, //清除角色、组织值
       tissueList: [], // 组织下拉框
       editorObj: {}, //点击编辑选中当前的行数据
-      org_id: "", //组织id
+      org_id: '', //组织id
 
       isClick: true, // 防止重复弹框
       submitBtn: false, // 防止弹框确定按钮重复请求
-      content: "",
-      content2: "",
+      content: '',
+      content2: '',
+      flattenOrgList: []
     };
   },
   //监听属性 类似于data概念
@@ -462,7 +495,7 @@ export default {
         this.fullHeight = val;
         this.timer = true;
         let that = this;
-        setTimeout(function () {
+        setTimeout(function() {
           //防止过度调用监测事件,导致卡顿
           that.timer = false;
         }, 400);
@@ -473,12 +506,14 @@ export default {
       if (val == false) {
         // this.$refs["form"].resetFields();
         for (var key in this.form) {
-          this.form[key] = "";
+          this.form[key] = '';
           // console.log(key)
         }
+
+        this.form.is_check = 0;
         this.refreshItem++;
       }
-    },
+    }
   },
   //方法集合
   methods: {
@@ -511,18 +546,22 @@ export default {
 
     // 编辑
     actionFunc(e) {
-      this.tltData = "编辑用户";
+      this.tltData = '编辑用户';
+      if (this.$refs['form']) {
+        this.$refs['form'].resetFields();
+      }
       this.editorObj = e;
       this.form.judge = [];
       var roleList = []; // 角色
       var list = this.form.judge; // 组织
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.get_parent_org_list",
+        method: 'POST',
+        url:
+          '/api/api_gateway?method=sysmenage.usermanager.get_parent_org_list',
         data: this.qs.stringify({
-          user_id: e.user_id,
-        }),
-      }).then((res) => {
+          user_id: e.user_id
+        })
+      }).then(res => {
         var orgdatas = res.data.data;
         if (orgdatas.length != 0) {
           for (var i = 0; i < e.org_list.length; i++) {
@@ -544,48 +583,51 @@ export default {
         roleList.push(a);
       }
 
+      console.log(list, '--------------------------- sddsdsafsafsafsa ');
+
       setTimeout(() => {
         this.form = {
           user: e.username,
-          password: "",
+          password: '',
           name: e.real_name,
           role: roleList,
           judge: list,
           phone: e.mobile,
           mailbox: e.email,
           state: e.state,
+          is_check: e.is_check || 0
         };
         this.userVisible = true;
       }, 1000);
     },
     // 停用
     outUse(data) {
-      if (data.state == "已停用") {
-        var msg = "启用";
-      } else if (data.state == "正常") {
-        var msg = "停用";
+      if (data.state == '已停用') {
+        var msg = '启用';
+      } else if (data.state == '正常') {
+        var msg = '停用';
       }
-      this.$confirm("此操作将" + msg + "该账号, 是否继续?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
-        closeOnClickModal: false,
+      this.$confirm('此操作将' + msg + '该账号, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning',
+        closeOnClickModal: false
       })
         .then(() => {
           this.$axios({
-            method: "POST",
-            url: "/api/api_gateway?method=sysmenage.usermanager.user_disable",
+            method: 'POST',
+            url: '/api/api_gateway?method=sysmenage.usermanager.user_disable',
             data: this.qs.stringify({
               user_id: data.user_id,
-              state: msg == "启用" ? 1 : 4,
-            }),
-          }).then((res) => {
+              state: msg == '启用' ? 1 : 4
+            })
+          }).then(res => {
             if (res.data.data == true) {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
-                  type: "success",
-                  message: "成功",
-                  duration: 1500,
+                  type: 'success',
+                  message: '成功',
+                  duration: 1500
                 });
               }
               this.userListData();
@@ -593,10 +635,10 @@ export default {
           });
         })
         .catch(() => {
-          if (document.getElementsByClassName("el-message").length == 0) {
+          if (document.getElementsByClassName('el-message').length == 0) {
             this.$message({
-              type: "info",
-              message: "已取消",
+              type: 'info',
+              message: '已取消'
             });
           }
         });
@@ -604,41 +646,42 @@ export default {
 
     // 重置密码
     resetPwd(data) {
-      this.$prompt("请输入新密码", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      this.$prompt('请输入新密码', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
         // inputPlaceholder: "默认密码为@12345678",
-        inputErrorMessage: "新密码格式不正确",
+        inputErrorMessage: '新密码格式不正确',
         closeOnClickModal: false,
-        inputValidator: (val) => {
+        inputValidator: val => {
           if (val) {
-            if (escape(val).indexOf("%u") != -1) {
-              return "不能输入汉字!";
-            } else if (val.split(" ").join("").length == 0) {
-              return "不能输入空格!";
-            } else if (val.indexOf("#") == -1 && val.indexOf("@") == -1) {
-              return "密码中必须包含#或者@字符";
+            if (escape(val).indexOf('%u') != -1) {
+              return '不能输入汉字!';
+            } else if (val.split(' ').join('').length == 0) {
+              return '不能输入空格!';
+            } else if (val.indexOf('#') == -1 && val.indexOf('@') == -1) {
+              return '密码中必须包含#或者@字符';
             }
           } else {
-            return "请输入密码!";
+            return '请输入密码!';
           }
-        },
+        }
       })
         .then(({ value }) => {
           this.$axios({
-            method: "POST",
-            url: "/api/api_gateway?method=sysmenage.usermanager.password_modify",
+            method: 'POST',
+            url:
+              '/api/api_gateway?method=sysmenage.usermanager.password_modify',
             data: this.qs.stringify({
               user_id: data.user_id,
-              password: value == null ? "@12345678" : value,
-            }),
-          }).then((res) => {
+              password: value == null ? '@12345678' : value
+            })
+          }).then(res => {
             if (res.data.data == true) {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
-                  message: "成功!",
-                  type: "success",
-                  duration: 1500,
+                  message: '成功!',
+                  type: 'success',
+                  duration: 1500
                 });
               }
             }
@@ -646,10 +689,10 @@ export default {
           });
         })
         .catch(() => {
-          if (document.getElementsByClassName("el-message").length == 0) {
+          if (document.getElementsByClassName('el-message').length == 0) {
             this.$message({
-              type: "info",
-              message: "取消输入",
+              type: 'info',
+              message: '取消输入'
             });
           }
         });
@@ -657,33 +700,33 @@ export default {
 
     // 删除
     deleteFunc(data) {
-      this.$confirm("此操作将永久删除该账号, 是否继续?", "提示", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
-        type: "warning",
+      this.$confirm('此操作将永久删除该账号, 是否继续?', '提示', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消',
+        type: 'warning'
       })
         .then(() => {
           this.$axios({
-            method: "POST",
-            url: "/api/api_gateway?method=sysmenage.usermanager.user_delete",
+            method: 'POST',
+            url: '/api/api_gateway?method=sysmenage.usermanager.user_delete',
             data: this.qs.stringify({
-              user_id: data.user_id,
-            }),
-          }).then((res) => {
+              user_id: data.user_id
+            })
+          }).then(res => {
             if (res.data.data == true) {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
-                  message: "成功!",
-                  type: "success",
-                  duration: 1500,
+                  message: '成功!',
+                  type: 'success',
+                  duration: 1500
                 });
               }
             } else {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
-                  message: "失败!",
-                  type: "error",
-                  duration: 1500,
+                  message: '失败!',
+                  type: 'error',
+                  duration: 1500
                 });
               }
             }
@@ -692,10 +735,10 @@ export default {
           });
         })
         .catch(() => {
-          if (document.getElementsByClassName("el-message").length == 0) {
+          if (document.getElementsByClassName('el-message').length == 0) {
             this.$message({
-              type: "info",
-              message: "已取消删除",
+              type: 'info',
+              message: '已取消删除'
             });
           }
         });
@@ -717,14 +760,14 @@ export default {
 
     // 添加用户
     addrRole() {
-      this.tltData = "添加用户";
+      this.tltData = '添加用户';
       this.userVisible = true;
     },
 
     // 添加 - 编辑 确定
     submitForm() {
       var that = this;
-      this.$refs["form"].validate((valid) => {
+      this.$refs['form'].validate(valid => {
         if (valid) {
           this.submitBtn = true;
           // 处理隶属组织、角色
@@ -734,7 +777,7 @@ export default {
             orgList.push(this.form.judge[i][this.form.judge[i].length - 1]);
           }
           for (var j = 0; j < this.form.role.length; j++) {
-            if (typeof this.form.role[j] == "number") {
+            if (typeof this.form.role[j] == 'number') {
               roleList.push(this.form.role[j]);
             } else {
               for (var x = 0; x < this.form.role[j].length; x++) {
@@ -742,7 +785,10 @@ export default {
               }
             }
           }
-          if (this.tltData == "添加用户") {
+
+          let url = '';
+
+          if (this.tltData == '添加用户') {
             var postData = this.qs.stringify({
               username: this.form.user, // 登录账号 必
               real_name: this.form.name, // 用户名 必
@@ -752,9 +798,10 @@ export default {
               state: this.form.state, //用户状态
               mobile: this.form.phone, // 手机号
               email: this.form.mailbox, //邮箱地址
+              is_check: this.form.is_check
             });
-            var url = "/api/api_gateway?method=sysmenage.usermanager.user_add";
-          } else if (this.tltData == "编辑用户") {
+            url = '/api/api_gateway?method=sysmenage.usermanager.user_add';
+          } else if (this.tltData == '编辑用户') {
             var postData = this.qs.stringify({
               user_id: this.editorObj.user_id, // 用户id 必
               real_name: this.form.name, // 用户名 必
@@ -762,32 +809,32 @@ export default {
               role_id_list: JSON.stringify(roleList), //角色id数组 必
               mobile: this.form.phone, //手机号
               email: this.form.mailbox, //邮箱地址
+              is_check: this.form.is_check
             });
-            var url =
-              "/api/api_gateway?method=sysmenage.usermanager.user_modify";
+            url = '/api/api_gateway?method=sysmenage.usermanager.user_modify';
           }
 
           this.$axios({
-            method: "POST",
+            method: 'POST',
             url,
-            data: postData,
+            data: postData
           })
-            .then((res) => {
+            .then(res => {
               if (res.data.data == true) {
-                if (document.getElementsByClassName("el-message").length == 0) {
+                if (document.getElementsByClassName('el-message').length == 0) {
                   this.$message({
-                    message: "成功!",
-                    type: "success",
-                    duration: 1500,
+                    message: '成功!',
+                    type: 'success',
+                    duration: 1500
                   });
                 }
-                this.$refs["form"].resetFields();
+                this.$refs['form'].resetFields();
                 this.userVisible = false;
                 this.userListData();
               }
               this.submitBtn = false;
             })
-            .catch((err) => {
+            .catch(err => {
               this.submitBtn = false;
             });
         } else {
@@ -798,7 +845,9 @@ export default {
 
     // 取消
     resetForm() {
-      this.$refs["form"].resetFields();
+      if (this.$refs['form']) {
+        this.$refs['form'].resetFields();
+      }
       this.refreshItem++;
       this.userVisible = false;
     },
@@ -806,17 +855,17 @@ export default {
     // 获取用户列表
     userListData() {
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.user_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=sysmenage.usermanager.user_list',
         data: this.qs.stringify({
           page: this.page,
-          page_item: "20",
+          page_item: '20',
           real_name: this.nameVal, // 用户名称
           mobile: this.phoneVal, //电话
-          org_id: this.org_id,
-        }),
+          org_id: this.org_id
+        })
       })
-        .then((res) => {
+        .then(res => {
           if (res.data.data.page_item !== 0) {
             var data = res.data.data.page_list;
             var list = [];
@@ -832,7 +881,7 @@ export default {
           });
           this.loading2 = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.loading2 = false;
         });
     },
@@ -840,28 +889,30 @@ export default {
     // 获取左侧组织列表
     organizationData() {
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.org_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=sysmenage.usermanager.org_list',
         data: this.qs.stringify({
           page: this.page,
-          page_item: "100000000",
-          org_name: "",
-        }),
+          page_item: '100000000',
+          org_name: ''
+        })
       })
-        .then((res) => {
+        .then(res => {
+          console.log(res, '-0------ user manager');
           if (res.data.data.page_list.length !== 0) {
-            var obj = {
-              org_name: "全部",
-              id: "",
-            };
+            // var obj = {
+            //   org_name: '全部',
+            //   id: ''
+            // };
             var list = res.data.data.page_list;
             this.tissueList = list; // 弹框组织列表
             var data = res.data.data.page_list;
-            this.data = [obj, ...data]; // 左侧组织列表
+            this.data = [...data]; // 左侧组织列表
+            this.flattenOrgList = flatMapDeepDataList(list, 'childrens');
           }
           this.loading = false;
         })
-        .catch((err) => {
+        .catch(err => {
           this.loading = false;
         });
     },
@@ -869,22 +920,23 @@ export default {
     // 获取角色列表
     roleAxios() {
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.role_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=sysmenage.usermanager.role_list',
         data: this.qs.stringify({
           page: this.page,
-          page_item: "10000000",
-          role_name: "",
-        }),
+          page_item: '10000000',
+          role_name: ''
+        })
       })
-        .then((res) => {
+        .then(res => {
           if (res.data.data.total_item !== 0) {
             this.roleData = res.data.data.page_list;
           }
         })
-        .catch((err) => {});
+        .catch(err => {});
     },
     judgeData(item) {
+      console.log(item, '----------------');
       this.form.judge = item;
     },
     roleChange(item) {
@@ -905,7 +957,7 @@ export default {
         str += `<p>` + e.role_list[i].role_list + `</p>`;
       }
       this.content2 = str;
-    },
+    }
   },
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {},
@@ -923,7 +975,7 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style lang="less" scoped>

+ 0 - 1
minggao/src/page/warning/warningrecord.vue

@@ -280,7 +280,6 @@ export default {
           center: center,
           resizeEnable: true,
           zoom: 10,
-          lang: 'en',
           mapStyle: 'amap://styles/fresh'
         });
         var marker = new AMap.Marker();

+ 157 - 57
minggao/src/page/warning/warningset.vue

@@ -1,9 +1,98 @@
 <!--  -->
 <template>
   <div class="setwainbox">
+    <div class="mb-20">
+      <el-alert title="数值为0时不触发" type="warning" :closable="false">
+      </el-alert>
+    </div>
     <div class="setinfo">
       <div class="setinfo_off">
         <p class="setinfo_off_index">1</p>
+        <p class="setinfo_off_title">总量预警</p>
+        <el-switch
+          v-model="warninfo.pest_total_status"
+          active-color="#409eff"
+          inactive-color="#ff4949"
+        >
+        </el-switch>
+      </div>
+      <div class="setinfo_text">
+        <el-input
+          v-model="warninfo.level_1"
+          placeholder="请输入内容"
+          size="mini"
+          oninput="value=value.replace(/[^\d]+/g,'')"
+        ></el-input>
+        <p class="setinfo_text_describe">
+          每天害虫
+          <span style="color: #1b76ff">总量预警</span>
+          达到此值时,触发<span style="color: #67C23A">一级绿色</span>预警
+        </p>
+      </div>
+      <div class="setinfo_text">
+        <el-input
+          v-model="warninfo.level_2"
+          placeholder="请输入内容"
+          size="mini"
+          oninput="value=value.replace(/[^\d]+/g,'')"
+        ></el-input>
+        <p class="setinfo_text_describe">
+          每天害虫
+          <span style="color: #1b76ff">总量预警</span>达到此值时,触发<span
+            style="color: #409EFF"
+            >二级蓝色</span
+          >预警
+        </p>
+      </div>
+      <div class="setinfo_text">
+        <el-input
+          v-model="warninfo.level_3"
+          placeholder="请输入内容"
+          size="mini"
+          oninput="value=value.replace(/[^\d]+/g,'')"
+        ></el-input>
+        <p class="setinfo_text_describe">
+          每天害虫
+          <span style="color: #1b76ff">总量预警</span>达到此值时,触发<span
+            style="color: #E6A23C"
+            >三级黄色</span
+          >预警
+        </p>
+      </div>
+      <div class="setinfo_text">
+        <el-input
+          v-model="warninfo.level_4"
+          placeholder="请输入内容"
+          size="mini"
+          oninput="value=value.replace(/[^\d]+/g,'')"
+        ></el-input>
+        <p class="setinfo_text_describe">
+          每天害虫
+          <span style="color: #1b76ff">总量预警</span>达到此值时,触发<span
+            style="color: orange"
+            >四级橙色</span
+          >预警
+        </p>
+      </div>
+      <div class="setinfo_text">
+        <el-input
+          v-model="warninfo.level_5"
+          placeholder="请输入内容"
+          size="mini"
+          oninput="value=value.replace(/[^\d]+/g,'')"
+        ></el-input>
+        <p class="setinfo_text_describe">
+          每天害虫
+          <span style="color: #1b76ff">总量预警</span>达到此值时,触发<span
+            style="color: #F56C6C"
+            >五级红色</span
+          >预警
+        </p>
+      </div>
+    </div>
+    <div class="setinfo">
+      <div class="setinfo_off">
+        <p class="setinfo_off_index">2</p>
         <p class="setinfo_off_title">目标种类预警</p>
         <el-switch
           v-model="warninfo.species_status"
@@ -27,7 +116,7 @@
     </div>
     <div class="setinfo">
       <div class="setinfo_off">
-        <p class="setinfo_off_index">2</p>
+        <p class="setinfo_off_index">3</p>
         <p class="setinfo_off_title">数量预警</p>
         <el-switch
           v-model="warninfo.pest_name_status"
@@ -85,30 +174,7 @@
         </div>
       </div>
     </div>
-    <div class="setinfo">
-      <div class="setinfo_off">
-        <p class="setinfo_off_index">3</p>
-        <p class="setinfo_off_title">总量预警</p>
-        <el-switch
-          v-model="warninfo.pest_total_status"
-          active-color="#409eff"
-          inactive-color="#ff4949"
-        >
-        </el-switch>
-      </div>
-      <div class="setinfo_text">
-        <el-input
-          v-model="warninfo.pest_total_num"
-          placeholder="请输入内容"
-          size="mini"
-          oninput="value=value.replace(/[^\d]+/g,'')"
-        ></el-input>
-        <p class="setinfo_text_describe">
-          每天害虫
-          <span style="color: #1b76ff">总量预警</span>达到此值时,触发预警
-        </p>
-      </div>
-    </div>
+
     <div class="setinfo">
       <div class="setinfo_off">
         <p class="setinfo_off_index">4</p>
@@ -149,6 +215,7 @@
 
 <script>
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+import { uniq, filter, map } from 'lodash-es';
 
 export default {
   //import引入的组件需要注入到对象中才能使用
@@ -160,7 +227,7 @@ export default {
       wormlist: [],
       options: [],
       useroptions: [],
-      value1: [391, 390],
+      value1: [391, 390]
     };
   },
   //监听属性 类似于data概念
@@ -178,14 +245,14 @@ export default {
       if (tf) {
         var obj = {
           pest_name: '',
-          pest_num: '',
+          pest_num: ''
         };
         this.wormlist.push(obj);
       } else {
         this.$message({
           showClose: true,
           message: '请将信息填写完整后增加',
-          type: 'warning',
+          type: 'warning'
         });
       }
     },
@@ -199,23 +266,23 @@ export default {
         url: '/api/api_gateway?method=sysmenage.usermanager.user_list',
         data: this.qs.stringify({
           page: '1',
-          page_item: '99999999',
-        }),
+          page_item: '99999999'
+        })
       })
-        .then((res) => {
+        .then(res => {
           // console.log(res.data.data.page_list);
           var page_list = res.data.data.page_list;
           for (var i = 0; i < page_list.length; i++) {
             var obj = {
               value: page_list[i].user_id,
-              label: page_list[i].real_name,
+              label: page_list[i].real_name
             };
             this.useroptions.push(obj);
           }
           // real_name
           // useroptions
         })
-        .catch((err) => {
+        .catch(err => {
           console.log(err);
         });
     },
@@ -226,22 +293,22 @@ export default {
         url: '/api/api_gateway?method=sysmenage.maintain.pest_list',
         data: this.qs.stringify({
           page: '1',
-          page_item: '99999999',
-        }),
+          page_item: '99999999'
+        })
       })
-        .then((res) => {
+        .then(res => {
           // console.log(res.data.data.page_list);
           this.options = [];
           var data = res.data.data.page_list;
           for (var i = 0; i < data.length; i++) {
             var obj = {
               value: data[i].pest_name,
-              label: data[i].pest_name,
+              label: data[i].pest_name
             };
             this.options.push(obj);
           }
         })
-        .catch((err) => {
+        .catch(err => {
           console.log(err);
         });
     },
@@ -250,9 +317,9 @@ export default {
       this.$axios({
         method: 'POST',
         url: '/api/api_gateway?method=alert_manage.alert.get_alert_config',
-        data: this.qs.stringify({}),
+        data: this.qs.stringify({})
       })
-        .then((res) => {
+        .then(res => {
           console.log(res.data.data);
           this.warninfo = JSON.parse(JSON.stringify(res.data.data));
 
@@ -272,8 +339,8 @@ export default {
             this.wormlist = [
               {
                 pest_name: '',
-                pest_num: '',
-              },
+                pest_num: ''
+              }
             ];
           }
           if (this.warninfo.user_uids == '') {
@@ -286,7 +353,7 @@ export default {
           }
           console.log(this.warninfo);
         })
-        .catch((err) => {
+        .catch(err => {
           console.log(err);
         });
     },
@@ -314,31 +381,36 @@ export default {
             pest_total_status: infoobj.pest_total_status, //       是       害虫总数预警状态
             alien_species_status: infoobj.alien_species_status, //    是       外来入侵物种预警状态
             user_uids: infoobj.user_uids.join(','),
-          }),
+            level_1: infoobj.level_1 || 0,
+            level_2: infoobj.level_2 || 0,
+            level_3: infoobj.level_3 || 0,
+            level_4: infoobj.level_4 || 0,
+            level_5: infoobj.level_5 || 0
+          })
         })
-          .then((res) => {
+          .then(res => {
             console.log(res);
             if (res.data.message == '') {
               this.$message({
                 message: '预警设置成功',
-                type: 'success',
+                type: 'success'
               });
               this.getwarninfo();
             } else {
               this.$message({
                 message: res.data.message,
-                type: 'error',
+                type: 'error'
               });
             }
           })
-          .catch((err) => {
+          .catch(err => {
             console.log(err);
           });
       } else {
         this.$message({
           message: this.yanzheng(),
           type: 'warning',
-          duration: 1500,
+          duration: 1500
         });
       }
     },
@@ -348,6 +420,21 @@ export default {
         return item.pest_name != '' && item.pest_num != '';
       });
       console.log(tf);
+      const totalData = [
+        this.warninfo.level_1,
+        this.warninfo.level_2,
+        this.warninfo.level_3,
+        this.warninfo.level_4,
+        this.warninfo.level_5
+      ];
+
+      const filterData = filter(
+        map(totalData, num => num + ''),
+        item => !!item
+      );
+
+      const hasSameNum = uniq(filterData).length !== filterData.length;
+
       if (
         this.warninfo.alien_species_status == false &&
         this.warninfo.pest_name_status == false &&
@@ -355,6 +442,8 @@ export default {
         this.warninfo.species_status == false
       ) {
         return '请至少开启一项预警信息';
+      } else if (this.warninfo.pest_total_status && hasSameNum) {
+        return '总量预警信息值不能相同';
       } else if (
         this.warninfo.species_status &&
         this.warninfo.species_num == ''
@@ -362,17 +451,12 @@ export default {
         return '请将目标种类预警信息填写完整';
       } else if (this.warninfo.pest_name_status && tf == false) {
         return '请将数量预警信息填写完整';
-      } else if (
-        this.warninfo.pest_total_status &&
-        this.warninfo.pest_total_num == ''
-      ) {
-        return '请将总量预警信息填写完整';
       } else if (this.warninfo.user_uids.length == 0) {
         return '请选择预警接收人';
       } else {
         return '';
       }
-    },
+    }
   },
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -388,10 +472,14 @@ export default {
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 </script>
 <style scoped lang="less">
+.mb-20 {
+  margin-bottom: 20px;
+}
+
 .setwainbox {
   width: 100%;
   //   height: 100%;
@@ -421,6 +509,18 @@ export default {
         margin-top: 3px;
       }
     }
+
+    .setinfo_item {
+      width: 100px;
+      margin: 0 20px;
+
+      &.fixed-width {
+        /deep/ .el-input {
+          width: 100%;
+        }
+      }
+    }
+
     .setinfo_text {
       margin-top: 20px;
       display: flex;
@@ -469,4 +569,4 @@ export default {
     border-color: #409eff;
   }
 }
-</style>
+</style>

+ 37 - 1
minggao/src/router/index.js

@@ -63,8 +63,13 @@ import photoView from '@/page/monitor/PhotoView';
 //*********************诱捕器系统********************
 import maintain from '@/page/forecasting/maintain/maintain'; //监测点维护
 import trap from '@/page/forecasting/trap/trap'; //诱捕器
+import forestTrap from '@/page/forecasting/trap/forestTrap'; //林木害虫诱捕器
+import trypetidTrap from '@/page/forecasting/trap/trypetidTrap'; //实蝇诱捕器
+import trypetidMonitoringTrap from '@/page/forecasting/trap/trypetidMonitoringTrap'; //实蝇监测智能诱捕器
 import fillinrecord from '@/page/forecasting/trap/fillinrecord'; //填报记录
 import bait from '@/page/forecasting/trap/bait'; //诱剂维护
+import monthKillingLamp from '@/page/forecasting/monthKillingLamp/index';
+import monthKillingLampDetail from '@/page/forecasting/monthKillingLamp/scdDetail';
 //*********************任务报表********************
 import monitoringtask from '@/page/monitoring/monitoringtask'; //监测任务统计
 import supervisiontask from '@/page/monitoring/supervisiontask'; //监督任务统计
@@ -316,8 +321,23 @@ export default new Router({
           component: trap
         },
         {
+          path: 'forest-trap',
+          component: forestTrap
+        },
+        {
+          path: 'trypetid-trap',
+          component: trypetidTrap
+        },
+        {
+          path: 'trypetid-monitoring-trap',
+          component: trypetidMonitoringTrap
+        },
+        {
           path: 'fillinrecord',
-          component: fillinrecord
+          component: fillinrecord,
+          meta: {
+            title: '填报记录'
+          }
         },
         {
           path: 'bait',
@@ -365,6 +385,22 @@ export default new Router({
         {
           path: 'fieldSurveys',
           component: fieldSurveysRecordForm
+        },
+        // 需求修改 诱捕器相关
+        // 风吸式太阳诱虫灯
+        {
+          path: 'moth-killing-lamp',
+          component: monthKillingLamp,
+          meta: {
+            title: '风吸式太阳诱虫灯'
+          }
+        },
+        {
+          path: 'scdDetail/:e_id/:d_id/:address/:device_name',
+          component: monthKillingLampDetail,
+          meta: {
+            title: '风吸式太阳诱虫灯-详情'
+          }
         }
       ]
     }

+ 13 - 0
minggao/src/util/constants.js

@@ -37,3 +37,16 @@ export const BLOB_TYPE = {
   xlsx: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
   zip: 'application/zip'
 };
+
+export const pointTypeOptions = [
+  {
+    id: '1',
+    name: '林木害虫监测点'
+  },
+  {
+    id: '2',
+    name: '实蝇监测点'
+  }
+];
+
+export const sortDeviceTypeIDList = [3, 2, 8, 9, 10];

+ 21 - 0
minggao/src/util/helpers.js

@@ -0,0 +1,21 @@
+import { zipObject, map, each, omit } from 'lodash-es';
+
+export function normalization(arr, key = 'id') {
+  return zipObject(map(arr, key), arr);
+}
+
+export function flatMapDeepDataList(arr, key = 'children') {
+  let initDataList = [];
+
+  each(arr, item => {
+    if (item[key] && item[key].length) {
+      const children = item[key];
+      initDataList.push(omit(item, [key]));
+      initDataList.push(...flatMapDeepDataList(children, key));
+    } else {
+      initDataList.push(item);
+    }
+  });
+
+  return initDataList;
+}

+ 5 - 0
minggao/yarn.lock

@@ -2175,6 +2175,11 @@ d@1, d@^1.0.1:
     es5-ext "^0.10.50"
     type "^1.0.1"
 
+dayjs@^1.11.7:
+  version "1.11.7"
+  resolved "https://registry.npmmirror.com/dayjs/-/dayjs-1.11.7.tgz#4b296922642f70999544d1144a2c25730fce63e2"
+  integrity sha512-+Yw9U6YO5TQohxLcIkrXBeY73WP3ejHWVvx8XCk3gxvQDCTEmS48ZrSZCKciI7Bhl/uCMyxYtE9UqRILmFphkQ==
+
 de-indent@^1.0.2:
   version "1.0.2"
   resolved "https://registry.npmmirror.com/de-indent/-/de-indent-1.0.2.tgz#b2038e846dc33baa5796128d0804b455b8c1e21d"