管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-04-03 786b2ae462000deb67669f614fc4ba6fe63149c5
空间查询下载,资料馆属性查询,文件下载修改
已修改6个文件
462 ■■■■ 文件已修改
src/components/MapView/mapMenuPop.vue 247 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/MapView/mapMenuTop.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Archive/index.vue 197 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Synthesis/LeftMenu.vue 5 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/Tools/LayerTree.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/datamanage/uploadmanage.vue 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
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、json、jsonp、script、text
          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
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
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;
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
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)
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("数据修改失败")