管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-04-03 786b2ae462000deb67669f614fc4ba6fe63149c5
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、json、jsonp、script、text
          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、json、jsonp、script、text
        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;
      }
    },
    //获取数据库数据
    //获取数据库数据js
    getBankTableData(res) {
      this.listBankData.name = res.entity;
      this.listBankData.pageIndex = 1;