Explorar o código

诱捕器页面拆分

yf_zhb %!s(int64=2) %!d(string=hai) anos
pai
achega
c0c602d880

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

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

+ 10 - 0
minggao/src/page/forecasting/monthKillingLamp/index.vue

@@ -0,0 +1,10 @@
+<template>
+  <div class="page">
+    <el-empty description="暂无数据"></el-empty>
+  </div>
+</template>
+<style lang="less" scoped>
+.page {
+  height: 100%;
+}
+</style>

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

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

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

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

+ 270 - 221
minggao/src/page/forecasting/trap/trap.vue

@@ -74,6 +74,17 @@
       <el-button type="info" size="mini" @click="deriveVisible = true"
       <el-button type="info" size="mini" @click="deriveVisible = true"
         >导出数据</el-button
         >导出数据</el-button
       >
       >
+
+      <el-button
+        type="info"
+        size="mini"
+        @click="
+          $router.push(
+            `/index/fillinrecord?typeID=${typeID}&pointType=${point_type}`
+          )
+        "
+        >填报记录</el-button
+      >
     </div>
     </div>
     <el-card class="box-card" style="margin-top: 15px">
     <el-card class="box-card" style="margin-top: 15px">
       <div class="cbdboxs_table" v-loading="loading">
       <div class="cbdboxs_table" v-loading="loading">
@@ -92,12 +103,12 @@
           <el-table-column prop="trap_number" label="编号"> </el-table-column>
           <el-table-column prop="trap_number" label="编号"> </el-table-column>
           <el-table-column prop="lng" label="经度">
           <el-table-column prop="lng" label="经度">
             <template slot-scope="scope">
             <template slot-scope="scope">
-              <span>{{ ToDegrees(scope.row.lng, "lng") }}</span>
+              <span>{{ ToDegrees(scope.row.lng, 'lng') }}</span>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
           <el-table-column prop="lat" label="纬度">
           <el-table-column prop="lat" label="纬度">
             <template slot-scope="scope">
             <template slot-scope="scope">
-              <span>{{ ToDegrees(scope.row.lat, "lat") }}</span>
+              <span>{{ ToDegrees(scope.row.lat, 'lat') }}</span>
             </template>
             </template>
           </el-table-column>
           </el-table-column>
           <el-table-column prop="org_list" label="隶属组织">
           <el-table-column prop="org_list" label="隶属组织">
@@ -114,7 +125,10 @@
                 v-else
                 v-else
               >
               >
                 <div class="popover-content" v-html="content"></div>
                 <div class="popover-content" v-html="content"></div>
-                <span v-if="scope.row.org_list.length !== 0" @mouseover="orglisthover(scope.row)" slot="reference"
+                <span
+                  v-if="scope.row.org_list.length !== 0"
+                  @mouseover="orglisthover(scope.row)"
+                  slot="reference"
                   >{{ scope.row.org_list[0].org_name }}...</span
                   >{{ scope.row.org_list[0].org_name }}...</span
                 >
                 >
               </el-popover>
               </el-popover>
@@ -129,17 +143,17 @@
               <div class="state">
               <div class="state">
                 <p
                 <p
                   :style="{
                   :style="{
-                    color: scope.row.trap_status == '1' ? '#30A031 ' : 'red',
+                    color: scope.row.trap_status == '1' ? '#30A031 ' : 'red'
                   }"
                   }"
                 >
                 >
                   ·
                   ·
                 </p>
                 </p>
                 <p
                 <p
                   :style="{
                   :style="{
-                    color: scope.row.trap_status == '1' ? '#30A031 ' : 'red',
+                    color: scope.row.trap_status == '1' ? '#30A031 ' : 'red'
                   }"
                   }"
                 >
                 >
-                  {{ scope.row.trap_status == "1" ? "正常" : "停用" }}
+                  {{ scope.row.trap_status == '1' ? '正常' : '停用' }}
                 </p>
                 </p>
               </div>
               </div>
             </template>
             </template>
@@ -173,7 +187,7 @@
     <el-dialog
     <el-dialog
       :title="addtitle"
       :title="addtitle"
       :visible.sync="addtraptf"
       :visible.sync="addtraptf"
-      width="580px"
+      width="800px"
       @close="resetForm('ruleForm')"
       @close="resetForm('ruleForm')"
       :close-on-click-modal="false"
       :close-on-click-modal="false"
     >
     >
@@ -192,13 +206,21 @@
             <el-form-item label="所在经度" prop="lng">
             <el-form-item label="所在经度" prop="lng">
               <el-input v-model="ruleForm.lng" @blur="latblur"></el-input>
               <el-input v-model="ruleForm.lng" @blur="latblur"></el-input>
               <p style="height: 24px; padding-left: 16px">
               <p style="height: 24px; padding-left: 16px">
-                {{ isNaN(ruleForm.lng)?ToDigital(ruleForm.lng, "lng"):ToDegrees(ruleForm.lng, "lng") }}
+                {{
+                  isNaN(ruleForm.lng)
+                    ? ToDigital(ruleForm.lng, 'lng')
+                    : ToDegrees(ruleForm.lng, 'lng')
+                }}
               </p>
               </p>
             </el-form-item>
             </el-form-item>
             <el-form-item label="所在纬度" prop="lat">
             <el-form-item label="所在纬度" prop="lat">
               <el-input v-model="ruleForm.lat" @blur="latblur"></el-input>
               <el-input v-model="ruleForm.lat" @blur="latblur"></el-input>
               <p style="height: 24px; padding-left: 16px">
               <p style="height: 24px; padding-left: 16px">
-                {{ isNaN(ruleForm.lat)?ToDigital(ruleForm.lat, "lat"):ToDegrees(ruleForm.lat, "lat") }}
+                {{
+                  isNaN(ruleForm.lat)
+                    ? ToDigital(ruleForm.lat, 'lat')
+                    : ToDegrees(ruleForm.lat, 'lat')
+                }}
               </p>
               </p>
             </el-form-item>
             </el-form-item>
           </div>
           </div>
@@ -286,7 +308,7 @@
           @click="submitForm('ruleForm')"
           @click="submitForm('ruleForm')"
           size="mini"
           size="mini"
           :disabled="releaseTF"
           :disabled="releaseTF"
-          >{{ releaseTF == true ? "发布中..." : "确 定" }}</el-button
+          >{{ releaseTF == true ? '发布中...' : '确 定' }}</el-button
         >
         >
       </span>
       </span>
     </el-dialog>
     </el-dialog>
@@ -349,7 +371,7 @@
           @click="deriveclick"
           @click="deriveclick"
           size="mini"
           size="mini"
           :disabled="deriveTF"
           :disabled="deriveTF"
-          >{{ deriveTF ? "导出中..." : "确 定" }}</el-button
+          >{{ deriveTF ? '导出中...' : '确 定' }}</el-button
         >
         >
       </span>
       </span>
     </el-dialog>
     </el-dialog>
@@ -401,142 +423,157 @@
 </template>
 </template>
 
 
 <script>
 <script>
-import { isArray } from "highcharts";
+import { pointTypeOptions } from '@/util/constants';
+import { isArray } from 'highcharts';
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 //这里可以导入其他文件(比如:组件,工具js,第三方插件js,json文件,图片文件等等)
 
 
 export default {
 export default {
   //import引入的组件需要注入到对象中才能使用
   //import引入的组件需要注入到对象中才能使用
   components: {},
   components: {},
+  props: {
+    point_type: {
+      type: String,
+      default: ''
+    },
+    typeID: {
+      type: String,
+      default: ''
+    }
+  },
   data() {
   data() {
     //这里存放数据
     //这里存放数据
     var checkname = (rule, value, callback) => {
     var checkname = (rule, value, callback) => {
       if (/^[A-Za-z0-9\u4e00-\u9fa5]+$/.test(value)) {
       if (/^[A-Za-z0-9\u4e00-\u9fa5]+$/.test(value)) {
         callback();
         callback();
       } else {
       } else {
-        callback(new Error("请输入非中文格式"));
+        callback(new Error('请输入非中文格式'));
       }
       }
     };
     };
     var checklnglat = (rule, value, callback) => {
     var checklnglat = (rule, value, callback) => {
       if (isNaN(value)) {
       if (isNaN(value)) {
-        callback(new Error("请输入数字"));
+        callback(new Error('请输入数字'));
       } else {
       } else {
         callback();
         callback();
       }
       }
     };
     };
     return {
     return {
-      idinput: "",
-      inoffvalue: "",
+      idinput: '',
+      inoffvalue: '',
       inoffoptions: [
       inoffoptions: [
-        { label: "停用", value: "0" },
-        { label: "正常", value: "1" },
+        { label: '停用', value: '0' },
+        { label: '正常', value: '1' }
       ],
       ],
-      versionsvalue: "",
-      versionsvalue1: "", //组织id
+      versionsvalue: '',
+      versionsvalue1: '', //组织id
       versionsoptions: [], //组织
       versionsoptions: [], //组织
-      versionsvalue2: "", //组织id 用于搜索
+      versionsvalue2: '', //组织id 用于搜索
       versionsoptions2: [], //组织 用于搜索
       versionsoptions2: [], //组织 用于搜索
       defaultParams: {
       defaultParams: {
-        label: "org_name",
-        value: "id",
-        children: "childrens",
+        label: 'org_name',
+        value: 'id',
+        children: 'childrens',
         multiple: true,
         multiple: true,
-        checkStrictly: true,
+        checkStrictly: true
       },
       },
-      trapvalue: "",
+      trapvalue: '',
       traponsoptions: [], //监测点
       traponsoptions: [], //监测点
       inducer_data: [],
       inducer_data: [],
       queryInfo: {
       queryInfo: {
         page: 1,
         page: 1,
-        point_id: "", //监测点id
-        trap_number: "", //设备id
-        org_id: "", //组织id
-        trap_status: "", //状态
+        point_id: '', //监测点id
+        trap_number: '', //设备id
+        org_id: '', //组织id
+        trap_status: '' //状态
       },
       },
       tableData: [],
       tableData: [],
-      device_id: "",
+      device_id: '',
       total: 10,
       total: 10,
       loading: false,
       loading: false,
       addtraptf: false, //增加诱捕器弹框
       addtraptf: false, //增加诱捕器弹框
       ruleForm: {
       ruleForm: {
-        trap_id: "", //诱捕器id 修改时用到
-        trap_number: "", //诱捕器编号
-        lat: "", //           必传(string)               纬度
-        lng: "", //      必传(string)               经度
+        trap_id: '', //诱捕器id 修改时用到
+        trap_number: '', //诱捕器编号
+        lat: '', //           必传(string)               纬度
+        lng: '', //      必传(string)               经度
         org_id: [], //     必传(string)               所属组织id
         org_id: [], //     必传(string)               所属组织id
-        inducer_id: "", //     必传(string)               诱剂id
-        point_id: "", //     必传(string)               所属监测点id
-        trap_status: "", //    必传(string)               设备状态0停用 1正常
-        basecity: "",
-        oldorg_id: [],
+        inducer_id: '', //     必传(string)               诱剂id
+        point_id: '', //     必传(string)               所属监测点id
+        trap_status: '', //    必传(string)               设备状态0停用 1正常
+        basecity: '',
+        oldorg_id: []
       },
       },
       rules: {
       rules: {
-        basecity: [{ required: true, message: "请选择地址", trigger: "blur" }],
+        basecity: [{ required: true, message: '请选择地址', trigger: 'blur' }],
         trap_number: [
         trap_number: [
-          { required: true, message: "请输入诱捕器编号", trigger: "blur" },
-          { validator: checkname, trigger: "blur" },
+          { required: true, message: '请输入诱捕器编号', trigger: 'blur' },
+          { validator: checkname, trigger: 'blur' }
         ],
         ],
         lng: [
         lng: [
-          { required: true, message: "请输入经度", trigger: "blur" },
+          { required: true, message: '请输入经度', trigger: 'blur' }
           // { validator: checklnglat, trigger: "blur" },
           // { validator: checklnglat, trigger: "blur" },
         ],
         ],
         lat: [
         lat: [
-          { required: true, message: "请输入纬度", trigger: "blur" },
+          { required: true, message: '请输入纬度', trigger: 'blur' }
           // { validator: checklnglat, trigger: "blur" },
           // { validator: checklnglat, trigger: "blur" },
         ],
         ],
         // org_id: [
         // org_id: [
         //   { required: true, message: "请选择隶属组织", trigger: "change" },
         //   { required: true, message: "请选择隶属组织", trigger: "change" },
         // ],
         // ],
         point_id: [
         point_id: [
-          { required: true, message: "请选择所在监测点", trigger: "change" },
+          { required: true, message: '请选择所在监测点', trigger: 'change' }
         ],
         ],
         inducer_id: [
         inducer_id: [
-          { required: true, message: "请选择诱剂名称", trigger: "change" },
+          { required: true, message: '请选择诱剂名称', trigger: 'change' }
         ],
         ],
         trap_status: [
         trap_status: [
-          { required: true, message: "请选择设备状态", trigger: "change" },
-        ],
+          { required: true, message: '请选择设备状态', trigger: 'change' }
+        ]
       },
       },
-      parameter: "",
-      addtitle: "新增诱捕器",
+      parameter: '',
+      addtitle: '新增诱捕器',
       downloadtf: false,
       downloadtf: false,
-      downloadinput: "", //上传的文件名
+      downloadinput: '', //上传的文件名
       deriveVisible: false, //导出弹框
       deriveVisible: false, //导出弹框
-      derivefilename: "", //导出文件名称
+      derivefilename: '', //导出文件名称
       //地图属性
       //地图属性
       addLocationDialogVisible: false,
       addLocationDialogVisible: false,
       locationForm: {
       locationForm: {
-        lng: "",
-        lat: "",
+        lng: '',
+        lat: ''
       },
       },
-      addr: "", //搜索栏地址
-      address: "", //地图上标签地址
+      addr: '', //搜索栏地址
+      address: '', //地图上标签地址
       center: [114.05, 22.55],
       center: [114.05, 22.55],
-      content: "", //设备列表组织列表
+      content: '', //设备列表组织列表
       releaseTF: false,
       releaseTF: false,
       deriveTF: false,
       deriveTF: false,
+      pointTypeOptions
     };
     };
   },
   },
   //监听属性 类似于data概念
   //监听属性 类似于data概念
   computed: {},
   computed: {},
   //监控data中的数据变化
   //监控data中的数据变化
   watch: {
   watch: {
-    parameter: function (e) {
+    parameter: function(e) {
       // console.log(e);
       // console.log(e);
-      if (e == "add") {
+      if (e == 'add') {
         // console.log(this.$data.addtitle)
         // console.log(this.$data.addtitle)
-        this.$data.addtitle = "新增诱捕器";
-      } else if (e == "modify") {
-        this.$data.addtitle = "修改诱捕器";
+        this.$data.addtitle = '新增诱捕器';
+      } else if (e == 'modify') {
+        this.$data.addtitle = '修改诱捕器';
       }
       }
     },
     },
-    addtraptf: function (e) {
+    addtraptf: function(e) {
       if (e) {
       if (e) {
         console.log(this.$data.ruleForm);
         console.log(this.$data.ruleForm);
-        if (this.$data.ruleForm.lat != "" && this.$data.ruleForm.lng != "") {
-          this.city(this.ToDigital(this.$data.ruleForm.lat), this.ToDigital(this.$data.ruleForm.lng));
+        if (this.$data.ruleForm.lat != '' && this.$data.ruleForm.lng != '') {
+          this.city(
+            this.ToDigital(this.$data.ruleForm.lat),
+            this.ToDigital(this.$data.ruleForm.lng)
+          );
         }
         }
       }
       }
-    },
+    }
   },
   },
   //方法集合
   //方法集合
   methods: {
   methods: {
@@ -544,8 +581,8 @@ export default {
       //获取设备列表
       //获取设备列表
       this.loading = true;
       this.loading = true;
       this.$axios({
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=monitor_manage.trap_manage.trap_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=monitor_manage.trap_manage.trap_list',
         data: this.qs.stringify({
         data: this.qs.stringify({
           page_size: 20,
           page_size: 20,
           page: this.queryInfo.page,
           page: this.queryInfo.page,
@@ -553,15 +590,16 @@ export default {
           point_id: this.queryInfo.point_id,
           point_id: this.queryInfo.point_id,
           org_id: this.queryInfo.org_id,
           org_id: this.queryInfo.org_id,
           trap_status: this.queryInfo.trap_status,
           trap_status: this.queryInfo.trap_status,
-        }),
-      }).then((res) => {
+          type_id: this.typeID
+        })
+      }).then(res => {
         this.loading = false;
         this.loading = false;
         console.log(res.data.data);
         console.log(res.data.data);
         // console.log(res.data.data.page_list[0].org_list[0].org_name, '-----------111---------------------')
         // console.log(res.data.data.page_list[0].org_list[0].org_name, '-----------111---------------------')
         this.total = res.data.data.total_item;
         this.total = res.data.data.total_item;
         this.tableData = res.data.data.page_list;
         this.tableData = res.data.data.page_list;
         for (var i = 0; i < this.tableData.length; i++) {
         for (var i = 0; i < this.tableData.length; i++) {
-          this.tableData[i]["index"] = i + 1;
+          this.tableData[i]['index'] = i + 1;
         }
         }
         this.$nextTick(() => {
         this.$nextTick(() => {
           this.$refs.gridTable.bodyWrapper.scrollTop = 0;
           this.$refs.gridTable.bodyWrapper.scrollTop = 0;
@@ -571,12 +609,13 @@ export default {
     getmon() {
     getmon() {
       //获取监测点列表 组织列表
       //获取监测点列表 组织列表
       this.$axios({
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.org_list",
+        method: 'POST',
+        url: '/api/api_gateway?method=sysmenage.usermanager.org_list',
         data: this.qs.stringify({
         data: this.qs.stringify({
-          page_item: "100000000",
-        }),
-      }).then((res) => {
+          page_item: '100000000',
+          point_type: this.point_type
+        })
+      }).then(res => {
         console.log(res.data.data);
         console.log(res.data.data);
         this.versionsoptions = res.data.data.page_list; //组织
         this.versionsoptions = res.data.data.page_list; //组织
         this.traponsoptions = res.data.data.point_data;
         this.traponsoptions = res.data.data.point_data;
@@ -585,12 +624,12 @@ export default {
     },
     },
     getmon2() {
     getmon2() {
       this.$axios({
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=monitor_manage.trap_manage.trap_org",
+        method: 'POST',
+        url: '/api/api_gateway?method=monitor_manage.trap_manage.trap_org',
         data: this.qs.stringify({
         data: this.qs.stringify({
-          page_item: "10000000",
-        }),
-      }).then((res) => {
+          page_item: '10000000'
+        })
+      }).then(res => {
         console.log(res.data.data);
         console.log(res.data.data);
         this.versionsoptions2 = res.data.data.org_data; //组织
         this.versionsoptions2 = res.data.data.org_data; //组织
         // this.inoffoptions = res.data.data.point_data;
         // this.inoffoptions = res.data.data.point_data;
@@ -620,7 +659,7 @@ export default {
     },
     },
     submitForm(formName) {
     submitForm(formName) {
       console.log(this.ruleForm);
       console.log(this.ruleForm);
-      this.$refs[formName].validate((valid) => {
+      this.$refs[formName].validate(valid => {
         if (valid) {
         if (valid) {
           var org_id = [];
           var org_id = [];
           if (Array.isArray(this.ruleForm.org_id)) {
           if (Array.isArray(this.ruleForm.org_id)) {
@@ -643,75 +682,76 @@ export default {
           }
           }
 
 
           if (org_id.length > 0) {
           if (org_id.length > 0) {
-            org_id = org_id.join("/");
+            org_id = org_id.join('/');
           } else {
           } else {
             this.$message({
             this.$message({
-              message: "请选择隶属组织",
-              type: "warning",
+              message: '请选择隶属组织',
+              type: 'warning'
             });
             });
             return;
             return;
           }
           }
           console.log(org_id);
           console.log(org_id);
           this.releaseTF = true;
           this.releaseTF = true;
-          if (this.ruleForm.basecity == "请重新选择地址") {
+          if (this.ruleForm.basecity == '请重新选择地址') {
             this.$message({
             this.$message({
               showClose: true,
               showClose: true,
-              message: "请重新选择地址",
-              type: "warning",
+              message: '请重新选择地址',
+              type: 'warning'
             });
             });
             this.releaseTF = false;
             this.releaseTF = false;
             return;
             return;
           }
           }
           this.$axios({
           this.$axios({
-            method: "POST",
-            url: "/api/api_gateway?method=monitor_manage.trap_manage.add_trap",
+            method: 'POST',
+            url: '/api/api_gateway?method=monitor_manage.trap_manage.add_trap',
             data: this.qs.stringify({
             data: this.qs.stringify({
               trap_id: this.ruleForm.trap_id, //                  非必传(num)                诱捕器id 修改项
               trap_id: this.ruleForm.trap_id, //                  非必传(num)                诱捕器id 修改项
               trap_number: this.ruleForm.trap_number, //               必传(string)               设备编号
               trap_number: this.ruleForm.trap_number, //               必传(string)               设备编号
-              lat: this.ToDegrees(this.ruleForm.lat,"lat"), //                       必传(string)               纬度
-              lng: this.ToDegrees(this.ruleForm.lng,"lng"), //                       必传(string)               经度
+              lat: this.ToDegrees(this.ruleForm.lat, 'lat'), //                       必传(string)               纬度
+              lng: this.ToDegrees(this.ruleForm.lng, 'lng'), //                       必传(string)               经度
               org_id: org_id, //                    必传(string)               所属组织id
               org_id: org_id, //                    必传(string)               所属组织id
               inducer_id: this.ruleForm.inducer_id, //                必传(string)               诱剂id
               inducer_id: this.ruleForm.inducer_id, //                必传(string)               诱剂id
               point_id: this.ruleForm.point_id, //                  必传(string)               所属监测点id
               point_id: this.ruleForm.point_id, //                  必传(string)               所属监测点id
               trap_status: this.ruleForm.trap_status, //               必传(string)               设备状态0停用 1正常
               trap_status: this.ruleForm.trap_status, //               必传(string)               设备状态0停用 1正常
               parameter: this.parameter,
               parameter: this.parameter,
               city: this.ruleForm.basecity,
               city: this.ruleForm.basecity,
-            }),
-          }).then((res) => {
+              type_id: this.typeID
+            })
+          }).then(res => {
             console.log(res);
             console.log(res);
             if (res.data.data) {
             if (res.data.data) {
-              var message = "";
-              if (this.parameter == "add") {
+              var message = '';
+              if (this.parameter == 'add') {
                 // console.log(this.$data.addtitle)
                 // console.log(this.$data.addtitle)
-                message = "添加成功!";
-              } else if (this.parameter == "modify") {
-                message = "修改成功!";
+                message = '添加成功!';
+              } else if (this.parameter == 'modify') {
+                message = '修改成功!';
               }
               }
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
                 this.$message({
                   showClose: true,
                   showClose: true,
                   message: message,
                   message: message,
-                  type: "success",
+                  type: 'success'
                 });
                 });
               }
               }
               this.addtraptf = false;
               this.addtraptf = false;
               this.getcbdlist();
               this.getcbdlist();
             } else {
             } else {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
                 this.$message({
                   showClose: true,
                   showClose: true,
-                  message: "添加失败" + res.data.message,
-                  type: "warning",
+                  message: '添加失败' + res.data.message,
+                  type: 'warning'
                 });
                 });
               }
               }
             }
             }
             this.releaseTF = false;
             this.releaseTF = false;
           });
           });
         } else {
         } else {
-          if (document.getElementsByClassName("el-message").length == 0) {
+          if (document.getElementsByClassName('el-message').length == 0) {
             this.$message({
             this.$message({
-              message: "请将信息填写完全",
-              type: "warning",
+              message: '请将信息填写完全',
+              type: 'warning'
             });
             });
           }
           }
           return false;
           return false;
@@ -723,12 +763,12 @@ export default {
       this.releaseTF = false;
       this.releaseTF = false;
       this.$refs[formName].resetFields();
       this.$refs[formName].resetFields();
       for (var key in this.ruleForm) {
       for (var key in this.ruleForm) {
-        this.ruleForm[key] = "";
+        this.ruleForm[key] = '';
       }
       }
     },
     },
     openadd() {
     openadd() {
       this.addtraptf = true;
       this.addtraptf = true;
-      this.parameter = "add";
+      this.parameter = 'add';
       // console.log(this.ruleForm)
       // console.log(this.ruleForm)
     },
     },
     addtrap(e) {
     addtrap(e) {
@@ -740,7 +780,7 @@ export default {
       }
       }
       // console.log(this.ruleForm.org_id);
       // console.log(this.ruleForm.org_id);
       this.ruleForm.trap_status = this.ruleForm.trap_status.toString();
       this.ruleForm.trap_status = this.ruleForm.trap_status.toString();
-      this.parameter = "modify";
+      this.parameter = 'modify';
       this.ruleForm.org_id = [];
       this.ruleForm.org_id = [];
       this.ruleForm.oldorg_id = e.org_list;
       this.ruleForm.oldorg_id = e.org_list;
       console.log(this.ruleForm);
       console.log(this.ruleForm);
@@ -750,12 +790,13 @@ export default {
     },
     },
     getmon3(e) {
     getmon3(e) {
       this.$axios({
       this.$axios({
-        method: "POST",
-        url: "/api/api_gateway?method=sysmenage.usermanager.get_parent_org_list",
+        method: 'POST',
+        url:
+          '/api/api_gateway?method=sysmenage.usermanager.get_parent_org_list',
         data: this.qs.stringify({
         data: this.qs.stringify({
-          device_id: e.trap_id,
-        }),
-      }).then((res) => {
+          device_id: e.trap_id
+        })
+      }).then(res => {
         console.log(res.data.data);
         console.log(res.data.data);
         console.log(e);
         console.log(e);
         var orgdatas = res.data.data;
         var orgdatas = res.data.data;
@@ -779,46 +820,46 @@ export default {
     deletes(events) {
     deletes(events) {
       //删除诱捕器
       //删除诱捕器
       console.log(events);
       console.log(events);
-      var str = "您确定删除编号为<" + events.trap_number + ">的诱捕器吗?";
-      this.$confirm(str, "删除诱捕器", {
-        confirmButtonText: "确定",
-        cancelButtonText: "取消",
+      var str = '您确定删除编号为<' + events.trap_number + '>的诱捕器吗?';
+      this.$confirm(str, '删除诱捕器', {
+        confirmButtonText: '确定',
+        cancelButtonText: '取消'
       })
       })
         .then(() => {
         .then(() => {
           this.$axios({
           this.$axios({
-            method: "POST",
-            url: "/api/api_gateway?method=monitor_manage.trap_manage.add_trap",
+            method: 'POST',
+            url: '/api/api_gateway?method=monitor_manage.trap_manage.add_trap',
             data: this.qs.stringify({
             data: this.qs.stringify({
               trap_id: events.trap_id,
               trap_id: events.trap_id,
-              parameter: "del",
-            }),
-          }).then((res) => {
+              parameter: 'del'
+            })
+          }).then(res => {
             console.log(res);
             console.log(res);
             if (res.data.data) {
             if (res.data.data) {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
                 this.$message({
                   showClose: true,
                   showClose: true,
-                  message: "删除成功!",
-                  type: "success",
+                  message: '删除成功!',
+                  type: 'success'
                 });
                 });
               }
               }
               this.getcbdlist();
               this.getcbdlist();
             } else {
             } else {
-              if (document.getElementsByClassName("el-message").length == 0) {
+              if (document.getElementsByClassName('el-message').length == 0) {
                 this.$message({
                 this.$message({
                   showClose: true,
                   showClose: true,
-                  message: "删除失败," + res.data.message,
-                  type: "warning",
+                  message: '删除失败,' + res.data.message,
+                  type: 'warning'
                 });
                 });
               }
               }
             }
             }
           });
           });
         })
         })
         .catch(() => {
         .catch(() => {
-          if (document.getElementsByClassName("el-message").length == 0) {
+          if (document.getElementsByClassName('el-message').length == 0) {
             this.$message({
             this.$message({
-              type: "info",
-              message: "已取消删除",
+              type: 'info',
+              message: '已取消删除'
             });
             });
           }
           }
         });
         });
@@ -826,17 +867,18 @@ export default {
     handle(ev) {
     handle(ev) {
       this.downloadinput = ev.name;
       this.downloadinput = ev.name;
       var datas = new FormData();
       var datas = new FormData();
-      var username = localStorage.getItem("username");
-      datas.append("username", username);
-      datas.append("file", ev.raw);
+      var username = localStorage.getItem('username');
+      datas.append('username', username);
+      datas.append('file', ev.raw);
+      datas.append('type_id', this.typeID);
       this.$axios({
       this.$axios({
-        method: "POST",
-        url: "/api/trap_export",
+        method: 'POST',
+        url: '/api/trap_export',
         data: datas,
         data: datas,
-        responseType: "blob",
-      }).then((res) => {
+        responseType: 'blob'
+      }).then(res => {
         console.log(res);
         console.log(res);
-        this.downloadFile(res, "allot_result.xls");
+        this.downloadFile(res, 'allot_result.xls');
       });
       });
     },
     },
     download() {
     download() {
@@ -845,12 +887,12 @@ export default {
       window.location.href =
       window.location.href =
         // this.$deriveData +
         // this.$deriveData +
         // "http://192.168.1.77:12345/api/trap_export";1
         // "http://192.168.1.77:12345/api/trap_export";1
-        this.$deriveData + "/api/trap_export";
+        this.$deriveData + '/api/trap_export';
     },
     },
     downloadFile(res, name) {
     downloadFile(res, name) {
-      let link = document.createElement("a");
+      let link = document.createElement('a');
       link.href = window.URL.createObjectURL(new Blob([res.data]));
       link.href = window.URL.createObjectURL(new Blob([res.data]));
-      link.target = "_blank";
+      link.target = '_blank';
       //文件名和格式
       //文件名和格式
       link.download = name;
       link.download = name;
       document.body.appendChild(link);
       document.body.appendChild(link);
@@ -860,67 +902,68 @@ export default {
     },
     },
     deriveclick() {
     deriveclick() {
       // this.deriveVisible = false;
       // this.deriveVisible = false;
-      if (this.derivefilename == "") {
-        if (document.getElementsByClassName("el-message").length == 0) {
+      if (this.derivefilename == '') {
+        if (document.getElementsByClassName('el-message').length == 0) {
           this.$message({
           this.$message({
             showClose: true,
             showClose: true,
-            message: "请输入文件名称",
-            type: "warning",
+            message: '请输入文件名称',
+            type: 'warning'
           });
           });
         }
         }
       } else {
       } else {
         this.deriveTF = true;
         this.deriveTF = true;
         console.log(this.ruleForm);
         console.log(this.ruleForm);
         this.$axios({
         this.$axios({
-          method: "POST",
-          url: "api/trap_list_export",
+          method: 'POST',
+          url: 'api/trap_list_export',
           data: this.qs.stringify({
           data: this.qs.stringify({
             trap_number: this.ruleForm.trap_number,
             trap_number: this.ruleForm.trap_number,
             point_id: this.ruleForm.point_id,
             point_id: this.ruleForm.point_id,
             org_id: this.ruleForm.org_id,
             org_id: this.ruleForm.org_id,
             trap_status: this.ruleForm.trap_status,
             trap_status: this.ruleForm.trap_status,
             file_name: this.derivefilename,
             file_name: this.derivefilename,
-            user: localStorage.getItem("username"),
+            user: localStorage.getItem('username'),
+            type_id: this.typeID
           }),
           }),
-          responseType: "blob",
-        }).then((res) => {
+          responseType: 'blob'
+        }).then(res => {
           console.log(res);
           console.log(res);
-          this.downloadFile(res, this.derivefilename + ".xls");
+          this.downloadFile(res, this.derivefilename + '.xls');
         });
         });
       }
       }
     },
     },
     reset() {
     reset() {
       //重置
       //重置
-      this.idinput = "";
-      this.trapvalue = "";
-      this.inoffvalue = "";
-      this.queryInfo.trap_number = "";
-      this.queryInfo.point_id = "";
-      this.queryInfo.org_id = "";
-      this.queryInfo.trap_status = "";
-      this.versionsvalue2 = "";
+      this.idinput = '';
+      this.trapvalue = '';
+      this.inoffvalue = '';
+      this.queryInfo.trap_number = '';
+      this.queryInfo.point_id = '';
+      this.queryInfo.org_id = '';
+      this.queryInfo.trap_status = '';
+      this.versionsvalue2 = '';
       this.versionsvalue = [];
       this.versionsvalue = [];
       this.queryInfo.page = 1;
       this.queryInfo.page = 1;
       this.getcbdlist();
       this.getcbdlist();
     },
     },
     init() {
     init() {
-      console.log(document.getElementById("mapContainer2"));
-      var map = new AMap.Map("mapContainer2", {
+      console.log(document.getElementById('mapContainer2'));
+      var map = new AMap.Map('mapContainer2', {
         center: this.center,
         center: this.center,
         resizeEnable: true,
         resizeEnable: true,
         zoom: 10,
         zoom: 10,
-        lang: "en",
+        lang: 'en'
       });
       });
-      AMap.plugin(["AMap.ToolBar", "AMap.Geocoder"], () => {
+      AMap.plugin(['AMap.ToolBar', 'AMap.Geocoder'], () => {
         map.addControl(new AMap.ToolBar());
         map.addControl(new AMap.ToolBar());
         this.geocoder = new AMap.Geocoder({
         this.geocoder = new AMap.Geocoder({
-          city: "全国",
-          radius: 1000,
+          city: '全国',
+          radius: 1000
         });
         });
       });
       });
       setTimeout(() => {
       setTimeout(() => {
         var marker = new AMap.Marker({
         var marker = new AMap.Marker({
-          position: this.center,
+          position: this.center
         });
         });
         console.log(this.center);
         console.log(this.center);
         marker.setMap(map);
         marker.setMap(map);
@@ -932,45 +975,45 @@ export default {
       //位置搜索
       //位置搜索
       var marker = new AMap.Marker();
       var marker = new AMap.Marker();
       this.geocoder.getLocation(this.addr, (status, result) => {
       this.geocoder.getLocation(this.addr, (status, result) => {
-        if (status === "complete" && result.geocodes.length) {
+        if (status === 'complete' && result.geocodes.length) {
           var lnglat = result.geocodes[0].location;
           var lnglat = result.geocodes[0].location;
           marker.setPosition(lnglat);
           marker.setPosition(lnglat);
           this.map.add(marker);
           this.map.add(marker);
           this.map.setFitView(marker);
           this.map.setFitView(marker);
           this.locationForm = {
           this.locationForm = {
             lat: lnglat.lat,
             lat: lnglat.lat,
-            lng: lnglat.lng,
+            lng: lnglat.lng
           };
           };
         } else {
         } else {
-          if (document.getElementsByClassName("el-message").length == 0) {
-            this.$message.error("根据地址查询位置失败");
+          if (document.getElementsByClassName('el-message').length == 0) {
+            this.$message.error('根据地址查询位置失败');
           }
           }
         }
         }
       });
       });
     },
     },
     // 地图点击事件
     // 地图点击事件
     testevent() {
     testevent() {
-      this.map.on("click", (ev) => {
+      this.map.on('click', ev => {
         var lnglat = [ev.lnglat.lng, ev.lnglat.lat];
         var lnglat = [ev.lnglat.lng, ev.lnglat.lat];
         this.locationForm = { lng: lnglat[0], lat: lnglat[1] };
         this.locationForm = { lng: lnglat[0], lat: lnglat[1] };
         this.map.clearMap();
         this.map.clearMap();
         var marker = new AMap.Marker({
         var marker = new AMap.Marker({
-          position: lnglat,
+          position: lnglat
         });
         });
         marker.setMap(this.map);
         marker.setMap(this.map);
         this.getAddress(lnglat);
         this.getAddress(lnglat);
         setTimeout(() => {
         setTimeout(() => {
           new AMap.InfoWindow({
           new AMap.InfoWindow({
-            content: "<h5>" + "当前选中地址" + "</h5>" + this.address,
-            offset: new AMap.Pixel(0, -32),
+            content: '<h5>' + '当前选中地址' + '</h5>' + this.address,
+            offset: new AMap.Pixel(0, -32)
           }).open(this.map, lnglat);
           }).open(this.map, lnglat);
         }, 100);
         }, 100);
       });
       });
     },
     },
     getAddress(lnglat) {
     getAddress(lnglat) {
-      AMap.plugin("AMap.Geocoder", () => {
+      AMap.plugin('AMap.Geocoder', () => {
         this.geocoder.getAddress(lnglat, (status, result) => {
         this.geocoder.getAddress(lnglat, (status, result) => {
-          if (status === "complete" && result.info === "OK") {
+          if (status === 'complete' && result.info === 'OK') {
             this.address = result.regeocode.formattedAddress;
             this.address = result.regeocode.formattedAddress;
           }
           }
         });
         });
@@ -981,7 +1024,10 @@ export default {
       this.ruleForm.lng = this.locationForm.lng;
       this.ruleForm.lng = this.locationForm.lng;
       this.ruleForm.lat = this.locationForm.lat;
       this.ruleForm.lat = this.locationForm.lat;
       this.addLocationDialogVisible = false;
       this.addLocationDialogVisible = false;
-      this.city(this.ToDigital(this.ruleForm.lat), this.ToDigital(this.ruleForm.lng));
+      this.city(
+        this.ToDigital(this.ruleForm.lat),
+        this.ToDigital(this.ruleForm.lng)
+      );
     },
     },
     addLocationDialogClosed() {
     addLocationDialogClosed() {
       //弹框关闭时
       //弹框关闭时
@@ -993,24 +1039,24 @@ export default {
       if (this.locationForm.lat && this.locationForm.lng) {
       if (this.locationForm.lat && this.locationForm.lng) {
         let lnglat = [this.locationForm.lng, this.locationForm.lat];
         let lnglat = [this.locationForm.lng, this.locationForm.lat];
         var marker = new AMap.Marker({
         var marker = new AMap.Marker({
-          position: lnglat,
+          position: lnglat
         });
         });
         marker.setMap(this.map);
         marker.setMap(this.map);
       } else {
       } else {
-        if (document.getElementsByClassName("el-message").length == 0) {
-          this.$message.warning("请输入经纬度!");
+        if (document.getElementsByClassName('el-message').length == 0) {
+          this.$message.warning('请输入经纬度!');
         }
         }
         // return fasle;
         // return fasle;
       }
       }
     },
     },
     dingwei() {
     dingwei() {
       console.log(this.ruleForm);
       console.log(this.ruleForm);
-      if (this.ruleForm.lng != "" && this.ruleForm.lng != 0) {
+      if (this.ruleForm.lng != '' && this.ruleForm.lng != 0) {
         this.center[0] = this.ToDigital(this.ruleForm.lng);
         this.center[0] = this.ToDigital(this.ruleForm.lng);
       } else {
       } else {
         this.center = [114.05, 22.55];
         this.center = [114.05, 22.55];
       }
       }
-      if (this.ruleForm.lat != "" && this.ruleForm.lat != 0) {
+      if (this.ruleForm.lat != '' && this.ruleForm.lat != 0) {
         this.center[1] = this.ToDigital(this.ruleForm.lat);
         this.center[1] = this.ToDigital(this.ruleForm.lat);
       } else {
       } else {
         this.center = [114.05, 22.55];
         this.center = [114.05, 22.55];
@@ -1022,35 +1068,35 @@ export default {
     },
     },
     //度 转 度°分′秒″
     //度 转 度°分′秒″
     ToDegrees(val, type) {
     ToDegrees(val, type) {
-      if (typeof val == "undefined" || val == "" || isNaN(val)) {
+      if (typeof val == 'undefined' || val == '' || isNaN(val)) {
         return val;
         return val;
       }
       }
       val = val.toString();
       val = val.toString();
-      var A = "";
-      if (type == "lng") {
-        A = val > 0 ? "E" : "W";
-      } else if (type == "lat") {
-        A = val > 0 ? "N" : "S";
+      var A = '';
+      if (type == 'lng') {
+        A = val > 0 ? 'E' : 'W';
+      } else if (type == 'lat') {
+        A = val > 0 ? 'N' : 'S';
       }
       }
-      var i = val.indexOf(".");
+      var i = val.indexOf('.');
       var strDu = i < 0 ? val : val.substring(0, i); //获取度
       var strDu = i < 0 ? val : val.substring(0, i); //获取度
       var strFen = 0;
       var strFen = 0;
       var strMiao = 0;
       var strMiao = 0;
       if (i > 0) {
       if (i > 0) {
-        var strFen = "0" + val.substring(i);
-        strFen = strFen * 60 + "";
-        i = strFen.indexOf(".");
+        var strFen = '0' + val.substring(i);
+        strFen = strFen * 60 + '';
+        i = strFen.indexOf('.');
         if (i > 0) {
         if (i > 0) {
-          strMiao = "0" + strFen.substring(i);
+          strMiao = '0' + strFen.substring(i);
           strFen = strFen.substring(0, i); //获取分
           strFen = strFen.substring(0, i); //获取分
-          strMiao = strMiao * 60 + "";
-          i = strMiao.indexOf(".");
+          strMiao = strMiao * 60 + '';
+          i = strMiao.indexOf('.');
           strMiao = strMiao.substring(0, i + 4); //取到小数点后面三位
           strMiao = strMiao.substring(0, i + 4); //取到小数点后面三位
           strMiao = parseFloat(strMiao).toFixed(2); //精确小数点后面两位
           strMiao = parseFloat(strMiao).toFixed(2); //精确小数点后面两位
         }
         }
       }
       }
       console.log(A);
       console.log(A);
-      return strDu + "°" + strFen + "′" + strMiao + "″" + A;
+      return strDu + '°' + strFen + '′' + strMiao + '″' + A;
     },
     },
     //度°分′秒″ 转 度
     //度°分′秒″ 转 度
     ToDigital(lnglat) {
     ToDigital(lnglat) {
@@ -1060,26 +1106,26 @@ export default {
       console.log(lnglat);
       console.log(lnglat);
       lnglat = lnglat.toString();
       lnglat = lnglat.toString();
       var strDu, strFen, strMiao;
       var strDu, strFen, strMiao;
-      var duindex = lnglat.indexOf("°"); //字符度的下标
-      var fenindex = lnglat.indexOf("′"); //字符分的下标
-      var miaoindex = lnglat.indexOf("″"); //字符秒的下标
+      var duindex = lnglat.indexOf('°'); //字符度的下标
+      var fenindex = lnglat.indexOf('′'); //字符分的下标
+      var miaoindex = lnglat.indexOf('″'); //字符秒的下标
       strDu = lnglat.slice(0, duindex);
       strDu = lnglat.slice(0, duindex);
       strFen = lnglat.slice(duindex + 1, fenindex);
       strFen = lnglat.slice(duindex + 1, fenindex);
       strMiao = lnglat.slice(fenindex + 1, miaoindex);
       strMiao = lnglat.slice(fenindex + 1, miaoindex);
       // len = len > 6 || typeof len == "undefined" ? 6 : len; //精确到小数点后最多六位
       // len = len > 6 || typeof len == "undefined" ? 6 : len; //精确到小数点后最多六位
       strDu =
       strDu =
-        typeof strDu == "undefined" || strDu == "" ? 0 : parseFloat(strDu);
+        typeof strDu == 'undefined' || strDu == '' ? 0 : parseFloat(strDu);
       strFen =
       strFen =
-        typeof strFen == "undefined" || strFen == ""
+        typeof strFen == 'undefined' || strFen == ''
           ? 0
           ? 0
           : parseFloat(strFen) / 60;
           : parseFloat(strFen) / 60;
       strMiao =
       strMiao =
-        typeof strMiao == "undefined" || strMiao == ""
+        typeof strMiao == 'undefined' || strMiao == ''
           ? 0
           ? 0
           : parseFloat(strMiao) / 3600;
           : parseFloat(strMiao) / 3600;
       var digital = strDu + strFen + strMiao;
       var digital = strDu + strFen + strMiao;
       if (digital == 0) {
       if (digital == 0) {
-        return "";
+        return '';
       } else {
       } else {
         return digital.toFixed(6);
         return digital.toFixed(6);
       }
       }
@@ -1094,35 +1140,38 @@ export default {
     },
     },
     city(lat, lng) {
     city(lat, lng) {
       $.ajax({
       $.ajax({
-        url: "https://restapi.amap.com/v3/geocode/regeo",
-        type: "get",
-        dataType: "jsonp",
+        url: 'https://restapi.amap.com/v3/geocode/regeo',
+        type: 'get',
+        dataType: 'jsonp',
         data: this.qs.stringify({
         data: this.qs.stringify({
-          location: lng + "," + lat,
-          key: "78ce288400f4fc6d9458989875c833c2",
-          extensions: "base",
+          location: lng + ',' + lat,
+          key: '78ce288400f4fc6d9458989875c833c2',
+          extensions: 'base'
         }),
         }),
-        success: (res) => {
+        success: res => {
           console.log(res);
           console.log(res);
           if (res.regeocode.addressComponent.city.length == 0) {
           if (res.regeocode.addressComponent.city.length == 0) {
-            this.ruleForm.basecity = "请重新选择地址";
+            this.ruleForm.basecity = '请重新选择地址';
           } else {
           } else {
             this.ruleForm.basecity = res.regeocode.addressComponent.city;
             this.ruleForm.basecity = res.regeocode.addressComponent.city;
           }
           }
 
 
           console.log(this.ruleForm);
           console.log(this.ruleForm);
         },
         },
-        error: function (err) {
+        error: function(err) {
           // alert("服务端错误,请刷新浏览器后重试");
           // alert("服务端错误,请刷新浏览器后重试");
-        },
+        }
       });
       });
       // return arr;
       // return arr;
     },
     },
     latblur() {
     latblur() {
-      if (this.ruleForm.lat != "" && this.ruleForm.lng != "") {
-        this.city(this.ToDigital(this.ruleForm.lat), this.ToDigital(this.ruleForm.lng));
+      if (this.ruleForm.lat != '' && this.ruleForm.lng != '') {
+        this.city(
+          this.ToDigital(this.ruleForm.lat),
+          this.ToDigital(this.ruleForm.lng)
+        );
       }
       }
-    },
+    }
   },
   },
   beforeCreate() {}, //生命周期 - 创建之前
   beforeCreate() {}, //生命周期 - 创建之前
   //生命周期 - 创建完成(可以访问当前this实例)
   //生命周期 - 创建完成(可以访问当前this实例)
@@ -1138,7 +1187,7 @@ export default {
   updated() {}, //生命周期 - 更新之后
   updated() {}, //生命周期 - 更新之后
   beforeDestroy() {}, //生命周期 - 销毁之前
   beforeDestroy() {}, //生命周期 - 销毁之前
   destroyed() {}, //生命周期 - 销毁完成
   destroyed() {}, //生命周期 - 销毁完成
-  activated() {}, //如果页面有keep-alive缓存功能,这个函数会触发
+  activated() {} //如果页面有keep-alive缓存功能,这个函数会触发
 };
 };
 </script>
 </script>
 <style scoped lang="less">
 <style scoped lang="less">

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

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

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

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

+ 1 - 1
minggao/src/page/homepage/facilitydistribute.vue

@@ -60,7 +60,7 @@
         v-model="point_type"
         v-model="point_type"
         placeholder="请选择监测点类型"
         placeholder="请选择监测点类型"
         size="mini"
         size="mini"
-        @change="getmon2"
+        @change="handlePointTypeChange"
       >
       >
         <el-option
         <el-option
           v-for="item in pointTypeOptions"
           v-for="item in pointTypeOptions"

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

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