Quellcode durchsuchen

杀虫灯详情,组织结构和监测点可搜索,细节调整

yf_zhb vor 2 Jahren
Ursprung
Commit
1d22291984

+ 3 - 3
minggao/index.html

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

+ 47 - 40
minggao/src/page/forecasting/cbd/Cbd.vue

@@ -571,12 +571,14 @@
               :props="defaultParams"
               :clearable="true"
               placeholder="请选择隶属组织"
+              filterable
             ></el-cascader>
           </el-form-item>
           <el-form-item label="所在监测点" prop="point_id">
             <el-select
               v-model="ruleForm.point_id"
               placeholder="请选择所在监测点"
+              filterable
             >
               <el-option
                 v-for="item in traponsoptions"
@@ -1463,36 +1465,40 @@ export default {
               device_name: this.ruleForm.device_name,
               city: this.ruleForm.basecity
             })
-          }).then(res => {
-            console.log(res);
-            if (res.data.data) {
-              // var message = "";
-              // if (this.parameter == "add") {
-              //   // console.log(this.$data.addtitle)
-              //   message = "添加成功!";
-              // } else if (this.parameter == "modify") {
-              //   message = "修改成功!";
-              // }
-              if (document.getElementsByClassName('el-message').length == 0) {
-                this.$message({
-                  showClose: true,
-                  message: '修改成功!',
-                  type: 'success'
-                });
-              }
-              this.operationDialogVisible = false;
-              this.getEquipList();
-            } else {
-              if (document.getElementsByClassName('el-message').length == 0) {
-                this.$message({
-                  showClose: true,
-                  message: '添加失败' + res.data.message,
-                  type: 'warning'
-                });
+          })
+            .then(res => {
+              console.log(res);
+              if (res.data.data) {
+                // var message = "";
+                // if (this.parameter == "add") {
+                //   // console.log(this.$data.addtitle)
+                //   message = "添加成功!";
+                // } else if (this.parameter == "modify") {
+                //   message = "修改成功!";
+                // }
+                if (document.getElementsByClassName('el-message').length == 0) {
+                  this.$message({
+                    showClose: true,
+                    message: '修改成功!',
+                    type: 'success'
+                  });
+                }
+                this.operationDialogVisible = false;
+                this.getEquipList();
+              } else {
+                if (document.getElementsByClassName('el-message').length == 0) {
+                  this.$message({
+                    showClose: true,
+                    message: '添加失败' + res.data.message,
+                    type: 'warning'
+                  });
+                }
               }
-            }
-            this.releaseTF = false;
-          });
+              this.releaseTF = false;
+            })
+            .finally(() => {
+              this.releaseTF = false;
+            });
         } else {
           if (document.getElementsByClassName('el-message').length == 0) {
             this.$message({
@@ -1527,17 +1533,18 @@ export default {
         if (arr[0].parent_name == '根组织') {
           this.versionsoptions = arr;
         } else {
-          var obj = {
-            id: 148,
-            org_name: '研发部',
-            childrens: []
-          };
-          for (var i = 0; i < arr.length; i++) {
-            obj.childrens.push(arr[i]);
-            obj.id = arr[0].parent_id;
-            obj.org_name = arr[0].parent_name;
-          }
-          this.versionsoptions.push(obj);
+          // var obj = {
+          //   id: 148,
+          //   org_name: '研发部',
+          //   childrens: []
+          // };
+          // for (var i = 0; i < arr.length; i++) {
+          //   obj.childrens.push(arr[i]);
+          //   obj.id = arr[0].parent_id;
+          //   obj.org_name = arr[0].parent_name;
+          // }
+          // this.versionsoptions.push(obj);
+          this.versionsoptions = arr;
         }
         console.log(this.versionsoptions);
         this.traponsoptions = res.data.data.point_data;

+ 283 - 47
minggao/src/page/forecasting/monthKillingLamp/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div style="cursor: default; position: relative">
+  <div style="cursor: default; position: relative;width: 99%">
     <search-bar
       @fun="getDisplayType"
       :displayType="displayType"
@@ -18,6 +18,7 @@
           :xl="6"
           v-for="item in equipList"
           :key="item.imei"
+          style="margin-bottom:10px;"
         >
           <el-card class="box-card">
             <!-- <span :class="['on-stauts', item.is_online == 1 ? 'on' : 'off']"></span> -->
@@ -395,7 +396,7 @@
                   v-model="equipContrlForm.clt"
                   show-input
                 ></el-slider>
-                <el-button
+                <!-- <el-button
                   size="mini"
                   @click="qingchong"
                   style="
@@ -406,15 +407,22 @@
                     color: #fff;
                   "
                   >清虫</el-button
-                >
+                > -->
               </div>
             </div>
           </el-form-item>
           <el-form-item class="handAddFormBtn">
-            <el-button type="primary" size="mini" @click="equipControlSubm"
+            <el-button
+              type="primary"
+              :loading="controlActionLoading"
+              size="mini"
+              @click="equipControlSubm"
               >确定</el-button
             >
-            <el-button size="mini" @click="equipControlDialogVisible = false"
+            <el-button
+              size="mini"
+              :loading="controlActionLoading"
+              @click="equipControlDialogVisible = false"
               >取消</el-button
             >
           </el-form-item>
@@ -506,6 +514,7 @@
               :options="versionsoptions"
               :props="defaultParams"
               :clearable="true"
+              filterable
               placeholder="请选择隶属组织"
             ></el-cascader>
           </el-form-item>
@@ -513,6 +522,7 @@
             <el-select
               v-model="ruleForm.point_id"
               placeholder="请选择所在监测点"
+              filterable
             >
               <el-option
                 v-for="item in traponsoptions"
@@ -571,6 +581,50 @@
         >
       </span>
     </el-dialog>
+    <el-dialog
+      class="map_dialog"
+      title="地图选点"
+      :visible.sync="addLocationDialogVisible"
+      width="820px"
+      @closed="addLocationDialogClosed"
+      :close-on-click-modal="false"
+    >
+      <el-form
+        :inline="true"
+        :model="locationForm"
+        class="demo-form-inline"
+        size="mini"
+      >
+        <el-form-item label="经度">
+          <el-input clearable v-model="locationForm.lng"></el-input>
+        </el-form-item>
+        <el-form-item label="纬度">
+          <el-input clearable v-model="locationForm.lat"></el-input>
+        </el-form-item>
+        <el-form-item>
+          <el-button type="primary" size="mini" @click="locationSearch"
+            >定位</el-button
+          >
+        </el-form-item>
+        <el-form-item label="">
+          <el-input
+            placeholder="请输入地区检索"
+            v-model="addr"
+            clearable
+            @change="addrChange()"
+          ></el-input>
+        </el-form-item>
+      </el-form>
+      <div class="amap-demo" id="mapContainer2" style="height: 400px"></div>
+      <span slot="footer" class="dialog-footer">
+        <el-button @click="addLocationDialogVisible = false" size="mini"
+          >取 消</el-button
+        >
+        <el-button type="primary" @click="addLocationSubm" size="mini"
+          >确 定</el-button
+        >
+      </span>
+    </el-dialog>
 
     <!-- 批量下发弹框 -->
     <el-dialog
@@ -721,6 +775,7 @@
   </div>
 </template>
 <script>
+import { assign } from 'lodash-es';
 import SearchBar from '@/components/SearchBar';
 import Circulation from '../../../../static/js/equipState_dict.json';
 
@@ -896,7 +951,15 @@ export default {
         ]
       },
       center: [114.05, 22.55],
-      releaseTF: false
+      releaseTF: false,
+      addLocationDialogVisible: false,
+      locationForm: {
+        lng: '',
+        lat: ''
+      },
+      addr: '', //搜索栏地址
+      address: '', //地图上标签地址
+      controlActionLoading: false
     };
   },
   watch: {
@@ -970,6 +1033,7 @@ export default {
       this.$refs.screenData.searchVal = this.$route.query.id;
     }
     this.getEquipList();
+    this.getmon();
   },
 
   activated() {
@@ -1351,7 +1415,7 @@ export default {
       });
     },
     equipControlSubm() {
-      let obj = this.equipContrlForm;
+      let obj = assign({}, this.equipContrlForm);
       if (obj.st) {
         obj.st =
           obj.st && obj.st.slice(0, 2).charAt(0) != '0'
@@ -1372,7 +1436,9 @@ export default {
         }
       }
 
-      console.log(obj);
+      console.log(obj, '--------------------------- device control submit');
+
+      this.controlActionLoading = true;
 
       this.$axios({
         method: 'POST',
@@ -1382,14 +1448,21 @@ export default {
           d_id: this.d_id,
           config: JSON.stringify(obj)
         })
-      }).then(res => {
-        if (res.data.message == '') {
-          this.$resetMessage.success('设备控制修改成功');
-        } else {
-          this.$resetMessage.error('设备控制修改失败');
-        }
-        this.equipControlDialogVisible = false;
-      });
+      })
+        .then(res => {
+          if (res.data.message == '') {
+            this.$message.success('设备控制修改成功');
+          } else {
+            this.$message.error('设备控制修改失败');
+          }
+        })
+        .finally(() => {
+          // 设备控制下发有延迟,延迟一秒关闭
+          setTimeout(() => {
+            this.controlActionLoading = false;
+            this.equipControlDialogVisible = false;
+          }, 1000);
+        });
     },
     equipControlDialogClosed() {
       this.$refs.equipContrlRef.resetFields();
@@ -1654,6 +1727,148 @@ export default {
         }
       });
     },
+    getmon() {
+      //获取监测点列表 组织列表
+      this.$axios({
+        method: 'POST',
+        url: '/api/api_gateway?method=sysmenage.usermanager.org_list',
+        data: this.qs.stringify({
+          page_item: '100000000'
+        })
+      }).then(res => {
+        console.log(res.data.data);
+        // this.versionsoptions = res.data.data.page_list; //组织
+        var arr = res.data.data.page_list; //组织
+        console.log(this.versionsoptions);
+        if (arr[0].parent_name == '根组织') {
+          this.versionsoptions = arr;
+        } else {
+          var obj = {
+            id: arr[0].id,
+            org_name: arr[0].org_name,
+            childrens: []
+          };
+          for (var i = 0; i < arr.length; i++) {
+            obj.childrens.push(arr[i]);
+            obj.id = arr[0].parent_id;
+            obj.org_name = arr[0].parent_name;
+          }
+          // this.versionsoptions.push(obj);
+          this.versionsoptions = arr;
+        }
+        console.log(
+          this.versionsoptions,
+          '----------------- versionsoptions',
+          obj
+        );
+        this.traponsoptions = res.data.data.point_data;
+        this.inducer_data = res.data.data.inducer_data;
+      });
+    },
+    init() {
+      console.log(document.getElementById('mapContainer2'));
+      var map = new AMap.Map('mapContainer2', {
+        center: this.center,
+        resizeEnable: true,
+        zoom: 10,
+        lang: 'en'
+      });
+      AMap.plugin(['AMap.ToolBar', 'AMap.Geocoder'], () => {
+        map.addControl(new AMap.ToolBar());
+        this.geocoder = new AMap.Geocoder({
+          city: '全国',
+          radius: 1000
+        });
+      });
+      setTimeout(() => {
+        var marker = new AMap.Marker({
+          position: this.center
+        });
+        console.log(this.center);
+        marker.setMap(map);
+      }, 1000);
+      this.map = map;
+      this.testevent();
+    },
+    addrChange() {
+      //位置搜索
+      var marker = new AMap.Marker();
+      this.geocoder.getLocation(this.addr, (status, result) => {
+        if (status === 'complete' && result.geocodes.length) {
+          var lnglat = result.geocodes[0].location;
+          marker.setPosition(lnglat);
+          this.map.add(marker);
+          this.map.setFitView(marker);
+          this.locationForm = {
+            lat: lnglat.lat,
+            lng: lnglat.lng
+          };
+        } else {
+          if (document.getElementsByClassName('el-message').length == 0) {
+            this.$message.error('根据地址查询位置失败');
+          }
+        }
+      });
+    },
+    // 地图点击事件
+    testevent() {
+      this.map.on('click', ev => {
+        var lnglat = [ev.lnglat.lng, ev.lnglat.lat];
+        this.locationForm = { lng: lnglat[0], lat: lnglat[1] };
+        this.map.clearMap();
+        var marker = new AMap.Marker({
+          position: lnglat
+        });
+        marker.setMap(this.map);
+        this.getAddress(lnglat);
+        setTimeout(() => {
+          new AMap.InfoWindow({
+            content: '<h5>' + '当前选中地址' + '</h5>' + this.address,
+            offset: new AMap.Pixel(0, -32)
+          }).open(this.map, lnglat);
+        }, 100);
+      });
+    },
+    getAddress(lnglat) {
+      AMap.plugin('AMap.Geocoder', () => {
+        this.geocoder.getAddress(lnglat, (status, result) => {
+          if (status === 'complete' && result.info === 'OK') {
+            this.address = result.regeocode.formattedAddress;
+          }
+        });
+      });
+    },
+    addLocationSubm() {
+      //点击确定
+      this.ruleForm.lng = this.locationForm.lng;
+      this.ruleForm.lat = this.locationForm.lat;
+      console.log(this.ruleForm);
+      this.city(
+        this.ToDigital(this.ruleForm.lat),
+        this.ToDigital(this.ruleForm.lng)
+      );
+      this.addLocationDialogVisible = false;
+    },
+    addLocationDialogClosed() {
+      //弹框关闭时
+      // this.locationForm = { lat: "", lng: "" };
+      this.center = [114.05, 22.55];
+      this.map = null;
+    },
+    locationSearch() {
+      if (this.locationForm.lat && this.locationForm.lng) {
+        let lnglat = [this.locationForm.lng, this.locationForm.lat];
+        var marker = new AMap.Marker({
+          position: lnglat
+        });
+        marker.setMap(this.map);
+      } else {
+        if (document.getElementsByClassName('el-message').length == 0) {
+          this.$message.warning('请输入经纬度!');
+        }
+        // return fasle;
+      }
+    },
     dingwei() {
       if (this.ruleForm.lng != '' && this.ruleForm.lng != 0) {
         this.center[0] = this.ToDigital(this.ruleForm.lng);
@@ -1810,8 +2025,7 @@ export default {
           this.releaseTF = true;
           this.$axios({
             method: 'POST',
-            url:
-              '/api/api_gateway?method=monitor_manage.cbd_manage.add_device_info',
+            url: '/api/api_gateway?method=forecast.worm_lamp.add_device_info',
             data: this.qs.stringify({
               org_id: org_id, //                  非必传(num)                诱捕器id 修改项
               point_id: this.ruleForm.point_id, //               必传(string)               设备编号
@@ -1821,36 +2035,40 @@ export default {
               device_name: this.ruleForm.device_name,
               city: this.ruleForm.basecity
             })
-          }).then(res => {
-            console.log(res);
-            if (res.data.data) {
-              // var message = "";
-              // if (this.parameter == "add") {
-              //   // console.log(this.$data.addtitle)
-              //   message = "添加成功!";
-              // } else if (this.parameter == "modify") {
-              //   message = "修改成功!";
-              // }
-              if (document.getElementsByClassName('el-message').length == 0) {
-                this.$message({
-                  showClose: true,
-                  message: '修改成功!',
-                  type: 'success'
-                });
-              }
-              this.operationDialogVisible = false;
-              this.getEquipList();
-            } else {
-              if (document.getElementsByClassName('el-message').length == 0) {
-                this.$message({
-                  showClose: true,
-                  message: '添加失败' + res.data.message,
-                  type: 'warning'
-                });
+          })
+            .then(res => {
+              console.log(res);
+              if (res.data.data) {
+                // var message = "";
+                // if (this.parameter == "add") {
+                //   // console.log(this.$data.addtitle)
+                //   message = "添加成功!";
+                // } else if (this.parameter == "modify") {
+                //   message = "修改成功!";
+                // }
+                if (document.getElementsByClassName('el-message').length == 0) {
+                  this.$message({
+                    showClose: true,
+                    message: '修改成功!',
+                    type: 'success'
+                  });
+                }
+                this.operationDialogVisible = false;
+                this.getEquipList();
+              } else {
+                if (document.getElementsByClassName('el-message').length == 0) {
+                  this.$message({
+                    showClose: true,
+                    message: '添加失败' + res.data.message,
+                    type: 'warning'
+                  });
+                }
               }
-            }
-            this.releaseTF = false;
-          });
+              this.releaseTF = false;
+            })
+            .finally(() => {
+              this.releaseTF = false;
+            });
         } else {
           if (document.getElementsByClassName('el-message').length == 0) {
             this.$message({
@@ -2084,6 +2302,24 @@ export default {
   color: rgb(23, 187, 137);
 }
 
+.haiguan {
+  display: flex;
+  flex-wrap: wrap;
+  margin-top: 5px;
+  .haiguan_item {
+    // width: 70px;
+    height: 20px;
+    border: 1px solid #d4d2d2;
+    line-height: 20px;
+    margin-right: 10px;
+    padding: 2px 10px;
+    border-radius: 5px;
+  }
+  .haiguan_itemnone {
+    line-height: 20px;
+  }
+}
+
 .buttonbox {
   margin-bottom: 23px;
   padding-left: 100px;

+ 3 - 52
minggao/src/page/forecasting/monthKillingLamp/scdDetail.vue

@@ -1,12 +1,5 @@
 <template>
-  <div style="cursor: default">
-    <el-breadcrumb separator-class="el-icon-arrow-right">
-      <el-breadcrumb-item>防治系统</el-breadcrumb-item>
-      <el-breadcrumb-item :to="{ path: '/index/scd' }"
-        >杀虫灯</el-breadcrumb-item
-      >
-      <el-breadcrumb-item>数据详情</el-breadcrumb-item>
-    </el-breadcrumb>
+  <div style="cursor: default;width: 99%">
     <el-button type="success" size="small" @click="goBackPage()"
       ><i class="el-icon--left el-icon-d-arrow-left"></i>返回</el-button
     >
@@ -34,11 +27,7 @@
           <el-col :md="24" :lg="!shield ? 14 : 24">
             <el-card class="box-card" id="box-card1">
               <div class="charts">
-                <highcharts
-                  v-if="$QueryPermission(264)"
-                  :options="option1"
-                ></highcharts>
-                <highcharts v-else :options="option3"></highcharts>
+                <highcharts :options="option3"></highcharts>
               </div>
             </el-card>
           </el-col>
@@ -59,44 +48,7 @@
         </div>
       </div>
       <el-card class="box-card">
-        <el-table
-          :data="tableData"
-          stripe
-          style="width: 100%"
-          v-if="$QueryPermission(264)"
-        >
-          <el-table-column
-            v-for="(item, index) in tableHeadTxt"
-            :key="index"
-            :prop="item[1]"
-            :label="item[0]"
-            :width="setWidth(item)"
-          >
-            <template slot-scope="scope">{{
-              scope.row[scope.column.property]
-            }}</template>
-          </el-table-column>
-        </el-table>
-        <!-- 新建区农业农村局定制 -->
-        <el-table
-          :data="tableData"
-          stripe
-          style="width: 100%"
-          v-else-if="shield"
-        >
-          <el-table-column
-            v-for="(item, index) in tableHeadTxt3"
-            :key="index"
-            :prop="item[1]"
-            :label="item[0]"
-            :width="setWidth(item)"
-          >
-            <template slot-scope="scope">{{
-              scope.row[scope.column.property]
-            }}</template>
-          </el-table-column>
-        </el-table>
-        <el-table :data="tableData" stripe style="width: 100%" v-else>
+        <el-table :data="tableData" stripe style="width: 100%">
           <el-table-column
             v-for="(item, index) in tableHeadTxt2"
             :key="index"
@@ -317,7 +269,6 @@ export default {
     this.myuid = sessionStorage.getItem('myuid');
   },
   mounted() {
-    this.getwornjuri();
     this.equipStateDict = Circulation;
     this.refreshData();
     this.loadingInstance1 = Loading.service({

+ 9 - 3
minggao/src/page/homepage/facilitydistribute.vue

@@ -49,6 +49,7 @@
         placeholder="请选择隶属组织"
         size="mini"
         clearable
+        filterable
         @change="search"
       >
         <el-option
@@ -80,6 +81,7 @@
         placeholder="请选择所在监测点"
         size="mini"
         clearable
+        filterable
         @change="search"
       >
         <el-option
@@ -400,7 +402,7 @@ export default {
       loading: false,
       device_type_id: 0,
       myVideo2: {},
-      pestboxloading: true,
+      pestboxloading: false,
       center: [114.052758, 22.545817],
       cbdnum: 0,
       jknum: 0,
@@ -524,6 +526,8 @@ export default {
         mapStyle: 'amap://styles/fresh',
         layers: []
       });
+
+      console.log(map, 'init map -------------------- init sdsdsa');
       //new AMap.TileLayer.Satellite(),new AMap.TileLayer.RoadNet()
       AMap.plugin(['AMap.ToolBar', 'AMap.Geocoder'], () => {
         map.addControl(new AMap.ToolBar());
@@ -540,7 +544,7 @@ export default {
       //   console.log(e);
       // });
       this.map = map;
-      this.getbaselist();
+      // this.getbaselist();
     },
     getbaselist() {
       this.pestboxloading = true;
@@ -564,7 +568,8 @@ export default {
         this.cbdnum = 0;
         this.jknum = 0;
         this.ybqnum = 0;
-        this.map.clearMap();
+        // this.map.clearMap();
+        this.map && this.map.clearMap();
         this.mouseTool.close(true);
 
         //rest pestNum
@@ -1088,6 +1093,7 @@ export default {
   beforeUpdate() {}, //生命周期 - 更新之前
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {
+    this.map && this.map.destroy();
     if (this.myVideo2[`myPlayer`]) {
       this.myVideo2[`myPlayer`].stop();
     }

+ 3 - 1
minggao/src/page/homepage/pestdistribute.vue

@@ -64,6 +64,7 @@
         placeholder="请选择所在监测点"
         size="mini"
         clearable
+        filterable
         @change="search"
       >
         <el-option
@@ -79,6 +80,7 @@
         placeholder="请选择隶属组织"
         size="mini"
         clearable
+        filterable
         @change="search"
       >
         <el-option
@@ -529,7 +531,7 @@ export default {
         })
       }).then(res => {
         // console.log(res.data.data);
-        this.map.clearMap();
+        this.map && this.map.clearMap();
         this.mouseTool.close(true);
         var resdata = res.data.data;
         this.loading = false;

+ 8 - 0
minggao/src/router/index.js

@@ -69,6 +69,7 @@ import trypetidMonitoringTrap from '@/page/forecasting/trap/trypetidMonitoringTr
 import fillinrecord from '@/page/forecasting/trap/fillinrecord'; //填报记录
 import bait from '@/page/forecasting/trap/bait'; //诱剂维护
 import monthKillingLamp from '@/page/forecasting/monthKillingLamp/index';
+import monthKillingLampDetail from '@/page/forecasting/monthKillingLamp/scdDetail';
 //*********************任务报表********************
 import monitoringtask from '@/page/monitoring/monitoringtask'; //监测任务统计
 import supervisiontask from '@/page/monitoring/supervisiontask'; //监督任务统计
@@ -393,6 +394,13 @@ export default new Router({
           meta: {
             title: '风吸式太阳诱虫灯'
           }
+        },
+        {
+          path: 'scdDetail/:e_id/:d_id/:address/:device_name',
+          component: monthKillingLampDetail,
+          meta: {
+            title: '风吸式太阳诱虫灯-详情'
+          }
         }
       ]
     }