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/Archive/index.vue |  197 +++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 166 insertions(+), 31 deletions(-)

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;

--
Gitblit v1.9.3