Procházet zdrojové kódy

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

lkk před 6 měsíci
rodič
revize
d6bf442d3f

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

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

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

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