From 786b2ae462000deb67669f614fc4ba6fe63149c5 Mon Sep 17 00:00:00 2001
From: Surpriseplus <845948745@qq.com>
Date: 星期一, 03 四月 2023 17:10:19 +0800
Subject: [PATCH] 空间查询下载,资料馆属性查询,文件下载修改

---
 src/views/datamanage/uploadmanage.vue |    4 
 src/views/Archive/index.vue           |  197 ++++++++++++++++++++---
 src/views/Tools/LayerTree.vue         |    4 
 src/components/MapView/mapMenuTop.vue |    5 
 src/views/Synthesis/LeftMenu.vue      |    5 
 src/components/MapView/mapMenuPop.vue |  247 +++++++++++++++++++++---------
 6 files changed, 353 insertions(+), 109 deletions(-)

diff --git a/src/components/MapView/mapMenuPop.vue b/src/components/MapView/mapMenuPop.vue
index 36f4d0e..87b9a75 100644
--- a/src/components/MapView/mapMenuPop.vue
+++ b/src/components/MapView/mapMenuPop.vue
@@ -144,6 +144,7 @@
   decr,
   encr,
   dataLib_selectDepsByIds,
+  dataLib_selectDbOverflowDep
 } from "../../api/api.js"
 import { getToken } from "@/utils/auth"
 import $ from "jquery"
@@ -232,6 +233,7 @@
 
       // this.dialogInsertVisible = false
       // this.dialogVisible = true
+
       this.codeForm = res;
       this.download();
     },
@@ -254,29 +256,105 @@
       this.dialogInsertVisible = false
     },
     async getDownloadDep() {
-      var std = []
+      this.$bus.$emit("setDialogInsertVisible", true)
+
+      // var std = []
+      // for (var i in this.option) {
+      //   std.push(this.option[i].entity)
+      // }
+      // var obj = {
+      //   entities: std,
+      //   wkt: this.listdata.wkt,
+      // }
+      // const data = await dataQuery_selectDbOverflowDep(JSON.stringify(obj))
+      // if (data.code != 200) {
+      //   this.$message.error("鏁版嵁璇锋眰澶辫触")
+      //   return
+      // }
+
+      // if (data.result.length == 0 || data.result == null) {
+      //   this.insertFlag = 1
+      //   // this.dialogVisible = true
+      //   
+      // } else {
+      //   this.insertFlag = 2
+      //   var std = []
+      //   this.insertOption.ids = data.result
+      //   var val = ""
+      //   for (var i in data.result) {
+      //     if (val == "") {
+      //       val += "codes=" + data.result[i]
+      //     } else {
+      //       val += "&codes=" + data.result[i]
+      //     }
+
+      //     std.push({
+      //       name: data.result[i],
+      //     })
+      //   }
+      //   const data1 = await dataLib_selectDepsByIds(val)
+
+      //   this.ruleForm.depid = data1.result
+      //   this.ruleForm.depname = std
+      //   this.ruleForm.wkt = decr(this.listdata.wkt)
+      //   this.ruleForm.tabs = this.option
+      //   // this.dialogInsertVisible = true
+      //   this.$bus.$emit("setDialogInsertVisible", this.ruleForm)
+      // }
+    },
+    async signGetPublicKey() {
+      const res = await sign_getPublicKey()
+      if (res && res.code == 200) {
+        window.encrypt = new JSEncrypt()
+        encrypt.setPublicKey(res.result)
+      }
+    },
+    async download() {
+      if (this.codeForm.password == "") return
+
+      var entities = [];
       for (var i in this.option) {
-        std.push(this.option[i].entity)
+        entities.push(this.option[i].entity)
       }
       var obj = {
-        entities: std,
+        pwd: encrypt.encrypt(this.codeForm.password),
+        entities: entities,
         wkt: this.listdata.wkt,
+        filter: null,
+        ids: null,
+        depcode: null,
+        dirs: null
       }
-      const data = await dataQuery_selectDbOverflowDep(JSON.stringify(obj))
+      const data = await dataLib_selectDbOverflowDep(obj)
       if (data.code != 200) {
-        this.$message.error("鏁版嵁璇锋眰澶辫触")
         return
       }
 
-      if (data.result.length == 0 || data.result == null) {
-        this.insertFlag = 1
-        // this.dialogVisible = true
-        this.$bus.$emit("setDialogInsertVisible", true)
+      if (data.result.length == 0) {
+        var that = this;
+
+        $.ajax({
+          url: BASE_URL + "/dataLib/downloadDbData?token=" + getToken(),
+          type: "POST",
+          data: JSON.stringify(obj),
+          dataType: 'json', // html銆乯son銆乯sonp銆乻cript銆乼ext
+          contentType: "application/json", // "application/x-www-form-urlencoded"
+          success: (data) => {
+            if (data.code == 200) {
+
+              if (data.result) {
+                that.selectDownloadFile(data.result, obj.pwd)
+              }
+
+            }
+          },
+          error: function (e) {
+          }
+        });
       } else {
-        this.insertFlag = 2
-        var std = []
-        this.insertOption.ids = data.result
+
         var val = ""
+        var std = [];
         for (var i in data.result) {
           if (val == "") {
             val += "codes=" + data.result[i]
@@ -289,78 +367,94 @@
           })
         }
         const data1 = await dataLib_selectDepsByIds(val)
-
         this.ruleForm.depid = data1.result
         this.ruleForm.depname = std
         this.ruleForm.wkt = decr(this.listdata.wkt)
         this.ruleForm.tabs = this.option
-        // this.dialogInsertVisible = true
         this.$bus.$emit("setDialogInsertVisible", this.ruleForm)
       }
-    },
-    async signGetPublicKey() {
-      const res = await sign_getPublicKey()
-      if (res && res.code == 200) {
-        window.encrypt = new JSEncrypt()
-        encrypt.setPublicKey(res.result)
-      }
-    },
-    async download() {
-      if (this.codeForm.password == "") return
-      if (this.insertFlag == 1) {
-        var obj = {
-          pwd: encrypt.encrypt(this.codeForm.password),
-          entities: [],
-          wkt: this.listdata.wkt,
-        }
-        for (var i in this.option) {
-          obj.entities.push(this.option[i].entity)
-        }
-        var token = getToken()
-        var that = this
-        $.ajax(BASE_URL + "/dataLib/downloadDbReq?token=" + token, {
-          type: "post",
-          data: JSON.stringify(obj),
-          async: true,
-          cache: false,
-          processData: false,
-          contentType: false,
-          success: res => {
-            if (res.code != 200) {
-              return
-            }
 
-            this.selectDownloadFile(res.result, obj.pwd)
-          },
-        })
-      } else if (this.insertFlag == 2) {
-        var std = []
-        var std1 = []
-        for (var i in this.option) {
-          std.push(this.option[i].tabDesc)
-          std1.push(this.option[i].entity)
-        }
-        var obj = {
-          depcodes: this.insertOption.ids,
-          pwd: encr(this.codeForm.password),
-          tabs: std,
-          entities: std1,
-          wkt: this.listdata.wkt,
-          descr: this.ruleForm.descr,
-        }
-        const data1 = await apply_insertApply(JSON.stringify(obj))
-        if (data1.code != 200) {
-          this.$message.error("鏁版嵁鐢宠澶辫触")
-          return
-        }
-        this.$message({
-          message: "鏁版嵁鐢宠鎴愬姛",
-          type: "success",
-        })
+      // if (this.insertFlag == 1) {
 
-        this.closeDown()
-      }
+      //   for (var i in this.option) {
+      //     obj.entities.push(this.option[i].entity)
+      //   }
+      //   var token = getToken()
+      //   var that = this
+      //   $.ajax(BASE_URL + "/dataLib/downloadDbReq?token=" + token, {
+      //     type: "post",
+      //     data: JSON.stringify(obj),
+      //     async: true,
+      //     cache: false,
+      //     processData: false,
+      //     contentType: false,
+      //     success: res => {
+      //       if (res.code != 200) {
+      //         return
+      //       }
+
+      //       this.selectDownloadFile(res.result, obj.pwd)
+      //     },
+      //   })
+      // } else if (this.insertFlag == 2) {
+      //   var std = []
+      //   var std1 = []
+      //   for (var i in this.option) {
+      //     std.push(this.option[i].tabDesc)
+      //     std1.push(this.option[i].entity)
+      //   }
+      //   var obj = {
+      //     depcodes: this.insertOption.ids,
+      //     pwd: encr(this.codeForm.password),
+      //     tabs: std,
+      //     entities: std1,
+      //     wkt: this.listdata.wkt,
+      //     descr: this.ruleForm.descr,
+      //   }
+      //   const data1 = await apply_insertApply(JSON.stringify(obj))
+
+      //   this.closeDown()
+      // }
     },
+    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",
+      })
+
+    },
+
+
+
+
     async selectDownloadFile(rsid, rspwd) {
       var downObj = {
         guid: rsid,
@@ -834,6 +928,9 @@
     this.$bus.$on("setInsertDown", res => {
       this.getInsertDown(res)
     })
+    this.$bus.$on("setInsertApply", res => {
+      this.getInsertApply(res)
+    })
   },
   destroyed() {
     this.$store.state.propertiesFlag = null
diff --git a/src/components/MapView/mapMenuTop.vue b/src/components/MapView/mapMenuTop.vue
index 945beab..8bf05cb 100644
--- a/src/components/MapView/mapMenuTop.vue
+++ b/src/components/MapView/mapMenuTop.vue
@@ -391,6 +391,7 @@
       this.menuTopFrom.queryLayer = null;
 
       this.$store.state.propertiesName = valTree[0];
+      this.treeChange = [];
       for (var i = 0; i < valTree.length; i++) {
         if (valTree[i].entity) {
           if (!this.menuTopFrom.queryLayer) {
@@ -473,6 +474,10 @@
         sgworld.Creator.DeleteObject(this.$store.state.primitLayer)
         this.$store.state.primitLayer = null
       }
+
+
+
+
       if (this.treeChange.length == 0) {
         this.$message.error("璇烽�夋嫨瑕佹煡璇㈢殑鏁版嵁")
         return
diff --git a/src/views/Archive/index.vue b/src/views/Archive/index.vue
index 63ee996..4c71eac 100644
--- a/src/views/Archive/index.vue
+++ b/src/views/Archive/index.vue
@@ -302,7 +302,6 @@
         <el-divider></el-divider>
         <p>{{ $t('archiveObj.label8') }}锛歿{setInfoBoxTime(itemdetail1.lastTime) }} </p>
         <el-divider></el-divider>
-
         <p>{{ $t('dataManage.vmobj.depName') }}锛歿{ itemdetail1.depName }}</p>
         <el-divider></el-divider>
         <p>
@@ -648,6 +647,7 @@
               @click="downloadLogVisible = true"
             >{{$t('common.download')}}</el-button>
           </el-form-item>
+          <!--   -->
         </el-form>
         <el-divider />
         <el-table
@@ -1212,6 +1212,8 @@
 import $ from 'jquery'
 import { getToken } from '@/utils/auth';
 import {
+  decr,
+  encr,
   selectdepTab,
   dataLib_selectProject,
   dataLib_selectDirTypes,
@@ -1227,7 +1229,10 @@
   dataLib_selectPageAndCountByPid,
   dataLib_selectMetaById,
   dataLib_selectFiles,
-  dataLib_deletes
+  dataLib_deletes,
+  dataLib_selectDbOverflowDep,
+  dataLib_selectDepsByIds,
+  apply_insertApply
 } from '../../api/api';
 import { dataLibView } from '@/api/screen.js'
 export default {
@@ -1371,6 +1376,7 @@
       },
       dialogInsertVisible: false,
       dialogVisible1: false,
+      multipleSelection: [],
     };
   },
 
@@ -1388,6 +1394,11 @@
     })
   },
   methods: {
+    //鏁版嵁搴撴煡璇笅杞�
+    downloadBankData() {
+      // downloadLogVisible
+
+    },
     handleCloseDown1() {
       this.$confirm("纭鍏抽棴锛�")
         .then(_ => {
@@ -1397,7 +1408,7 @@
     },
     downloadx() {
       this.$bus.$emit("setInsertDown", this.codeForm)
-      this.closeDownx();
+      // 
     },
     closeDownx() {
       this.dialogVisible1 = false;
@@ -1406,10 +1417,82 @@
         repassword: '',
       }
     },
-    getInsertDown() {
+    async getInsertDown() {
+
       this.dialogInsertVisible = false;
-      this.dialogVisible1 = true;
-      // 
+      this.dialogVisible1 = false;
+      this.downloadLogVisible = false;
+      var obj = null
+      if (this.dialogMapVisible == true) {
+        var entities = [];
+        var tabs = [];
+        for (var i in this.ruleForm.tabs) {
+          entities.push(this.ruleForm.tabs[i].entity)
+          tabs.push(this.ruleForm.tabs[i].tabDesc)
+        }
+        var std = [];
+        for (var i in this.ruleForm.depname) {
+          std.push(this.ruleForm.depname[i].name)
+        }
+        obj = {
+          pwd: encr(this.codeForm.password),
+          entities: entities,
+          wkt: encr(this.ruleForm.wkt),
+          filter: null,
+          ids: null,
+          depcode: null,
+          dirs: null,
+          depcodes: std,
+          descr: this.ruleForm.descr,
+          tabs: tabs
+        }
+      } else {
+        var ids = [];
+        var filter = null;
+        this.downloadLogVisible = false;
+        if (this.multipleSelection.length != 0) {
+          for (var i in this.multipleSelection) {
+            ids.push(this.multipleSelection[i].gid)
+          }
+          filter = null;
+        } else {
+          filter = this.listBankData.filter;
+          ids = null;
+        }
+
+        var std = [];
+        for (var i in this.ruleForm.depname) {
+          std.push(this.ruleForm.depname[i].name)
+        }
+        var dirs = null;
+        if (this.listData.dirs) {
+          dirs = this.listData.dirs
+        }
+        obj = {
+          pwd: encr(this.codeForm.password),
+          entities: [this.listBankData.name], // bpachydrogeology,bhydrogeologyattach
+          wkt: null,
+          filter: filter,
+          ids: ids,
+          depcode: this.listData.depcode,
+          dirs: dirs,
+          depcodes: std,
+          descr: this.ruleForm.descr,
+          tabs: [this.listBankData.title]
+        }
+      }
+
+      const data = await apply_insertApply(JSON.stringify(obj))
+      if (data.code != 200) {
+        this.$message.error("鏁版嵁鐢宠澶辫触")
+        return
+      }
+      this.$message({
+        message: "鏁版嵁鐢宠鎴愬姛",
+        type: "success",
+      })
+      this.closeDownx();
+      this.closeDown1();
     },
 
     closeInsertDown() {
@@ -1422,6 +1505,7 @@
         descr: null,
       }
       this.dialogInsertVisible = false
+      this.closeDown1();
     },
     handleInsertClose() {
       this.$confirm("纭鍏抽棴锛�")
@@ -1823,32 +1907,76 @@
       if (!passwordreg.test(this.codeForm.password)) {
         return;
       }
+      var ids = [];
+      var filter = null;
+      this.downloadLogVisible = false;
+      if (this.multipleSelection.length != 0) {
+        for (var i in this.multipleSelection) {
+          ids.push(this.multipleSelection[i].gid)
+        }
+        filter = null;
+      } else {
+        filter = this.listBankData.filter;
+        ids = null;
+      }
+
+
       var obj = {
         entities: [this.listBankData.name], // bpachydrogeology,bhydrogeologyattach
-        filter: this.listBankData.filter,
+        filter: filter,
+        ids: ids,
+        wkt: null,
         pwd: encrypt.encrypt(this.codeForm.password),
-        depcodes: [this.listData.depcode],
+        depcode: this.listData.depcode,
         dirs: this.listData.dirs
-
       };
+      const data = await dataLib_selectDbOverflowDep(obj)
+      if (data.code != 200) {
+        return
+      }
+      if (data.result.length == 0) {
+        var that = this;
+        $.ajax({
+          url: BASE_URL + "/dataLib/downloadDbData?token=" + getToken(),
+          type: "POST",
+          data: JSON.stringify(obj),
+          dataType: 'json', // html銆乯son銆乯sonp銆乻cript銆乼ext
+          contentType: "application/json", // "application/x-www-form-urlencoded"
+          success: (data) => {
+            if (data.code == 200) {
+              that.downloadflie(data, this.codeForm.password)
 
-      var that = this;
-      $.ajax({
-        url: BASE_URL + "/dataLib/downloadEntityReq?token=" + getToken(),
-        type: "POST",
-        data: JSON.stringify(obj),
-        dataType: 'json', // html銆乯son銆乯sonp銆乻cript銆乼ext
-        contentType: "application/json", // "application/x-www-form-urlencoded"
-        success: (data) => {
-          if (data.code == 200) {
-            that.downloadflie(data, this.codeForm.password)
-
+            }
+          },
+          error: function (e) {
           }
-        },
-        error: function (e) {
+        });
+
+      } else {
+        var val = ""
+        var std = [];
+        for (var i in data.result) {
+          if (val == "") {
+            val += "codes=" + data.result[i]
+          } else {
+            val += "&codes=" + data.result[i]
+          }
+
+          std.push({
+            name: data.result[i],
+          })
         }
-      });
-      this.closeDown1();
+
+        const data1 = await dataLib_selectDepsByIds(val)
+        this.ruleForm.depid = data1.result
+        this.ruleForm.depname = std
+        this.ruleForm.wkt = null
+        this.ruleForm.tabs = [{
+          tabDesc: this.listBankData.title
+        }]
+        this.dialogInsertVisible = true
+      }
+      // this.closeDown1();
     },
     downloadflie(data, pwd) {
 
@@ -1856,6 +1984,8 @@
       var url = BASE_URL + "/dataLib/downloadFile?token=" + token + "&guid=" + data.result + "&pwd=" + encrypt.encrypt(pwd);
       $("#downFrame").attr("src", url).click();
       this.loading = false;
+      this.closeDownx();
+      this.closeDown1();
     },
     closeDown1() {
       this.downloadLogVisible = false;
@@ -1887,24 +2017,29 @@
         return;
       }
       this.passWorldVisible = false;
+      var password = this.codeForm.repassword
       var std = [];
       for (var i in this.multipleSelection1) {
         std.push(this.multipleSelection1[i].id)
       }
       var obj = {
-        pwd: encrypt.encrypt(this.codeForm.repassword),
+        pwd: encrypt.encrypt(password),
         ids: std
       };
+      this.closeDown();
+      this.closeDownx();
       const res = await dataLib_downloadReq(JSON.stringify(obj));
 
       if (res.code != 200) {
         this.$message.error('涓嬭浇璇锋眰澶辫触');
         return
       }
-
+      if (!res.result) {
+        return
+      }
       var downObj = {
         guid: res.result,
-        pwd: encodeURIComponent(encrypt.encrypt(this.codeForm.repassword))
+        pwd: encodeURIComponent(encrypt.encrypt(password))
       }
 
       const data = await dataLib_selectDownloadFile(downObj)
@@ -1916,7 +2051,7 @@
       var url = BASE_URL + "/dataLib/downloadFile?token=" + token + "&guid=" + res.result + "&pwd=" + encodeURIComponent(encrypt.encrypt(this.codeForm.repassword));
 
       $("#downFrame").attr("src", url).click();
-      this.closeDown();
+
 
       this.monthdata.filter((res) => {
         return res.ischecked = false;
@@ -1960,8 +2095,8 @@
       this.formInline.keywords = "";//楂樼骇鎼滅储
       this.getAllTabesData();
     },
-    handleSelectionChange() {
-
+    handleSelectionChange(val) {
+      this.multipleSelection = val;
     },
     //鍗$墖璇︽儏鐐瑰嚮浜嬩欢
     async setCardDetails(res) {
@@ -1976,7 +2111,7 @@
           break;
       }
     },
-    //鑾峰彇鏁版嵁搴撴暟鎹�
+    //鑾峰彇鏁版嵁搴撴暟鎹甹s
     getBankTableData(res) {
       this.listBankData.name = res.entity;
       this.listBankData.pageIndex = 1;
diff --git a/src/views/Synthesis/LeftMenu.vue b/src/views/Synthesis/LeftMenu.vue
index f5a922c..ea36c62 100644
--- a/src/views/Synthesis/LeftMenu.vue
+++ b/src/views/Synthesis/LeftMenu.vue
@@ -2543,6 +2543,7 @@
         tileHeight: 512,
       });
       layerWMS.name = "Wms_Layer";
+
       window.Viewer.scene.imageryLayers.addImageryProvider(window.layerWMS);
       var layer2 = new Image({
         name: "Wms_Layer",
@@ -3056,8 +3057,10 @@
     },
     getInsertDown() {
       this.dialogInsertVisible = false;
-      this.dialogVisible1 = true;
+      // this.dialogVisible1 = true;
       // 
+
+      this.$bus.$emit("setInsertApply", this.ruleForm)
     },
     handleExtentClose() {
       this.dialogExtentVisible = false
diff --git a/src/views/Tools/LayerTree.vue b/src/views/Tools/LayerTree.vue
index f461b83..04cc9d1 100644
--- a/src/views/Tools/LayerTree.vue
+++ b/src/views/Tools/LayerTree.vue
@@ -1180,9 +1180,9 @@
       }
     },
     setChangeProLayer() {
-
+      var value = this.$store.state.isProjectLayer;
       if (value.length != 0) {
-        var value = this.$store.state.isProjectLayer;
+
         var std = [];
         for (var i in value) {
           std.push(value[i].id)
diff --git a/src/views/datamanage/uploadmanage.vue b/src/views/datamanage/uploadmanage.vue
index 6308636..c61aef4 100644
--- a/src/views/datamanage/uploadmanage.vue
+++ b/src/views/datamanage/uploadmanage.vue
@@ -750,6 +750,10 @@
     },
     //淇敼鎻愪氦
     async setEditLayerSubmit() {
+      if (this.editLayer.url) {
+        var url = this.editLayer.url;
+        this.editLayer.url = url.replace(iisHost, "{host}");
+      }
       const data = await publish_update(this.editLayer);
       if (data.code != 200) {
         this.$message.error("鏁版嵁淇敼澶辫触")

--
Gitblit v1.9.3