Procházet zdrojové kódy

诱捕器组织不显示 3/12

zhangyun před 3 roky
rodič
revize
4a8b0c52fe

+ 2 - 2
minggao/config/index.js

@@ -12,9 +12,9 @@ module.exports = {
     assetsPublicPath: '/',
     proxyTable: {
       '/api': {
-        //  target: 'http://192.168.1.17:12345', //翟毅飞
+         target: 'http://192.168.1.17:12345', //翟毅飞
         //  target: 'https://yfznscd.com', //线上
-         target: 'https://www.toreskj.com', //线上
+        //  target: 'https://www.toreskj.com', //线上
         // target: 'http://192.168.1.77:12345', //曹世祥
         // target:"http://114.115.147.140:12345",
         // target: 'https://www.yfznscd.com',

+ 1 - 1
minggao/index.html

@@ -3,7 +3,7 @@
   <head>
     <meta charset="utf-8">
     <meta name="viewport" content="width=device-width,initial-scale=1.0">
-    <title>minggao</title>
+    <title>深圳海关国门生物安全监测预警指挥平台</title>
   </head>
   <body style="margin: 0;">
     <div id="app"></div>

+ 6 - 6
minggao/src/page/commandCenter/superviseAdminDetails.vue

@@ -64,8 +64,8 @@
             <ul class="list_ul">
               <li class="list_sing_li">
                 <div class="list_sing_div">
-                  <span class="list_div_tlt">签到图片:</span>
-                  <p v-if="taskObj.img_list.length !== 0" style="display: flex">
+                  <p class="list_div_tlt" style="width:12%">签到图片:</p>
+                  <p v-if="taskObj.img_list.length !== 0" style="display: flex;width:88%;flex-wrap:wrap;">
                     <span
                       class="list_div_img"
                       v-for="(item, index) in taskObj.img_list"
@@ -412,17 +412,17 @@ export default {
       }
 
       .list_sing_li {
-        display: flex;
-        justify-content: space-between;
+        // display: flex;
+        // justify-content: space-between;
         .list_sing_div {
           margin: 0 0 25px 0;
-          width: 33%;
+          width: 100%;
           font-size: 14px;
           display: flex;
           color: #333333;
           .list_div_img {
             width: 113px;
-            margin: 0 15px 0 0;
+            margin: 0 15px 15px 0;
             display: flex;
             img {
               width: 100%;

+ 6 - 6
minggao/src/page/commandCenter/taskRegulatorDetails.vue

@@ -61,10 +61,10 @@
             <ul class="list_ul">
               <li class="list_sing_li">
                 <div class="list_sing_div">
-                  <span class="list_div_tlt">签到图片:</span>
+                  <p class="list_div_tlt" style="width:12%">签到图片:</p>
                   <p
                     v-if="taskObj.img_list.length !== 0"
-                    style="display: flex;"
+                    style="display: flex;width:88%;flex-wrap:wrap;"
                   >
                     <span
                       class="list_div_img"
@@ -299,17 +299,17 @@ export default {
       }
 
       .list_sing_li {
-        display: flex;
-        justify-content: space-between;
+        // display: flex;
+        // justify-content: space-between;
         .list_sing_div {
           margin: 0 0 25px 0;
-          width: 40%;
+          width: 100%;
           font-size: 14px;
           display: flex;
           color: #333333;
           .list_div_img {
             width: 113px;
-            margin: 0 15px 0 0;
+            margin: 0 15px 15px 0;
             display: flex;
             img {
               width: 100%;

+ 46 - 2
minggao/src/page/forecasting/cbd/Cbd.vue

@@ -836,6 +836,16 @@ export default {
   deactivated() {
     console.log("cbd_deactivated");
   },
+  watch: {
+    operationDialogVisible: function (e) {
+      if (e) {
+        console.log(this.$data.ruleForm);
+        if (this.$data.ruleForm.lat != "" && this.$data.ruleForm.lng != "") {
+          this.city(this.$data.ruleForm.lat, this.$data.ruleForm.lng);
+        }
+      }
+    },
+  },
   computed: {
     userType: function () {
       //获取用户类型
@@ -1126,6 +1136,9 @@ export default {
             }
           }
         }
+        if(this.ruleForm.org_id[0] != this.versionsoptions[0].id){
+          this.ruleForm.org_id.unshift(this.versionsoptions[0].id)
+        }
         console.log(this.ruleForm.org_id);
         this.operationDialogVisible = true;
       });
@@ -1365,6 +1378,15 @@ export default {
       }
       org_id = org_id.join("/");
       console.log(this.ruleForm);
+      if (this.ruleForm.basecity == "请重新选择地址") {
+            this.$message({
+              showClose: true,
+              message: "请重新选择地址",
+              type: "warning",
+            });
+            this.releaseTF = false;
+            return;
+          }
       this.$refs[formName].validate((valid) => {
         if (valid) {
           this.releaseTF = true;
@@ -1438,7 +1460,25 @@ export default {
         }),
       }).then((res) => {
         console.log(res.data.data);
-        this.versionsoptions = res.data.data.page_list; //组织
+        // 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: 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);
+        }
+        console.log(this.versionsoptions)
         this.traponsoptions = res.data.data.point_data;
         this.inducer_data = res.data.data.inducer_data;
       });
@@ -1640,7 +1680,11 @@ export default {
         }),
         success: (res)=> {
           console.log(res);
-          this.ruleForm.basecity = res.regeocode.addressComponent.city
+          if (res.regeocode.addressComponent.city.length == 0) {
+            this.ruleForm.basecity = "请重新选择地址";
+          } else {
+            this.ruleForm.basecity = res.regeocode.addressComponent.city;
+          }
           console.log(this.ruleForm)
         },
         error: function (err) {

+ 46 - 17
minggao/src/page/forecasting/trap/trap.vue

@@ -460,6 +460,7 @@ export default {
         basecity: "",
       },
       rules: {
+        basecity: [{ required: true, message: "请选择地址", trigger: "blur" }],
         trap_number: [
           { required: true, message: "请输入诱捕器编号", trigger: "blur" },
           { validator: checkname, trigger: "blur" },
@@ -518,6 +519,14 @@ export default {
         this.$data.addtitle = "修改诱捕器";
       }
     },
+    addtraptf: function (e) {
+      if (e) {
+        console.log(this.$data.ruleForm);
+        if (this.$data.ruleForm.lat != "" && this.$data.ruleForm.lng != "") {
+          this.city(this.$data.ruleForm.lat, this.$data.ruleForm.lng);
+        }
+      }
+    },
   },
   //方法集合
   methods: {
@@ -558,7 +567,24 @@ export default {
         }),
       }).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: 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);
+        }
+        console.log(this.versionsoptions)
         this.traponsoptions = res.data.data.point_data;
         this.inducer_data = res.data.data.inducer_data;
       });
@@ -597,21 +623,6 @@ export default {
     },
     submitForm(formName) {
       console.log(this.ruleForm);
-      // var org_id = [];
-      // if (Array.isArray(this.ruleForm.org_id)) {
-      //   for (var i = 0; i < this.ruleForm.org_id.length; i++) {
-      //     org_id.push(
-      //       this.ruleForm.org_id[i][this.ruleForm.org_id[i].length - 1]
-      //     );
-      //   }
-      // } else {
-      //   org_id = this.ruleForm.org_id;
-      // }
-      // if (org_id.length > 0) {
-      //   org_id = org_id.join("/");
-      // }
-      // console.log(org_id);
-      // this.releaseTF = true;
       this.$refs[formName].validate((valid) => {
         if (valid) {
           var org_id = [];
@@ -629,6 +640,15 @@ export default {
           }
           console.log(org_id);
           this.releaseTF = true;
+          if (this.ruleForm.basecity == "请重新选择地址") {
+            this.$message({
+              showClose: true,
+              message: "请重新选择地址",
+              type: "warning",
+            });
+            this.releaseTF = false;
+            return;
+          }
           this.$axios({
             method: "POST",
             url: "/api/api_gateway?method=monitor_manage.trap_manage.add_trap",
@@ -736,6 +756,10 @@ export default {
             }
           }
         }
+        console.log(this.versionsoptions)
+        if(this.ruleForm.org_id[0] != this.versionsoptions[0].id){
+          this.ruleForm.org_id.unshift(this.versionsoptions[0].id)
+        }
         console.log(this.ruleForm.org_id);
         this.addtraptf = true;
       });
@@ -1068,7 +1092,12 @@ export default {
         }),
         success: (res) => {
           console.log(res);
-          this.ruleForm.basecity = res.regeocode.addressComponent.city;
+          if (res.regeocode.addressComponent.city.length == 0) {
+            this.ruleForm.basecity = "请重新选择地址";
+          } else {
+            this.ruleForm.basecity = res.regeocode.addressComponent.city;
+          }
+
           console.log(this.ruleForm);
         },
         error: function (err) {

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

@@ -697,7 +697,7 @@ export default {
           type: "scroll", //分页类型
           data: (function () {
             var list = [];
-            for (var i = 1; i < data.length; i++) {
+            for (var i = 0; i < data.length; i++) {
               list.push(data[i]);
             }
             return list;

+ 64 - 17
minggao/src/page/monitor/Monitor.vue

@@ -699,7 +699,11 @@
             >
           </div>
           <el-form-item label="所在城市" prop="basecity">
-            <el-input v-model="ruleForm.basecity" disabled style="width:217px"></el-input>
+            <el-input
+              v-model="ruleForm.basecity"
+              disabled
+              style="width: 217px"
+            ></el-input>
           </el-form-item>
         </el-form>
       </div>
@@ -999,7 +1003,7 @@ export default {
         lat: "",
         device_name: "",
         device_id: "",
-        basecity:""
+        basecity: "",
       },
       rules: {
         device_name: [
@@ -1091,7 +1095,7 @@ export default {
       for (var key in this.ruleForm) {
         this.ruleForm[key] = e[key];
       }
-      this.city(this.ruleForm.lat,this.ruleForm.lng)
+      this.city(this.ruleForm.lat, this.ruleForm.lng);
       this.getmon3(e);
     },
     getmon3(e) {
@@ -1118,6 +1122,9 @@ export default {
             }
           }
         }
+        if(this.ruleForm.org_id[0] != this.versionsoptions[0].id){
+          this.ruleForm.org_id.unshift(this.versionsoptions[0].id)
+        }
         console.log(this.ruleForm.org_id);
         this.operationDialogVisible = true;
       });
@@ -1959,6 +1966,15 @@ export default {
         org_id = this.ruleForm.org_id;
       }
       org_id = org_id.join("/");
+      if (this.ruleForm.basecity == "请重新选择地址") {
+        this.$message({
+          showClose: true,
+          message: "请重新选择地址",
+          type: "warning",
+        });
+        this.releaseTF = false;
+        return;
+      }
       this.$refs[formName].validate((valid) => {
         if (valid) {
           this.$axios({
@@ -1971,7 +1987,7 @@ export default {
               lng: this.ToDigital(this.ruleForm.lng), //
               device_id: this.ruleForm.device_id,
               device_name: this.ruleForm.device_name,
-              city:this.ruleForm.basecity
+              city: this.ruleForm.basecity,
             }),
           }).then((res) => {
             console.log(res);
@@ -2030,7 +2046,25 @@ export default {
         }),
       }).then((res) => {
         console.log(res.data.data);
-        this.versionsoptions = res.data.data.page_list; //组织
+        // 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: 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);
+        }
+        console.log(this.versionsoptions)
         this.traponsoptions = res.data.data.point_data;
         this.inducer_data = res.data.data.inducer_data;
       });
@@ -2113,7 +2147,7 @@ export default {
       this.ruleForm.lng = this.locationForm.lng;
       this.ruleForm.lat = this.locationForm.lat;
       this.addLocationDialogVisible = false;
-      this.city(this.ruleForm.lat,this.ruleForm.lng)
+      this.city(this.ruleForm.lat, this.ruleForm.lng);
     },
     addLocationDialogClosed() {
       //弹框关闭时
@@ -2211,7 +2245,7 @@ export default {
         return digital.toFixed(6);
       }
     },
-    city(lat,lng) {
+    city(lat, lng) {
       $.ajax({
         url: "https://restapi.amap.com/v3/geocode/regeo",
         type: "get",
@@ -2221,22 +2255,27 @@ export default {
           key: "78ce288400f4fc6d9458989875c833c2",
           extensions: "base",
         }),
-        success: (res)=> {
+        success: (res) => {
           console.log(res);
-          this.ruleForm.basecity = res.regeocode.addressComponent.city
-          console.log(this.ruleForm)
+          // this.ruleForm.basecity = res.regeocode.addressComponent.city
+          if (res.regeocode.addressComponent.city.length == 0) {
+            this.ruleForm.basecity = "请重新选择地址";
+          } else {
+            this.ruleForm.basecity = res.regeocode.addressComponent.city;
+          }
+          console.log(this.ruleForm);
         },
         error: function (err) {
-          alert("服务端错误,请刷新浏览器后重试")
-        }
-      })
+          alert("服务端错误,请刷新浏览器后重试");
+        },
+      });
       // return arr;
     },
-    latblur(){
-      if(this.ruleForm.lat!=""&&this.ruleForm.lng!=""){
-        this.city(this.ruleForm.lat,this.ruleForm.lng)
+    latblur() {
+      if (this.ruleForm.lat != "" && this.ruleForm.lng != "") {
+        this.city(this.ruleForm.lat, this.ruleForm.lng);
       }
-    }
+    },
   },
   watch: {
     // 添加设备弹框
@@ -2257,6 +2296,14 @@ export default {
         this.stepIndex = 0; // 步骤下标
       }
     },
+    operationDialogVisible: function (e) {
+      if (e) {
+        console.log(this.$data.ruleForm);
+        if (this.$data.ruleForm.lat != "" && this.$data.ruleForm.lng != "") {
+          this.city(this.$data.ruleForm.lat, this.$data.ruleForm.lng);
+        }
+      }
+    },
   },
 };
 </script>

+ 5 - 5
minggao/src/util/http.js

@@ -19,11 +19,11 @@ Vue.prototype.DOMIN = DOMIN
 Vue.prototype.wsUrl = wsUrl // 实时通信Url
 Vue.prototype.mapJson = mapJson //请求地图json,不带端口号
 // console.log(DOMIN)
-// axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
-// axios.defaults.timeout = 30000;
-// axios.defaults.withCredentials = true //axios请求时携带session
-// axios.defaults.crossDomain = true
-// axios.defaults.baseURL = DOMIN
+axios.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=UTF-8';
+axios.defaults.timeout = 30000;
+axios.defaults.withCredentials = true //axios请求时携带session
+axios.defaults.crossDomain = true
+axios.defaults.baseURL = DOMIN
 
 
 // axios请求前的拦截