管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-04-06 5685babbcf4eb0b1cbbe1385472d862ce5fbb410
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
@@ -840,6 +840,7 @@
      width="90%"
      top="10vh"
      :close-on-click-modal="false"
      :before-close="handleMaptClose"
    >
      <div style="height:73vh">
        <map-sdk v-if='showMapVisible'></map-sdk>
@@ -1131,7 +1132,7 @@
            <el-button
              class="primary"
              size="small"
              @click="getInsertDown"
              @click="getInsertDownx"
            >{{
              $t("common.confirm")
            }}</el-button>
@@ -1212,6 +1213,8 @@
import $ from 'jquery'
import { getToken } from '@/utils/auth';
import {
  decr,
  encr,
  selectdepTab,
  dataLib_selectProject,
  dataLib_selectDirTypes,
@@ -1227,7 +1230,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 +1377,7 @@
      },
      dialogInsertVisible: false,
      dialogVisible1: false,
      multipleSelection: [],
    };
  },
@@ -1388,6 +1395,11 @@
    })
  },
  methods: {
    //数据库查询下载
    downloadBankData() {
      // downloadLogVisible
    },
    handleCloseDown1() {
      this.$confirm("确认关闭?")
        .then(_ => {
@@ -1396,8 +1408,8 @@
        .catch(_ => { })
    },
    downloadx() {
      this.$bus.$emit("setInsertDown", this.codeForm)
      this.closeDownx();
      this.$bus.$emit("setInsertDown2", this.codeForm)
      //
    },
    closeDownx() {
      this.dialogVisible1 = false;
@@ -1406,10 +1418,85 @@
        repassword: '',
      }
    },
    getInsertDown() {
    async getInsertDownx() {
      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 +1509,7 @@
        descr: null,
      }
      this.dialogInsertVisible = false
      this.closeDown1();
    },
    handleInsertClose() {
      this.$confirm("确认关闭?")
@@ -1691,6 +1779,29 @@
      this.$store.state.download = true;
    },
    handleMaptClose() {
      this.dialogMapVisible = false;
      this.showMapVisible = false;
      this.$store.state.mapMenuBoolean = false;
      this.$store.state.mapMenuBoxFlag = null;
      this.$store.state.mapPopBoolean = false;
      this.$store.state.mapPopBoxFlag = false;
      this.$store.state.download = false;
      if (window.sgworld) {
        window.sgworld.Creator.SimpleGraphic.clear();
        for (var i in this.$store.state.queryInfo) {
          window.sgworld.Viewer.entities.remove(this.$store.state.queryInfo[i]);
        }
      }
      this.$store.state.queryInfo = [];
      if (this.$store.state.primitLayer != null) {
        sgworld.Viewer.entities.remove(this.$store.state.primitLayer);
        sgworld.Creator.DeleteObject(this.$store.state.primitLayer);
        this.$store.state.primitLayer = null;
      }
    },
    downloadMap(index, rows) {
      var token = getToken()
      var url = BASE_URL + "/dataLib/downloadFile?token=" + token + "&guid=" + rows.guid + "&pwd=" + rows.pwd;
@@ -1823,32 +1934,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 +2011,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 +2044,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 +2078,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 +2122,8 @@
      this.formInline.keywords = "";//高级搜索
      this.getAllTabesData();
    },
    handleSelectionChange() {
    handleSelectionChange(val) {
      this.multipleSelection = val;
    },
    //卡片详情点击事件
    async setCardDetails(res) {
@@ -1976,7 +2138,7 @@
          break;
      }
    },
    //获取数据库数据
    //获取数据库数据js
    getBankTableData(res) {
      this.listBankData.name = res.entity;
      this.listBankData.pageIndex = 1;