研发图纸文件管理系统-前端项目
he wei
2022-11-17 901a67f3503a9e5eb248372fcaba1ccf81821424
U 产品详情 提供下载源压缩包
2个文件已修改
67 ■■■■■ 已修改文件
src/pages/resourceManage/product/details/apis.js 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/details/details.vue 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/details/apis.js
@@ -37,6 +37,18 @@
}
/**
 * 下载原始压缩包文件
 * @returns
 */
export const getOriginalZip = (parentModel, customCode, version) => {
  return axios({
    method: "GET",
    url: "product/getOriginalZip",
    params: { parentModel, customCode, version }
  })
}
/**
 * 产品指定版本详情
 * @returns 
 */
@@ -62,7 +74,7 @@
 * 修改附件锁定状态
 * @returns
 */
 export const updateProductLock = (data) => {
export const updateProductLock = (data) => {
  return axios({
    method: "POST",
    url: "attachLock/updateProductLock",
src/pages/resourceManage/product/details/details.vue
@@ -8,7 +8,11 @@
          @select="selectChanged"
          @diff="diff"
        ></list>
        <div class="handler" :title="sideVisible ? '隐藏' : '展开'" @click="toggleSide">
        <div
          class="handler"
          :title="sideVisible ? '隐藏' : '展开'"
          @click="toggleSide"
        >
          <a-icon class="icon" type="left" />
        </div>
      </div>
@@ -142,8 +146,14 @@
            <a-button
              v-if="canDownloadBom && currentVersion.enabled"
              type="primary"
              @click="checkLock"
              @click="checkLock('zipDownload')"
              >bom下载</a-button
            >
            <a-button
              v-if="canDownloadBom && currentVersion.enabled && originalZipUrl"
              type="primary"
              @click="checkLock('OriginalZipDownload')"
              >下载原始包</a-button
            >
            <a-button
              type="primary"
@@ -320,6 +330,7 @@
  zipDownload,
  getBomHistoryAndMaterial,
  compare,
  getOriginalZip,
} from "./apis";
import { setpHistoryEnable, getLockedList, getLogList } from "../apis";
import { dwgReview } from "@/pages/workplace/apis";
@@ -333,6 +344,9 @@
  mixins: [WSMixin],
  data() {
    return {
      originalZipUrl: "",
      // 当前操作 下载bom包 下载原始包
      currentAction: "",
      sideVisible: true,
      logVisible: false,
      logList: [],
@@ -632,7 +646,20 @@
      // console.log(obj, "--==");
      // this.record = obj;
      this.currentVersion = obj;
      this.getOriginalZip();
      this.getInfo();
    },
    getOriginalZip() {
      const {
        currentVersion: { parentModel, customCode, version },
      } = this;
      this.originalZipUrl = "";
      getOriginalZip(parentModel, customCode, version).then((res) => {
        const { code, data, data2 } = res.data;
        if (code && data) {
          this.originalZipUrl = data2;
        }
      });
    },
    getInfo(force) {
      const {
@@ -703,7 +730,9 @@
      document.body.removeChild(link);
      downloadLog(parentCode, subModel);
    },
    checkLock() {
    // action 检查后要执行的动作
    checkLock(action) {
      this.currentAction = action;
      getLockedList(this.currentVersion.id).then((res) => {
        const { code, data, data2, data3 } = res.data;
        if (code) {
@@ -714,7 +743,8 @@
            this.lockListVisible = true;
          } else {
            // 没有锁定
            this.zipDownload();
            // this.zipDownload();
            this[action]();
          }
        } else {
          this.$message.error("查询锁定清单出错");
@@ -726,7 +756,20 @@
    },
    lockListOk() {
      this.lockListVisible = false;
      this.zipDownload();
      // this.zipDownload();
      this[this.currentAction]();
    },
    OriginalZipDownload() {
      let loading = this.$layer.loading();
      let link = document.createElement("a");
      link.style.display = "none";
      let url = this.webUrl + this.originalZipUrl;
      link.href = url;
      link.download = url;
      document.body.appendChild(link);
      link.click();
      this.$layer.close(loading);
      document.body.removeChild(link);
    },
    zipDownload() {
      // const { parentCode, currentVersion } = this;