管道基础大数据平台系统开发-【前端】-新系統界面
Surpriseplus
2023-04-18 a7d306cb0fe6482251f9d4acdc29674ffc13a032
src/views/datamanage/metadataManage.vue
@@ -337,7 +337,7 @@
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange"
          :current-page="listData.pageIndex"
          :page-sizes="[10, 20, 50, 100]"
          :page-sizes="[10, 50, 100, 200]"
          :page-size="listData.pageSize"
          layout="total, sizes, prev, pager, next, jumper"
          :total="count"
@@ -601,7 +601,7 @@
            @size-change="handleLoaderSizeChange"
            @current-change="handleLoaderCurrentChange"
            :current-page="listLoader.pageIndex"
            :page-sizes="[10, 20, 50, 100]"
            :page-sizes="[10, 50, 100, 200]"
            :page-size="listLoader.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="count1"
@@ -770,7 +770,7 @@
            @size-change="handleMetaSizeChange"
            @current-change="handMetaCurrentChange"
            :current-page="listMetaData.pageIndex"
            :page-sizes="[10, 20, 50, 100]"
            :page-sizes="[10, 50, 100, 200]"
            :page-size="listMetaData.pageSize"
            layout="total, sizes, prev, pager, next, jumper"
            :total="listMetaData.count"
@@ -882,14 +882,68 @@
        v-if="dialog.isJpg"
        class="pdfClass"
      >
        <img
          style="width: 100%; height: 100%"
        <el-image
          style="width:100%; height:100%"
          :src="dialog.src"
          alt=""
        />
          :preview-src-list="[dialog.src]"
        >
        </el-image>
      </div>
    </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=""
@@ -902,6 +956,7 @@
import $ from "jquery"
import { getToken } from "@/utils/auth"
import {
  encr,
  deleteMeta,
  insertMeta,
  meta_downloadReq,
@@ -916,6 +971,9 @@
  sign_getPublicKey,
  updateMeta,
  meta_selectById,
  meta_selectMetaOverflowDep,
  meta_selectDepsByCodes,
  apply_insertApply
} from "../../api/api"
import MyBread from "../../components/MyBread.vue"
@@ -1046,6 +1104,14 @@
        isJpg: false,
        src: "",
      },
      dialogInsertFile: false,
      fileFrom: {
        descr: null,
        depid: null,
        ids: null,
        pwd: null,
        depcodes: null
      }
    }
  },
  created() {
@@ -1500,7 +1566,7 @@
                message: "删除成功!",
              })
              this.multipleSelection = []
              this.listData.pageSize = 10
              // this.listData.pageSize = 10
              this.listData.pageIndex = 1
              this.getMetaData()
            } else {
@@ -1584,44 +1650,123 @@
      })
    },
    async download() {
      var std = []
      var ids = []
      for (var i in this.multipleSelection) {
        std.push(this.multipleSelection[i].id)
        ids.push(this.multipleSelection[i].id)
      }
      var obj = {
        pwd: encrypt.encrypt(this.codeForm.repassword),
        ids: std,
      }
      const res = await meta_downloadReq(JSON.stringify(obj))
      if (res.code != 200) {
        this.$message.error("下载请求失败")
        return
      }
      var downObj = {
        guid: res.result,
        pwd: encodeURIComponent(encrypt.encrypt(this.codeForm.repassword)),
      }
      const data = await meta_selectDownloadFile(downObj)
        ids: ids,
      };
      const data = await meta_selectMetaOverflowDep(obj)
      if (data.code != 200) {
        this.$message.error("下载请求失败")
        return
      }
      var token = getToken()
      var url =
        BASE_URL +
        "/meta/downloadFile?token=" +
        token +
        "&guid=" +
        res.result +
        "&pwd=" +
        encodeURIComponent(encrypt.encrypt(this.codeForm.repassword))
      var password = this.codeForm.repassword
      if (data.result.length == 0) {
        var obj = {
          pwd: encrypt.encrypt(this.codeForm.repassword),
          ids: ids,
        }
        const res = await meta_downloadReq(JSON.stringify(obj))
        if (res.code != 200) {
          this.$message.error("下载请求失败")
          return
        }
      $("#downFrame").attr("src", url).click()
        var downObj = {
          guid: res.result,
          pwd: encodeURIComponent(encrypt.encrypt(this.codeForm.repassword)),
        }
        const data1 = await meta_selectDownloadFile(downObj)
        if (data1.code != 200) {
          this.$message.error("下载请求失败")
          return
        }
        var token = getToken()
        var url =
          BASE_URL +
          "/meta/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 meta_selectDepsByCodes(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.closeDown()
    },
    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
      }
    },
    closeDown() {
      this.showCodeBox = false
      this.codeForm.password = ""
@@ -1680,7 +1825,7 @@
        this.dialog.isJpg = true
      }
      this.dialog.dialogVisible = true
      this.dialog.isPdf = true
      var url =
        BASE_URL +
        "/inquiry/downloadForView?guid=" +