Browse Source

耕地保护分析功能一直处于运行状态无法完成修改,分析跳转后数据未更新获取结果错误

lkk 8 months ago
parent
commit
d6bf442d3f

+ 4 - 1
src/views/LandConsolidation/components/organize.vue

@@ -2,7 +2,7 @@
   <div class="OrganizeCon">
   <div class="OrganizeCon">
     <div class="tdTitle">试点目标</div>
     <div class="tdTitle">试点目标</div>
     <div class="echars">
     <div class="echars">
-      <pie unit="亩" class="pie_echart" ref="echartRef0"></pie>
+      <pie unit="亩" class="pie_echart" ref="echartRef0"  @echartClickTitle="(name) => echartClickTitle(name)"></pie>
     </div>
     </div>
     <div class="content">
     <div class="content">
       <div class="item" v-for="(sd, index) in orgnList" :key="index">
       <div class="item" v-for="(sd, index) in orgnList" :key="index">
@@ -158,6 +158,9 @@ export default {
     this.initEcharts();
     this.initEcharts();
   },
   },
   methods: {
   methods: {
+    echartClickTitle(name){
+      // console.log(name,'-------------------------');
+    },
     changeData(name, updata) {
     changeData(name, updata) {
       this[name] = updata;
       this[name] = updata;
     },
     },

+ 37 - 34
src/views/farmlandProtection/components/fzjcyp.vue

@@ -88,7 +88,7 @@ export default {
       },
       },
       //分析模型列表
       //分析模型列表
       anaModels: [],
       anaModels: [],
-      anaModelsCopy:[],//用于存放分析模型初始数据
+      anaModelsCopy: [], //用于存放分析模型初始数据
       templateYZ: [], //用地性质模版因子
       templateYZ: [], //用地性质模版因子
       editData: {}, //编辑的对象
       editData: {}, //编辑的对象
       multipleSelection: [],
       multipleSelection: [],
@@ -139,7 +139,7 @@ export default {
         xzmj: 0,
         xzmj: 0,
         xmmc: "耕地保护项目_" + this.getCurrentDateTime(),
         xmmc: "耕地保护项目_" + this.getCurrentDateTime(),
       };
       };
-      this.anaModels = this.anaModelsCopy
+      this.anaModels = this.anaModelsCopy;
       this.$refs.ruleForm.resetFields();
       this.$refs.ruleForm.resetFields();
       this.$refs.multipleTable.clearSelection();
       this.$refs.multipleTable.clearSelection();
       this.$refs.range.reset();
       this.$refs.range.reset();
@@ -154,40 +154,43 @@ export default {
             Message.warning("请绘制或导入选址范围!");
             Message.warning("请绘制或导入选址范围!");
             return;
             return;
           }
           }
-          let obj = {
+          if (this.multipleSelection.length) {
-            xzfw: this.$refs.range.fileDataID,
+            let obj = {
-            xmmc: this.ruleForm.xmmc,
+              xzfw: this.$refs.range.fileDataID,
-            mxlist: this.multipleSelection,
+              xmmc: this.ruleForm.xmmc,
-          };
+              mxlist: this.multipleSelection,
+            };
 
 
-          const loading = this.$loading({
+            const loading = this.$loading({
-            lock: true,
+              lock: true,
-            text: "分析中",
+              text: "分析中",
-            spinner: "el-icon-loading",
+              spinner: "el-icon-loading",
-            background: "rgba(0, 0, 0, 0.7)",
+              background: "rgba(0, 0, 0, 0.7)",
-          });
+            });
-          setTimeout(() => {
+            AddGdbh(obj)
-            loading.close();
+              .then((res) => {
-            this.activeTabs = "lsju";
+                // setTimeout(() => {
-            this.$emit("updateParent", "activeTabs", "lsju");
+                this.activeTabs = "lsju";
-            this.$refs.multipleTable.clearSelection();
+                this.$emit("updateParent", "activeTabs", "lsju");
-          }, 1000);
+                this.$refs.multipleTable.clearSelection();
-          AddGdbh(obj)
+                this.$message({
-            .then((res) => {
+                  message: res.message,
-              loading.close();
+                  type: res.success ? "success" : "warning",
-              this.activeTabs = "lsju";
+                });
-              this.$emit("updateParent", "activeTabs", "lsju");
+                this.reset();
-              this.$refs.multipleTable.clearSelection();
+                loading.close();
-              this.$message({
+              // }, 2000);
-                message: res.message,
+              })
-                type: res.success ? "success" : "warning",
+              .catch((error) => {
+                loading.close();
+                Message.error(error);
               });
               });
-              this.reset();
+          } else {
-            })
+            this.$message({
-            .catch((error) => {
+              message: "至少选择一个分析模型",
-              loading.close();
+              type: "warning",
-              Message.error(error);
             });
             });
+          }
         } else {
         } else {
           loading.close();
           loading.close();
           console.log("error submit!!");
           console.log("error submit!!");
@@ -199,7 +202,7 @@ export default {
       GetMxList()
       GetMxList()
         .then((res) => {
         .then((res) => {
           this.anaModels = res.data;
           this.anaModels = res.data;
-          this.anaModelsCopy = JSON.parse(JSON.stringify(res.data))
+          this.anaModelsCopy = JSON.parse(JSON.stringify(res.data));
         })
         })
         .catch((erro) => {
         .catch((erro) => {
           console.log(erro);
           console.log(erro);