zhangyun il y a 3 ans
Parent
commit
16a3c024a7
97 fichiers modifiés avec 4916 ajouts et 1601 suppressions
  1. 1 0
      pingpu_vue/index.html
  2. 11 3
      pingpu_vue/src/assets/fonts/iconfont.css
  3. 1 1
      pingpu_vue/src/assets/fonts/iconfont.js
  4. 14 0
      pingpu_vue/src/assets/fonts/iconfont.json
  5. BIN
      pingpu_vue/src/assets/fonts/iconfont.ttf
  6. BIN
      pingpu_vue/src/assets/fonts/iconfont.woff
  7. BIN
      pingpu_vue/src/assets/fonts/iconfont.woff2
  8. BIN
      pingpu_vue/src/assets/images/forecasting/monitor/addequip.png
  9. BIN
      pingpu_vue/src/assets/images/forecasting/monitor/direction-btn.png
  10. BIN
      pingpu_vue/src/assets/images/forecasting/monitor/zoom-btn.png
  11. BIN
      pingpu_vue/src/assets/images/home/home03/background/背景.png
  12. 3 5
      pingpu_vue/src/components/DateSearch/index.vue
  13. 3 3
      pingpu_vue/src/components/editor/Editor.vue
  14. 56 4
      pingpu_vue/src/main.js
  15. 45 24
      pingpu_vue/src/page/base/baselist.vue
  16. 131 84
      pingpu_vue/src/page/base/maofacility.vue
  17. 23 14
      pingpu_vue/src/page/base/maphandle.vue
  18. 79 19
      pingpu_vue/src/page/base/mapplot.vue
  19. 361 28
      pingpu_vue/src/page/base/plotlist.vue
  20. 218 15
      pingpu_vue/src/page/bzy/BzyPhotos.vue
  21. 3 2
      pingpu_vue/src/page/bzy/DataDetail.vue
  22. 17 13
      pingpu_vue/src/page/bzy/bzy.vue
  23. 25 16
      pingpu_vue/src/page/cbd/Cbd.vue
  24. 3 13
      pingpu_vue/src/page/cbd/DataDetails.vue
  25. 3 0
      pingpu_vue/src/page/cbd/MessageWarn.vue
  26. 6 5
      pingpu_vue/src/page/cbd/analyse.vue
  27. 10 10
      pingpu_vue/src/page/cbd/cbdCanvas.vue
  28. 227 191
      pingpu_vue/src/page/cbd/cbdDataPhotos.vue
  29. 7 3
      pingpu_vue/src/page/crop/crop.vue
  30. 42 24
      pingpu_vue/src/page/crop/cropadd.vue
  31. 27 15
      pingpu_vue/src/page/crop/evildata.vue
  32. 362 0
      pingpu_vue/src/page/fault/faultinfo.vue
  33. 1097 0
      pingpu_vue/src/page/gis/gisshow.vue
  34. 256 957
      pingpu_vue/src/page/home/Home.vue
  35. 123 77
      pingpu_vue/src/page/index/index.vue
  36. 162 0
      pingpu_vue/src/page/login/login.vue
  37. 4 4
      pingpu_vue/src/page/monitor/Monitor.vue
  38. 5 9
      pingpu_vue/src/page/monitor/PhotoView.vue
  39. 1 0
      pingpu_vue/src/page/qxz/Data24.vue
  40. 5 3
      pingpu_vue/src/page/qxz/HistoryData.vue
  41. 30 17
      pingpu_vue/src/page/qxz/envi.vue
  42. 52 0
      pingpu_vue/src/page/specialist/specialist.vue
  43. 2 0
      pingpu_vue/src/page/sqz/Data24.vue
  44. 24 11
      pingpu_vue/src/page/sqz/HistoryData.vue
  45. 216 22
      pingpu_vue/src/page/sqz/sqz.vue
  46. 573 0
      pingpu_vue/src/page/user/userlist.vue
  47. 631 0
      pingpu_vue/src/page/worn/earlywarning.vue
  48. 53 6
      pingpu_vue/src/router/index.js
  49. 4 3
      pingpu_vue/src/util/http.js
  50. BIN
      pingpu_vue/static/images/gisshow/2a.png
  51. BIN
      pingpu_vue/static/images/gisshow/3.gif
  52. BIN
      pingpu_vue/static/images/gisshow/3.png
  53. BIN
      pingpu_vue/static/images/gisshow/3a.png
  54. BIN
      pingpu_vue/static/images/gisshow/3off.gif
  55. BIN
      pingpu_vue/static/images/gisshow/3off.png
  56. BIN
      pingpu_vue/static/images/gisshow/4a.png
  57. BIN
      pingpu_vue/static/images/gisshow/5.gif
  58. BIN
      pingpu_vue/static/images/gisshow/5.png
  59. BIN
      pingpu_vue/static/images/gisshow/5a.png
  60. BIN
      pingpu_vue/static/images/gisshow/5off.gif
  61. BIN
      pingpu_vue/static/images/gisshow/5off.png
  62. BIN
      pingpu_vue/static/images/gisshow/6.gif
  63. BIN
      pingpu_vue/static/images/gisshow/6.png
  64. BIN
      pingpu_vue/static/images/gisshow/6a.png
  65. BIN
      pingpu_vue/static/images/gisshow/6off.gif
  66. BIN
      pingpu_vue/static/images/gisshow/6off.png
  67. BIN
      pingpu_vue/static/images/gisshow/7.gif
  68. BIN
      pingpu_vue/static/images/gisshow/7.png
  69. BIN
      pingpu_vue/static/images/gisshow/7a.png
  70. BIN
      pingpu_vue/static/images/gisshow/7off.gif
  71. BIN
      pingpu_vue/static/images/gisshow/7off.png
  72. BIN
      pingpu_vue/static/images/gisshow/8.gif
  73. BIN
      pingpu_vue/static/images/gisshow/8.png
  74. BIN
      pingpu_vue/static/images/gisshow/8off.gif
  75. BIN
      pingpu_vue/static/images/gisshow/8off.png
  76. BIN
      pingpu_vue/static/images/gisshow/all.png
  77. BIN
      pingpu_vue/static/images/gisshow/yujing.gif
  78. BIN
      pingpu_vue/static/images/gisshow/yujing.png
  79. BIN
      pingpu_vue/static/images/home/icon.png
  80. BIN
      pingpu_vue/static/images/home/none.png
  81. BIN
      pingpu_vue/static/images/home/qing.png
  82. BIN
      pingpu_vue/static/images/home/wu.png
  83. BIN
      pingpu_vue/static/images/home/xue.png
  84. BIN
      pingpu_vue/static/images/home/yin.png
  85. BIN
      pingpu_vue/static/images/home/yu.png
  86. BIN
      pingpu_vue/static/images/home/yun.png
  87. BIN
      pingpu_vue/static/images/home/墒情监测.png
  88. BIN
      pingpu_vue/static/images/home/环境监测.png
  89. BIN
      pingpu_vue/static/images/home/病害监测.png
  90. BIN
      pingpu_vue/static/images/home/监控设备.png
  91. BIN
      pingpu_vue/static/images/home/虫情监测.png
  92. BIN
      pingpu_vue/static/images/index/base.png
  93. BIN
      pingpu_vue/static/images/index/sqjc.png
  94. BIN
      pingpu_vue/static/images/index/user.png
  95. BIN
      pingpu_vue/static/images/index/yjxx.png
  96. BIN
      pingpu_vue/static/images/login/loginbg.png
  97. BIN
      pingpu_vue/static/images/map/5.png

+ 1 - 0
pingpu_vue/index.html

@@ -50,6 +50,7 @@
   <script
     src="https://webapi.amap.com/maps?v=2.0&key=c907b4265ae043cbdbf64304f1f80b2b&plugin=AMap.PolygonEditor,AMap.MarkerClusterer,AMap.DistrictSearch"></script>
   <script src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/js/ezuikit.js"></script>
+  <script src="https://webstaticimg.oss-cn-hangzhou.aliyuncs.com/bigdata_app/js/jsencrypt.min.js"></script>
   <script src="./static/imouplayer.js"></script>
 </body>
 

+ 11 - 3
pingpu_vue/src/assets/fonts/iconfont.css

@@ -1,8 +1,8 @@
 @font-face {
   font-family: "iconfont"; /* Project id 3646500 */
-  src: url('iconfont.woff2?t=1663119675835') format('woff2'),
-       url('iconfont.woff?t=1663119675835') format('woff'),
-       url('iconfont.ttf?t=1663119675835') format('truetype');
+  src: url('iconfont.woff2?t=1663634293009') format('woff2'),
+       url('iconfont.woff?t=1663634293009') format('woff'),
+       url('iconfont.ttf?t=1663634293009') format('truetype');
 }
 
 .iconfont {
@@ -13,6 +13,14 @@
   -moz-osx-font-smoothing: grayscale;
 }
 
+.icon-zongmianji:before {
+  content: "\e617";
+}
+
+.icon-dikuaishuliang:before {
+  content: "\e618";
+}
+
 .icon-mianji:before {
   content: "\e613";
 }

Fichier diff supprimé car celui-ci est trop grand
+ 1 - 1
pingpu_vue/src/assets/fonts/iconfont.js


+ 14 - 0
pingpu_vue/src/assets/fonts/iconfont.json

@@ -6,6 +6,20 @@
   "description": "",
   "glyphs": [
     {
+      "icon_id": "31804522",
+      "name": "总面积",
+      "font_class": "zongmianji",
+      "unicode": "e617",
+      "unicode_decimal": 58903
+    },
+    {
+      "icon_id": "31804523",
+      "name": "地块数量",
+      "font_class": "dikuaishuliang",
+      "unicode": "e618",
+      "unicode_decimal": 58904
+    },
+    {
       "icon_id": "31803947",
       "name": "面积",
       "font_class": "mianji",

BIN
pingpu_vue/src/assets/fonts/iconfont.ttf


BIN
pingpu_vue/src/assets/fonts/iconfont.woff


BIN
pingpu_vue/src/assets/fonts/iconfont.woff2


BIN
pingpu_vue/src/assets/images/forecasting/monitor/addequip.png


BIN
pingpu_vue/src/assets/images/forecasting/monitor/direction-btn.png


BIN
pingpu_vue/src/assets/images/forecasting/monitor/zoom-btn.png


BIN
pingpu_vue/src/assets/images/home/home03/background/背景.png


+ 3 - 5
pingpu_vue/src/components/DateSearch/index.vue

@@ -173,11 +173,9 @@ export default {
           new Date(this.timeRange[1]).getTime() / 1000
         );
       } else {
-        this.btnSelected = 2;
-        this.queryInfo.begin = parseInt(
-          (Date.now() - 24 * 3600000 * 30) / 1000
-        );
-        this.queryInfo.end = parseInt((Date.now() + 24 * 3600000) / 1000);
+        this.btnSelected = 1;
+        this.queryInfo.begin = parseInt(+Date.now()/ 1000)-24*60*60;
+        this.queryInfo.end = parseInt(+Date.now()/ 1000);
       }
       this.$emit("dateChange", this.queryInfo);
       this.$emit("btnSelected", this.btnSelected);

+ 3 - 3
pingpu_vue/src/components/editor/Editor.vue

@@ -90,7 +90,7 @@ export default {
       // axios 定义上传方法
       axios({
         method: "post", // post方法
-        url: "/api/v2/util/upload/img/", // 请求上传图片服务器的路径
+        url: "/api/util/upload/img/", // 请求上传图片服务器的路径
         // headers: {
         // // 配置headers请求头
         //   Authorization: localStorage.getItem('logintoken'), // token认证,看后台
@@ -103,9 +103,9 @@ export default {
           failure("HTTP Error: " + res.msg);
           return;
         }
-        this.obj.imgSrc = res.data.data.img_url;
+        this.obj.imgSrc = res.img_url;
         // 上传成功之后,将对应完整的图片路径拼接在success的参数中,回显图片的地址
-        success(res.data.data.src);
+        success(res.img_url);
       });
     },
   },

+ 56 - 4
pingpu_vue/src/main.js

@@ -15,8 +15,7 @@ import './util/http.js'
 import './util/formatTime'
 // import qs from 'qs'
 Vue.prototype.qs = Qs //全局注册,使用方法为:this.qs
-// Vue.prototype.http = "http://106.119.196.18:10005"
-Vue.prototype.http = 'http://192.168.1.52:8005'
+Vue.prototype.$http = "http://106.119.196.18:10004"
 /* eslint-disable no-new */
 const ElementUI = require('element-ui')
 Vue.use(ElementUI);
@@ -41,14 +40,67 @@ Vue.use(VueHighcharts);
 import Viewer from 'v-viewer'
 Vue.use(Viewer, {
   defaultOptions: {
-    "zIndex": 9999,
+    "zIndex": 99999999,
   }
 })
 import 'viewerjs/dist/viewer.css'
-Vue.prototype.$imghost = 'http://www.hnyfwlw.com:8006/projectimg' // 线上图片服务器路径常量
+// Vue.prototype.$imghost = 'http://8.136.98.49:8002' // 线上图片服务器路径常量
 
+router.beforeEach(async (to, from, next) => {
+  console.log(to)
+  console.log(this)
+  var tokens = localStorage.getItem("keys")
+  if (to.path == "/login") {
+    if (tokens) {
+      next({
+        path: '/index/home'
+      })
+    } else {
+      next()
+    }
+  } else {
+    if (to.query.token) {
+      axios({
+        method: "POST",
+        url: "/api/api_gateway?method=user.login.zg_login_user",
+        data: Qs.stringify({
+          pp_token: to.query.token
+        }),
+      }).then((res) => {
+        if (res.data.message == "") {
+          console.log(res.data.data.data);
+          var data = res.data.data.data.children;
+          var menuList1 = [];
+          for (let i = 0; i < data.length; i++) {
+            menuList1.push(data[i]);
+          }
+          localStorage.setItem("zg_keys",to.query.token)
+          localStorage.setItem("menu", JSON.stringify(menuList1));
+          var key = res.data.data.session_key;
+          localStorage.setItem("keys", key);
+          localStorage.setItem("username", res.data.data.data.username);
+          localStorage.setItem("myuid", res.data.data.data.myuid);
+          next()
+        } else {
+          next({
+            path: '/login'
+          })
+        }
+      });
+    } else {
+      if (tokens) {
+        next()
+      } else {
+        next({
+          path: '/login'
+        })
+        // next()
+      }
+    }
+  }
 
 
+})
 
 function throttle() {
   let prev = 0

+ 45 - 24
pingpu_vue/src/page/base/baselist.vue

@@ -122,7 +122,7 @@
             <!-- <el-input v-model="baseinfodata.img_url"></el-input> -->
             <el-upload
               class="avatar-uploader"
-              :action="http + '/api/v2/util/upload/img/'"
+              :action="$http + '/api/util/upload/img/'"
               :show-file-list="false"
               :on-success="handleAvatarSuccess"
               :before-upload="beforeAvatarUpload"
@@ -150,6 +150,8 @@
               :rows="2"
               placeholder="请输入内容"
               v-model="baseinfodata.describe"
+              :maxlength="256"
+              show-word-limit
             >
             </el-input>
           </el-form-item>
@@ -230,9 +232,16 @@ export default {
   //方法集合
   methods: {
     tomap() {
-      this.$router.push(
-        "/index/maphandle?lng=" + this.center[0] + "&lat=" + this.center[1]
-      );
+      console.log(this.baselistdata);
+      if (this.baselistdata.length) {
+        this.$router.push(
+          "/index/maphandle?lng=" + this.center[0] + "&lat=" + this.center[1]
+        );
+      } else {
+        this.$router.push(
+          "/index/maphandle"
+        );
+      }
     },
     tofac(item) {
       var center = JSON.parse(item.coordinates)[0];
@@ -246,22 +255,25 @@ export default {
       );
     },
     toplot(item) {
+      console.log(item)
       var center = JSON.parse(item.coordinates)[0];
       this.$router.push(
         "/index/mapplot?lng=" +
           center[0] +
           "&lat=" +
-          this.center[1] +
+          center[1] +
           "&id=" +
           item.base_id
       );
     },
     handleCurrentChange(e) {
       this.page = e;
+      this.getbaslist()
     },
-    handleSizeChange() {
+    handleSizeChange(e) {
       this.page = 1;
       this.page_size = e;
+      this.getbaslist()
     },
     getbaslist() {
       this.loading = true;
@@ -275,29 +287,31 @@ export default {
         }),
       }).then((res) => {
         this.loading = false;
-        if (res.data.data) {
+        if (res.data.data.data.length) {
           this.baselistdata = res.data.data.data;
           this.total = res.data.data.total_num;
           this.center = JSON.parse(this.baselistdata[0].coordinates)[0];
-          this.$nextTick(() => {
-            document.getElementsByClassName("number")[0].innerText = "首页";
-            var length = document.getElementsByClassName("number").length;
-            document.getElementsByClassName("number")[length - 1].innerText =
-              "末页";
-          });
+          // this.$nextTick(() => {
+          //   document.getElementsByClassName("number")[0].innerText = "首页";
+          //   var length = document.getElementsByClassName("number").length;
+          //   document.getElementsByClassName("number")[length - 1].innerText =
+          //     "末页";
+          // });
         }
       });
     },
     amend(item) {
-      console.log(item)
-      var data = JSON.parse(JSON.stringify(item))
-      this.baseinfodata = data
-      console.log(this.baseinfodata)
-      this.baseinfodata.base_addr = data.area_addr[0]+data.area_addr[1]+data.area_addr[2]
-      this.dialogVisible = true
+      console.log(item);
+      var data = JSON.parse(JSON.stringify(item));
+      this.baseinfodata = data;
+      this.baseinfodata.img_url2 = data.img_url
+      console.log(this.baseinfodata);
+      this.baseinfodata.base_addr =
+        data.area_addr[0] + data.area_addr[1] + data.area_addr[2];
+      this.dialogVisible = true;
     },
     handleAvatarSuccess(res, file) {
-      this.baseinfodata.img_url2 = this.http + res.data.items.img_url;
+      this.baseinfodata.img_url2 = this.$http + res.img_url;
       this.baseinfodata.img_url = URL.createObjectURL(file.raw);
     },
     handleAvatarError(res) {
@@ -318,7 +332,7 @@ export default {
             method: "post",
             url: "api/api_gateway?method=basemanager.baseinfo.modify_land_base",
             data: this.qs.stringify({
-              base_id:this.baseinfodata.base_id,
+              base_id: this.baseinfodata.base_id,
               base_name: this.baseinfodata.base_name,
               img_url: this.baseinfodata.img_url2,
               describe: this.baseinfodata.describe,
@@ -331,10 +345,10 @@ export default {
                 this.$message.success("修改成功");
               }
               this.dialogVisible = false;
-              this.getbaslist()
+              this.getbaslist();
             } else {
               if (document.getElementsByClassName("el-message").length == 0) {
-                this.$message.error("修改失败");
+                this.$message.error(res.data.message);
               }
             }
           });
@@ -364,7 +378,7 @@ export default {
                 type: "success",
                 message: "删除成功!",
               });
-              this.getbaslist()
+              this.getbaslist();
             } else {
               this.$message({
                 type: "error",
@@ -464,6 +478,12 @@ export default {
     border-radius: 10px;
     .el-row {
       margin-bottom: 20px;
+      display: flex;
+      flex-wrap: wrap;
+      .el-col{
+        margin-bottom: 20px;
+        float: none;
+      }
       &:last-child {
         margin-bottom: 0;
       }
@@ -507,6 +527,7 @@ export default {
             line-height: 15px;
             margin: 0 auto;
             align-items: center;
+            cursor: pointer;
             p {
               width: 50%;
               text-align: center;

+ 131 - 84
pingpu_vue/src/page/base/maofacility.vue

@@ -3,7 +3,6 @@
   <div class="facilitybox">
     <div id="mapbox"></div>
     <div class="inputbox">
-      <div class="btnbox1" @click="goBackPage()">返回</div>
       <el-input
         size="small"
         @change="addrChange()"
@@ -23,14 +22,26 @@
           <span>{{ alreadyhave.area_addr[1] }}</span>
           <span>{{ alreadyhave.area_addr[2] }}</span>
         </p>
-        <p>基地面积:{{ alreadyhave.base_area }} 亩</p>
-        <p>设备数量:{{ faclist.length }} 台</p>
+        <p>
+          <i class="iconfont icon-zongmianji"></i> 基地面积:{{
+            alreadyhave.base_area
+          }}
+          亩
+        </p>
+        <p>
+          <i class="iconfont icon-dikuaishuliang"></i> 设备数量:{{
+            faclist.length
+          }}
+          块
+        </p>
       </div>
       <div class="listbox_fac">
+        <div class="table_page">
+          <p @click="tofac" class="table_page_no">地块信息</p>
+          <p class="table_page_act">设备信息</p>
+        </div>
         <div class="listbox_facbox">
-          <div class="tishi" v-if="faclist.length==0">
-            暂无绑定设备
-          </div>
+          <div class="tishi" v-if="faclist.length == 0">暂无绑定设备</div>
           <div
             class="listbox_facbox_item"
             v-for="(item, index) in faclist"
@@ -48,7 +59,7 @@
       </div>
     </div>
     <el-dialog
-      title="基地信息"
+      title="绑定设备"
       :visible.sync="dialogVisible"
       width="580px"
       :close-on-click-modal="false"
@@ -71,7 +82,7 @@
             <el-input
               v-model="device_id"
               size="mini"
-              placeholder="请输入病虫害名称"
+              placeholder="请输入设备ID"
             ></el-input>
           </div>
           <div class="btnbox" @click="getwormlist">查询</div>
@@ -153,7 +164,7 @@ export default {
         area_addr: [],
       },
       faclist: [],
-      baseloading:false
+      baseloading: false,
     };
   },
   //监听属性 类似于data概念
@@ -170,8 +181,15 @@ export default {
   //方法集合
   methods: {
     //返回上一页
-    goBackPage() {
-      this.$router.go(-1);
+    tofac() {
+      this.$router.push(
+        "/index/mapplot?lng=" +
+          this.center[0] +
+          "&lat=" +
+          this.center[1] +
+          "&id=" +
+          this.base_id
+      );
     },
     init() {
       var map = new AMap.Map("mapbox", {
@@ -191,7 +209,7 @@ export default {
       this.map = map;
     },
     getbaslist() {
-      this.baseloading = true
+      this.baseloading = true;
       this.$axios({
         method: "post",
         url: "api/api_gateway?method=basemanager.baseinfo.list_land_base",
@@ -257,21 +275,25 @@ export default {
           page_size: 99999999,
         }),
       }).then((res) => {
-        this.baseloading = false
+        this.baseloading = false;
         if (res.data.data) {
           var data = res.data.data.data;
-          this.faclist = data
+          this.faclist = data;
           console.log(data);
           for (var i = 0; i < data.length; i++) {
             var icon = new AMap.Icon({
               size: new AMap.Size(28, 30),
-              image: "../../../static/images/map/"+data[i].device_type_id+".png",
+              image:
+                "../../../static/images/map/" + data[i].device_type_id + ".png",
               imageSize: new AMap.Size(28, 30),
             });
             //创建marker
-            console.log(JSON.parse(data[i].coordinates))
+            console.log(JSON.parse(data[i].coordinates));
             new AMap.Marker({
-              position: new AMap.LngLat(JSON.parse(data[i].coordinates)[0],JSON.parse(data[i].coordinates)[1]),
+              position: new AMap.LngLat(
+                JSON.parse(data[i].coordinates)[0],
+                JSON.parse(data[i].coordinates)[1]
+              ),
               icon: icon,
               map: this.map,
               offset: new AMap.Pixel(-14, -30),
@@ -281,6 +303,9 @@ export default {
       });
     },
     drawfa() {
+      if (document.getElementsByClassName("el-message").length == 0) {
+        this.$message.success("开始绑定");
+      }
       if (this.underway) {
         if (document.getElementsByClassName("el-message").length == 0) {
           this.$message.warning("正在绘制中,请勿重复点击");
@@ -288,6 +313,11 @@ export default {
         return;
       }
       this.underway = true;
+      this.map.on("click", (e) => {
+        if (document.getElementsByClassName("el-message").length == 0) {
+          this.$message.warning("请在基地内点击");
+        }
+      });
       this.Polygon.on("click", (e) => {
         var icon = new AMap.Icon({
           size: new AMap.Size(28, 30),
@@ -347,6 +377,7 @@ export default {
         this.loading = false;
         if (res.data.data) {
           console.log(res.data.data);
+          this.type_idoptions = []
           this.facilitylist = res.data.data.device_list;
           this.total = res.data.data.total_num;
           var type_list = res.data.data.type_list;
@@ -393,6 +424,7 @@ export default {
               device_id: "",
               coordinates: "",
             };
+            this.$router.go(0);
           } else {
             if (document.getElementsByClassName("el-message").length == 0) {
               this.$message.error(res.data.message);
@@ -544,90 +576,105 @@ export default {
   }
 }
 .listbox {
-    position: absolute;
-    width: 350px;
-    height: 95%;
-    top: 2.5%;
-    right: 15px;
-    background-color: #fff;
-    border-radius: 10px;
-    padding: 20px;
-    box-sizing: border-box;
-    .listbox_base {
+  position: absolute;
+  width: 350px;
+  height: 95%;
+  top: 2.5%;
+  right: 15px;
+  background-color: #fff;
+  border-radius: 10px;
+  padding: 20px;
+  box-sizing: border-box;
+  .listbox_base {
+    width: 100%;
+    border-bottom: 1px solid #f2f2f2;
+    p {
+      font-size: 14px;
+      margin-bottom: 8px;
+      overflow: hidden; //溢出隐藏
+      white-space: nowrap; //禁止换行
+      text-overflow: ellipsis; //...
+      color: #262626;
+    }
+    p:first-child {
+      font-size: 30px;
+      margin-bottom: 10px;
+      color: #262626;
+    }
+  }
+  .listbox_fac {
+    width: 100%;
+    height: calc(100% - 133px);
+    .table_page {
       width: 100%;
-      border-bottom: 1px solid #f2f2f2;
-      p {
-        font-size: 14px;
-        margin-bottom: 8px;
-        overflow: hidden; //溢出隐藏
-        white-space: nowrap; //禁止换行
-        text-overflow: ellipsis; //...
-        color: #262626;
+      display: flex;
+      P {
+        width: 50%;
+        text-align: center;
+        height: 30px;
+        line-height: 30px;
+        cursor: pointer;
       }
-      p:first-child {
-        font-size: 30px;
-        margin-bottom: 10px;
-        color: #262626;
+      .table_page_act {
+        border-bottom: 2px solid #4f71ff;
+        color: #4f71ff;
       }
     }
-    .listbox_fac {
+    .listbox_facbox {
       width: 100%;
-      height: calc(100% - 133px);
-      .listbox_facbox {
+      height: calc(100% - 32px);
+      overflow-y: auto;
+      .tishi {
         width: 100%;
-        height: 100%;
-        overflow-y: auto;
-        .tishi{
-          width: 100%;
-          padding: 20px 0;
-          box-sizing: border-box;
-          text-align: center;
+        padding: 20px 0;
+        box-sizing: border-box;
+        text-align: center;
+      }
+      .listbox_facbox_item {
+        width: 100%;
+        background-color: #ecf5ff;
+        padding: 10px;
+        box-sizing: border-box;
+        margin-top: 10px;
+        p {
+          font-size: 14px;
+          color: #262626;
         }
-        .listbox_facbox_item {
-          width: 100%;
-          background-color: #ecf5ff;
-          padding: 10px;
-          box-sizing: border-box;
-          margin-top: 10px;
-          p {
-            font-size: 14px;
-            color: #262626;
-          }
-          .title {
-            font-size: 16px;
-            margin-bottom: 10px;
-            // font-weight: 700;
+        .title {
+          font-size: 16px;
+          margin-bottom: 10px;
+          // font-weight: 700;
+          overflow: hidden; //溢出隐藏
+          white-space: nowrap; //禁止换行
+          text-overflow: ellipsis; //...
+          color: #262626;
+        }
+        .caozuo {
+          display: flex;
+          font-size: 14px;
+          margin-top: 5px;
+          div:first-child {
+            width: 80%;
             overflow: hidden; //溢出隐藏
             white-space: nowrap; //禁止换行
             text-overflow: ellipsis; //...
-            color: #262626;
           }
-          .caozuo {
+          div:nth-child(2) {
             display: flex;
-            font-size: 14px;
-            margin-top: 5px;
-            div:first-child {
-              width: 80%;
-              overflow: hidden; //溢出隐藏
-              white-space: nowrap; //禁止换行
-              text-overflow: ellipsis; //...
+            P {
+              margin-left: 10px;
+              cursor: pointer;
             }
-            div:nth-child(2) {
-              display: flex;
-              P {
-                margin-left: 10px;
-                cursor: pointer;
-              }
-              p:first-child {
-                color: #4f71ff;
-              }
-              P:last-child {
-                color: red;
-              }
+            p:first-child {
+              color: #4f71ff;
+            }
+            P:last-child {
+              color: red;
             }
           }
         }
       }
     }
   }
+}
 </style>

+ 23 - 14
pingpu_vue/src/page/base/maphandle.vue

@@ -3,7 +3,7 @@
   <div class="mappage">
     <div id="mapbox"></div>
     <div class="inputbox">
-      <div class="btnbox1" @click="goBackPage">返回</div>
+      <!-- <div class="btnbox1" @click="goBackPage">返回</div> -->
       <el-input
         size="small"
         @change="addrChange()"
@@ -33,7 +33,11 @@
           class="demo-ruleForm"
         >
           <el-form-item label="基地名称" prop="base_name">
-            <el-input size="mini" maxlength="20" v-model="baseinfodata.base_name"></el-input>
+            <el-input
+              size="mini"
+              maxlength="20"
+              v-model="baseinfodata.base_name"
+            ></el-input>
           </el-form-item>
           <el-form-item label="负责人" prop="production_name">
             <el-input
@@ -52,7 +56,7 @@
             <!-- <el-input v-model="baseinfodata.img_url"></el-input> -->
             <el-upload
               class="avatar-uploader"
-              :action="http + '/api/v2/util/upload/img/'"
+              :action="$http + '/api/util/upload/img/'"
               :show-file-list="false"
               :on-success="handleAvatarSuccess"
               :before-upload="beforeAvatarUpload"
@@ -80,6 +84,8 @@
               :rows="2"
               placeholder="请输入内容"
               v-model="baseinfodata.describe"
+              :maxlength="256"
+              show-word-limit
             >
             </el-input>
           </el-form-item>
@@ -283,10 +289,10 @@ export default {
           //   this.compute(JSON.parse(this.alreadyhave[i].coordinates));
           // }
           var flag = this.alreadyhave.some((item) => {
-            return this.compute(JSON.parse(item.coordinates))
-          })
-          console.log(flag)
-          if(!flag){
+            return this.compute(JSON.parse(item.coordinates));
+          });
+          console.log(flag);
+          if (!flag) {
             this.dialogVisible = true;
           }
         });
@@ -311,9 +317,9 @@ export default {
           this.$message.warning("基地被覆盖,绘制无效");
         }
         this.map.remove(this.overlays);
-        return true
-      }else{
-        return false
+        return true;
+      } else {
+        return false;
       }
     },
     getcity(path) {
@@ -349,7 +355,8 @@ export default {
       });
     },
     handleAvatarSuccess(res, file) {
-      this.baseinfodata.img_url2 = this.http + res.data.items.img_url;
+      console.log(res)
+      this.baseinfodata.img_url2 = this.$http + res.img_url;
       this.baseinfodata.img_url = URL.createObjectURL(file.raw);
     },
     handleAvatarError(res) {
@@ -393,7 +400,7 @@ export default {
               this.$router.go(-1);
             } else {
               if (document.getElementsByClassName("el-message").length == 0) {
-                this.$message.error("添加失败");
+                this.$message.error(res.data.message);
               }
             }
           });
@@ -407,8 +414,10 @@ export default {
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
-    // console.log(this.$route)
-    if (this.$route.query.lng == "") {
+    // console.log(this.$route.query.lng);
+    if (!this.$route.query.lng) {
+      this.center = [116.412427, 39.303573];
+    } else if (this.$route.query.lng == "") {
       this.center = [116.412427, 39.303573];
     } else {
       this.center = [this.$route.query.lng, this.$route.query.lat];

+ 79 - 19
pingpu_vue/src/page/base/mapplot.vue

@@ -3,7 +3,6 @@
   <div class="plotbox">
     <div id="mapbox"></div>
     <div class="inputbox">
-      <div class="btnbox1" @click="goBackPage()">返回</div>
       <el-input
         size="small"
         @change="addrChange()"
@@ -23,14 +22,26 @@
           <span>{{ alreadyhave.area_addr[1] }}</span>
           <span>{{ alreadyhave.area_addr[2] }}</span>
         </p>
-        <p>基地面积:{{ alreadyhave.base_area }} 亩</p>
-        <p>地块数量:{{ faclist.length }} 块</p>
+        <p>
+          <i class="iconfont icon-zongmianji"></i> 基地面积:{{
+            alreadyhave.base_area
+          }}
+          亩
+        </p>
+        <p>
+          <i class="iconfont icon-dikuaishuliang"></i> 地块数量:{{
+            faclist.length
+          }}
+          块
+        </p>
       </div>
       <div class="listbox_fac">
+        <div class="table_page">
+          <p class="table_page_act">地块信息</p>
+          <p @click="tofac" class="table_page_no">设备信息</p>
+        </div>
         <div class="listbox_facbox">
-          <div class="tishi" v-if="faclist.length==0">
-            暂无地块
-          </div>
+          <div class="tishi" v-if="faclist.length == 0">暂无地块</div>
           <div
             class="listbox_facbox_item"
             v-for="(item, index) in faclist"
@@ -41,7 +52,7 @@
             <div class="caozuo">
               <div>地块面积:{{ item.massif_area }} 亩</div>
               <div>
-                <p @click="getpoltlistinfo(item.massif_name)">修改</p>
+                <p @click="getpoltlistinfo(item.massif_name),getcroplist(item.massif_id)">修改</p>
                 <p @click="delfac(item.massif_id)">删除</p>
               </div>
             </div>
@@ -85,6 +96,7 @@
             <el-input
               size="mini"
               maxlength="15"
+              type="number"
               v-model="polyinfo.slope"
             ></el-input>
           </el-form-item>
@@ -147,6 +159,7 @@
             <el-input
               size="mini"
               maxlength="15"
+              type="number"
               v-model="poltlistinfo.slope"
             ></el-input>
           </el-form-item>
@@ -188,6 +201,18 @@ export default {
   components: {},
   data() {
     //这里存放数据
+    var validatePass2 = (rule, value, callback) => {
+      value = value.toString();
+      if (value === "") {
+        callback(new Error("请输入地块坡度"));
+      } else if (value.indexOf("-") != -1) {
+        callback(new Error("请输入正整数"));
+      } else if (value.indexOf(".") != -1) {
+        callback(new Error("请输入正整数"));
+      } else {
+        callback();
+      }
+    };
     return {
       city: "",
       map: "",
@@ -223,12 +248,12 @@ export default {
         },
         slope: {
           required: true,
-          message: "请输入地块坡度",
+          validator: validatePass2,
           trigger: "blur",
         },
         crop_id: {
           required: true,
-          message: "请输入地块坡度",
+          message: "请选择种植作物",
           trigger: "blur",
         },
       },
@@ -238,20 +263,34 @@ export default {
       faclist: [],
       dialogVisibleinfo: false,
       poltlistinfo: {},
-      loading:false
+      loading: false,
     };
   },
   //监听属性 类似于data概念
   computed: {},
   //监控data中的数据变化
-  watch: {},
+  watch: {
+    dialogVisible(val){
+      if(val){
+        this.getcroplist()
+      }
+    }
+  },
   //方法集合
   methods: {
     //返回上一页
-    goBackPage() {
-      this.$router.go(-1);
+    tofac() {
+      this.$router.push(
+        "/index/maofacility?lng=" +
+          this.center[0] +
+          "&lat=" +
+          this.center[1] +
+          "&id=" +
+          this.base_id
+      );
     },
     init() {
+      console.log(this.center);
       var map = new AMap.Map("mapbox", {
         center: this.center,
         resizeEnable: true,
@@ -294,7 +333,7 @@ export default {
       });
     },
     getbaslist() {
-      this.loading = true
+      this.loading = true;
       this.$axios({
         method: "post",
         url: "api/api_gateway?method=basemanager.baseinfo.list_land_base",
@@ -356,6 +395,9 @@ export default {
       });
     },
     createPolygon() {
+      if (document.getElementsByClassName("el-message").length == 0) {
+        this.$message.success("开始绘制");
+      }
       if (this.underway) {
         if (document.getElementsByClassName("el-message").length == 0) {
           this.$message.warning("正在绘制中,请勿重复点击");
@@ -507,6 +549,7 @@ export default {
                 slope: "", //                  必传    坡度
                 crop_id: "", //                必传    农作物id
               };
+              this.$router.go(0);
             } else {
               if (document.getElementsByClassName("el-message").length == 0) {
                 this.$message.error(res.data.message);
@@ -520,11 +563,13 @@ export default {
       });
     },
     //获取种植物信息
-    getcroplist() {
+    getcroplist(id) {
       this.$axios({
         method: "post",
         url: "api/api_gateway?method=basemanager.baseinfo.massif_by_crop_list",
-        data: this.qs.stringify({}),
+        data: this.qs.stringify({
+          massif_id:id
+        }),
       }).then((res) => {
         if (res.data.data) {
           var data = res.data.data;
@@ -637,6 +682,7 @@ export default {
     } else {
       this.center = [this.$route.query.lng, this.$route.query.lat];
     }
+    console.log(this.center);
     this.base_id = this.$route.query.id;
   },
   beforeMount() {}, //生命周期 - 挂载之前
@@ -644,7 +690,6 @@ export default {
   mounted() {
     this.init();
     this.getbaslist();
-    this.getcroplist();
   },
   beforeUpdate() {}, //生命周期 - 更新之前
   updated() {}, //生命周期 - 更新之后
@@ -723,11 +768,26 @@ export default {
     .listbox_fac {
       width: 100%;
       height: calc(100% - 133px);
+      .table_page {
+        width: 100%;
+        display: flex;
+        P {
+          width: 50%;
+          text-align: center;
+          height: 30px;
+          line-height: 30px;
+          cursor: pointer;
+        }
+        .table_page_act {
+          border-bottom: 2px solid #4f71ff;
+          color: #4f71ff;
+        }
+      }
       .listbox_facbox {
         width: 100%;
-        height: 100%;
+        height: calc(100% - 32px);
         overflow-y: auto;
-        .tishi{
+        .tishi {
           width: 100%;
           padding: 20px 0;
           box-sizing: border-box;

+ 361 - 28
pingpu_vue/src/page/base/plotlist.vue

@@ -14,6 +14,7 @@
               size="mini"
               filterable
               placeholder="请选择"
+              clearable
             >
               <el-option
                 v-for="item in baseoptions"
@@ -28,10 +29,10 @@
             <el-input
               v-model="massif_name"
               size="mini"
-              placeholder="请输入农作物名称"
+              placeholder="请输入地块名称"
             ></el-input>
           </div>
-          <div class="btnbox">查询</div>
+          <div class="btnbox" @click="getmassiflist">查询</div>
         </div>
       </div>
     </div>
@@ -41,28 +42,23 @@
         :data="tableData"
         stripe
         style="width: 100%"
-        height="530"
+        height="560px"
       >
-        <el-table-column prop="base_name" label="基地名称">
-        </el-table-column>
-        <el-table-column prop="massif_name" label="地块名称">
-        </el-table-column>
-        <el-table-column prop="crop_name" label="农作物名称">
-        </el-table-column>
-        <el-table-column prop="terrain" label="地形">
-        </el-table-column>
-        <el-table-column prop="slope" label="坡度">
-        </el-table-column>
+        <el-table-column prop="base_name" label="基地名称"> </el-table-column>
+        <el-table-column prop="massif_name" label="地块名称"> </el-table-column>
+        <el-table-column prop="crop_name" label="农作物名称"> </el-table-column>
+        <el-table-column prop="terrain" label="地形"> </el-table-column>
+        <el-table-column prop="slope" label="坡度"> </el-table-column>
         <el-table-column label="操作" fixed="right">
           <template slot-scope="scope">
             <span
               style="color: #4f71ff; margin-right: 15px; cursor: pointer"
-              @click="toamend(scope.row.crop_id)"
+              @click="opendata(scope.row.massif_id)"
               >数据列表</span
             >
             <span
               style="color: #4f71ff; margin-right: 15px; cursor: pointer"
-              @click="deldata(scope.row.crop_id)"
+              @click="adddata(scope.row.massif_id)"
               >录入数据</span
             >
           </template>
@@ -81,6 +77,114 @@
         </el-pagination>
       </div>
     </div>
+    <el-dialog title="录入数据" :visible.sync="dialogVisible" width="500px">
+      <div class="datainfobox">
+        <el-form
+          :model="ruleForm"
+          :rules="rules"
+          ref="ruleForm"
+          label-width="100px"
+          class="demo-ruleForm"
+        >
+          <el-form-item label="年份" prop="plant_year">
+            <el-date-picker
+              v-model="ruleForm.plant_year"
+              size="mini"
+              type="year"
+              placeholder="选择年份"
+            >
+            </el-date-picker>
+          </el-form-item>
+          <el-form-item label="作物" prop="crop_name">
+            <el-select
+              v-model="ruleForm.crop_name"
+              filterable
+              placeholder="请选择作物"
+              size="mini"
+            >
+              <el-option
+                v-for="item in cropoptions"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </el-form-item>
+          <el-form-item label="产量" prop="harvest">
+            <el-input
+              size="mini"
+              v-model="ruleForm.harvest"
+              placeholder="请输入内容"
+            ></el-input>
+            <span>斤</span>
+          </el-form-item>
+          <el-form-item label="备注" prop="remarks">
+            <el-input
+              type="textarea"
+              :rows="2"
+              placeholder="请输入内容"
+              v-model="ruleForm.remarks"
+            >
+            </el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="addinfof">取 消</el-button>
+        <el-button type="primary" size="mini" @click="addinfot"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+    <el-dialog title="录入数据" :visible.sync="dialogVisible2" width="1000px">
+      <div class="datalistbox">
+        <el-select
+          v-model="ysersel"
+          filterable
+          placeholder="请选择年份"
+          size="mini"
+          clearable
+          @change="yearchange"
+        >
+          <el-option
+            v-for="item in yearlist"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+        <el-table :data="tabledatadia" style="width: 100%" class="tablebox">
+          <el-table-column prop="plant_year" label="年份" width="100">
+          </el-table-column>
+          <el-table-column prop="crop_name" label="种植作物" width="180">
+          </el-table-column>
+          <el-table-column prop="harvest" label="产量" width="180">
+          </el-table-column>
+          <el-table-column prop="remarks" label="备注"> </el-table-column>
+          <el-table-column prop="address" label="操作" width="100">
+            <template slot-scope="scope">
+              <span
+                style="color: #4f71ff; margin-right: 15px; cursor: pointer"
+                @click="deldata(scope.row.record_id)"
+                >删除</span
+              >
+            </template>
+          </el-table-column>
+        </el-table>
+        <div class="pagination">
+          <el-pagination
+            background
+            layout="prev, pager, next,jumper"
+            :total="totalNum"
+            :page-size="10"
+            @current-change="handleCurrentChange"
+          >
+          </el-pagination>
+        </div>
+      </div>
+    </el-dialog>
   </div>
 </template>
 
@@ -92,6 +196,21 @@ export default {
   components: {},
   data() {
     //这里存放数据
+    var validatePass = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("请输入产量"));
+      } else {
+        if (isNaN(value)) {
+          callback(new Error("请输入数值"));
+        } else {
+          if (value < 0) {
+            callback(new Error("请输入正确格式"));
+          } else {
+            callback();
+          }
+        }
+      }
+    };
     return {
       massif_name: "",
       totalNum: 10,
@@ -101,6 +220,30 @@ export default {
       loading: false,
       basevalue: "",
       baseoptions: [],
+      dialogVisible: false,
+      ruleForm: {
+        massif_id: "", //        必传      地块id
+        plant_year: "", //       必须      年份   2022
+        crop_name: "", //        必须      作物   xxxxx
+        harvest: "", //          必须      产量   100
+        remarks: "", //         非必须     备注
+      },
+      rules: {
+        plant_year: [
+          { required: true, message: "请选择年份", trigger: "change" },
+        ],
+        crop_name: [
+          { required: true, message: "请选择作物", trigger: "change" },
+        ],
+        harvest: [{ required: true, validator: validatePass, trigger: "blur" }],
+      },
+      cropoptions: [],
+      dialogVisible2: false,
+      yearlist: [],
+      ysersel: "",
+      tablepage: 1,
+      tabledatadia: [],
+      massif_id: "",
     };
   },
   //监听属性 类似于data概念
@@ -112,11 +255,11 @@ export default {
     handleSizeChange(e) {
       this.page = 1;
       this.page_size = e;
-      this.getcroplist();
+      this.getmassiflist();
     },
     handleCurrentChange(e) {
       this.page = e;
-      this.getcroplist();
+      this.getmassiflist();
     },
     getbaselist() {
       this.$axios({
@@ -135,17 +278,17 @@ export default {
               value: data[i].base_id,
               label: data[i].base_name,
             };
-            this.baseoptions.push(obj)
+            this.baseoptions.push(obj);
           }
         }
       });
     },
-    getcroplist() {
+    getmassiflist() {
       this.$axios({
         method: "POST",
         url: "/api/api_gateway?method=basemanager.baseinfo.get_massif_list",
         data: this.qs.stringify({
-          base_id:this.basevalue,
+          base_id: this.basevalue,
           massif_name: this.massif_name, //       非必须     农作物名称
           page: this.page, //            非必须     页码,默认1
           page_size: this.page_size, //       非必须     每页条目数,默认10
@@ -158,18 +301,174 @@ export default {
         }
       });
     },
-    toamend(){
-
+    getcroplist() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=basemanager.baseinfo.massif_by_crop_list",
+        data: this.qs.stringify({}),
+      }).then((res) => {
+        if (res.data.data) {
+          console.log(res.data.data);
+          var data = res.data.data;
+          for (var i = 0; i < data.length; i++) {
+            var obj = {
+              value: data[i].crop_name,
+              label: data[i].crop_name,
+            };
+            this.cropoptions.push(obj);
+          }
+        }
+      });
+    },
+    addinfof() {
+      this.dialogVisible = false;
+      this.ruleForm = {
+        massif_id: "", //        必传      地块id
+        plant_year: "", //       必须      年份   2022
+        crop_name: "", //        必须      作物   xxxxx
+        harvest: "", //          必须      产量   100
+        remarks: "", //         非必须     备注
+      };
+    },
+    addinfot() {
+      // this.dialogVisible = true;
+      var year = new Date(this.ruleForm.plant_year).getFullYear();
+      this.$refs["ruleForm"].validate((valid) => {
+        if (valid) {
+          this.$axios({
+            method: "post",
+            url: "api/api_gateway?method=basemanager.baseinfo.add_plant_record",
+            data: this.qs.stringify({
+              massif_id: this.ruleForm.massif_id, //           必传    地块名称
+              plant_year: year,
+              crop_name: this.ruleForm.crop_name, //               必传    地形
+              harvest: this.ruleForm.harvest, //                 必传    坡度
+              remarks: this.ruleForm.remarks, //               必传    农作物id
+            }),
+          }).then((res) => {
+            if (res.data.data) {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.success("添加成功");
+              }
+              this.dialogVisible = false;
+              this.ruleForm = {
+                massif_id: "", //        必传      地块id
+                plant_year: "", //       必须      年份   2022
+                crop_name: "", //        必须      作物   xxxxx
+                harvest: "", //          必须      产量   100
+                remarks: "", //         非必须     备注
+              };
+            } else {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.error(res.data.message);
+              }
+            }
+          });
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+    opendata(id) {
+      this.dialogVisible2 = true;
+      this.getyearlist(id);
+      this.gettabledata(id);
+      this.massif_id = id;
+    },
+    adddata(id) {
+      this.dialogVisible = true;
+      this.ruleForm.massif_id = id;
+    },
+    getyearlist(massif_id) {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=basemanager.baseinfo.get_plant_year_list",
+        data: this.qs.stringify({
+          massif_id: massif_id,
+        }),
+      }).then((res) => {
+        if (res.data.data) {
+          console.log(res.data.data);
+          var data = res.data.data;
+          this.yearlist = [];
+          for (var i = 0; i < data.length; i++) {
+            var obj = {
+              value: data[i],
+              label: data[i],
+            };
+            this.yearlist.push(obj);
+          }
+        }
+      });
+    },
+    handleCurrentChange(e) {
+      this.tablepage = e;
+      this.gettabledata(this.massif_id);
+    },
+    yearchange(e) {
+      this.tablepage = 1;
+      this.ysersel = e;
+      this.gettabledata(this.massif_id);
+    },
+    gettabledata(massif_id) {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=basemanager.baseinfo.get_plant_record",
+        data: this.qs.stringify({
+          massif_id: massif_id,
+          plant_year: this.ysersel, //       非必须    年份
+          page: this.tablepage, //            非必须     页码,默认1
+          page_size: 10, //       非必须     每页条目数,默认10
+        }),
+      }).then((res) => {
+        if (res.data.data) {
+          // console.log(res.data.data.data);
+          this.total_num = res.data.data.total_num;
+          this.tabledatadia = res.data.data.data;
+        }
+      });
+    },
+    deldata(id) {
+      this.$confirm("此操作将删除该条数据, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.$axios({
+            method: "POST",
+            url: "/api/api_gateway?method=basemanager.baseinfo.del_plant_record",
+            data: this.qs.stringify({
+              record_id: id,
+            }),
+          }).then((res) => {
+            if (res.data.data) {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.success("删除成功");
+              }
+              this.gettabledata(this.massif_id);
+            } else {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.error(res.data.message);
+              }
+            }
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
     },
-    deldata(){
-
-    }
   },
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
+    this.getmassiflist();
+    this.getbaselist();
     this.getcroplist();
-    this.getbaselist()
   },
   beforeMount() {}, //生命周期 - 挂载之前
   //生命周期 - 挂载完成(可以访问DOM元素)
@@ -215,10 +514,10 @@ export default {
       padding: 20px;
       box-sizing: border-box;
       line-height: 28px;
-      justify-content:flex-end;
+      justify-content: flex-end;
       .left_search {
         display: flex;
-        .firstsearch{
+        .firstsearch {
           margin-right: 15px;
         }
       }
@@ -271,4 +570,38 @@ export default {
     }
   }
 }
+.datainfobox {
+  /deep/.el-date-editor {
+    width: 200px;
+  }
+  /deep/.el-select {
+    width: 200px;
+  }
+  /deep/.el-input {
+    width: 200px;
+  }
+  /deep/.el-textarea {
+    .el-textarea__inner {
+      font-family: "Avenir", Helvetica, Arial, sans-serif;
+    }
+  }
+}
+.datalistbox {
+  .tablebox {
+    margin: 15px 0;
+  }
+  .pagination {
+    display: flex;
+    justify-content: flex-end;
+    margin-top: 20px;
+    /deep/.el-pager {
+      .active {
+        background-color: #4f71ff !important;
+      }
+    }
+    /deep/.el-input__inner:hover {
+      border-color: #4f71ff;
+    }
+  }
+}
 </style>

+ 218 - 15
pingpu_vue/src/page/bzy/BzyPhotos.vue

@@ -10,6 +10,9 @@
       </div>
       <p class="baselistbox_top_line"></p>
       <div class="baselistbox_top_search">
+        <div class="capzuo_left">
+          <span>设备ID:{{ device_id }}</span>
+        </div>
         <div class="check-btns">
           <div class="type-check">
             <el-button type="primary" size="mini" @click="equipStatusCheck('0')"
@@ -88,6 +91,9 @@
     </div>
     <div class="baselistbox_photo">
       <el-row :gutter="30" v-viewer v-if="photoList.length > 0">
+        <div class="none" v-if="!photoList.length">
+          <img src="../../../static/images/quexingye.png" alt="" />
+        </div>
         <el-col
           :xs="24"
           :sm="24"
@@ -99,7 +105,7 @@
         >
           <div class="photoItem">
             <div class="photoInfo">
-              <template v-if="userType == 1">
+              <template>
                 <i
                   class="iconfont icon-shanchu"
                   v-show="delBtnState && downBtnState"
@@ -125,14 +131,23 @@
               </template>
             </div>
             <div class="date" style="background: #fff">
-              {{ (item.addtime * 1000) | formatTime }}
+              <div>
+                {{ (item.addtime * 1000) | formatTime }}
+              </div>
+              <div>
+                <span
+                  style="color: #4f71ff; margin-left: 15px; cursor: pointer"
+                  @click="addearly(item.id)"
+                  >手动预警</span
+                >
+              </div>
             </div>
           </div>
         </el-col>
       </el-row>
       <!-- 暂无数据 -->
       <div style="text-align: center" v-else>
-        <img :src="$imghost + zanwu" alt />
+        <img src="../../../static/images/quexingye.png" alt />
       </div>
       <div class="pagination">
         <el-pagination
@@ -146,6 +161,67 @@
         </el-pagination>
       </div>
     </div>
+    <el-dialog
+      title="手动预警"
+      :visible.sync="adddialogVisible"
+      :close-on-click-modal="false"
+      width="580px"
+    >
+      <div class="addwarnbox">
+        <el-form
+          :model="warninginfo"
+          :rules="rules"
+          ref="ruleForm"
+          label-width="100px"
+          class="demo-ruleForm"
+        >
+          <el-form-item label="预警标题" prop="title">
+            <el-input
+              size="mini"
+              maxlength="15"
+              v-model="warninginfo.title"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="预警内容" prop="describe">
+            <el-input
+              size="mini"
+              maxlength="100"
+              type="textarea"
+              v-model="warninginfo.describe"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button size="mini" @click="adddialogVisible = false"
+          >取 消</el-button
+        >
+        <el-button size="mini" type="primary" @click="amend">确 定</el-button>
+      </span>
+    </el-dialog>
+    <!-- <el-dialog
+      title="预警信息"
+      :visible.sync="seedialogVisible"
+      :close-on-click-modal="false"
+      width="580px"
+    >
+      <div class="addwarnbox">
+        <el-form
+          :model="seewarninginfo"
+          :rules="rules"
+          ref="ruleForm"
+          label-width="100px"
+          class="demo-ruleForm"
+        >
+          <el-form-item label="预警标题" prop="title">
+            <p>{{ seewarninginfo.title }}</p>
+          </el-form-item>
+          <el-form-item label="预警内容" prop="describe">
+            <p>{{ seewarninginfo.describe }}</p>
+          </el-form-item>
+        </el-form>
+      </div>
+    </el-dialog> -->
   </div>
 </template>
 <script>
@@ -178,6 +254,20 @@ export default {
         name: this.$route.query.name,
         addr: this.$route.query.addr,
       },
+      img_id: "",
+      adddialogVisible: false,
+      warninginfo: {
+        title: "",
+        describe: "",
+      },
+      rules: {
+        title: [{ required: true, message: "请输入预警标题", trigger: "blur" }],
+        describe: [
+          { required: true, message: "请输入预警内容", trigger: "blur" },
+        ],
+      },
+      seedialogVisible: false,
+      seewarninginfo: {},
     };
   },
   mounted() {
@@ -276,19 +366,61 @@ export default {
       }
       if (flag == 8) {
         //批量下载图片
-        if (this.dataList.length == 0) {
-          if (document.getElementsByClassName("el-message").length == 0) {
-            this.$message.warning("请选择要下载的图片!");
-          }
+        // if (this.dataList.length == 0) {
+        //   if (document.getElementsByClassName("el-message").length == 0) {
+        //     this.$message.warning("请选择要下载的图片!");
+        //   }
+        // } else {
+        //   var a = {};
+        //   for (let i = 0; i < this.dataList.length; i++) {
+        //     setTimeout(() => {
+        //       a["link" + i] = document.createElement("a"); // 创建a标签
+        //       a["link" + i].href = this.dataList[i].addr;
+        //       a["link" + i].download = "下载图片"; // 重命名文件
+        //       a["link" + i].click();
+        //     }, i * 1000);
+        //   }
+        // }
+        var arr = [];
+        for (let i = 0; i < this.dataList.length; i++) {
+          arr.push(this.dataList[i].id);
+        }
+        console.log(arr)
+        if (arr.length) {
+          this.$axios({
+            method: "POST",
+            url: "api/img_download",
+            data: this.qs.stringify({
+              img_id: arr.join(","),
+              device_type: 7,
+            }),
+            headers: {
+              // 这里需要使用form-data格式数据发送请求
+              "Content-Type": "application/x-www-form-urlencoded",
+            },
+            responseType: "blob",
+          })
+            .then((res) => {
+              console.log(res);
+              const elink = document.createElement("a");
+              elink.download = "img.zip";
+              elink.style.display = "none";
+              const blob = new Blob([res.data], { type: "application/zip" });
+              const href = URL.createObjectURL(blob);
+              elink.href = href;
+              document.body.appendChild(elink);
+              elink.click();
+              document.body.removeChild(elink);
+              window.URL.revokeObjectURL(href);
+            })
+            .catch(() => {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.error("请求图片资源超时,请稍后重试");
+              }
+            });
         } else {
-          var a = {};
-          for (let i = 0; i < this.dataList.length; i++) {
-            setTimeout(() => {
-              a["link" + i] = document.createElement("a"); // 创建a标签
-              a["link" + i].href = this.dataList[i].addr;
-              a["link" + i].download = "下载图片"; // 重命名文件
-              a["link" + i].click();
-            }, i * 1000);
+          if (document.getElementsByClassName("el-message").length == 0) {
+            this.$message.warning("请选择下载图片");
           }
         }
       }
@@ -478,6 +610,58 @@ export default {
         }
       });
     },
+    addearly(id) {
+      this.img_id = id;
+      this.adddialogVisible = true;
+    },
+    // seeearly(id) {
+    //   this.seedialogVisible = true
+    //   this.$axios({
+    //     method: "POST",
+    //     url: "/api/api_gateway?method=device.device_picture.bzy_warning_list",
+    //     data: this.qs.stringify({
+    //       img_id: id,
+    //     }),
+    //   }).then((res) => {
+    //     if (res.data.message == "") {
+    //       console.log(res.data.data.data[0])
+    //       this.seewarninginfo  = res.data.data.data[0]
+    //     }
+    //   });
+    // },
+    amend() {
+      this.$refs["ruleForm"].validate((valid) => {
+        if (valid) {
+          this.$axios({
+            method: "POST",
+            url: "/api/api_gateway?method=device.device_picture.bzy_photo_warning_save",
+            data: this.qs.stringify({
+              img_id: this.img_id,
+              title: this.warninginfo.title,
+              describe: this.warninginfo.describe,
+            }),
+          }).then((res) => {
+            if (res.data.message == "") {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.success("设置成功");
+              }
+              this.adddialogVisible = false;
+              this.warninginfo = {
+                title: "",
+                describe: "",
+              };
+            } else {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.error("设置失败");
+              }
+            }
+          });
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
   },
 };
 </script>
@@ -514,6 +698,10 @@ export default {
     padding: 20px;
     box-sizing: border-box;
     line-height: 28px;
+    .capzuo_left {
+      font-size: 14px;
+      margin-bottom: 20px;
+    }
   }
 }
 .baselistbox_photo {
@@ -524,6 +712,11 @@ export default {
   padding: 20px;
   box-sizing: border-box;
   border-radius: 10px;
+  .none {
+    width: 100%;
+    display: flex;
+    justify-content: space-around;
+  }
   .pagination {
     display: flex;
     justify-content: flex-end;
@@ -606,6 +799,9 @@ export default {
     text-align: center;
     font-size: 14px;
     padding: 10px 0;
+    display: flex;
+    justify-content: space-between;
+    line-height: 19px;
   }
   .photoCtrl {
     background-color: #fff;
@@ -636,4 +832,11 @@ export default {
   background-color: #4f71ff !important;
   color: #fff;
 }
+.addwarnbox {
+  /deep/.el-textarea {
+    .el-textarea__inner {
+      font-family: "Avenir", Helvetica, Arial, sans-serif;
+    }
+  }
+}
 </style>

+ 3 - 2
pingpu_vue/src/page/bzy/DataDetail.vue

@@ -633,11 +633,12 @@ export default {
           end = "";
         }
         console.log(begin);
-        var username = localStorage.getItem("cUsername");
+        var username = localStorage.getItem("username");
         console.log(username);
         // console.log(window.location.origin)
         window.location.href =
-          this.$deriveData +
+          // this.$deriveData +
+          this.$http+
           // "http://192.168.1.77:8002"+
           "/api/cbd_export?device_id=" +
           this.$route.params.d_id +

+ 17 - 13
pingpu_vue/src/page/bzy/bzy.vue

@@ -47,6 +47,7 @@
         stripe
         style="width: 100%"
         :default-sort="{ prop: 'device_name', order: 'addtime' }"
+        height="560px"
       >
         <el-table-column
           prop="device_name"
@@ -129,11 +130,12 @@
             v-model="equipInfo.device_id"
           ></el-input>
         </el-form-item>
-        <el-form-item label="设备名称:" v-if="equipInfo.device_name">
+        <el-form-item label="设备名称:">
           <el-input
-            style="width: 217px"
-            disabled
+            :maxlength="10"
+            size="mini"
             v-model="equipInfo.device_name"
+            style="width: 200px"
           ></el-input>
         </el-form-item>
         <el-form-item label="载玻片滴液时间(s): " prop="drop_time">
@@ -387,12 +389,12 @@ export default {
             console.log(data[i].imei + "这是带识别的");
           }
         }
-        this.$nextTick(() => {
-          document.getElementsByClassName("number")[0].innerText = "首页";
-          var length = document.getElementsByClassName("number").length;
-          document.getElementsByClassName("number")[length - 1].innerText =
-            "末页";
-        });
+        // this.$nextTick(() => {
+        //   document.getElementsByClassName("number")[0].innerText = "首页";
+        //   var length = document.getElementsByClassName("number").length;
+        //   document.getElementsByClassName("number")[length - 1].innerText =
+        //     "末页";
+        // });
       });
     },
     handleSizeChange(e) {
@@ -455,12 +457,14 @@ export default {
           device_type_id: 7,
           d_id: this.d_id,
           config: JSON.stringify(this.setFrom),
+          device_name:this.equipInfo.device_name
         }),
       }).then((res) => {
         if (res.data.message == "") {
           if (document.getElementsByClassName("el-message").length == 0) {
             this.$message.success("设备控制修改成功");
           }
+          this.getEquipList()
         } else {
           if (document.getElementsByClassName("el-message").length == 0) {
             this.$message.err("设备控制修改失败");
@@ -646,7 +650,7 @@ export default {
   }
   .baselistbox_table {
     width: 100%;
-    height: calc(100% - 140px);
+    // height: calc(100% - 140px);
     background-color: #fff;
     margin-top: 10px;
     padding: 20px;
@@ -659,9 +663,9 @@ export default {
       }
     }
     .pagination {
-      position: absolute;
-      bottom: 10px;
-      right: 20px;
+      display: flex;
+      justify-content: flex-end;
+      margin-top: 20px;
       /deep/.el-pager {
         .active {
           background-color: #4f71ff !important;

+ 25 - 16
pingpu_vue/src/page/cbd/Cbd.vue

@@ -11,7 +11,7 @@
               >{{ onewarning.device_id | subDeviceId }}
               {{ warning_status(onewarning.warning_status) }}
             </div>
-            <i class="iconfont el-icon-message-solid"></i>
+            <i class="el-icon-bell"></i>
           </div>
           <ul
             class="warningInfoList"
@@ -99,7 +99,7 @@
         :data="equipList"
         stripe
         style="width: 100%"
-        height="530"
+        height="560px"
         :default-sort="{ prop: 'device_name', order: 'addtime' }"
       >
         <el-table-column
@@ -107,7 +107,6 @@
           sortable
           label="设备名称"
           width="180"
-          fixed
         >
           <template slot-scope="scope">{{
             scope.row.device_name == "" ? "无" : scope.row.device_name
@@ -137,7 +136,7 @@
             scope.row.address || "无" | ellipsis
           }}</template>
         </el-table-column>
-        <el-table-column label="操作" width="350" fixed="right">
+        <el-table-column label="操作" width="350">
           <template slot-scope="scope">
             <span
               style="color: #4f71ff; margin-right: 15px; cursor: pointer"
@@ -217,11 +216,12 @@
               v-model="equipInfo.device_id"
             ></el-input>
           </el-form-item>
-          <el-form-item label="设备名称:" v-if="equipInfo.device_name">
+          <el-form-item label="设备名称:">
             <el-input
-              disabled
               size="mini"
               v-model="equipInfo.device_name"
+              :maxlength="10"
+              style="width: 200px"
             ></el-input>
           </el-form-item>
           <el-form-item label="设备开关:" prop="ds">
@@ -486,12 +486,12 @@ export default {
             console.log(data[i].imei + "这是带识别的");
           }
         }
-        this.$nextTick(() => {
-          document.getElementsByClassName("number")[0].innerText = "首页";
-          var length = document.getElementsByClassName("number").length;
-          document.getElementsByClassName("number")[length - 1].innerText =
-            "末页";
-        });
+        // this.$nextTick(() => {
+        //   document.getElementsByClassName("number")[0].innerText = "首页";
+        //   var length = document.getElementsByClassName("number").length;
+        //   document.getElementsByClassName("number")[length - 1].innerText =
+        //     "末页";
+        // });
       });
     },
     handleSizeChange(e) {
@@ -584,12 +584,14 @@ export default {
           device_type_id: 3,
           d_id: this.d_id,
           config: JSON.stringify(newForm),
+          device_name: this.equipInfo.device_name,
         }),
       }).then((res) => {
         if (res.data.message == "") {
           if (document.getElementsByClassName("el-message").length == 0) {
             this.$message.success("设备控制修改成功");
           }
+          this.getEquipList();
         } else {
           if (document.getElementsByClassName("el-message").length == 0) {
             this.$message.error("设备控制修改失败");
@@ -645,7 +647,9 @@ export default {
         }),
       }).then((res) => {
         if (res.data.data == true) {
-          this.cbdWarningList();
+          // this.warningList = []
+          // this.cbdWarningPage=1
+          // this.cbdWarningList();
         }
       });
     },
@@ -660,7 +664,9 @@ export default {
       }).then((res) => {
         console.log(res.data.data);
         if (res.data.data == true) {
-          this.cbdWarningList();
+          // this.warningList = []
+          // this.cbdWarningPage=1
+          // this.cbdWarningList();
         }
       });
     },
@@ -766,12 +772,15 @@ export default {
         flex-direction: column;
         align-items: flex-end;
         position: relative;
+        border: 1px solid #c0c4cc;
+        border-radius: 25px;
+        padding: 0 15px;
         .title {
           width: 100%;
-          padding: 5px 10px;
+          // padding: 5px 10px;
           border-radius: 15px;
           margin-bottom: 10px;
-          background: #fff;
+          // background: #fff;
           display: flex;
           align-items: center;
           justify-content: space-between;

+ 3 - 13
pingpu_vue/src/page/cbd/DataDetails.vue

@@ -798,7 +798,7 @@ export default {
       var that = this;
       console.log(this.value1);
       if (that.value == "" || that.value1 == "") {
-        this.$resetMessage({
+        this.$message({
           message: "请将必填项填写完整",
           type: "warning",
           duration: 1500,
@@ -806,15 +806,6 @@ export default {
       } 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;
@@ -822,10 +813,9 @@ export default {
           begin = "";
           end = "";
         }
-        var username = localStorage.getItem("cUsername");
+        var username = localStorage.getItem("username");
         window.location.href =
-          this.$deriveData +
-          // "http://192.168.1.77:8002"+
+          this.$http+
           "/api/cbd_export?device_id=" +
           that.$route.params.d_id +
           "&filename=" +

+ 3 - 0
pingpu_vue/src/page/cbd/MessageWarn.vue

@@ -36,6 +36,7 @@
                 placeholder="请填写害虫数量"
                 clearable
                 @change="input1ChangeFun"
+                @blur="input1=input1.replace(/[^\d]/g,'')"
               ></el-input>
             </div>
             <div class="hint">
@@ -95,6 +96,7 @@
                   placeholder="请填写害虫数量"
                   clearable
                   @change="wormNumFun2"
+                  @blur="item.nums=item.nums.replace(/[^\d]/g,'')"
                 ></el-input>
                 <i
                   v-if="index == 0"
@@ -149,6 +151,7 @@
                 placeholder="请填写害虫数量"
                 clearable
                 @change="input3ChangeFun"
+                @blur="input3=input3.replace(/[^\d]/g,'')"
               ></el-input>
             </div>
             <div class="hint">

+ 6 - 5
pingpu_vue/src/page/cbd/analyse.vue

@@ -172,7 +172,7 @@
         </el-table-column>
         <el-table-column prop="index" label="图像">
           <template slot-scope="scope">
-            <p @click="opendia(scope.row)" style="color: #14a478">查看</p>
+            <p @click="opendia(scope.row)" style="color: #14a478;cursor: pointer;">查看</p>
           </template>
         </el-table-column>
       </el-table>
@@ -217,7 +217,7 @@
         <img :src="indentify_photo" alt="" v-viewer />
       </div>
       <div class="wormlistbox" v-if="!checkObj(tabworm)">
-        <p v-for="(item, key) in tabworm" :key="item">
+        <p v-for="(item, key) in tabworm" :key="key">
           {{ key }} -- {{ item }}头
         </p>
       </div>
@@ -904,7 +904,7 @@ export default {
       this.img_url = data.img_url;
       this.indentify_photo = data.indentify_photo;
       this.tabworm = data.pest_dict;
-      console.log(data);
+      console.log(this.tabworm);
     },
     //图像溯源
     getworminfotable() {
@@ -956,7 +956,7 @@ export default {
       var myuid = sessionStorage.getItem("myuid");
       if (this.acttableindex == 1) {
         window.location.href =
-          this.$deriveData +
+          this.$http+
           // "http://192.168.1.23:8000" +
           "/api/pest_image_source_export?d_ids=" +
           this.d_id +
@@ -973,7 +973,7 @@ export default {
           this.amend;
       } else if (this.acttableindex == 2) {
         window.location.href =
-          this.$deriveData +
+          this.$http+
           // "http://192.168.1.23:8000" +
           "/api/pest_base_data_export?d_ids=" +
           this.d_id +
@@ -1253,6 +1253,7 @@ export default {
     font-size: 14px;
     border-radius: 5px;
     color: #4f71ff;
+    cursor: pointer;
   }
   .act {
     border: 1px solid #4f71ff;

+ 10 - 10
pingpu_vue/src/page/cbd/cbdCanvas.vue

@@ -206,7 +206,7 @@ export default {
     aaa(val) {
       console.log("val.length", val.length);
       if (val.length > 10) {
-        this.$resetMessage.error("长度不可超过10个");
+        this.$message.error("长度不可超过10个");
         this.aaa = val.slice(0, 10);
         console.log(this.aaa);
       }
@@ -553,7 +553,7 @@ export default {
     sub() {
       var isText = this.totalRect.every((v) => v.text);
       if (isText == false) {
-        this.$resetMessage("请点选绘制框内部,在右侧输入标记名称");
+        this.$message("请点选绘制框内部,在右侧输入标记名称");
       } else {
         const data = this.totalRect.filter((v) => v.flag_id === "2");
         this.isDisabled = true;
@@ -569,7 +569,7 @@ export default {
           }),
         })
           .then((res) => {
-            this.$resetMessage.success("提交完成");
+            this.$message.success("提交完成");
             this.clearAll(2);
             this.getDataList();
             this.$nextTick(() => {
@@ -622,14 +622,14 @@ export default {
           }
         )
           .then(() => {
-            this.$resetMessage({
+            this.$message({
               type: "success",
               message: "已关闭",
             });
             this.$router.go(-1);
           })
           .catch(() => {
-            this.$resetMessage({
+            this.$message({
               type: "info",
               message: "已取消",
             });
@@ -777,7 +777,7 @@ whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
         this.$nextTick(() => {
           loading.close();
         });
-        this.$resetMessage.success("重新识别成功");
+        this.$message.success("重新识别成功");
         if (res.data.data && res.data.data.label) {
           let labelListTag = [];
           if (res.data.data.label) {
@@ -811,7 +811,7 @@ whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
           // this.initDataList.push(...mark);
           // this.getText(this.totalRect);
           // this.showLabelList = this.getData2();
-          this.$resetMessage.error(res.data.message);
+          this.$message.error(res.data.message);
           if (this.isShibieimg == true) {
             this.isShibie = true;
           }
@@ -940,11 +940,11 @@ whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
               if (res.data.data) {
                 this.getData(res.data.data.indentify_result);
               }
-              // this.$resetMessage.error("暂无信息");
+              // this.$message.error("暂无信息");
             }
           };
         } else {
-          this.$resetMessage.error("暂无图片");
+          this.$message.error("暂无图片");
         }
       });
     },
@@ -1062,7 +1062,7 @@ whhESFie/lZUWRsk8M89Rkr8m5rwmBl+uLAd5LopyshFqKTBXeT2ytHP1JCQLPBO
           this.delIndex = "";
         })
         .catch(() => {
-          this.$resetMessage({
+          this.$message({
             type: "info",
             message: "已取消",
           });

+ 227 - 191
pingpu_vue/src/page/cbd/cbdDataPhotos.vue

@@ -164,9 +164,7 @@
                               <span>{{ item.num }}</span>
                             </div>
-                            <div
-                              class="result_listBox_btn"
-                            >
+                            <div class="result_listBox_btn">
                               <el-button
                                 @click="pictureDetailsFun(item, index)"
                                 size="mini"
@@ -194,7 +192,7 @@
           <!-- 暂无数据 -->
           <div class="expertDiagnosis_referral_units_not" v-else>
             <img
-              :src="$imghost + zanwu"
+              src="../../../static/images/quexingye.png"
               alt
               class="expertDiagnosis_referral_units_notImg"
             />
@@ -225,7 +223,7 @@
           background
           layout="prev, pager, next,jumper"
           :total="totalNum"
-          :page-size="8"
+          :page-size="12"
           @current-change="changePage"
           v-if="imgListShow"
         >
@@ -537,172 +535,172 @@ import "viewerjs/dist/viewer.css";
 // import { isArray, time } from "highcharts";
 // import { Texture } from "../../../../static/js/three";
 Vue.use(Viewer);
-Viewer.setDefaults({
-  inline: false,
-  button: true, //右上角按钮
-  navbar: false, //底部缩略图
-  title: false, //当前图片标题
-  toolbar: false, //底部工具栏
-  tooltip: true, //显示缩放百分比
-  movable: true, //是否可以移动
-  zoomable: true, //是否可以缩放
-  rotatable: true, //是否可旋转
-  scalable: true, //是否可翻转
-  // transition: false, //使用 CSS3 过度
-  fullscreen: false, //播放时是否全屏
-  keyboard: true, //是否支持键盘
-  ready: function (e) {
-    // console.log(e.type, '组件以初始化')
-  },
-  show: function (e) {
-    console.log(e.type, "图片显示开始");
-    // var iconBox = document.getElementById("iconBox");
-    // iconBox.style.display = "flex";
-  },
-  shown: function (e) {},
-  hide: function (e) {
-    // this.offGridding()
-    console.log(e.type, "图片隐藏完成");
-    // console.log(document.getElementById("ceshiID"));
-    // var domData = document.getElementById("reseau");
-    // var html = "";
-    // domData.innerHTML = html;
-    // var iconBox = document.getElementById("iconBox");
-    // iconBox.style.display = "none";
-  },
-  hidden: function (e) {
-    var domData = document.getElementById("reseau");
-    var html = "";
-    domData.innerHTML = html;
-    console.log(e.type, "图片隐藏结束");
-  },
-  view: function (e) {},
-  viewed: function (e) {
-    console.log("8001");
-    var iconDom = document.getElementById("iconDom");
-    var j = JSON.stringify(iconDom);
-    var g = j.indexOf("icon2");
-    if (g !== -1) {
-      var b;
-      var c;
-      var a = e.path[0].ownerDocument.images[20].outerHTML;
-      b = a.split('style="');
-      c = b[1].split('">');
-      var f = c[0];
-      var t = f.replace("margin-top", "top");
-      var y = t.replace("margin-left", "left");
-      var x = y + "z-index:10000;";
-      var q = x.replace("width: ", "");
-      var o = q.replace("max-width: ", "");
-      o = o.replace("relative", "absolute");
-      var domData = document.getElementById("reseau");
-      var imgs = "./../../../static/images/gridding/2.png";
-
-      var html =
-        '<div class="griddingLine" v-show="iconShow">' +
-        '<img src="' +
-        imgs +
-        '" alt="" class="" ' +
-        'style="' +
-        o +
-        '"' +
-        " />" +
-        "</div>";
-      domData.innerHTML = html;
-    }
-  },
-  zoom: function (e) {
-    console.log("8002");
-    var iconDom = document.getElementById("iconDom");
-    var j = JSON.stringify(iconDom);
-    var g = j.indexOf("icon2");
-    console.log(g);
-    if (g !== -1) {
-      var b;
-      var c;
-      var imgs = "./../../../static/images/gridding/2.png";
-
-      console.log("----------------------------------");
-      console.log(e.detail.originalEvent);
-      console.log("----------------------------------");
-      // if (e.detail.originalEvent.path !== undefined) {
-      if (e.detail.originalEvent !== null) {
-        console.log("我运行了这里");
-        var a = e.detail.originalEvent.path[0].outerHTML;
-        b = a.split('style="');
-        c = b[1].split('">');
-        var f = c[0];
-        var t = f.replace("margin-top", "top");
-        var y = t.replace("margin-left", "left");
-        var x = y + "z-index:10000;";
-        // var q = x.replace("width: ", "");
-        var o = x.replace("max-width: ", "");
-        o = o.replace("relative", "absolute");
-        console.log(o);
-      } else {
-      }
-
-      var domData = document.getElementById("reseau");
-      var html =
-        '<div class="griddingLine" v-show="iconShow" style="overflow: hidden;' +
-        o +
-        '" >' +
-        '<img src="' +
-        imgs +
-        '" alt="" class="" ' +
-        'style="' +
-        o +
-        '"' +
-        " />" +
-        "</div>";
-      domData.innerHTML = html;
-    }
-  },
-  zoomed: function (e) {
-    console.log("这里被运行了");
-    var iconDom = document.getElementById("iconDom");
-    var j = JSON.stringify(iconDom);
-    var g = j.indexOf("icon2");
-    var imgs = "./../../../static/images/gridding/2.png";
-    if (g !== -1) {
-      // if (e.detail.originalEvent.path !== undefined) {
-      if (e.detail.originalEvent !== null) {
-        var b;
-        var c;
-        var a = e.detail.originalEvent.path[0].outerHTML;
-        b = a.split('style="');
-        c = b[1].split('">');
-        var f = c[0];
-        var t = f.replace("margin-top", "top");
-        var y = t.replace("margin-left", "left");
-        var x = y + "z-index:10000;";
-        // var q = x.replace("width: ", "");
-        var o = x.replace("max-width: ", "");
-        o = o.replace("relative", "absolute");
-        var imgo = o.replace("absolute", "none");
-        var imgo = imgo.replace("width: ", "");
-        var domData = document.getElementById("reseau");
-        var html =
-          '<div class="griddingLine" v-show="iconShow" style="overflow: hidden;' +
-          o +
-          '" >' +
-          '<img src="' +
-          imgs +
-          '" alt="" class="" ' +
-          'style="' +
-          imgo +
-          '"' +
-          " />" +
-          '<div style="color: red; font-weight: 550; float: left; position: absolute; left: 3.5rem;bottom: .8rem; z-index: 10001; font-size: 15px;">' +
-          "*注:每个网格大小为20*20mm" +
-          "</div>" +
-          "</div>";
-        domData.innerHTML = html;
-      } else {
-      }
-    }
-  },
-});
+// Viewer.setDefaults({
+//   inline: false,
+//   button: true, //右上角按钮
+//   navbar: false, //底部缩略图
+//   title: false, //当前图片标题
+//   toolbar: false, //底部工具栏
+//   tooltip: true, //显示缩放百分比
+//   movable: true, //是否可以移动
+//   zoomable: true, //是否可以缩放
+//   rotatable: true, //是否可旋转
+//   scalable: true, //是否可翻转
+//   // transition: false, //使用 CSS3 过度
+//   fullscreen: false, //播放时是否全屏
+//   keyboard: true, //是否支持键盘
+//   ready: function (e) {
+//     // console.log(e.type, '组件以初始化')
+//   },
+//   show: function (e) {
+//     console.log(e.type, "图片显示开始");
+//     // var iconBox = document.getElementById("iconBox");
+//     // iconBox.style.display = "flex";
+//   },
+//   shown: function (e) {},
+//   hide: function (e) {
+//     // this.offGridding()
+//     console.log(e.type, "图片隐藏完成");
+//     // console.log(document.getElementById("ceshiID"));
+//     // var domData = document.getElementById("reseau");
+//     // var html = "";
+//     // domData.innerHTML = html;
+//     // var iconBox = document.getElementById("iconBox");
+//     // iconBox.style.display = "none";
+//   },
+//   hidden: function (e) {
+//     var domData = document.getElementById("reseau");
+//     var html = "";
+//     // domData.innerHTML = html;
+//     console.log(e.type, "图片隐藏结束");
+//   },
+//   view: function (e) {},
+//   viewed: function (e) {
+//     console.log("8001");
+//     var iconDom = document.getElementById("iconDom");
+//     var j = JSON.stringify(iconDom);
+//     var g = j.indexOf("icon2");
+//     if (g !== -1) {
+//       var b;
+//       var c;
+//       var a = e.path[0].ownerDocument.images[20].outerHTML;
+//       b = a.split('style="');
+//       c = b[1].split('">');
+//       var f = c[0];
+//       var t = f.replace("margin-top", "top");
+//       var y = t.replace("margin-left", "left");
+//       var x = y + "z-index:10000;";
+//       var q = x.replace("width: ", "");
+//       var o = q.replace("max-width: ", "");
+//       o = o.replace("relative", "absolute");
+//       var domData = document.getElementById("reseau");
+//       var imgs = "./../../../static/images/gridding/2.png";
+
+//       var html =
+//         '<div class="griddingLine" v-show="iconShow">' +
+//         '<img src="' +
+//         imgs +
+//         '" alt="" class="" ' +
+//         'style="' +
+//         o +
+//         '"' +
+//         " />" +
+//         "</div>";
+//       domData.innerHTML = html;
+//     }
+//   },
+//   zoom: function (e) {
+//     console.log("8002");
+//     var iconDom = document.getElementById("iconDom");
+//     var j = JSON.stringify(iconDom);
+//     var g = j.indexOf("icon2");
+//     console.log(g);
+//     if (g !== -1) {
+//       var b;
+//       var c;
+//       var imgs = "./../../../static/images/gridding/2.png";
+
+//       console.log("----------------------------------");
+//       console.log(e.detail.originalEvent);
+//       console.log("----------------------------------");
+//       // if (e.detail.originalEvent.path !== undefined) {
+//       if (e.detail.originalEvent !== null) {
+//         console.log("我运行了这里");
+//         var a = e.detail.originalEvent.path[0].outerHTML;
+//         b = a.split('style="');
+//         c = b[1].split('">');
+//         var f = c[0];
+//         var t = f.replace("margin-top", "top");
+//         var y = t.replace("margin-left", "left");
+//         var x = y + "z-index:10000;";
+//         // var q = x.replace("width: ", "");
+//         var o = x.replace("max-width: ", "");
+//         o = o.replace("relative", "absolute");
+//         console.log(o);
+//       } else {
+//       }
+
+//       var domData = document.getElementById("reseau");
+//       var html =
+//         '<div class="griddingLine" v-show="iconShow" style="overflow: hidden;' +
+//         o +
+//         '" >' +
+//         '<img src="' +
+//         imgs +
+//         '" alt="" class="" ' +
+//         'style="' +
+//         o +
+//         '"' +
+//         " />" +
+//         "</div>";
+//       domData.innerHTML = html;
+//     }
+//   },
+//   zoomed: function (e) {
+//     console.log("这里被运行了");
+//     var iconDom = document.getElementById("iconDom");
+//     var j = JSON.stringify(iconDom);
+//     var g = j.indexOf("icon2");
+//     var imgs = "./../../../static/images/gridding/2.png";
+//     if (g !== -1) {
+//       // if (e.detail.originalEvent.path !== undefined) {
+//       if (e.detail.originalEvent !== null) {
+//         var b;
+//         var c;
+//         var a = e.detail.originalEvent.path[0].outerHTML;
+//         b = a.split('style="');
+//         c = b[1].split('">');
+//         var f = c[0];
+//         var t = f.replace("margin-top", "top");
+//         var y = t.replace("margin-left", "left");
+//         var x = y + "z-index:10000;";
+//         // var q = x.replace("width: ", "");
+//         var o = x.replace("max-width: ", "");
+//         o = o.replace("relative", "absolute");
+//         var imgo = o.replace("absolute", "none");
+//         var imgo = imgo.replace("width: ", "");
+//         var domData = document.getElementById("reseau");
+//         var html =
+//           '<div class="griddingLine" v-show="iconShow" style="overflow: hidden;' +
+//           o +
+//           '" >' +
+//           '<img src="' +
+//           imgs +
+//           '" alt="" class="" ' +
+//           'style="' +
+//           imgo +
+//           '"' +
+//           " />" +
+//           '<div style="color: red; font-weight: 550; float: left; position: absolute; left: 3.5rem;bottom: .8rem; z-index: 10001; font-size: 15px;">' +
+//           "*注:每个网格大小为20*20mm" +
+//           "</div>" +
+//           "</div>";
+//         domData.innerHTML = html;
+//       } else {
+//       }
+//     }
+//   },
+// });
 export default {
   data() {
     return {
@@ -977,7 +975,7 @@ export default {
     };
   },
   mounted() {
-    // this.imgListData(); //图片列表数据请求
+    this.imgListData(); //图片列表数据请求
     // this.rainCharge(); //监测该设备是否在雨控状态
     // 测试获取当前设备的设备添加时间
     // this.deviceAddTime()
@@ -1216,7 +1214,7 @@ export default {
     },
     // 列表图片加载失败
     errImg(e) {
-      e.target.src = $imghost + "/images/expertDiagnosis/ku/noData.jpg";
+      e.target.src = $http + "/images/expertDiagnosis/ku/noData.jpg";
     },
     // 图片全选
     handleCheckAllChange(val) {
@@ -1275,7 +1273,7 @@ export default {
       if (flag == 3) {
         //删除
         if (this.idList.length == 0) {
-          this.$resetMessage.warning("请选择要删除的图片!");
+          this.$message.warning("请选择要删除的图片!");
         } else {
           this.delImgFun(this.idList);
         }
@@ -1313,14 +1311,53 @@ export default {
         this.deleTab = false;
       }
       if (flag == 8) {
-        var a = {};
+        // var a = {};
+        var arr = [];
         for (let i = 0; i < this.dataList.length; i++) {
-          setTimeout(() => {
-            a["link" + i] = document.createElement("a"); // 创建a标签
-            a["link" + i].href = this.dataList[i].addr;
-            a["link" + i].download = "下载图片"; // 重命名文件
-            a["link" + i].click();
-          }, i * 1000);
+          //   setTimeout(() => {
+          //     a["link" + i] = document.createElement("a"); // 创建a标签
+          //     a["link" + i].href = this.dataList[i].addr;
+          //     a["link" + i].download = "下载图片"; // 重命名文件
+          //     a["link" + i].click();
+          //   }, i * 1000);
+          arr.push(this.dataList[i].ids);
+        }
+        if (arr.length) {
+          this.$axios({
+            method: "POST",
+            url: "api/img_download",
+            data: this.qs.stringify({
+              img_id: arr.join(","),
+              device_type: 5,
+            }),
+            headers: {
+              // 这里需要使用form-data格式数据发送请求
+              "Content-Type": "application/x-www-form-urlencoded",
+            },
+            responseType: "blob",
+          })
+            .then((res) => {
+              console.log(res);
+              const elink = document.createElement("a");
+              elink.download = "img.zip";
+              elink.style.display = "none";
+              const blob = new Blob([res.data], { type: "application/zip" });
+              const href = URL.createObjectURL(blob);
+              elink.href = href;
+              document.body.appendChild(elink);
+              elink.click();
+              document.body.removeChild(elink);
+              window.URL.revokeObjectURL(href);
+            })
+            .catch(() => {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.error("请求图片资源超时,请稍后重试");
+              }
+            });
+        } else {
+          if (document.getElementsByClassName("el-message").length == 0) {
+            this.$message.warning("请选择下载图片");
+          }
         }
       }
       // 下载图片取消
@@ -1396,7 +1433,7 @@ export default {
         }),
       }).then((res) => {
         if (res.data.message == "") {
-          this.$resetMessage.success("指令下发成功!");
+          this.$message.success("指令下发成功!");
         }
       });
     },
@@ -2191,11 +2228,10 @@ export default {
           }).then((res) => {
             if (res.data.message == "") {
               if (document.getElementsByClassName("el-message").length == 0) {
-
-              this.$message({
-                type: "success",
-                message: "删除成功!",
-              });
+                this.$message({
+                  type: "success",
+                  message: "删除成功!",
+                });
               }
               this.equipStatusCheck("4");
               this.imgListData(); //图片列表数据请求
@@ -2464,7 +2500,7 @@ export default {
           });
         } else {
           if (document.getElementsByClassName("el-message").length == 0) {
-          this.$message.warning(res.data.message);
+            this.$message.warning(res.data.message);
           }
           this.currentImage =
             this.pictureDetailsFunDataObj.indentify_photo ||
@@ -2524,14 +2560,14 @@ export default {
       }).then((res) => {
         if (res.data.data) {
           if (document.getElementsByClassName("el-message").length == 0) {
-          this.$message.success("提交成功!");
+            this.$message.success("提交成功!");
           }
           this.$nextTick(() => {
             this.renderData(JSON.parse(res.data.data));
           });
         } else {
           if (document.getElementsByClassName("el-message").length == 0) {
-          this.$message.warning(res.data.message);
+            this.$message.warning(res.data.message);
           }
         }
         this.pictureDetailsFunDataObj.indentify_photo = "";
@@ -2567,7 +2603,7 @@ export default {
         .catch((err) => {
           console.log(err);
           if (document.getElementsByClassName("el-message").length == 0) {
-          this.$message.error("操作失败,请重试!");
+            this.$message.error("操作失败,请重试!");
           }
         });
     },

+ 7 - 3
pingpu_vue/src/page/crop/crop.vue

@@ -21,7 +21,7 @@
               placeholder="请输入农作物名称"
             ></el-input>
           </div>
-          <div class="btnbox">查询</div>
+          <div class="btnbox" @click="inquire">查询</div>
         </div>
       </div>
     </div>
@@ -31,7 +31,7 @@
         :data="tableData"
         stripe
         style="width: 100%"
-        height="530"
+        height="560px"
       >
         <el-table-column prop="crop_image" label="图片">
           <template slot-scope="scope">
@@ -124,6 +124,10 @@ export default {
     toamend(id) {
       this.$router.push("/index/cropadd?id=" + id);
     },
+    inquire(){
+      this.page = 1
+      this.getcroplist()
+    },
     getcroplist() {
       this.$axios({
         method: "POST",
@@ -159,7 +163,7 @@ export default {
               if (document.getElementsByClassName("el-message").length == 0) {
               this.$message.success("删除成功");
               }
-              this.page = 1
+              // this.page = 1
               this.getcroplist()
             } else {
               if (document.getElementsByClassName("el-message").length == 0) {

+ 42 - 24
pingpu_vue/src/page/crop/cropadd.vue

@@ -44,7 +44,7 @@
             <el-form-item label="农作物图片" prop="cropimage">
               <el-upload
                 class="avatar-uploader"
-                :action="http + '/api/v2/util/upload/img/'"
+                :action="$http + '/api/util/upload/img/'"
                 :show-file-list="false"
                 :on-success="handleAvatarSuccess"
                 :before-upload="beforeAvatarUpload"
@@ -70,18 +70,9 @@
       <el-table :data="tableData" style="width: 100%">
         <el-table-column prop="cycle_name" label="生长周期名称" width="180">
           <template slot-scope="scope">
-            <p v-show="!scope.row.nameinput">
-              {{ scope.row.cycle_name }}
-              <i
-                class="el-icon-edit"
-                color="#4f71ff"
-                @click="scope.row.nameinput = true"
-              ></i>
-            </p>
             <el-input
               v-model="scope.row.cycle_name"
               :autofocus="true"
-              v-show="scope.row.nameinput"
               size="mini"
               placeholder="请输入内容"
               :maxlength="6"
@@ -176,7 +167,7 @@
             <i
               class="el-icon-remove-outline"
               @click="deldata(scope.row)"
-              style="color: red"
+              style="color: red;cursor: pointer;"
             ></i>
           </template>
         </el-table-column>
@@ -190,7 +181,6 @@
       title="选择病虫害"
       :visible.sync="dialogVisible"
       width="580px"
-      :before-close="handleClose"
       top="3%"
       :close-on-click-modal="false"
     >
@@ -203,7 +193,7 @@
               placeholder="请输入病虫害名称"
             ></el-input>
           </div>
-          <div class="btnbox" @click="getwormlist">查询</div>
+          <div class="btnbox" @click="inquire">查询</div>
         </div>
         <div class="bot_table" v-loading="loading">
           <el-table
@@ -235,6 +225,7 @@
             :total="total"
             :page-size="8"
             @current-change="handleCurrentChange"
+            v-if="pageloading"
           >
           </el-pagination>
         </div>
@@ -258,6 +249,13 @@ export default {
   components: {},
   data() {
     //这里存放数据
+    var validatePass = (rule, value, callback) => {
+      if (value === "") {
+        callback(new Error("请选择农作物图片"));
+      } else {
+        callback();
+      }
+    };
     return {
       id: "",
       title: "",
@@ -276,7 +274,7 @@ export default {
         },
         cropvariety: {
           required: true,
-          message: "请输入作物名称",
+          message: "请输入物作品种",
           trigger: "blur",
         },
         cropcolor: {
@@ -286,7 +284,7 @@ export default {
         },
         cropimage: {
           required: true,
-          message: "请输入农作物图片",
+          validator: validatePass,
           trigger: "blur",
         },
       },
@@ -350,6 +348,7 @@ export default {
       page: 1,
       total: 8,
       sellistcontainer: {},
+      pageloading: false,
     };
   },
   //监听属性 类似于data概念
@@ -363,7 +362,7 @@ export default {
       this.$router.go(-1);
     },
     handleAvatarSuccess(res, file) {
-      this.ruleForm.cropimage2 = this.http + res.data.items.img_url;
+      this.ruleForm.cropimage2 = this.$http + res.img_url;
       this.ruleForm.cropimage = URL.createObjectURL(file.raw);
     },
     handleAvatarError(res) {
@@ -397,20 +396,31 @@ export default {
       this.tableData.splice(this.tableData.indexOf(data), 1);
     },
     sellist(data) {
+      this.wormname = "";
+      this.page = 1;
       this.sellistcontainer = data;
       this.dialogVisible = true;
       this.wormcode = "2";
       this.getwormlist();
+      this.pageloading = false;
     },
     sellistdis(data) {
+      this.wormname = "";
+      this.page = 1;
       this.sellistcontainer = data;
       this.dialogVisible = true;
       this.wormcode = "1";
       this.getwormlist();
+      this.pageloading = false;
     },
     handleSelectionChange(val) {
       this.multipleSelection = val;
     },
+    inquire() {
+      this.pageloading = false;
+      this.page = 1;
+      this.getwormlist();
+    },
     getwormlist() {
       this.loading = true;
       this.$axios({
@@ -423,16 +433,17 @@ export default {
           pest_name: this.wormname,
         }),
       }).then((res) => {
+        this.pageloading = true;
         this.loading = false;
         if (res.data.data) {
           this.wormtable = res.data.data.data;
           this.total = res.data.data.nums;
-          this.$nextTick(() => {
-            document.getElementsByClassName("number")[0].innerText = "首页";
-            var length = document.getElementsByClassName("number").length;
-            document.getElementsByClassName("number")[length - 1].innerText =
-              "末页";
-          });
+          // this.$nextTick(() => {
+          //   document.getElementsByClassName("number")[0].innerText = "首页";
+          //   var length = document.getElementsByClassName("number").length;
+          //   document.getElementsByClassName("number")[length - 1].innerText =
+          //     "末页";
+          // });
         }
       });
     },
@@ -484,8 +495,9 @@ export default {
             }).then((res) => {
               if (res.data.data) {
                 this.$message.success("添加成功");
+                this.goBackPage();
               } else {
-                this.$message.error("添加失败");
+                this.$message.error(res.data.message);
               }
             });
           } else if (this.title == "修改农作物") {
@@ -503,8 +515,9 @@ export default {
             }).then((res) => {
               if (res.data.data) {
                 this.$message.success("修改成功");
+                this.goBackPage();
               } else {
-                this.$message.error("修改失败");
+                this.$message.error(res.data.message);
               }
             });
           }
@@ -532,6 +545,10 @@ export default {
           this.ruleForm.cropcolor = data.crop_colors;
           this.ruleForm.cropimage2 = data.crop_image;
           this.tableData = data.cycle_list;
+          for(var i=0;i<this.tableData.length;i++){
+            this.tableData[i]['nameinput'] = false
+          } 
+          console.log(this.tableData)
         }
       });
     },
@@ -669,6 +686,7 @@ export default {
     align-items: center;
     .selp {
       color: #4f71ff;
+      cursor: pointer;
     }
   }
   /deep/.el-tag {

+ 27 - 15
pingpu_vue/src/page/crop/evildata.vue

@@ -45,6 +45,9 @@
           </p>
         </div>
         <el-row :gutter="20">
+          <div class="none" v-if="!wormlist.length">
+            <img src="../../../static/images/quexingye.png" alt="">
+          </div>
           <el-col :span="6" v-for="(item, index) in wormlist" :key="index">
             <div class="wormimgbox">
               <div class="imgbox">
@@ -68,6 +71,7 @@
         </el-row>
         <div class="pagination">
           <el-pagination
+          v-if="paginationload"
             background
             layout="prev, pager, next,jumper"
             :total="total"
@@ -81,7 +85,7 @@
     <div class="evillist">
       <div class="evillist_title">
         <p>识别排名</p>
-        <div class="btnbox" @click="recognitionVisible = true">
+        <div class="btnbox" @click="recognitionVisible = true;wormdisdata.url=''">
           <span>{{ wormordisindex == 2 ? "害虫识别" : "病害识别" }}</span>
         </div>
       </div>
@@ -141,7 +145,7 @@
               <el-form-item label="病虫害图片" prop="img_urls">
                 <el-upload
                   class="avatar-uploader"
-                  :action="http + '/api/v2/util/upload/img/'"
+                  :action="$http + '/api/util/upload/img/'"
                   :show-file-list="false"
                   :on-success="handleAvatarSuccess"
                   :before-upload="beforeAvatarUpload"
@@ -210,7 +214,7 @@
           <el-form-item label="识别图片" prop="url">
             <el-upload
               class="avatar-uploader"
-              :action="http + '/api/v2/util/upload/img/'"
+              :action="$http + '/api/util/upload/img/'"
               :show-file-list="false"
               :on-success="handleAvatarSuccess2"
               :before-upload="beforeAvatarUpload2"
@@ -291,9 +295,7 @@ export default {
         url: "",
         img_file: "",
       },
-      rules: {
-        url: { required: true, message: "请选择识别图片", trigger: "change" },
-      },
+      paginationload:false
     };
   },
   //监听属性 类似于data概念
@@ -318,12 +320,14 @@ export default {
       });
     },
     tabwormordisindex(index) {
+      this.paginationload = false
       this.page = 1;
       this.wormordisindex = index;
       this.getwormlist();
       this.getranking();
     },
     handleCurrentChange(e) {
+      console.log(e)
       this.page = e;
       this.getwormlist();
     },
@@ -340,17 +344,18 @@ export default {
         }),
       }).then((res) => {
         this.loading = false;
+        this.paginationload = true
         if (res.data.data) {
           this.wormlist = res.data.data.data;
           this.total = res.data.data.nums;
           this.wormnum = res.data.data.pest_nums;
           this.diseasenum = res.data.data.disease_nums;
-          this.$nextTick(() => {
-            document.getElementsByClassName("number")[0].innerText = "首页";
-            var length = document.getElementsByClassName("number").length;
-            document.getElementsByClassName("number")[length - 1].innerText =
-              "末页";
-          });
+          // this.$nextTick(() => {
+          //   document.getElementsByClassName("number")[0].innerText = "首页";
+          //   var length = document.getElementsByClassName("number").length;
+          //   document.getElementsByClassName("number")[length - 1].innerText =
+          //     "5";
+          // });
         }
       });
     },
@@ -389,8 +394,8 @@ export default {
         });
     },
     handleAvatarSuccess(res, file) {
-      console.log(this.http, res);
-      this.addedfrom.img_urls2 = this.http + res.data.items.img_url;
+      console.log(this.$http, res);
+      this.addedfrom.img_urls2 = this.$http + res.img_url;
       this.addedfrom.img_urls = URL.createObjectURL(file.raw);
     },
     handleAvatarError(res) {
@@ -512,7 +517,7 @@ export default {
       this.adddialogVisible = true;
     },
     handleAvatarSuccess2(res, file) {
-      this.wormdisdata.url = this.http + res.data.items.img_url;
+      this.wormdisdata.url = this.$http + res.img_url;
       this.wormdisdata.img_file = file;
     },
     handleAvatarError2(res) {
@@ -684,12 +689,18 @@ export default {
           height: 40px;
           text-align: center;
           line-height: 40px;
+          cursor: pointer;
         }
         .selp {
           color: #4f71ff;
           border-bottom: 3px solid #4f71ff;
         }
       }
+      .none{
+        width: 100%;
+        display: flex;
+        justify-content: space-around;
+      }
       .wormimgbox {
         width: 100%;
         height: 240px;
@@ -735,6 +746,7 @@ export default {
               text-align: center;
               color: #fff;
               height: 15px;
+              cursor: pointer;
             }
             p:first-child {
               border-right: 1px solid rgba(255, 255, 255, 0.8);

+ 362 - 0
pingpu_vue/src/page/fault/faultinfo.vue

@@ -0,0 +1,362 @@
+<!--  -->
+<template>
+  <div class="fauilbox">
+    <div class="baselistbox_top">
+      <div class="baselistbox_top_title">
+        <p>故障信息</p>
+      </div>
+      <p class="baselistbox_top_line"></p>
+      <div class="baselistbox_top_search">
+        <div class="left_search">
+          <div class="firstsearch">
+            <span class="biaoti">设备ID</span>
+            <el-input
+              v-model="queryInfo.f_id"
+              size="mini"
+              placeholder="请输入设备ID或名称"
+            ></el-input>
+          </div>
+          <div class="secsearch">
+            <span class="biaoti">设备类型</span>
+            <el-select
+              v-model="queryInfo.type"
+              size="mini"
+              filterable
+              placeholder="请选择"
+            >
+              <el-option
+                v-for="item in options"
+                :key="item.value"
+                :label="item.label"
+                :value="item.value"
+              >
+              </el-option>
+            </el-select>
+          </div>
+        </div>
+        <div class="right_search">
+          <div class="btnbox" @click="searchChange">查询</div>
+          <div class="btnbox2" @click="empty">重置</div>
+        </div>
+      </div>
+    </div>
+    <div class="baselistbox_table">
+      <el-table
+        v-loading="loading"
+        :data="faultlist"
+        stripe
+        style="width: 100%"
+        height="560px"
+        :default-sort="{ prop: 'device_name', order: 'addtime' }"
+      >
+        <el-table-column
+          prop="device_name"
+          sortable
+          label="设备类型"
+          width="120"
+        >
+          <template slot-scope="scope">{{
+            basetype[scope.row.device_type]
+          }}</template>
+        </el-table-column>
+        <el-table-column prop="imei" label="设备ID" width="180">
+          <template slot-scope="scope">{{ scope.row.device_id }}</template>
+        </el-table-column>
+        <el-table-column prop="addr" label="位置" width="350">
+        </el-table-column>
+        <el-table-column
+          prop="user"
+          label="联系人"
+          width="100"
+        ></el-table-column>
+        <el-table-column prop="userphone" sortable label="电话" width="150">
+        </el-table-column>
+        <el-table-column prop="errordesc" label="故障信息" width="350">
+        </el-table-column>
+        <el-table-column prop="uptime" label="故障时间" width="180">
+          <template slot-scope="scope">{{
+            (scope.row.uptime * 1000) | formatTime
+          }}</template>
+        </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <span
+              :style="{
+                color: scope.row.errorimg == '' ? '#BFBFBF' : '#4f71ff',
+                marginRight: '15px',
+                cursor: scope.row.errorimg == '' ? 'not-allowed' : 'pointer',
+              }"
+              @click="seeimg(scope.row.errorimg)"
+              >故障图片</span
+            >
+            <span
+              :style="{
+                color: scope.row.errorvideo == '' ? '#BFBFBF' : '#4f71ff',
+                marginRight: '15px',
+                cursor: scope.row.errorvideo == '' ? 'not-allowed' : 'pointer',
+              }"
+              @click="seevideo(scope.row.errorvideo)"
+              >故障视频</span
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination">
+        <el-pagination
+          background
+          layout="prev, pager, next,sizes,jumper"
+          :total="totalNum"
+          :page-sizes="[10, 20, 30, 50]"
+          :page-size="10"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+        >
+        </el-pagination>
+      </div>
+    </div>
+    <viewer v-show="imageListtstatus" :images="imageListtData" @inited="inited">
+      <img v-for="(src, index) in imageListtData" :src="src" :key="index" />
+    </viewer>
+    <el-dialog title="故障视频" :visible.sync="videodialogVisible" width="35%">
+      <div>
+        <video width="100%" :src="$http + videosrc" controls autoplay></video>
+      </div>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: {},
+  data() {
+    //这里存放数据
+    return {
+      options: [
+        {
+          value: "3",
+          label: "虫情",
+        },
+        {
+          value: "8",
+          label: "墒情",
+        },
+        {
+          value: "5",
+          label: "气象",
+        },
+        {
+          value: "7",
+          label: "病害",
+        },
+        {
+          value: "6",
+          label: "监控",
+        },
+      ],
+      basetype: {
+        3: "虫情监测",
+        8: "墒情监测",
+        5: "气象监测",
+        7: "病害监测",
+        6: "监控设备",
+      },
+      queryInfo: {
+        type: "",
+        f_id: "",
+      },
+      totalNum: 10,
+      page: 1,
+      page_size: 10,
+      faultlist: [],
+      loading: false,
+      imageListtstatus: false,
+      imageListtData: [],
+      videodialogVisible: false,
+      videosrc: "",
+    };
+  },
+  //监听属性 类似于data概念
+  computed: {},
+  //监控data中的数据变化
+  watch: {},
+  //方法集合
+  methods: {
+    searchChange() {
+      this.getfaultlist();
+    },
+    empty() {
+      this.queryInfo = {
+        type: "",
+        f_id: "",
+      };
+      this.getfaultlist();
+    },
+    handleSizeChange(e) {
+      this.page = 1;
+      this.page_size = e;
+      this.getfaultlist();
+    },
+    handleCurrentChange(e) {
+      this.page = e;
+      this.getfaultlist();
+    },
+    getfaultlist() {
+      this.loading = true;
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=after_sale.after_sale_manage.aftersale_info",
+        data: this.qs.stringify({
+          device_type_id: this.queryInfo.type,
+          f_id: this.queryInfo.f_id,
+          page: this.page,
+          page_size: this.page_size,
+        }),
+      }).then((res) => {
+        this.loading = false;
+        console.log(res);
+        if (res.data.data) {
+          this.faultlist = res.data.data.data;
+          this.totalNum = res.data.data.counts;
+        }
+      });
+    },
+    seeimg(img) {
+      // this.imageListtstatus = true
+      if (img!="") {
+        this.imageListtData = img.split(",");
+        console.log(this.imageListtData);
+        this.$viewer.show();
+        console.log(img);
+      }
+    },
+    seevideo(videosrc) {
+      if (videosrc != "") {
+        this.videosrc = videosrc;
+        this.videodialogVisible = true;
+      }
+    },
+    inited(viewer) {
+      this.$viewer = viewer;
+    },
+  },
+  beforeCreate() {}, //生命周期 - 创建之前
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.getfaultlist();
+  },
+  beforeMount() {}, //生命周期 - 挂载之前
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang="less" scoped>
+.fauilbox {
+  width: 100%;
+  height: 100%;
+  .baselistbox_top {
+    width: 100%;
+    height: 130px;
+    background-color: #fff;
+    border-radius: 10px;
+    .baselistbox_top_title {
+      width: 100%;
+      height: 65px;
+      display: flex;
+      padding: 20px;
+      box-sizing: border-box;
+      line-height: 25px;
+      justify-content: space-between;
+      p:first-child {
+        font-size: 18px;
+        font-weight: 700;
+      }
+    }
+    .baselistbox_top_line {
+      width: 100%;
+      height: 1px;
+      background-color: #f2f2f2;
+    }
+    .baselistbox_top_search {
+      width: 100%;
+      height: 68px;
+      display: flex;
+      padding: 20px;
+      box-sizing: border-box;
+      line-height: 28px;
+      justify-content: space-between;
+      .left_search {
+        display: flex;
+        .firstsearch,
+        .secsearch {
+          display: flex;
+          margin-right: 40px;
+          /deep/.el-input {
+            width: 240px;
+          }
+          .biaoti {
+            font-size: 14px;
+            margin-right: 20px;
+          }
+        }
+      }
+      .right_search {
+        display: flex;
+        .btnbox,
+        .btnbox2 {
+          width: 68px;
+          height: 28px;
+          border: 1px solid #4f71ff;
+          text-align: center;
+          border-radius: 3px;
+          font-size: 14px;
+          margin-left: 20px;
+          cursor: pointer;
+        }
+        .btnbox {
+          background-color: #4f71ff;
+          color: #fff;
+        }
+        .btnbox2 {
+          color: #4f71ff;
+        }
+      }
+    }
+  }
+  .baselistbox_table {
+    width: 100%;
+    // height: calc(100% - 140px);
+    background-color: #fff;
+    margin-top: 10px;
+    padding: 20px;
+    box-sizing: border-box;
+    position: relative;
+    border-radius: 10px;
+    /deep/.el-table__header {
+      th {
+        background-color: #f1f1f3;
+      }
+    }
+    .pagination {
+      display: flex;
+      justify-content: flex-end;
+      margin-top: 20px;
+      /deep/.el-pager {
+        .active {
+          background-color: #4f71ff !important;
+        }
+      }
+      /deep/.el-input__inner:hover {
+        border-color: #4f71ff;
+      }
+    }
+  }
+}
+</style>

Fichier diff supprimé car celui-ci est trop grand
+ 1097 - 0
pingpu_vue/src/page/gis/gisshow.vue


Fichier diff supprimé car celui-ci est trop grand
+ 256 - 957
pingpu_vue/src/page/home/Home.vue


+ 123 - 77
pingpu_vue/src/page/index/index.vue

@@ -7,18 +7,20 @@
         <p>智慧社区管理平台</p>
       </div>
       <div class="projectbox_top_right">
-        <img
-          src="../../../static/images/index/xxld.png"
-          alt=""
-          class="lingdang"
-        />
+        <div class="lingdangbox">
+          <img
+            src="../../../static/images/index/xxld.png"
+            alt=""
+            class="lingdang"
+            @click="towarn"
+          />
+          <p class="lingdang_dian" v-show="warningtf"></p>
+        </div>
         <p class="right_line"></p>
-        <img
-          src="../../../static/images/index/touxiang.png"
-          alt=""
-          class="touxiang"
-        />
-        <p>管理员1号</p>
+        <p>{{ username }}</p>
+        <p class="tuichu">
+          <i class="el-icon-switch-button" @click="quit"></i>
+        </p>
       </div>
     </div>
     <div class="projectbox_textbox">
@@ -43,14 +45,14 @@
                 v-if="item.children"
               >
                 <template slot="title">
-                  <!-- <img src="../../../" alt=""> -->
+                  <img :src="iconObj[item.pur_id]" alt="" />
                   <span>{{ item.purview_name }}</span>
                 </template>
                 <el-menu-item
-                  :index="'/index' + '/' + subItem.menu"
                   v-for="subItem in item.children"
                   @click="subMenuClick(subItem.menu, item, subItem.pur_id)"
                   :key="subItem.pur_id"
+                  :index="subItem.pur_id.toString()"
                 >
                   <template slot="title">
                     <span>{{ subItem.purview_name }}</span>
@@ -58,16 +60,11 @@
                 </el-menu-item>
               </el-submenu>
               <el-menu-item
-                :index="'/index' + '/' + item.menu"
+                :index="item.pur_id.toString()"
                 @click="homepage(item.menu)"
                 v-else
               >
-                <i
-                  :style="{
-                    fontSize: '16px',
-                  }"
-                  :class="iconObj[item.pur_id]"
-                ></i>
+                <img :src="iconObj[item.pur_id]" alt="" />
                 <span slot="title">{{ item.purview_name }}</span>
               </el-menu-item>
             </div>
@@ -98,52 +95,52 @@ export default {
       menuList2: [],
       menuActiveId: "",
       iconObj: {
-        20: "iconfont icon-shujuzhanshi",
-        22: "iconfont icon-shebei",
-        25: "iconfont icon-jidi",
-        28: "iconfont icon-xitong",
-        36: "iconfont icon-cebaoguanli",
-        40: "iconfont icon-huanjingjiance",
-        42: "iconfont icon-jiankong",
-        44: "iconfont icon-fangzhi",
-        46: "iconfont icon-nongchangguanli",
-        48: "iconfont icon-nongshiguanli",
-        58: "iconfont icon-suyuan",
-        124: "iconfont icon-zhuanjia",
-        129: "iconfont icon-shouhou",
-        155: "iconfont icon-banshou",
-        157: "iconfont icon-chidao",
-        164: "iconfont icon-suyuan",
-        168: "iconfont icon-chumiaoqi",
-        184: "iconfont icon-shuibeng",
-        185: "iconfont icon-wenshidapeng",
-        19: "iconfont icon-shouye",
-        179: "iconfont icon-qian",
-        233: "iconfont icon-wenshidapeng",
-        // 208: "iconfont icon-shuibeng",//114
-        202: "iconfont icon-shuibeng", //正式服
-        231: "iconfont icon-shuibeng", //正式服
+        1: "../../../static/images/index/sy.png",
+        2: "../../../static/images/index/gis.png",
+        3: "../../../static/images/index/hjjc.png",
+        4: "../../../static/images/index/sqjc.png",
+        5: "../../../static/images/index/ccjc.png",
+        6: "../../../static/images/index/ksny.png",
+        7: "../../../static/images/index/bhjc.png",
+        8: "../../../static/images/index/xxgl.png",
+        10: "../../../static/images/index/zjzd.png",
+        11: "../../../static/images/index/jdgl.png",
+        12: "../../../static/images/index/yjxx.png",
+        13: "../../../static/images/index/user.png",
+        14: "../../../static/images/index/base.png",
       },
+      username: "",
+      warningtf: false,
     };
   },
   //监听属性 类似于data概念
   computed: {},
   //监控data中的数据变化
-  watch: {},
+  watch: {
+    "$route.path": function (newVal) {
+      // console.log(newVal)
+      this.getpath();
+    },
+  },
   //方法集合
   methods: {
     getNavList() {
       this.$axios({
         method: "POST",
         url: "/api/api_gateway?method=user.login.user_login_info",
+        data: this.qs.stringify({
+          // pp_token:""
+        }),
       }).then((res) => {
-        console.log(res);
+        console.log(res.data);
         var data = res.data.data.children;
-        this.menuList2 = [];
+        this.username = res.data.data.username;
         this.menuList1 = [];
         for (let i = 0; i < data.length; i++) {
           this.menuList1.push(data[i]);
         }
+        localStorage.setItem("menu", JSON.stringify(this.menuList1));
+        this.getpath();
       });
     },
     homepage(menu) {
@@ -152,31 +149,72 @@ export default {
     subMenuClick(menu) {
       this.$router.push("/index/" + menu);
     },
-    getlogin() {
+    getpath() {
+      var path = String(this.$route.path); //获取当前页面路由
+      // console.log(path);
+      var indexnum = path.indexOf("/", 1); //第一个/的位置
+      // console.log(indexnum);
+      var indexnum2 = path.indexOf("/", indexnum + 1); //带有参数是第二个/位置
+      // console.log(indexnum2);
+      var newpath = "";
+      if (indexnum2 == -1) {
+        newpath = path.slice(indexnum + 1); //获取当前页面路由名称
+      } else {
+        newpath = path.slice(indexnum + 1, indexnum2); //获取当前页面路由名称
+      }
+      console.log(newpath);
+      for (var i = 0; i < this.menuList1.length; i++) {
+        if (newpath == this.menuList1[i].menu) {
+          this.menuActiveId = this.menuList1[i].pur_id.toString();
+          // console.log(this.menuActiveId)
+        } else {
+          console.log(this.menuList1[i].children);
+          if (this.menuList1[i].children) {
+            var data = this.menuList1[i].children;
+            for (var j = 0; j < data.length; j++) {
+              console.log(data[j].menu);
+              if (newpath == data[j].menu) {
+                this.menuActiveId = data[j].pur_id.toString();
+                console.log(this.menuActiveId);
+              }
+            }
+          }
+        }
+      }
+    },
+    towarn() {
+      this.$router.push("/index/earlywarning");
+    },
+    quit() {
+      localStorage.removeItem("menu");
+      localStorage.removeItem("keys");
+      this.$router.push("/login");
+    },
+    //预警提示
+    getwarningread() {
       this.$axios({
         method: "POST",
-        url: "/api/api_gateway?method=user.login.login_user",
-        data: this.qs.stringify({
-          password: "hnyfadmin",
-          username: "管理员",
-        }),
+        url: "/api/api_gateway?method=device.device_picture.warning_read",
+        data: this.qs.stringify({}),
       }).then((res) => {
-        if (res.data.data) {
-          // console.log(res.data.data.session_key)
-          var key = res.data.data.session_key;
-          localStorage.setItem("keys", key);
-        }
+        console.log(res);
+        this.warningtf = res.data.data;
       });
     },
   },
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
-  created() {},
+  created() {
+    this.getNavList();
+    this.getwarningread();
+  },
   beforeMount() {}, //生命周期 - 挂载之前
   //生命周期 - 挂载完成(可以访问DOM元素)
   mounted() {
-    this.getlogin();
-    this.getNavList();
+    // this.getNavList();
+    setInterval(()=>{
+      this.getwarningread();
+    },600000)
   },
   beforeUpdate() {}, //生命周期 - 更新之前
   updated() {}, //生命周期 - 更新之后
@@ -186,7 +224,6 @@ export default {
 };
 </script>
 <style lang="less" scoped>
-
 p {
   margin: 0;
 }
@@ -221,24 +258,32 @@ li {
     .projectbox_top_right {
       display: flex;
       .right_line {
-        height: 80%;
+        height: 40%;
         width: 1px;
         background-color: #fff;
-        margin-top: 5px;
+        margin-top: 12px;
+        margin-right: 10px;
       }
-      .lingdang {
-        width: 27px;
-        height: 27px;
-        vertical-align: middle;
-        margin-top: 5px;
-        margin-right: 20px;
+      .lingdangbox {
+        position: relative;
+        .lingdang {
+          width: 27px;
+          height: 27px;
+          vertical-align: middle;
+          margin-right: 10px;
+        }
+        .lingdang_dian{
+          width: 8px;
+          height: 8px;
+          background-color: red;
+          border-radius: 8px;
+          position: absolute;
+          top: 8px;
+          right: 12px;
+        }
       }
-      .touxiang {
-        width: 30px;
-        height: 30px;
-        vertical-align: middle;
-        margin: 5px 15px 0 25px;
-        border-radius: 50%;
+      .tuichu {
+        margin-left: 10px;
       }
     }
   }
@@ -265,6 +310,7 @@ li {
       /deep/.is-active {
         background-color: rgba(40, 100, 238, 0.08);
         border-right: 3px solid #4f71ff;
+        color: #303133 !important;
       }
       /deep/.el-submenu {
         background-color: transparent;

+ 162 - 0
pingpu_vue/src/page/login/login.vue

@@ -0,0 +1,162 @@
+<!--  -->
+<template>
+  <div class="loginbox">
+    <div class="logininfobox">
+      <div class="logininfo">
+        <div class="title">
+          <p>数字迁安</p>
+          <p>三情监测管理系统</p>
+        </div>
+        <div class="info">
+          <el-form
+            :model="ruleForm"
+            :rules="rules"
+            ref="ruleForm"
+            label-width="100px"
+            class="demo-ruleForm"
+            label-position="top"
+          >
+            <el-form-item label="账号" prop="username">
+              <el-input
+                v-model="ruleForm.username"
+                placeholder="请输入账号"
+              ></el-input>
+            </el-form-item>
+            <el-form-item label="密码" prop="password">
+              <el-input
+                v-model="ruleForm.password"
+                type="password"
+                placeholder="请输入密码"
+              ></el-input>
+            </el-form-item>
+          </el-form>
+        </div>
+        <div class="btn" @click="register">登 录</div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: {},
+  data() {
+    //这里存放数据
+    return {
+      ruleForm: {
+        password: "",
+        username: "",
+      },
+      rules: {
+        username: { required: true, message: "请输入账号", trigger: "blur" },
+        password: { required: true, message: "请输入密码", trigger: "blur" },
+      },
+    };
+  },
+  //监听属性 类似于data概念
+  computed: {},
+  //监控data中的数据变化
+  watch: {},
+  //方法集合
+  methods: {
+    register() {
+      this.$refs["ruleForm"].validate((valid) => {
+        if (valid) {
+          this.$axios({
+            method: "POST",
+            url: "/api/api_gateway?method=user.login.login_user",
+            data: this.qs.stringify({
+              username: this.ruleForm.username,
+              password: this.ruleForm.password,
+            }),
+          }).then((res) => {
+            if (res.data.message == "") {
+              console.log(res.data.session_key);
+              var key = res.data.data.session_key;
+              localStorage.setItem("keys", key);
+              this.$router.push("/index/home");
+              localStorage.setItem("username", this.ruleForm.username);
+              localStorage.setItem("myuid", res.data.data.data.myuid);
+            } else {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.error(res.data.message);
+              }
+            }
+          });
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+  },
+  beforeCreate() {}, //生命周期 - 创建之前
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  beforeMount() {}, //生命周期 - 挂载之前
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang="less" scoped>
+.loginbox {
+  width: 100%;
+  height: 100vh;
+  background-image: url("../../../static/images/login/loginbg.png");
+  background-size: 100% 100%;
+  display: flex;
+  justify-content: flex-end;
+  .logininfobox {
+    width: 700px;
+    height: 100%;
+    background-color: #fff;
+    padding: 0 150px;
+    box-sizing: border-box;
+    display: flex;
+    flex-direction: column;
+    justify-content: center;
+    .logininfo {
+      margin-bottom: 50px;
+      .title {
+        width: 100%;
+        text-align: center;
+        color: #333333;
+        p:first-child {
+          font-size: 36px;
+        }
+        p:last-child {
+          font-size: 26px;
+          margin-top: 15px;
+        }
+      }
+      .info {
+        margin-top: 50px;
+        /deep/.el-form-item {
+          margin-bottom: 15px;
+        }
+        /deep/.el-input__inner {
+          border: 0;
+          background-color: #edf7ff;
+        }
+      }
+      .btn {
+        background-color: #4f71ff;
+        font-size: 18px;
+        text-align: center;
+        padding: 10px 0;
+        color: #fff;
+        border-radius: 8px;
+        margin-top: 40px;
+      }
+    }
+  }
+}
+</style>

+ 4 - 4
pingpu_vue/src/page/monitor/Monitor.vue

@@ -164,8 +164,8 @@
             @click="checkPlayType(0)"
             class="playtype0"
           ></div>
-          <div @click="addEquip()" class="addequip"></div>
-          <div @click="bindingSIM()" class="addequipA"></div>
+          <!-- <div @click="addEquip()" class="addequip"></div> -->
+          <!-- <div @click="bindingSIM()" class="addequipA"></div> -->
           <!-- 绑定SIM卡及SIM卡查询 -->
           <!--  <div style="width: 140px; display: flex; margin: 0 auto">
            
@@ -1067,7 +1067,7 @@ export default {
       this.activeIndex = index; //菜单选中状态
       this.id = device_id; //保存选中的设备id
       this.$axios({
-        url: "/api/api_gateway?method=camera.camera_manage.addr_camera",
+        url: "/api/api_gateway?method=camera.camera_manage.addr_camera_list",
         method: "POST",
         data: this.qs.stringify({ device_id: device_id }),
       }).then((res) => {
@@ -1813,7 +1813,7 @@ li {
   }
   .monitor_hint {
     position: fixed;
-    top: 105px;
+    top: 60px;
     left: 200px;
     height: 30px;
     line-height: 30px;

+ 5 - 9
pingpu_vue/src/page/monitor/PhotoView.vue

@@ -38,16 +38,12 @@
               <el-card style="height: 272px">
                 <!-- <img :src="src.addr" class="image" /> -->
                 <img v-lazy="src.addr" id="viewerDom" v-viewer class="image" />
-                <span class="time">{{
-                  (src.addtime * 1000) | formatTime
-                }}</span>
-                <span
+                <!-- <span
                   class="del iconfont icon-shanchu"
                   @click="delPhoto(src)"
-                ></span>
+                ></span> -->
                 <div class="bottom">
-                  <!-- <img src="@/assets/images/forecasting/monitor/icon.png" /> -->
-                  病情识别
+                  {{ (src.addtime * 1000) | formatTime }}
                 </div>
               </el-card>
             </el-col>
@@ -60,7 +56,7 @@
           v-if="images.length <= 0"
         >
           <img
-            :src="$imghost + zanwu"
+            src="../../../static/images/quexingye.png"
             alt
             class="expertDiagnosis_referral_units_notImg"
           />
@@ -280,7 +276,7 @@ export default {
       border-color: #4f71ff;
     }
   }
-  .expertDiagnosis_referral_units_not{
+  .expertDiagnosis_referral_units_not {
     width: 264px;
     margin: 0 auto;
   }

+ 1 - 0
pingpu_vue/src/page/qxz/Data24.vue

@@ -985,6 +985,7 @@ export default {
                     });
                   }
                   this.realTimeAxios(); //实时状态数据请求
+                  this.setFactorShow = false
                 } else {
                   if (
                     document.getElementsByClassName("el-message").length == 0

+ 5 - 3
pingpu_vue/src/page/qxz/HistoryData.vue

@@ -196,6 +196,7 @@ export default {
     },
     timechange(e) {
       console.log(e);
+      this.flag = true
       if (e) {
         this.start_time = Math.floor(+new Date(e[0]) / 1000);
         this.end_time = Math.floor(+new Date(e[1]) / 1000);
@@ -233,8 +234,7 @@ export default {
         }
         console.log(begin, end);
         window.location.href =
-          this.$deriveData +
-          // "http://8.136.98.49:8002"+
+          this.$http +
           "/api/qxz_data_export?device_id=" +
           that.queryInfo.device_id +
           "&filename=" +
@@ -267,7 +267,7 @@ export default {
               type: "success",
             });
           }
-          // this.$resetMessage.success("刷新成功");
+          // this.$message.success("刷新成功");
           setTimeout(() => {
             this.getHisDataList();
             // this.refreshload = false;
@@ -441,6 +441,7 @@ export default {
           line-height: 26px;
           background-color: #4f71ff;
           color: #fff;
+          cursor: pointer;
         }
       }
       .search_right {
@@ -454,6 +455,7 @@ export default {
           font-size: 14px;
           margin-right: 20px;
           line-height: 26px;
+          cursor: pointer;
         }
         .timebtn1 {
           background-color: #4f71ff;

+ 30 - 17
pingpu_vue/src/page/qxz/envi.vue

@@ -12,7 +12,7 @@
               >{{ onewarning.device_id | subDeviceId }}
               {{ onewarning.warning_content }}
             </div>
-            <i class="iconfont el-icon-message-solid"></i>
+            <i class="el-icon-bell"></i>
           </div>
           <ul
             class="warningInfoList"
@@ -104,7 +104,7 @@
         :data="equipList"
         stripe
         style="width: 100%"
-        height="530"
+        height="560px"
         :default-sort="{ order: 'uptime' }"
       >
         <el-table-column label="设备名称" width="180">
@@ -203,8 +203,9 @@
       <div class="set_item">
         <span>设备编号</span><span>{{ equipInfo.equip_id }}</span>
       </div>
-      <div class="set_item" v-if="equipInfo.equip_name">
-        <span>设备名称</span><span>{{ equipInfo.equip_name }}</span>
+      <div class="set_item">
+        <span>设备名称</span>
+        <el-input size="mini" v-model="equipInfo.equip_name" placeholder="请输入内容" style="width:200px;" :maxlength="10"></el-input>
       </div>
       <div class="tit">上传时间间隔</div>
       <div class="set_item">
@@ -407,12 +408,12 @@ export default {
             // this.totalNum = res.data.data.nums;
           }
           this.loading = false;
-          this.$nextTick(() => {
-            document.getElementsByClassName("number")[0].innerText = "首页";
-            var length = document.getElementsByClassName("number").length;
-            document.getElementsByClassName("number")[length - 1].innerText =
-              "末页";
-          });
+          // this.$nextTick(() => {
+          //   document.getElementsByClassName("number")[0].innerText = "首页";
+          //   var length = document.getElementsByClassName("number").length;
+          //   document.getElementsByClassName("number")[length - 1].innerText =
+          //     "末页";
+          // });
         })
         .catch(() => {
           this.$message.error("获取数据失败!");
@@ -487,12 +488,14 @@ export default {
           device_type_id: 5,
           d_id: this.equipInfo.d_id,
           config: JSON.stringify(this.setFrom),
+          device_name:this.equipInfo.equip_name
         }),
       }).then((res) => {
         if (res.data.message == "") {
           if (document.getElementsByClassName("el-message").length == 0) {
             this.$message.success("操作成功");
           }
+          this.getEquipList()
         } else {
           if (document.getElementsByClassName("el-message").length == 0) {
             this.$message.err("操作失败");
@@ -538,18 +541,18 @@ export default {
             var phone = {};
             this.phoneNumber = phone;
           }
-
+          this.phoneNumberA = res.data.data.phone
           for (var i = 1; i <= len; i++) {
             var key = "e" + i;
             if (data[key]) {
               var conftxt = data[key].split("#")[0];
               if (phone.dat) {
                 if (phone.dat[key]) {
-                  var type = phone.dat[key].split("#")[0];
+                  var type = phone.dat[key].split("#")[0]==0?false:true;
                   var alarmVal = phone.dat[key].split("#")[1];
                   console.log(111111111);
                 } else {
-                  var type = 0;
+                  var type = false;
                   var alarmVal = "";
                   console.log(222222222);
                 }
@@ -691,7 +694,9 @@ export default {
         }),
       }).then((res) => {
         if (res.data.data == true) {
-          this.hjjcWarningList();
+          // this.warningList = []
+          // this.hjjcWarningPage = 1
+          // this.hjjcWarningList();
         }
       });
     },
@@ -706,7 +711,9 @@ export default {
       }).then((res) => {
         console.log(res.data.data);
         if (res.data.data == true) {
-          this.hjjcWarningList();
+          // this.warningList = []
+          // this.hjjcWarningPage = 1
+          // this.hjjcWarningList();
         }
       });
     },
@@ -784,12 +791,15 @@ export default {
         flex-direction: column;
         align-items: flex-end;
         position: relative;
+        border: 1px solid #C0C4CC;
+        border-radius: 25px;
+        padding: 0 15px;
         .title {
           width: 100%;
-          padding: 5px 10px;
+          // padding: 5px 10px;
           border-radius: 15px;
           margin-bottom: 10px;
-          background: #fff;
+          // background: #fff;
           display: flex;
           align-items: center;
           justify-content: space-between;
@@ -940,6 +950,9 @@ export default {
   .sliderParent {
     flex: 1;
   }
+  /depp/.el-input__inner{
+    width: 200px !important;
+  }
 }
 /deep/.el-slider__button {
   border: 2px solid #4f71ff;

+ 52 - 0
pingpu_vue/src/page/specialist/specialist.vue

@@ -0,0 +1,52 @@
+<!--  -->
+<template>
+  <div class="speciabox">
+    <iframe
+      :src="`http://103.89.185.161:3010/#/start?token=`+keys+`&code=zhwd`"
+      frameborder="0"
+      class="iframe"
+    ></iframe>
+  </div>
+</template>
+
+<script>
+//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: {},
+  data() {
+    //这里存放数据
+    return {
+        keys:localStorage.getItem("zg_keys")
+    };
+  },
+  //监听属性 类似于data概念
+  computed: {},
+  //监控data中的数据变化
+  watch: {},
+  //方法集合
+  methods: {},
+  beforeCreate() {}, //生命周期 - 创建之前
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {},
+  beforeMount() {}, //生命周期 - 挂载之前
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang="less" scoped>
+.speciabox {
+  width: 100%;
+  height: 100%;
+  .iframe {
+    width: 100%;
+    height: 100%;
+  }
+}
+</style>

+ 2 - 0
pingpu_vue/src/page/sqz/Data24.vue

@@ -1004,6 +1004,7 @@ export default {
     // },
 
     amendFactor(data) {
+      console.log(data)
       var name = data.name; //修改值
       var type = data.type; //原来值
       var ekey = data.ekey; //通道名
@@ -1036,6 +1037,7 @@ export default {
                     });
                   }
                   this.realTimeAxios(); //实时状态数据请求
+                  this.setFactorShow = false
                 } else {
                   if (
                     document.getElementsByClassName("el-message").length == 0

+ 24 - 11
pingpu_vue/src/page/sqz/HistoryData.vue

@@ -18,25 +18,25 @@
         <div class="search_right">
           <div
             :class="timeindex == 1 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
-            @click="empty(1)"
+            @click="empty(1),flag = true;"
           >
             近一天
           </div>
           <div
             :class="timeindex == 2 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
-            @click="empty(2)"
+            @click="empty(2),flag = true;"
           >
             近七天
           </div>
           <div
             :class="timeindex == 3 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
-            @click="empty(3)"
+            @click="empty(3),flag = true;"
           >
             近一月
           </div>
           <div
             :class="timeindex == 4 ? 'timebtn timebtn1' : 'timebtn timebtn2'"
-            @click="empty(4)"
+            @click="empty(4),flag = true;"
           >
             近三月
           </div>
@@ -66,6 +66,7 @@
             scope.row[scope.column.property]
           }}</template>
         </el-table-column>
+        <el-table-column label="" prop=""></el-table-column>
       </el-table>
       <div class="pagination">
         <el-pagination
@@ -168,6 +169,7 @@ export default {
         device_id: this.$route.params.id,
         page: 1,
       },
+      flag:false
     };
   },
   //监听属性 类似于data概念
@@ -200,10 +202,15 @@ export default {
     },
     timechange(e) {
       console.log(e);
-      this.start_time = Math.floor(+new Date(e[0]) / 1000);
-      this.end_time = Math.floor(+new Date(e[1]) / 1000);
-      this.page = 1;
-      this.getHisDataList();
+      this.flag = true
+      if (e) {
+        this.start_time = Math.floor(+new Date(e[0]) / 1000);
+        this.end_time = Math.floor(+new Date(e[1]) / 1000);
+        this.page = 1;
+        this.getHisDataList();
+      } else {
+        this.empty(1);
+      }
     },
     // 导出
     deriveData() {
@@ -233,8 +240,7 @@ export default {
         }
         console.log(begin, end);
         window.location.href =
-          this.$deriveData +
-          // "http://8.136.98.49:8002"+
+          this.$http +
           "/api/qxz_data_export?device_id=" +
           that.queryInfo.device_id +
           "&filename=" +
@@ -267,7 +273,7 @@ export default {
               type: "success",
             });
           }
-          // this.$resetMessage.success("刷新成功");
+          // this.$message.success("刷新成功");
           setTimeout(() => {
             this.getHisDataList();
             // this.refreshload = false;
@@ -364,6 +370,11 @@ export default {
           }
         } else {
           this.hisData = [];
+          if (!this.flag) {
+            if (this.timeindex != 4) {
+              this.empty(this.timeindex + 1);
+            }
+          }
         }
       });
     },
@@ -443,6 +454,7 @@ export default {
           line-height: 26px;
           background-color: #4f71ff;
           color: #fff;
+          cursor: pointer;
         }
       }
       .search_right {
@@ -456,6 +468,7 @@ export default {
           font-size: 14px;
           margin-right: 20px;
           line-height: 26px;
+          cursor: pointer;
         }
         .timebtn1 {
           background-color: #4f71ff;

+ 216 - 22
pingpu_vue/src/page/sqz/sqz.vue

@@ -4,6 +4,63 @@
     <div class="baselistbox_top">
       <div class="baselistbox_top_title">
         <p>墒情监测</p>
+        <div class="warningInfo" v-if="warningList.length !== 0">
+          <div class="title" @click="showWarningInfo">
+            <div>
+              <i class="iconfont el-icon-s-order" style="margin-right: 10px"></i
+              >{{ onewarning.device_id | subDeviceId }}
+              {{ onewarning.warning_content }}
+            </div>
+            <i class="el-icon-bell"></i>
+          </div>
+          <ul
+            class="warningInfoList"
+            v-if="isWarningList"
+            v-infinite-scroll="load"
+            infinite-scroll-delay="200"
+            infinite-scroll-immediate="false"
+          >
+            <li @click="oneWarningList()">
+              <div style="padding-left: 10px">
+                <i class="iconfont el-icon-s-promotion"></i>一键已读
+              </div>
+            </li>
+            <li v-for="(item, index) in warningList" :key="index">
+              <el-popover placement="left" trigger="click" style="">
+                <div style="padding: 5px 0px; width: 500px">
+                  设备编号:{{ item.device_id }}
+                </div>
+                <div style="padding: 5px 0px; width: 500px; line-height: 30px">
+                  详细信息:{{
+                    setData(
+                      item.ekey,
+                      item.current_value,
+                      item.warning_content,
+                      item.set_value
+                    )
+                  }}
+                </div>
+                <el-button
+                  slot="reference"
+                  @click="yidu(item.d_id)"
+                  style="background-color: transparent"
+                >
+                  <i class="circle" v-if="item.status == 0"></i>
+                  <div
+                    style="width: 60%; text-align: left"
+                    :class="item.status == 0 ? 'active' : ''"
+                  >
+                    {{ item.device_id | subDeviceId }}
+                    {{ item.warning_content }}
+                  </div>
+                  <span :class="item.status == 0 ? 'active' : ''">{{
+                    (item.upltime * 1000) | formatTime
+                  }}</span>
+                </el-button>
+              </el-popover>
+            </li>
+          </ul>
+        </div>
       </div>
       <p class="baselistbox_top_line"></p>
       <div class="baselistbox_top_search">
@@ -46,7 +103,7 @@
         :data="equipList"
         stripe
         style="width: 100%"
-        height="530"
+        height="560px"
         :default-sort="{ order: 'uptime' }"
       >
         <el-table-column label="设备名称" width="180">
@@ -70,12 +127,6 @@
           label="信号强度"
           width="120"
         ></el-table-column>
-        <!-- <el-table-column prop="dver" label="设备版本" width="280">
-          <template slot-scope="scope">
-            <div v-if="scope.row.dver">{{ scope.row.dver }}</div>
-            <div v-else>无</div>
-          </template>
-        </el-table-column> -->
         <el-table-column
           prop="uptime"
           sortable
@@ -151,8 +202,8 @@
       <div class="set_item">
         <span>设备编号</span><span>{{ equipInfo.equip_id }}</span>
       </div>
-      <div class="set_item" v-if="equipInfo.equip_name">
-        <span>设备名称</span><span>{{ equipInfo.equip_name }}</span>
+      <div class="set_item">
+        <span>设备名称</span> <el-input size="mini" v-model="equipInfo.equip_name" placeholder="请输入内容" style="width:200px;" :maxlength="10"></el-input>
       </div>
       <div class="tit">上传时间间隔</div>
       <div class="set_item">
@@ -311,6 +362,13 @@ export default {
       simLoading: false,
       id: "",
       totalNum: 0,
+      isWarningList: false,
+      warningList:[],
+      onewarning: {
+        warning_status: "",
+        device_id: "",
+      },
+      hjjcWarningPage:"",
     };
   },
   //监听属性 类似于data概念
@@ -349,12 +407,12 @@ export default {
             // this.totalNum = res.data.data.nums;
           }
           this.loading = false;
-          this.$nextTick(() => {
-            document.getElementsByClassName("number")[0].innerText = "首页";
-            var length = document.getElementsByClassName("number").length;
-            document.getElementsByClassName("number")[length - 1].innerText =
-              "末页";
-          });
+          // this.$nextTick(() => {
+          //   document.getElementsByClassName("number")[0].innerText = "首页";
+          //   var length = document.getElementsByClassName("number").length;
+          //   document.getElementsByClassName("number")[length - 1].innerText =
+          //     "末页";
+          // });
         })
         .catch(() => {
           this.$message.error("获取数据失败!");
@@ -429,12 +487,14 @@ export default {
           device_type_id: 8,
           d_id: this.equipInfo.d_id,
           config: JSON.stringify(this.setFrom),
+           device_name:this.equipInfo.equip_name
         }),
       }).then((res) => {
         if (res.data.message == "") {
           if (document.getElementsByClassName("el-message").length == 0) {
             this.$message.success("操作成功");
           }
+          this.getEquipList()
         } else {
           if (document.getElementsByClassName("el-message").length == 0) {
             this.$message.err("操作失败");
@@ -481,18 +541,18 @@ export default {
             var phone = {};
             this.phoneNumber = phone;
           }
-
+          that.phoneNumberA = res.data.data.phone;
           for (var i = 1; i <= len; i++) {
             var key = "e" + i;
             if (data[key]) {
               var conftxt = data[key].split("#")[0];
               if (phone.dat) {
                 if (phone.dat[key]) {
-                  var type = phone.dat[key].split("#")[0];
+                  var type = phone.dat[key].split("#")[0]==0?false:true;
                   var alarmVal = phone.dat[key].split("#")[1];
                   console.log(111111111);
                 } else {
-                  var type = 0;
+                  var type = false;
                   var alarmVal = "";
                   console.log(222222222);
                 }
@@ -620,11 +680,81 @@ export default {
       this.itemId = id;
       this.$router.push(`/index/sqzHistoryData/${id}/${d_id}`);
     },
+    // 点击预警信息
+    showWarningInfo() {
+      this.isWarningList = !this.isWarningList;
+    },
+    // 一键已读
+    oneWarningList() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=forecast.worm_lamp.qxz_warning",
+        data: this.qs.stringify({
+          status: "yes",
+          device_type:"8",
+        }),
+      }).then((res) => {
+        if (res.data.data == true) {
+          // this.warningList = []
+          // this.hjjcWarningPage = 1
+          // this.hjjcWarningList();
+        }
+      });
+    },
+    // 单条信息已读
+    yidu(id) {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=forecast.worm_lamp.qxz_warning",
+        data: this.qs.stringify({
+          d_id: id,
+          device_type:"8",
+        }),
+      }).then((res) => {
+        console.log(res.data.data);
+        if (res.data.data == true) {
+          // this.warningList = []
+          // this.hjjcWarningPage = 1
+          // this.hjjcWarningList();
+        }
+      });
+    },
+    // 测报灯信息预警
+    hjjcWarningList() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=forecast.worm_lamp.qxz_warning",
+        data: this.qs.stringify({
+          page: this.hjjcWarningPage,
+          device_type:"8",
+        }),
+      }).then((res) => {
+        var data = res.data.data.data;
+        for (var i = 0; i < data.length; i++) {
+          this.warningList.push(data[i]);
+        }
+        // this.warningList = res.data.data.data;
+        this.onewarning = this.warningList[0];
+      });
+    },
+    load() {
+      this.hjjcWarningPage++;
+      this.hjjcWarningList();
+    },
+    setData(data1, data2, data3, data4) {
+      const dw = data1.split("#")[1];
+      const res = `当前${data1.replace("#", data2)}${data3.replace(
+        "预警",
+        "用户设置预警值"
+      )}${data4}${dw}`;
+      return res;
+    },
   },
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
   created() {
     this.getEquipList();
+    this.hjjcWarningList();
   },
   beforeMount() {}, //生命周期 - 挂载之前
   //生命周期 - 挂载完成(可以访问DOM元素)
@@ -652,14 +782,78 @@ export default {
       padding: 20px;
       box-sizing: border-box;
       line-height: 25px;
+      justify-content: space-between;
       p:first-child {
-        font-size: 14px;
-        margin-right: 20px;
-      }
-      p:last-child {
         font-size: 18px;
         font-weight: 700;
       }
+      .warningInfo {
+        width: 30%;
+        font-size: 15px;
+        display: flex;
+        flex-direction: column;
+        align-items: flex-end;
+        position: relative;
+        border: 1px solid #C0C4CC;
+        border-radius: 25px;
+        padding: 0 15px;
+        .title {
+          width: 100%;
+          // padding: 5px 10px;
+          border-radius: 15px;
+          margin-bottom: 10px;
+          // background: #fff;
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+        }
+        .title > i {
+          color: #ccc !important;
+        }
+        .warningInfoList {
+          position: absolute;
+          right: 0px;
+          top: 45px;
+          z-index: 9;
+          width: 100%;
+          max-height: 310px;
+          padding: 5px 0px;
+          background: #fff;
+          box-shadow: 0px 5px 18px 0px #999;
+          overflow-y: scroll;
+          overflow-x: hidden;
+        }
+        /deep/ .el-button:focus {
+          border: none !important;
+          font-weight: 600 !important;
+          // font-size: 15px !important;
+          color: black !important;
+          background: #fff !important;
+          padding: 0;
+        }
+        /deep/ .el-button {
+          width: 100%;
+          font-size: 15px !important;
+          padding: 10px 10px !important;
+          color: rgb(26, 25, 25) !important;
+          border: none !important;
+        }
+        /deep/ .el-button > span {
+          display: flex;
+          align-items: center;
+          justify-content: space-between;
+        }
+        /deep/ .el-button > span .circle {
+          display: inline-block;
+          width: 5px;
+          height: 5px;
+          border-radius: 50%;
+          background: red;
+        }
+        .active {
+          color: red;
+        }
+      }
     }
     .baselistbox_top_line {
       width: 100%;

+ 573 - 0
pingpu_vue/src/page/user/userlist.vue

@@ -0,0 +1,573 @@
+<!-- 用户列表 -->
+<template>
+  <div class="userbox">
+    <div class="baselistbox_top">
+      <div class="baselistbox_top_title">
+        <p>虫情监测</p>
+      </div>
+      <p class="baselistbox_top_line"></p>
+      <div class="baselistbox_top_search">
+        <div class="left_search">
+          <div class="btnbox2" @click="adduser">新增</div>
+        </div>
+        <div class="right_search">
+          <div class="firstsearch">
+            <el-input
+              v-model="username"
+              size="mini"
+              placeholder="请输入用户名称"
+            ></el-input>
+          </div>
+          <div class="btnbox" @click="searchChange">查询</div>
+        </div>
+      </div>
+    </div>
+    <div class="baselistbox_table">
+      <el-table
+        v-loading="loading"
+        :data="userlist"
+        stripe
+        style="width: 100%"
+        height="560"
+        :default-sort="{ prop: 'user_name', order: 'create_time' }"
+      >
+        <el-table-column prop="user_name" sortable label="用户名">
+        </el-table-column>
+        <el-table-column prop="create_time" sortable label="创建时间">
+        </el-table-column>
+        <el-table-column prop="is_ziguang" label="是否专家">
+          <template slot-scope="scope" :title="scope.row.is_ziguang">{{
+            scope.row.is_ziguang ? "是" : "否"
+          }}</template>
+        </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <span
+              style="color: #4f71ff; margin-right: 15px; cursor: pointer"
+              @click="allocation(scope.row)"
+              >分配权限</span
+            >
+            <span
+              style="color: #4f71ff; margin-right: 15px; cursor: pointer"
+              @click="passdialogVisible = true;u_id=scope.row.uid"
+              >修改密码</span
+            >
+            <span
+              style="color: red; margin-right: 15px; cursor: pointer"
+              @click="deluser(scope.row.uid)"
+              >删除</span
+            >
+          </template>
+        </el-table-column>
+      </el-table>
+      <div class="pagination">
+        <el-pagination
+          background
+          layout="prev, pager, next,sizes,jumper"
+          :total="totalnum"
+          :page-sizes="[10, 20, 30, 50]"
+          :page-size="10"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+        >
+        </el-pagination>
+      </div>
+    </div>
+    <el-dialog
+      title="创建用户"
+      :visible.sync="dialogVisible"
+      width="580px"
+      :close-on-click-modal="false"
+    >
+      <div class="userinfobox">
+        <el-form
+          :model="ruleForm"
+          :rules="rules"
+          ref="ruleForm"
+          label-width="100px"
+          class="demo-ruleForm"
+        >
+          <el-form-item label="用户名称" prop="username">
+            <el-input
+              size="mini"
+              v-model="ruleForm.username"
+              :maxlength="10"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="用户密码" prop="password">
+            <el-input
+              size="mini"
+              type="password"
+              v-model="ruleForm.password"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="dialogVisible = false" size="mini">取 消</el-button>
+        <el-button type="primary" @click="sumbitinfo" size="mini"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+    <el-dialog
+      title="修改密码"
+      :visible.sync="passdialogVisible"
+      width="580px"
+      :close-on-click-modal="false"
+    >
+      <div class="userinfobox">
+        <el-form
+          :model="ruleForm2"
+          :rules="rules2"
+          ref="ruleForm2"
+          label-width="100px"
+          class="demo-ruleForm"
+        >
+          <el-form-item label="新密码" prop="password">
+            <el-input
+              size="mini"
+              v-model="ruleForm2.password"
+              type="password"
+            ></el-input>
+          </el-form-item>
+          <el-form-item label="确认新密码" prop="secpassword">
+            <el-input
+              size="mini"
+              type="password"
+              v-model="ruleForm2.secpassword"
+            ></el-input>
+          </el-form-item>
+        </el-form>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="passdialogVisible = false" size="mini">取 消</el-button>
+        <el-button type="primary" @click="amendpass" size="mini"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+    <el-dialog
+      title="分配权限"
+      :visible.sync="juridialogVisible"
+      width="580px"
+      :close-on-click-modal="false"
+    >
+      <div class="jurbox">
+        <el-tree
+          :data="jurdata"
+          show-checkbox
+          node-key="pur_id"
+          :props="defaultProps"
+          ref="tree"
+          :default-checked-keys="defKeys"
+        >
+        </el-tree>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="juridialogVisible = false" size="mini"
+          >取 消</el-button
+        >
+        <el-button type="primary" @click="authority" size="mini"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
+  </div>
+</template>
+
+<script>
+//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: {},
+  data() {
+    //这里存放数据
+    var validatePass2 = (rule, value, callback) => {
+      if (value == "") {
+        callback(new Error("请输入用户密码"));
+      } else if (value.length < 6) {
+        callback(new Error("用户密码最少输入6位"));
+      } else {
+        callback();
+      }
+    };
+    var validatePass = (rule, value, callback) => {
+      if (value == "") {
+        callback(new Error("请输入新密码"));
+      } else if (value.length < 6) {
+        callback(new Error("密码最少输入6位"));
+      } else if(value!=this.ruleForm2.password){
+        callback(new Error("俩次密码输入不一致"));
+      }else{
+        callback();
+      }
+    };
+    return {
+      username: "",
+      page: 1,
+      page_size: 10,
+      userlist: [],
+      totalnum: 10,
+      loading: false,
+      ruleForm: {
+        username: "",
+        password: "",
+      },
+      rules: {
+        username: {
+          required: true,
+          message: "请输入用户名称",
+          trigger: "blur",
+        },
+        password: {
+          required: true,
+          validator: validatePass2,
+          trigger: "blur",
+        },
+      },
+      dialogVisible: false,
+      juridialogVisible: false,
+      jurdata: [],
+      defaultProps: {
+        children: "children",
+        label: "purview_name",
+        id: "pur_id",
+      },
+      defKeys: [],
+      passdialogVisible:false,
+      ruleForm2:{
+        password:"",
+        secpassword:""
+      },
+      rules2:{
+        password: {
+          required: true,
+          validator: validatePass2,
+          trigger: "blur",
+        },
+        secpassword:{
+          required: true,
+          validator: validatePass,
+          trigger: "blur",
+        }
+      },
+      u_id:""
+    };
+  },
+  //监听属性 类似于data概念
+  computed: {},
+  //监控data中的数据变化
+  watch: {},
+  //方法集合
+  methods: {
+    adduser() {
+      this.dialogVisible = true;
+    },
+    searchChange() {
+      this.page = 1;
+      this.getuserlist();
+    },
+    handleSizeChange(e) {
+      this.page_size = e;
+      this.page = 1;
+      this.getuserlist();
+    },
+    handleCurrentChange(e) {
+      this.page = e;
+      this.getuserlist();
+    },
+    getuserlist() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=user.login.list_user",
+        data: this.qs.stringify({
+          username: this.username,
+          page: this.page,
+          page_size: this.page_size,
+        }),
+      }).then((res) => {
+        if (res.data.message == "") {
+          console.log(res.data.data.data);
+          this.userlist = res.data.data.data;
+          this.totalnum = res.data.data.total_num;
+        }
+      });
+    },
+    dataDetails() {},
+    allocation(e) {
+      this.jurdata = JSON.parse(localStorage.getItem("menu"));
+      this.jurdata[0].disabled = true;
+      var data = e.children;
+      this.defKeys = [1]
+      var arr = [];
+      for (var i = 0; i < data.length; i++) {
+        if (data[i].children) {
+          var childrens = data[i].children;
+          for (var j = 0; j < childrens.length; j++) {
+            arr.push(childrens[j].pur_id);
+          }
+        } else {
+          arr.push(data[i].pur_id);
+        }
+      }
+      this.defKeys = this.defKeys.concat(arr);
+      this.juridialogVisible = true;
+      this.u_id = e.uid;
+    },
+    authority() {
+      const keys = [
+        ...this.$refs.tree.getCheckedKeys(),
+        ...this.$refs.tree.getHalfCheckedKeys(),
+      ];
+      const idStr = keys.join(",");
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=user.perms.allot_perm",
+        data: this.qs.stringify({
+          uid: this.u_id,
+          role_perm: idStr,
+        }),
+      }).then((res) => {
+        if (res.data.message == "") {
+          if (document.getElementsByClassName("el-message").length == 0) {
+            this.$message.success("分配成功");
+          }
+          this.juridialogVisible = false;
+          this.getuserlist();
+        } else {
+          if (document.getElementsByClassName("el-message").length == 0) {
+            this.$message.error(res.data.message);
+          }
+        }
+      });
+    },
+    sumbitinfo() {
+      this.$refs["ruleForm"].validate((valid) => {
+        if (valid) {
+          this.$axios({
+            method: "POST",
+            url: "/api/api_gateway?method=user.login.create_user",
+            data: this.qs.stringify({
+              username: this.ruleForm.username,
+              password: this.ruleForm.password,
+            }),
+          }).then((res) => {
+            if (res.data.message == "") {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.success("创建成功");
+              }
+              this.dialogVisible = false;
+              this.getuserlist();
+            } else {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.error(res.data.message);
+              }
+            }
+          });
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+    amendpass(){
+      this.$refs["ruleForm2"].validate((valid) => {
+        if (valid) {
+          this.$axios({
+            method: "POST",
+            url: "/api/api_gateway?method=user.login.modify_pwd",
+            data: this.qs.stringify({
+              uid: this.u_id,
+              new_password: this.ruleForm2.secpassword,
+            }),
+          }).then((res) => {
+            if (res.data.message == "") {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.success("修改密码成功");
+              }
+              this.passdialogVisible = false;
+              this.getuserlist();
+            } else {
+              if (document.getElementsByClassName("el-message").length == 0) {
+                this.$message.error(res.data.message);
+              }
+            }
+          });
+        } else {
+          console.log("error submit!!");
+          return false;
+        }
+      });
+    },
+    deluser(id){
+      this.$confirm("此操作将删除该用户, 是否继续?", "提示", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning",
+      })
+        .then(() => {
+          this.$axios({
+            method: "post",
+            url: "api/api_gateway?method=user.login.del_user",
+            data: this.qs.stringify({
+              uid: id,
+            }),
+          }).then((res) => {
+            if (res.data.message == "") {
+              this.$message({
+                type: "success",
+                message: "删除成功!",
+              });
+              this.getuserlist();
+            } else {
+              this.$message({
+                type: "error",
+                message: res.data.message,
+              });
+            }
+          });
+        })
+        .catch(() => {
+          this.$message({
+            type: "info",
+            message: "已取消删除",
+          });
+        });
+    }
+  },
+  beforeCreate() {}, //生命周期 - 创建之前
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    this.getuserlist();
+  },
+  beforeMount() {}, //生命周期 - 挂载之前
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang="less" scoped>
+.userbox {
+  width: 100%;
+  height: 100%;
+  .baselistbox_top {
+    width: 100%;
+    height: 130px;
+    background-color: #fff;
+    border-radius: 10px;
+    .baselistbox_top_title {
+      width: 100%;
+      height: 65px;
+      display: flex;
+      padding: 20px;
+      box-sizing: border-box;
+      line-height: 25px;
+      justify-content: space-between;
+      p:first-child {
+        font-size: 18px;
+        font-weight: 700;
+      }
+    }
+    .baselistbox_top_line {
+      width: 100%;
+      height: 1px;
+      background-color: #f2f2f2;
+    }
+    .baselistbox_top_search {
+      width: 100%;
+      height: 68px;
+      display: flex;
+      padding: 20px;
+      box-sizing: border-box;
+      line-height: 28px;
+      justify-content: space-between;
+      .left_search {
+        display: flex;
+        .btnbox,
+        .btnbox2 {
+          width: 68px;
+          height: 28px;
+          border: 1px solid #4f71ff;
+          text-align: center;
+          border-radius: 3px;
+          font-size: 14px;
+          cursor: pointer;
+        }
+        .btnbox {
+          background-color: #4f71ff;
+          color: #fff;
+        }
+        .btnbox2 {
+          color: #4f71ff;
+        }
+      }
+      .right_search {
+        display: flex;
+        .firstsearch,
+        .secsearch {
+          display: flex;
+          margin-right: 40px;
+          /deep/.el-input {
+            width: 240px;
+          }
+          .biaoti {
+            font-size: 14px;
+            margin-right: 20px;
+          }
+        }
+        .btnbox,
+        .btnbox2 {
+          width: 68px;
+          height: 28px;
+          border: 1px solid #4f71ff;
+          text-align: center;
+          border-radius: 3px;
+          font-size: 14px;
+          margin-left: 20px;
+          cursor: pointer;
+        }
+        .btnbox {
+          background-color: #4f71ff;
+          color: #fff;
+        }
+        .btnbox2 {
+          color: #4f71ff;
+        }
+      }
+    }
+  }
+  .baselistbox_table {
+    width: 100%;
+    background-color: #fff;
+    margin-top: 10px;
+    padding: 20px;
+    box-sizing: border-box;
+    position: relative;
+    border-radius: 10px;
+    /deep/.el-table__header {
+      th {
+        background-color: #f1f1f3;
+      }
+    }
+    .pagination {
+      display: flex;
+      justify-content: flex-end;
+      margin-top: 20px;
+      /deep/.el-pager {
+        .active {
+          background-color: #4f71ff !important;
+        }
+      }
+      /deep/.el-input__inner:hover {
+        border-color: #4f71ff;
+      }
+    }
+  }
+}
+</style>

+ 631 - 0
pingpu_vue/src/page/worn/earlywarning.vue

@@ -0,0 +1,631 @@
+<!--  -->
+<template>
+  <div class="warnbox">
+    <div class="baselistbox_top">
+      <div class="baselistbox_top_title">
+        <p @click="goBackPage()" style="cursor: pointer">
+          <i class="el-icon-back"></i>
+          <span>返回</span>
+        </p>
+        <p>查看预警</p>
+      </div>
+      <div class="baselistbox_top_sel">
+        <el-select
+          v-model="warnvalue"
+          size="mini"
+          @change="tupechange"
+          placeholder="请选择"
+        >
+          <el-option
+            v-for="item in options"
+            :key="item.value"
+            :label="item.label"
+            :value="item.value"
+          >
+          </el-option>
+        </el-select>
+        <div class="btnbox" @click="allread">一键已读</div>
+      </div>
+    </div>
+    <div class="warnlistbox">
+      <div class="warnlistbox_text">
+        <!-- 测报灯 -->
+        <el-collapse accordion v-if="warnvalue == 1">
+          <el-collapse-item v-for="(item, index) in cbdinfo" :key="index">
+            <template slot="title">
+              <div class="warnlistbox_text_item" @click="read(item.d_id)">
+                <p :style="{ color: item.status == 1 ? '' : '#4f71ff' }">
+                  测报灯:
+                  {{ item.device_id }}
+                  {{ cbdtype[item.warning_status] }}
+                </p>
+                <p :style="{ color: item.status == 1 ? '' : '#4f71ff' }">
+                  {{
+                    item.status == 1 ? "已读" : "未读"
+                  }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{
+                    (item.upltime * 1000) | formatTime
+                  }}
+                </p>
+              </div>
+            </template>
+            <div style="display: flex">
+              <p v-for="(items, key) in item.warning_content" :key="key">
+                {{ key }}:{{ items }}
+                <span>、</span>
+              </p>
+            </div>
+          </el-collapse-item>
+        </el-collapse>
+        <!-- 墒情站 -->
+        <el-collapse accordion v-if="warnvalue == 2 || warnvalue == 3">
+          <el-collapse-item v-for="(item, index) in sqzinfo" :key="index">
+            <template slot="title">
+              <div class="warnlistbox_text_item" @click="read(item.d_id)">
+                <p :style="{ color: item.status == 1 ? '' : '#4f71ff' }">
+                  <span>{{ warnvalue == 2 ? "墒情站" : "气象站" }}:</span>
+                  {{ item.device_id }}
+                  {{ item.warning_content }}
+                </p>
+                <p :style="{ color: item.status == 1 ? '' : '#4f71ff' }">
+                  {{
+                    item.status == 1 ? "已读" : "未读"
+                  }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{
+                    (item.upltime * 1000) | formatTime
+                  }}
+                </p>
+              </div>
+            </template>
+            <div style="display: flex">
+              当前{{ item.ekey.split("#")[0] }}{{ item.current_value
+              }}{{ item.ekey.split("#")[1]
+              }}{{ item.warning_content.slice(0, 2) }}用户设置预警值{{
+                item.set_value
+              }}{{ item.ekey.split("#")[1] }}
+            </div>
+          </el-collapse-item>
+        </el-collapse>
+        <!-- 孢子仪 -->
+        <el-collapse accordion v-if="warnvalue == 4">
+          <el-collapse-item v-for="(item, index) in bzyinfo" :key="index">
+            <template slot="title">
+              <div class="warnlistbox_text_item" @click="read(item.d_id)">
+                <p :style="{ color: item.status == 1 ? '' : '#4f71ff' }">
+                  <span>病害监测:</span>
+                  {{ item.device_id }}
+                  {{ item.title }}
+                </p>
+                <p :style="{ color: item.status == 1 ? '' : '#4f71ff' }">
+                  {{
+                    item.status == 1 ? "已读" : "未读"
+                  }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{
+                    (item.upltime * 1000) | formatTime
+                  }}
+                </p>
+              </div>
+            </template>
+            <div style="display: flex">
+              {{ item.describe }}
+            </div>
+          </el-collapse-item>
+        </el-collapse>
+        <!-- 农作物 -->
+        <el-collapse accordion v-if="warnvalue == 5">
+          <el-collapse-item v-for="(item, index) in cropinfo" :key="index">
+            <template slot="title">
+              <div class="warnlistbox_text_item" @click="read(item.d_id)">
+                <p :style="{ color: item.status == 1 ? '' : '#4f71ff' }">
+                  <span>基地名称:</span>
+                  {{ item.base_name }}
+                  &nbsp;&nbsp;&nbsp;&nbsp;
+                  <span>地块名称:</span>
+                  {{ item.massif_name }}
+                  &nbsp;&nbsp;&nbsp;&nbsp;
+                  <span>作物名称:</span>
+                  {{ item.crop_name }}
+                </p>
+                <p :style="{ color: item.status == 1 ? '' : '#4f71ff' }">
+                  {{
+                    item.status == 1 ? "已读" : "未读"
+                  }}&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{{
+                    (item.upltime * 1000) | formatTime
+                  }}
+                </p>
+              </div>
+            </template>
+            <div style="display: flex">
+              {{ item.base_name }}中的{{ item.massif_name }}在{{
+                item.cycle_date
+              }}月预测会产生虫害:{{ item.pest_pest }},病害:{{
+                item.pest_disease
+              }}
+            </div>
+          </el-collapse-item>
+        </el-collapse>
+      </div>
+      <div class="pagination">
+        <el-pagination
+          background
+          layout="prev, pager, next,sizes,jumper"
+          :total="totalNum"
+          :page-sizes="[10, 20, 30, 50]"
+          :page-size="10"
+          @size-change="handleSizeChange"
+          @current-change="handleCurrentChange"
+        >
+        </el-pagination>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script>
+//这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
+
+export default {
+  //import引入的组件需要注入到对象中才能使用
+  components: {},
+  data() {
+    //这里存放数据
+    return {
+      totalNum: 10,
+      page: 1,
+      page_size: 10,
+      options: [
+        {
+          value: "3",
+          label: "气象",
+        },
+        {
+          value: "2",
+          label: "墒情",
+        },
+        {
+          value: "1",
+          label: "虫情",
+        },
+        {
+          value: "4",
+          label: "病害",
+        },
+        {
+          value: "5",
+          label: "农作物",
+        },
+      ],
+      warnvalue: "3",
+      cbdinfo: [],
+      cbdtype: {
+        1: "害虫目标种类预警",
+        2: "指定害虫数量预警",
+        3: "害虫数量总和预警",
+        4: "害虫综合预警",
+      },
+      cropinfo: [],
+      bzyinfo: [],
+      qxzinfo: [],
+      sqzinfo: [],
+    };
+  },
+  //监听属性 类似于data概念
+  computed: {},
+  //监控data中的数据变化
+  watch: {},
+  //方法集合
+  methods: {
+    goBackPage(){
+      this.$router.go(-1);
+    },
+    handleSizeChange(e) {
+      this.page = 1;
+      this.page_size = e;
+      //   this.getwarnlist();
+    },
+    handleCurrentChange(e) {
+      this.page = e;
+      //   this.getwarnlist();
+    },
+    tupechange(e) {
+      this.page = 1;
+      if (e == 1) {
+        this.getcbdlist();
+      } else if (e == 2) {
+        this.getsqzlist();
+      } else if (e == 3) {
+        this.getqxzlist();
+      } else if (e == 4) {
+        this.getbzylist();
+      } else if (e == 5) {
+        this.getcroplist();
+      }
+    },
+    allread() {
+        if (this.warnvalue == 1) {
+        this.cbdyiduall();
+      } else if (this.warnvalue == 2) {
+        this.sqzyiduall();
+      } else if (this.warnvalue == 3) {
+        this.qxzyiduall();
+      } else if (this.warnvalue == 4) {
+        this.bzyyiduall();
+      } else if (this.warnvalue == 5) {
+        this.cropyiduall();
+      }
+    },
+    read(d_id) {
+      if (this.warnvalue == 1) {
+        this.cbdyidu(d_id);
+      } else if (this.warnvalue == 2) {
+        this.sqzyidu(d_id);
+      } else if (this.warnvalue == 3) {
+        this.qxzyidu(d_id);
+      } else if (this.warnvalue == 4) {
+        this.bzyyidu(d_id);
+      } else if (this.warnvalue == 5) {
+        this.cropyidu(d_id);
+      }
+    },
+    //测报灯
+    getcbdlist() {
+      this.seedialogVisible = true;
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=forecast.worm_lamp.cbd_pest_warning",
+        data: this.qs.stringify({
+          page: this.page,
+          page_size: this.page_size,
+        }),
+      }).then((res) => {
+        if (res.data.message == "") {
+          console.log(res.data.data.data);
+          this.cbdinfo = res.data.data.data;
+          // this.$nextTick(() => {
+          //   document.getElementsByClassName("number")[0].innerText = "首页";
+          //   var length = document.getElementsByClassName("number").length;
+          //   document.getElementsByClassName("number")[length - 1].innerText =
+          //     "末页";
+          // });
+        }
+      });
+    },
+    // 单条信息已读
+    cbdyidu(id) {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=forecast.worm_lamp.cbd_pest_warning",
+        data: this.qs.stringify({
+          d_id: id,
+        }),
+      }).then((res) => {
+        console.log(res.data.data);
+        if (res.data.data == true) {
+          this.getcbdlist();
+        }
+      });
+    },
+    cbdyiduall() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=forecast.worm_lamp.cbd_pest_warning",
+        data: this.qs.stringify({
+          status: "yes",
+        }),
+      }).then((res) => {
+        if (res.data.data == true) {
+          this.getcbdlist();
+        }
+      });
+    },
+    //孢子仪
+    getbzylist() {
+      this.seedialogVisible = true;
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=device.device_picture.bzy_warning_list",
+        data: this.qs.stringify({
+          page: this.page,
+          page_size: this.page_size,
+        }),
+      }).then((res) => {
+        if (res.data.message == "") {
+          console.log(res.data.data);
+          this.bzyinfo = res.data.data.data;
+          this.totalNum = res.data.data.num;
+          // this.$nextTick(() => {
+          //   document.getElementsByClassName("number")[0].innerText = "首页";
+          //   var length = document.getElementsByClassName("number").length;
+          //   document.getElementsByClassName("number")[length - 1].innerText =
+          //     "末页";
+          // });
+        }
+      });
+    },
+    // 单条信息已读
+    bzyyidu(id) {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=device.device_picture.bzy_warning_read",
+        data: this.qs.stringify({
+          d_id: id,
+        }),
+      }).then((res) => {
+        console.log(res.data.data);
+        if (res.data.data == true) {
+          this.getbzylist();
+        }
+      });
+    },
+    // 单条信息已读
+    bzyyiduall() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=device.device_picture.bzy_warning_read",
+        data: this.qs.stringify({}),
+      }).then((res) => {
+        console.log(res.data.data);
+        if (res.data.data == true) {
+          this.getbzylist();
+        }
+      });
+    },
+    //气象站
+    getqxzlist() {
+      this.seedialogVisible = true;
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=forecast.worm_lamp.qxz_warning",
+        data: this.qs.stringify({
+          page: this.page,
+          page_size: this.page_size,
+        }),
+      }).then((res) => {
+        if (res.data.message == "") {
+          console.log(res.data.data.data);
+          this.sqzinfo = res.data.data.data;
+          this.totalNum = res.data.data.nusm;
+          // this.$nextTick(() => {
+          //   document.getElementsByClassName("number")[0].innerText = "首页";
+          //   var length = document.getElementsByClassName("number").length;
+          //   document.getElementsByClassName("number")[length - 1].innerText =
+          //     "末页";
+          // });
+        }
+      });
+    },
+     // 单条信息已读
+    qxzyidu(id) {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=forecast.worm_lamp.qxz_warning",
+        data: this.qs.stringify({
+          d_id: id,
+        }),
+      }).then((res) => {
+        console.log(res.data.data);
+        if (res.data.data == true) {
+          this.getqxzlist();
+        }
+      });
+    },
+    // 一键已读
+    qxzyiduall() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=forecast.worm_lamp.qxz_warning",
+        data: this.qs.stringify({
+          status: "yes",
+        }),
+      }).then((res) => {
+        if (res.data.data == true) {
+          this.getqxzlist();
+        }
+      });
+    },
+    //墒情站
+    getsqzlist() {
+      this.seedialogVisible = true;
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=forecast.worm_lamp.qxz_warning",
+        data: this.qs.stringify({
+          page: this.page,
+          page_size: this.page_size,
+          device_type: "8",
+        }),
+      }).then((res) => {
+        if (res.data.message == "") {
+          console.log(res.data.data.data);
+          this.sqzinfo = res.data.data.data;
+          this.totalNum = res.data.data.nusm;
+          // this.$nextTick(() => {
+          //   document.getElementsByClassName("number")[0].innerText = "首页";
+          //   var length = document.getElementsByClassName("number").length;
+          //   document.getElementsByClassName("number")[length - 1].innerText =
+          //     "末页";
+          // });
+        }
+      });
+    },
+    // 一键已读
+    sqzyiduall() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=forecast.worm_lamp.qxz_warning",
+        data: this.qs.stringify({
+          status: "yes",
+          device_type: "8",
+        }),
+      }).then((res) => {
+        if (res.data.data == true) {
+          this.getsqzlist();
+        }
+      });
+    },
+    // 单条信息已读
+    sqzyidu(id) {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=forecast.worm_lamp.qxz_warning",
+        data: this.qs.stringify({
+          d_id: id,
+        }),
+      }).then((res) => {
+        console.log(res.data.data);
+        if (res.data.data == true) {
+          this.getsqzlist();
+        }
+      });
+    },
+    //农作物
+    getcroplist() {
+      this.seedialogVisible = true;
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=device.device_picture.crops_warning_list",
+        data: this.qs.stringify({
+          page: this.page,
+          page_size: this.page_size,
+        }),
+      }).then((res) => {
+        if (res.data.message == "") {
+          console.log(res.data.data.data);
+          this.cropinfo = res.data.data.data;
+          this.totalNum = res.data.data.num;
+          //   this. =
+          // this.$nextTick(() => {
+          //   document.getElementsByClassName("number")[0].innerText = "首页";
+          //   var length = document.getElementsByClassName("number").length;
+          //   document.getElementsByClassName("number")[length - 1].innerText =
+          //     "末页";
+          // });
+        }
+      });
+    },
+    // 单条信息已读
+    cropyidu(id) {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=device.device_picture.crops_warning_read",
+        data: this.qs.stringify({
+          d_id: id,
+        }),
+      }).then((res) => {
+        console.log(res.data.data);
+        if (res.data.data == true) {
+          this.getcroplist();
+        }
+      });
+    },
+    // 一键已读
+    cropyiduall() {
+      this.$axios({
+        method: "POST",
+        url: "/api/api_gateway?method=device.device_picture.crops_warning_read",
+        data: this.qs.stringify({}),
+      }).then((res) => {
+        console.log(res.data.data);
+        if (res.data.data == true) {
+          this.getcroplist();
+        }
+      });
+    },
+  },
+  beforeCreate() {}, //生命周期 - 创建之前
+  //生命周期 - 创建完成(可以访问当前this实例)
+  created() {
+    // this.getcbdlist();
+    this.getsqzlist();
+  },
+  beforeMount() {}, //生命周期 - 挂载之前
+  //生命周期 - 挂载完成(可以访问DOM元素)
+  mounted() {},
+  beforeUpdate() {}, //生命周期 - 更新之前
+  updated() {}, //生命周期 - 更新之后
+  beforeDestroy() {}, //生命周期 - 销毁之前
+  destroyed() {}, //生命周期 - 销毁完成
+  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+};
+</script>
+<style lang='less' scoped>
+.warnbox {
+  width: 100%;
+  height: 100%;
+  .baselistbox_top {
+    width: 100%;
+    height: 70px;
+    background-color: #fff;
+    border-radius: 10px;
+    display: flex;
+    justify-content: space-between;
+    .baselistbox_top_title {
+      //   width: 100%;
+      height: 65px;
+      display: flex;
+      padding: 20px;
+      box-sizing: border-box;
+      line-height: 25px;
+      p:first-child {
+        font-size: 14px;
+        margin-right: 20px;
+      }
+      p:last-child {
+        font-size: 18px;
+        font-weight: 700;
+      }
+    }
+    .baselistbox_top_sel {
+      height: 65px;
+      padding-right: 40px;
+      display: flex;
+      padding-top: 20px;
+      box-sizing: border-box;
+      .btnbox {
+        width: 68px;
+        height: 26px;
+        border: 1px solid #4f71ff;
+        text-align: center;
+        border-radius: 3px;
+        font-size: 14px;
+        margin-left: 20px;
+        cursor: pointer;
+        background-color: #4f71ff;
+        color: #fff;
+        line-height: 26px;
+      }
+    }
+  }
+  .warnlistbox {
+    margin-top: 15px;
+    width: 100%;
+    padding: 40px;
+    background-color: #fff;
+    border-radius: 10px;
+    box-sizing: border-box;
+    .warnlistbox_text {
+      width: 100%;
+      .warnlistbox_text_item {
+        width: 98%;
+        display: flex;
+        justify-content: space-between;
+        p:first-child {
+          width: 70%;
+          // background-color: #4f71ff;
+        }
+      }
+    }
+
+    .pagination {
+      display: flex;
+      justify-content: flex-end;
+      margin-top: 20px;
+      /deep/.el-pager {
+        .active {
+          background-color: #4f71ff !important;
+        }
+      }
+      /deep/.el-input__inner:hover {
+        border-color: #4f71ff;
+      }
+    }
+  }
+}
+</style>

+ 53 - 6
pingpu_vue/src/router/index.js

@@ -3,6 +3,8 @@ import Router from 'vue-router'
 import index from '../../src/page/index/index.vue'
 
 //首页
+import login from '../../src/page/login/login.vue'
+//首页
 import home from '../../src/page/home/Home.vue'
 // 测报灯
 import Cbd from '../../src/page/cbd/Cbd.vue'
@@ -41,6 +43,16 @@ import maphandle from '../../src/page/base/maphandle.vue'
 import maofacility from '../../src/page/base/maofacility.vue'
 import mapplot from '../../src/page/base/mapplot.vue'
 
+//预警
+import earlywarning from '../../src/page/worn/earlywarning.vue'
+//故障
+import faultinfo from '../../src/page/fault/faultinfo.vue'
+//gis
+import gisshow from '../../src/page/gis/gisshow.vue'
+//用户列表
+import userlist from '../../src/page/user/userlist.vue'
+//专家
+import specialist from '../../src/page/specialist/specialist.vue'
 
 Vue.use(Router)
 
@@ -48,7 +60,11 @@ export default new Router({
   routes: [
     {
       path: '/',
-      redirect: '/index',
+      redirect: '/login',
+    },
+    {
+      path: '/login',
+      component: login,
     },
     {
       path: '/index',
@@ -64,7 +80,10 @@ export default new Router({
         },
         {
           path: 'Cbd',
-          component: Cbd
+          component: Cbd,
+          meta: {
+            keepAlive: true, //留存数据
+          }
         },
         {
           path: 'pestsStats',
@@ -88,7 +107,10 @@ export default new Router({
         },
         {
           path: 'envi',
-          component: envi
+          component: envi,
+          meta: {
+            keepAlive: true, //留存数据
+          }
         }, {
           path: 'Data24/:id',
           component: Data24
@@ -97,7 +119,10 @@ export default new Router({
           component: HistoryData
         }, {
           path: 'bzy',
-          component: bzy
+          component: bzy,
+          meta: {
+            keepAlive: true, //留存数据
+          }
         }, {
           path: 'bzyPhotos/:id',
           component: bzyPhotos
@@ -115,7 +140,10 @@ export default new Router({
           component: playback
         }, {
           path: 'sqz',
-          component: sqz
+          component: sqz,
+          meta: {
+            keepAlive: true, //留存数据
+          }
         }, {
           path: 'sqzData24/:id',
           component: sqzData24
@@ -133,7 +161,10 @@ export default new Router({
           component: evildata
         }, {
           path: "baselist",
-          component: baselist
+          component: baselist,
+          meta: {
+            keepAlive: true, //留存数据
+          }
         }, {
           path: "plotlist",
           component: plotlist
@@ -146,6 +177,22 @@ export default new Router({
         },{
           path: "mapplot",
           component: mapplot
+        },{
+          path: "earlywarning",
+          component: earlywarning
+        },{
+          path: "faultinfo",
+          component: faultinfo
+        },
+        {
+          path: "gisshow",
+          component: gisshow
+        },{
+          path: "userlist",
+          component: userlist
+        },{
+          path: "specialist",
+          component: specialist
         }
       ]
     }

+ 4 - 3
pingpu_vue/src/util/http.js

@@ -28,10 +28,11 @@ axios.interceptors.request.use(req => {
   } else {
     url = req.url.split('api/')[1]
   }
-  console.log(url)
-  if (url !== 'user.login.login_user' &&
+  // console.log(url)
+  if (url !== 'user.login.zg_login_user' &&
     url !== 'pest.pests.plant_discern' &&
-    url !== 'pest.pests.insect_discern') {
+    url !== 'pest.pests.insect_discern'&& 
+    url !== 'user.login.login_user') {
     req.data = req.data ? req.data + '&token=' + session : 'token=' + session;
   }
   return req

BIN
pingpu_vue/static/images/gisshow/2a.png


BIN
pingpu_vue/static/images/gisshow/3.gif


BIN
pingpu_vue/static/images/gisshow/3.png


BIN
pingpu_vue/static/images/gisshow/3a.png


BIN
pingpu_vue/static/images/gisshow/3off.gif


BIN
pingpu_vue/static/images/gisshow/3off.png


BIN
pingpu_vue/static/images/gisshow/4a.png


BIN
pingpu_vue/static/images/gisshow/5.gif


BIN
pingpu_vue/static/images/gisshow/5.png


BIN
pingpu_vue/static/images/gisshow/5a.png


BIN
pingpu_vue/static/images/gisshow/5off.gif


BIN
pingpu_vue/static/images/gisshow/5off.png


BIN
pingpu_vue/static/images/gisshow/6.gif


BIN
pingpu_vue/static/images/gisshow/6.png


BIN
pingpu_vue/static/images/gisshow/6a.png


BIN
pingpu_vue/static/images/gisshow/6off.gif


BIN
pingpu_vue/static/images/gisshow/6off.png


BIN
pingpu_vue/static/images/gisshow/7.gif


BIN
pingpu_vue/static/images/gisshow/7.png


BIN
pingpu_vue/static/images/gisshow/7a.png


BIN
pingpu_vue/static/images/gisshow/7off.gif


BIN
pingpu_vue/static/images/gisshow/7off.png


BIN
pingpu_vue/static/images/gisshow/8.gif


BIN
pingpu_vue/static/images/gisshow/8.png


BIN
pingpu_vue/static/images/gisshow/8off.gif


BIN
pingpu_vue/static/images/gisshow/8off.png


BIN
pingpu_vue/static/images/gisshow/all.png


BIN
pingpu_vue/static/images/gisshow/yujing.gif


BIN
pingpu_vue/static/images/gisshow/yujing.png


BIN
pingpu_vue/static/images/home/icon.png


BIN
pingpu_vue/static/images/home/none.png


BIN
pingpu_vue/static/images/home/qing.png


BIN
pingpu_vue/static/images/home/wu.png


BIN
pingpu_vue/static/images/home/xue.png


BIN
pingpu_vue/static/images/home/yin.png


BIN
pingpu_vue/static/images/home/yu.png


BIN
pingpu_vue/static/images/home/yun.png


BIN
pingpu_vue/static/images/home/墒情监测.png


BIN
pingpu_vue/static/images/home/环境监测.png


BIN
pingpu_vue/static/images/home/病害监测.png


BIN
pingpu_vue/static/images/home/监控设备.png


BIN
pingpu_vue/static/images/home/虫情监测.png


BIN
pingpu_vue/static/images/index/base.png


BIN
pingpu_vue/static/images/index/sqjc.png


BIN
pingpu_vue/static/images/index/user.png


BIN
pingpu_vue/static/images/index/yjxx.png


BIN
pingpu_vue/static/images/login/loginbg.png


BIN
pingpu_vue/static/images/map/5.png