管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-04-12 038aada592806f15d4e44b62f8b6f9e165afbcb3
src/views/Archive/index.vue
@@ -1198,6 +1198,59 @@
        </el-form-item>
      </el-form>
    </el-dialog>
    <el-dialog
      title="数据申请"
      :visible.sync="dialogInsertFile"
      width="30%"
      top="10vh"
      :modal="false"
      :close-on-click-modal="false"
      :show-close="false"
    >
      <el-form
        ref="form"
        :model="fileFrom"
        label-width="100px"
      >
        <el-form-item label="审核单位">
          <div>
            <ul>
              <li v-for="item in fileFrom.depid">
                {{ item.name }}
              </li>
            </ul>
          </div>
        </el-form-item>
        <el-form-item label="描述">
          <el-input
            type="textarea"
            placeholder="请输入内容"
            v-model="fileFrom.descr"
            maxlength="50"
            show-word-limit
          >
          </el-input>
        </el-form-item>
        <el-form-item>
          <el-button
            class="primary"
            size="small"
            @click="getFileInsertApply()"
          >{{
              $t("common.confirm")
            }}</el-button>
          <el-button
            type="info"
            size="small"
            @click="handleInsertFileClose()"
          >{{
              $t("common.cancel")
            }}</el-button>
        </el-form-item>
      </el-form>
    </el-dialog>
    <iframe
      id="downFrame"
      src=""
@@ -1233,7 +1286,8 @@
  dataLib_deletes,
  dataLib_selectDbOverflowDep,
  dataLib_selectDepsByIds,
  apply_insertApply
  apply_insertApply,
  dataLib_selectMetaOverflowDep
} from '../../api/api';
import { dataLibView } from '@/api/screen.js'
export default {
@@ -1378,6 +1432,14 @@
      dialogInsertVisible: false,
      dialogVisible1: false,
      multipleSelection: [],
      dialogInsertFile: false,
      fileFrom: {
        descr: null,
        depid: null,
        ids: null,
        pwd: null,
        depcodes: null
      }
    };
  },
@@ -1946,8 +2008,6 @@
        filter = this.listBankData.filter;
        ids = null;
      }
      var obj = {
        entities: [this.listBankData.name], // bpachydrogeology,bhydrogeologyattach
        filter: filter,
@@ -2046,39 +2106,74 @@
      this.passWorldVisible = false;
      var password = this.codeForm.repassword
      var std = [];
      var ids = [];
      for (var i in this.multipleSelection1) {
        std.push(this.multipleSelection1[i].id)
        ids.push(this.multipleSelection1[i].id)
      }
      var obj = {
        pwd: encrypt.encrypt(password),
        ids: std
      };
      // var obj = {
      // };
      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(password))
      }
      const data = await dataLib_selectDownloadFile(downObj)
      var obj = {
        ids: std,
      };
      const data = await dataLib_selectMetaOverflowDep(obj)
      if (data.code != 200) {
        this.$message.error('下载请求失败');
        return
      }
      var token = getToken()
      var url = BASE_URL + "/dataLib/downloadFile?token=" + token + "&guid=" + res.result + "&pwd=" + encodeURIComponent(encrypt.encrypt(this.codeForm.repassword));
      if (data.result.length == 0) {
        const res = await dataLib_downloadReq(JSON.stringify({
          pwd: encrypt.encrypt(password),
          ids: std
        }));
        if (res.code != 200) {
          this.$message.error('下载请求失败');
          return
        }
        if (!res.result) {
          return
        }
        var downObj = {
          guid: res.result,
          pwd: encodeURIComponent(encrypt.encrypt(password))
        }
      $("#downFrame").attr("src", url).click();
        const data = await dataLib_selectDownloadFile(downObj)
        if (data.code != 200) {
          this.$message.error('下载请求失败');
          return
        }
        var token = getToken()
        var url = BASE_URL + "/dataLib/downloadFile?token=" + token + "&guid=" + res.result + "&pwd=" + encodeURIComponent(encrypt.encrypt(this.codeForm.repassword));
        $("#downFrame").attr("src", url).click();
      } 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],
          })
        }
        const data1 = await dataLib_selectDepsByIds(val)
        if (data1.code != 200) {
          return
        }
        this.fileFrom.depid = data1.result
        this.fileFrom.ids = ids;
        this.fileFrom.pwd = encr(password);
        this.fileFrom.depcodes = data.result;
        this.dialogInsertFile = true;
      }
      this.monthdata.filter((res) => {
        return res.ischecked = false;
@@ -2090,6 +2185,44 @@
      this.codeForm.password = '';
      this.codeForm.repassword = '';
    },
    async getFileInsertApply() {
      this.dialogInsertFile = false
      var obj = {
        ids: this.fileFrom.ids,
        pwd: this.fileFrom.pwd,
        tabs: ["元数据表"],
        entities: ["sysmeta"],
        descr: this.fileFrom.descr,
        depcodes: this.fileFrom.depcodes
      };
      const data = await apply_insertApply(JSON.stringify(obj))
      this.handleInsertFileClose();
      if (data.code != 200) {
        this.$message.error("数据申请失败")
        return
      }
      this.$message({
        message: "数据申请成功",
        type: "success",
      })
    },
    handleInsertFileClose() {
      this.dialogInsertFile = false
      this.fileFrom = {
        descr: null,
        depid: null,
        ids: null,
        pwd: null,
        depcodes: null
      }
    },
    //文件下载
    setCardDownload(res) {
      // this.multipleSelection1 = [];