From 5685babbcf4eb0b1cbbe1385472d862ce5fbb410 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期四, 06 四月 2023 14:23:53 +0800
Subject: [PATCH] 地质体模型挂载,数据申请页面 添加下载功能

---
 src/components/MapView/mapMenuPop.vue |   92 ++++++++++++++++++++++++++++------------------
 1 files changed, 56 insertions(+), 36 deletions(-)

diff --git a/src/components/MapView/mapMenuPop.vue b/src/components/MapView/mapMenuPop.vue
index 87b9a75..40471a3 100644
--- a/src/components/MapView/mapMenuPop.vue
+++ b/src/components/MapView/mapMenuPop.vue
@@ -226,6 +226,8 @@
       optionx: [],
       imagePoint: null,
       Layerprimit: null,
+      insertOption: null,
+      isflag: true,
     }
   },
   methods: {
@@ -233,9 +235,12 @@
 
       // this.dialogInsertVisible = false
       // this.dialogVisible = true
+      if (this.isflag) {
+        this.codeForm = res;
+        this.download1();
+        this.isflag = false
+      }
 
-      this.codeForm = res;
-      this.download();
     },
     handleInsertClose() {
       this.$confirm("纭鍏抽棴锛�")
@@ -309,7 +314,7 @@
         encrypt.setPublicKey(res.result)
       }
     },
-    async download() {
+    async download1() {
       if (this.codeForm.password == "") return
 
       var entities = [];
@@ -417,39 +422,45 @@
       // }
     },
     async getInsertApply(res) {
-      var entities = [];
-      var tabs = [];
-      for (var i in this.option) {
-        entities.push(this.option[i].entity)
-        tabs.push(this.option[i].tabDesc)
-      }
-      var std = [];
-      for (var i in this.ruleForm.depname) {
-        std.push(this.ruleForm.depname[i].name)
-      }
 
-      var obj = {
-        pwd: encr(this.codeForm.password),
-        entities: entities,
-        wkt: this.listdata.wkt,
-        filter: null,
-        ids: null,
-        depcode: null,
-        dirs: null,
-        depcodes: std,
-        descr: res.descr,
-        tabs: tabs
-      }
-      const data = await apply_insertApply(JSON.stringify(obj))
-      if (data.code != 200) {
-        this.$message.error("鏁版嵁鐢宠澶辫触")
-        return
-      }
-      this.$message({
-        message: "鏁版嵁鐢宠鎴愬姛",
-        type: "success",
-      })
+      if (!this.isflag) {
+        var entities = [];
+        var tabs = [];
+        if (this.option.length != res.tabs.length) {
+          return
+        }
 
+        for (var i in this.option) {
+          entities.push(this.option[i].entity)
+          tabs.push(this.option[i].tabDesc)
+        }
+        var std = [];
+        for (var i in this.ruleForm.depname) {
+          std.push(this.ruleForm.depname[i].name)
+        }
+        var obj = {
+          pwd: encr(this.codeForm.password),
+          entities: entities,
+          wkt: this.listdata.wkt,
+          filter: null,
+          ids: null,
+          depcode: null,
+          dirs: null,
+          depcodes: std,
+          descr: res.descr,
+          tabs: tabs
+        }
+        const data = await apply_insertApply(JSON.stringify(obj))
+        if (data.code != 200) {
+          this.$message.error("鏁版嵁鐢宠澶辫触")
+          return
+        }
+        this.$message({
+          message: "鏁版嵁鐢宠鎴愬姛",
+          type: "success",
+        })
+        this.isflag = true;
+      }
     },
 
 
@@ -478,6 +489,7 @@
         "&pwd=" +
         encodeURIComponent(rspwd)
       $("#Iframe1").attr("src", url).click()
+      // this.isflag = true;
     },
     handleCloseDown() {
       this.$confirm("纭鍏抽棴锛�")
@@ -917,18 +929,26 @@
     },
   },
   created() {
+
     this.setTableAll()
+
   },
   mounted() {
+
     this.$bus.$on("changeMapMenuTop", res => {
       if (res == "true") {
         this.setTableAll()
       }
     })
-    this.$bus.$on("setInsertDown", res => {
+    this.$bus.$on("setInsertDown2", res => {
       this.getInsertDown(res)
     })
-    this.$bus.$on("setInsertApply", res => {
+    this.$bus.$on("setInsertDown1", res => {
+
+      this.getInsertDown(res)
+    })
+    this.$bus.$on("setInsertApply1", res => {
+
       this.getInsertApply(res)
     })
   },

--
Gitblit v1.9.3