研发图纸文件管理系统-前端项目
he wei
2023-10-21 d8f97ebbbe27affff762f4f131f29f773e4c4738
UA 物料图纸历史 0809详情等修改
9个文件已修改
1个文件已添加
814 ■■■■■ 已修改文件
src/assets/js/apis.js 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/components/filesTable.vue 160 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/components/ownerDownload.vue 217 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/materialsCenter/history/history.vue 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/materialsCenter/list.vue 46 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/apis.js 83 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/details/apis.js 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/details/details.vue 183 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/list.vue 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/config.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/assets/js/apis.js
@@ -37,3 +37,26 @@
    params: { oprateInfo, type },
  });
};
/**
 * //根据物料id查询dwg历史
 * @returns
 */
export const getDwgHisById = (materialId, pageCurr, pageSize) => {
  return axios({
    method: "GET",
    url: "materialHistory/getDwgHisById",
    params: { materialId, pageCurr, pageSize },
  });
};
/**
 * 根据物料id查询pic历史  目前用不上
 * @returns
 */
export const getPicHisById = (materialId, pageCurr, pageSize) => {
  return axios({
    method: "GET",
    url: "materialHistory/getPicHisById",
    params: { materialId, pageCurr, pageSize },
  });
};
src/pages/components/filesTable.vue
@@ -13,14 +13,32 @@
    >
      <template slot="action" slot-scope="text, record">
        <div v-if="record.url">
          <a v-if="!record.lockFlag && ((record.fileType == 'dwg' && canViewDoc) || (record.fileType != 'dwg' && canViewOther))" @click="view(record)">预览</a>
          <template v-if="((record.fileType == 'dwg' && canDownloadDoc) || (record.fileType != 'dwg' && canDownloadOther)) && !record.lockFlag">
          <a
            v-if="
              !record.lockFlag &&
              ((record.fileType == 'dwg' && canViewDoc) ||
                (record.fileType != 'dwg' && canViewOther))
            "
            @click="view(record)"
            >预览</a
          >
          <template
            v-if="
              ((record.fileType == 'dwg' && canDownloadDoc) ||
                (record.fileType != 'dwg' && canDownloadOther)) &&
              !record.lockFlag
            "
          >
            <a-divider type="vertical"></a-divider>
            <a @click="downloadReason(record)">下载</a>
          </template>
          <template v-if="canLockOther && (id || productId)">
            <a-divider v-if="!record.lockFlag" type="vertical"></a-divider>
            <a @click="lock(record)">{{ record.lockFlag ? "解锁" : "锁定" }}</a>
          </template>
          <template v-if="isOwnerDwg(record)">
            <a-divider type="vertical"></a-divider>
            <a @click="history(record)">历史</a>
          </template>
        </div>
      </template>
@@ -50,7 +68,46 @@
        />
      </a-form-model-item>
    </a-modal>
    <download-reason :reason-visible.sync="downloadReasonVisible" v-if="downloadReasonVisible" @ok="downloadReasonOk"></download-reason>
    <download-reason
      :reason-visible.sync="downloadReasonVisible"
      v-if="downloadReasonVisible"
      @ok="downloadReasonOk"
    ></download-reason>
    <a-modal
      :visible="dwgHisVisible"
      title="物料图纸历史"
      :width="860"
      :destroyOnClose="true"
      @cancel="dwgHisClose"
    >
      <a-table
        ref="table"
        :columns="dwgColumns"
        :dataSource="dwgDataSource"
        :scroll="{ x: 400, y1 }"
        :row-key="(record, index) => index"
        :pagination="{
          current: pageCurr,
          pageSize: pageSize,
          total: total,
          showSizeChanger: true,
          showLessItems: true,
          showQuickJumper: true,
          pageSizeOptions: ['10', '20', '50', '100'],
          showTotal: (total, range) =>
            `第 ${range[0]}-${range[1]} 条,总计 ${total} 条`,
          onChange: onPageChange,
          onShowSizeChange: onSizeChange,
        }"
      >
        <template slot="action" slot-scope="text, record">
          <a @click="dwgReview(record.url)">预览</a>
        </template>
      </a-table>
      <template v-slot:footer>
        <a-button @click="dwgHisClose">关闭</a-button>
      </template>
    </a-modal>
  </div>
</template>
@@ -58,11 +115,11 @@
import getWebUrl from "@/assets/js/tools/getWebUrl";
import { dwgReview } from "@/pages/workplace/apis";
// import { downloadLog } from "@/pages/system/logs/apis";
import { downLoadFileByFilePath } from "@/assets/js/apis";
import { downLoadFileByFilePath, getDwgHisById } from "@/assets/js/apis";
import { updateAttachLock } from "@/pages/resourceManage/materialsCenter/apis";
import { updateProductLock } from "@/pages/resourceManage/product/details/apis";
import checkPermit from "@/assets/js/tools/checkPermit";
import DownloadReason from '@/pages/components/downloadReason';
import DownloadReason from "@/pages/components/downloadReason";
import PERMITS from "@/assets/js/const/const_permits";
import { mapGetters } from "vuex";
export default {
@@ -83,6 +140,10 @@
        return null;
      },
    },
    subModel: {
      type: String,
      default: "",
    },
    // 类型 产品12 物料13
    type: {
      type: Number,
@@ -90,8 +151,8 @@
    },
    oprateVersion: {
      type: Number,
      default: 0
    }
      default: 0,
    },
  },
  data() {
    const columns = [
@@ -117,12 +178,35 @@
        dataIndex: "operation",
        key: "operation",
        align: "center",
        width: 200,
        scopedSlots: { customRender: "action" },
      },
    ];
    const dwgColumns = [
      {
        title: "文件名称",
        dataIndex: "fileName",
        align: "center",
        width: 200,
      },
      {
        title: "操作",
        dataIndex: "operation",
        key: "operation",
        align: "center",
        width: 140,
        scopedSlots: { customRender: "action" },
      },
    ];
    return {
      downloadUrl: '',
      dwgHisVisible: false,
      dwgColumns,
      dwgDataSource: [],
      pageCurr: 1,
      pageSize: 10,
      total: 0,
      y1: 400,
      downloadUrl: "",
      downloadReasonVisible: false,
      reason: "",
      reasonVisible: false,
@@ -164,6 +248,9 @@
    handleCancel() {
      this.previewVisible = false;
    },
    dwgHisClose() {
      this.dwgHisVisible = false;
    },
    dwgReview(url) {
      let loading = this.$layer.loading();
      dwgReview(url)
@@ -191,7 +278,13 @@
    downloadLog(url, reason) {
      let reg = /(.*\\+)*(.*)$/;
      let fileName = url.match(reg)[2];
      downLoadFileByFilePath(url, reason, this.info.oprateInfo, this.oprateVersion, this.type).then((res) => {
      downLoadFileByFilePath(
        url,
        reason,
        this.info.oprateInfo,
        this.oprateVersion,
        this.type
      ).then((res) => {
        let { data, status } = res;
        if (200 == status && data) {
          let url = window.URL.createObjectURL(data);
@@ -230,7 +323,7 @@
        localReason: this.reason,
        lockFlag,
        materialId: this.id ? this.id : undefined,
        productId: this.productId ? this.productId : undefined
        productId: this.productId ? this.productId : undefined,
      };
      let update = isProd ? updateProductLock : updateAttachLock;
      update([params]).then((res) => {
@@ -245,6 +338,53 @@
        }
      });
    },
    isOwnerDwg(record) {
      if (!this.subModel) {
        return false;
      }
      let reg = new RegExp("^" + this.subModel, "i");
      return reg.test(record.fileName) && record.fileType == "dwg";
    },
    history(record) {
      this.getList();
      this.dwgHisVisible = true;
    },
    getList() {
      getDwgHisById(this.id, this.pageCurr, this.pageSize)
        .then((res) => {
          let { code, data, data2 } = res.data;
          let list = [];
          let total = 0;
          if (code && data) {
            // console.log(data);
            let reg = /(.*\\+)*(.*)$/;
            list = data2.list.map((item) => {
              let url = item.dwgUrl;
              let fileName = url.match(reg)[2];
              return {
                fileName,
                url,
              };
            });
            total = data2.total;
          }
          this.dwgDataSource = list;
          this.total = total;
        })
        .catch((err) => {
          console.log(err);
        });
    },
    onPageChange(page, pageSize) {
      this.pageCurr = page;
      this.pageSize = pageSize;
      this.getList();
    },
    onSizeChange(current, size) {
      this.pageCurr = 1;
      this.pageSize = size;
      this.getList();
    },
  },
  computed: {
    dataSource() {
src/pages/resourceManage/components/ownerDownload.vue
New file
@@ -0,0 +1,217 @@
<template>
  <a-card class="card">
    <div class="p-header">
      <a-form layout="horizontal" class="flex">
        <div class="form">
          <a-row>
            <a-col :md="8" :sm="24">
              <a-form-item
                label="起止日期"
                :labelCol="{ span: 5 }"
                :wrapperCol="{ span: 18, offset: 1 }"
              >
                <a-date-picker
                  v-model="startDate"
                  :allowClear="false"
                  :valueFormat="dateFormat"
                  :format="dateFormat"
                  />-
                  <a-date-picker
                  v-model="endDate"
                  :allowClear="false"
                  :valueFormat="dateFormat"
                  :format="dateFormat"
                />
              </a-form-item>
            </a-col>
          </a-row>
        </div>
        <span style="float: right; margin-top: 3px">
          <a-button type="primary" @click="getList">查询</a-button>
        </span>
      </a-form>
    </div>
    <div class="p-content" ref="wraper">
      <div class="p-inner">
        <a-table
          ref="table"
          :columns="columns"
          :dataSource="dataSource"
          :scroll="{ x: 400, y }"
          row-key="id"
          :pagination="{
            current: pageCurr,
            pageSize: pageSize,
            total: total,
            showSizeChanger: true,
            showLessItems: true,
            showQuickJumper: true,
            pageSizeOptions: ['10', '20', '50', '100'],
            showTotal: (total, range) =>
              `第 ${range[0]}-${range[1]} 条,总计 ${total} 条`,
            onChange: onPageChange,
            onShowSizeChange: onSizeChange,
          }"
        >
          <template slot="dataIndex" slot-scope="{ index }">
            {{ index + 1 }}
          </template>
        </a-table>
      </div>
    </div>
  </a-card>
</template>
<script>
import { getUnlockByOwner } from "../product/apis";
import moment from "moment";
export default {
  name: "",
  data() {
    const columns = [
      {
        title: "操作时间",
        dataIndex: "createTime",
      },
      {
        title: "母料编码",
        dataIndex: "parentCode",
      },
      {
        title: "定制单号",
        dataIndex: "customCode",
      },
      {
        title: "版本时间",
        dataIndex: "versionTime",
      },
      {
        title: "操作类型",
        dataIndex: "lockType",
      },
      {
        title: "操作原因",
        dataIndex: "reason",
      },
    ];
    const dateFormat='YYYY-MM-DD';
    return {
      dateFormat,
      startDate: moment().subtract(30, 'days').format(dateFormat),
      endDate: moment().format(dateFormat),
      update: -1,
      pageCurr: 1,
      pageSize: 10,
      total: 0,
      y: 400,
      dataSource: [],
      columns,
    };
  },
  components: {},
  watch: {
    update(n) {
      if (-1 != n && !this._inactive) {
        this.$nextTick(() => {
          const header = document.querySelectorAll(
            ".doc-center-table .ant-table-header"
          )[0].clientHeight;
          const wraper = this.$refs.wraper.clientHeight;
          const h = wraper - header - 64;
          console.log(h, "h",wraper, header );
          this.y = h;
        });
      }
    },
    affixed() {
      setTimeout(() => {
        this.update = Math.random();
      }, 200);
    },
  },
  methods: {
    moment,
    getList() {
      getUnlockByOwner(this.startDate + " 00:00:00", this.endDate + " 00:00:00", this.pageCurr, this.pageSize)
        .then((res) => {
          let { code, data, data2 } = res.data;
          let list = [];
          let total = 0;
          if (code && data) {
            console.log(data);
            list = data2.list.map((v) => {
              v.lockType = v.lockFlag ? "锁定" : "解锁";
              return v;
            });
            total = data2.total;
          }
          this.dataSource = list;
          this.total = total;
          if (-1 == this.update) {
            this.update = Math.random();
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    onPageChange(page, pageSize) {
      this.pageCurr = page;
      this.pageSize = pageSize;
      this.getList();
    },
    onSizeChange(current, size) {
      this.pageCurr = 1;
      this.pageSize = size;
      this.getList();
    },
    resize() {
      setTimeout(() => {
        this.update = Math.random();
      }, 200);
    },
  },
  mounted() {
    this.getList();
    window.addEventListener("resize", this.resize);
  },
  destroyed() {
    window.removeEventListener("resize", this.resize);
  },
};
</script>
<style scoped>
.flex {
  display: flex;
}
.form {
  flex: 1;
}
.card {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.card /deep/ .ant-card-body {
  flex: 1;
  display: flex;
  flex-direction: column;
}
.p-content {
  flex: 1;
  position: relative;
}
.p-inner {
  position: absolute;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
}
/deep/ .ant-table-wrapper {
  height: 100%;
}
</style>
src/pages/resourceManage/materialsCenter/history/history.vue
@@ -97,7 +97,7 @@
      :visible="otherDocVisible"
      title="其他附件"
      :destroyOnClose="true"
      :width="600"
      :width="850"
      :footer="null"
      @cancel="otherDocCancel"
    >
@@ -149,7 +149,7 @@
  data() {
    return {
      oprateInfo: '',
      oprateInfo: "",
      downloadlogVisible: false,
      fullScreen: false,
      diffVisible: false,
@@ -268,7 +268,15 @@
          list = data2;
          prods = data2.products;
          attachLocks = data2.attachLocks || [];
          otherDoc = data3;
          let subModel = data2.subModel;
          let reg = new RegExp("^" + subModel, "i");
          let reg2 = /(.*\\+)*(.*)$/;
          otherDoc = data3.filter((v) => {
            let fileName = v.match(reg2)[2];
            let arr = fileName.split(".");
            let fileType = arr.length ? arr[arr.length - 1].toLowerCase() : "";
            return !(reg.test(fileName) && fileType == "dwg");
          });
        }
        this.dataSource = prods;
        this.record = list;
@@ -354,9 +362,7 @@
    },
    downloadLogs() {
      // console.log(this.record);
      let {
        id,
      } = this.record;
      let { id } = this.record;
      this.oprateInfo = id;
      this.downloadlogVisible = true;
    },
src/pages/resourceManage/materialsCenter/list.vue
@@ -138,7 +138,12 @@
      :footer="null"
      @cancel="fileListCancel"
    >
      <files-table :list="fileList" :info="info" :type="13"></files-table>
      <files-table
        :list="fileList"
        :info="info"
        :sub-model="currentObj.subModel"
        :type="13"
      ></files-table>
      <div class="footer">
        <a-space>
          <a-button @click="fileListCancel">关闭</a-button>
@@ -233,7 +238,7 @@
  mixins: [WSMixin],
  data() {
    return {
      oprateInfo: '',
      oprateInfo: "",
      downloadlogVisible: false,
      errorVisible: false,
      errorTbl2: {
@@ -257,7 +262,7 @@
            title: "问题描述",
            dataIndex: "irregularDesc",
            align: "center",
          }
          },
        ],
        dataSource: [],
      },
@@ -269,7 +274,7 @@
      fileList: [],
      resShow: false,
      submitShow: false,
      currentObj: null,
      currentObj: {},
      title: "",
      resList: [],
      // 是否为新增关联 false表示为删除关联
@@ -451,9 +456,7 @@
  methods: {
    downloadLogs(record) {
      // console.log(record);
      let {
        id,
      } = record;
      let { id } = record;
      this.oprateInfo = id;
      this.downloadlogVisible = true;
    },
@@ -622,11 +625,27 @@
        subCode,
        subModel,
      };
      let dwgFileName = subModel.toLowerCase() + ".dwg";
      formData.append("materialStr", JSON.stringify(obj));
      this.uploadFileList.forEach((v, i) => {
        formData.append("file", v.originFileObj);
      });
      if (
        this.uploadType == "normal" &&
        this.uploadFileList.some((v) => v.name.toLowerCase() == dwgFileName)
      ) {
        this.$message.error("所选附件类型不匹配");
        this.$layer.close(loading);
        return false;
      }
      if (
        this.uploadType == "dwg" &&
        this.uploadFileList.some((v) => v.name.toLowerCase() != dwgFileName)
      ) {
        this.$message.error("所选附件类型不匹配");
        this.$layer.close(loading);
        return false;
      }
      let upload = this.uploadType != "normal" ? picOrDwg : uploadOthers;
      upload(formData)
        .then((res) => {
@@ -691,13 +710,20 @@
      this.resize();
    },
    panelShow(obj) {
      const { id, dwgUrl, attachLocks } = obj;
      const { id, dwgUrl, attachLocks, subModel } = obj;
      this.currentObj = obj;
      let reg = new RegExp("^" + subModel, "i");
      let reg2 = /(.*\\+)*(.*)$/;
      getFileList(id).then((res) => {
        const { code, data, data2 } = res.data;
        let list = [];
        if (code && data) {
          list = data2;
          list = data2.filter((v) => {
            let fileName = v.match(reg2)[2];
            let arr = fileName.split(".");
            let fileType = arr.length ? arr[arr.length - 1].toLowerCase() : "";
            return !(reg.test(fileName) && fileType == "dwg");
          });
        }
        if (dwgUrl) {
          list.unshift(dwgUrl);
src/pages/resourceManage/product/apis.js
@@ -8,9 +8,9 @@
  return axios({
    method: "GET",
    url: "product/getAllProduct",
    params: { pageCurr, pageSize, ...data }
  })
}
    params: { pageCurr, pageSize, ...data },
  });
};
/**
 * 产品列表 不分页
 * @returns 
@@ -18,9 +18,9 @@
export const getAllProducts = () => {
  return axios({
    method: "GET",
    url: "product/getUpBomUseProduct"
  })
}
    url: "product/getUpBomUseProduct",
  });
};
/**
 * 产品下载(产品id和版本<当前最新版本>)
 * @returns 
@@ -30,9 +30,9 @@
    method: "GET",
    url: "product/downloadProduct",
    params: { productId, version, oprateReason, oprateInfo },
    responseType: "blob"
  })
}
    responseType: "blob",
  });
};
/**
 * 根据母料型号查询子件信息及有关联的散装件信息
@@ -42,9 +42,9 @@
  return axios({
    method: "GET",
    url: "product/getBomAndMaterial",
    params: { productId, version }
  })
}
    params: { productId, version },
  });
};
/**
 * 批量修改关联关系
@@ -54,9 +54,9 @@
  return axios({
    method: "POST",
    url: "worksheetMain/materialRelatedSubmit",
    data
  })
}
    data,
  });
};
/**
 * 上传产品
 * @returns 
@@ -65,9 +65,9 @@
  return axios({
    method: "POST",
    url: "product",
    data
  })
}
    data,
  });
};
/**
 * 产品指定版本的激活 锁定
 * customCode=1&enabled=1&parentCode=1&version=1
@@ -77,9 +77,9 @@
  return axios({
    method: "GET",
    url: "product/setpHistoryEnable",
    params
  })
}
    params,
  });
};
/**
 * 产品操作日志查询
 * customCode=1&parentCode=1
@@ -89,9 +89,9 @@
  return axios({
    method: "GET",
    url: "productLockLog/listByParentCodeAndCustomCode",
    params
  })
}
    params,
  });
};
/**
 * 根据产品id查询被锁定的物料dwg和产品丝印
 * @returns 
@@ -100,9 +100,9 @@
  return axios({
    method: "GET",
    url: "product/getLockedByProductId",
    params: { productId }
  })
}
    params: { productId },
  });
};
/**
 * 查询当前使用的所有的产品 不分页
 * @returns 
@@ -111,8 +111,8 @@
  return axios({
    method: "GET",
    url: "product/getCompareProduct",
  })
}
  });
};
/**
 * 查询当前使用的所有的产品 不分页 (过滤掉锁定的)
 * @returns 
@@ -121,5 +121,26 @@
  return axios({
    method: "GET",
    url: "product/getFkProduct",
  })
}
  });
};
/**
 * 查询用户的解锁操作
 * @returns
 */
export const getUnlockByOwner = (
  createTime,
  createTime1,
  pageCurr,
  pageSize
) => {
  return axios({
    method: "GET",
    url: "productLockLog/getUnlockByOwner",
    params: {
      createTime,
      createTime1,
      pageCurr,
      pageSize,
    },
  });
};
src/pages/resourceManage/product/details/apis.js
@@ -81,3 +81,25 @@
    data,
  });
};
/**
 * //验证母料编码是否存在产品中
 * @returns
 */
export const checkExist = (parentCode, customCode) => {
  return axios({
    method: "GET",
    url: "product/judgeParentCode",
    params: { parentCode, customCode },
  });
};
/**
 * 产品查看原来压缩包中文件信息(文件目录和时间)
 * @returns
 */
export const getzipAndRarInfo = (fileUrl) => {
  return axios({
    method: "GET",
    url: "zipAndRar/getzipAndRarInfo",
    params: { fileUrl },
  });
};
src/pages/resourceManage/product/details/details.vue
@@ -129,6 +129,19 @@
                        >详情</a
                      >
                    </template>
                    <template v-if="/^08|^09/.test(record.subCode)">
                      <a-divider
                        v-if="
                          record.softwares &&
                          record.softwares.length &&
                          canDownloadSoftware
                        "
                        type="vertical"
                      ></a-divider>
                      <a href="javascript:;" @click="toDetails08_09(record)"
                        >详情</a
                      >
                    </template>
                  </template>
                </a-table>
              </a-spin>
@@ -175,6 +188,12 @@
              type="primary"
              @click="checkLock('OriginalZipDownload')"
              >下载原始包</a-button
            >
            <a-button
              v-if="isTester && originalZipUrl"
              type="primary"
              @click="viewRar"
              >查看原始包</a-button
            >
            <a-button
              type="primary"
@@ -348,7 +367,9 @@
            <div>
              <span class="user">{{ item.owner }}</span> 在
              <span class="time">{{ item.createTime }}</span>
              {{ {"-1": "上传", "0": "激活", "1": "锁定"}[item.lockFlag] }}了版本
              {{
                { "-1": "上传", "0": "激活", "1": "锁定" }[item.lockFlag]
              }}了版本
              <span class="version">{{ item.versionTime }}</span>
            </div>
            <div>操作原因: {{ item.reason ? item.reason : "无" }}</div>
@@ -368,6 +389,24 @@
      :type="12"
      :oprate-info="oprateInfo"
    ></download-logs>
    <a-modal
      :visible="fileTreeVisible"
      :footer="null"
      :width="860"
      title="文件列表"
      :destroyOnClose="true"
      @cancel="fileTreeVisible = false"
      >
      <div class="log-content">
        <a-tree
          v-if="fileTree.length"
          :show-line="true"
          defaultExpandAll
          :tree-data="fileTree"
        />
        <a-empty v-else />
      </div>
    </a-modal>
  </div>
</template>
@@ -391,6 +430,8 @@
  getBomHistoryAndMaterial,
  compare,
  getOriginalZip,
  checkExist,
  getzipAndRarInfo,
} from "./apis";
import {
  searchDefaultMailUser,
@@ -410,6 +451,8 @@
  mixins: [WSMixin],
  data() {
    return {
      fileTreeVisible: false,
      fileTree: [],
      userListAll: [],
      mailList: [],
      tester: [],
@@ -1215,6 +1258,10 @@
      if (/^0120/.test(record.subCode)) {
        classList.push("is-0120");
      }
      // 08 09 开头的半成品
      if (/^08|^09/.test(record.subCode)) {
        classList.push("is-08_09");
      }
      return classList;
    },
    toDetails0120(record) {
@@ -1226,6 +1273,137 @@
      this.$router.push({
        path: "/resource/product-details-0120",
        query: { parentCode, customCode: "", parentModel, parentName },
      });
    },
    toDetails08_09(record) {
      const {
        subCode: parentCode,
        subModel: parentModel,
        subName: parentName,
      } = record;
      checkExist(parentCode, "")
        .then((res) => {
          let { code, data } = res.data;
          if (code && data) {
            this.$router.push({
              path: "/resource/product-details-0809",
              query: { parentCode, customCode: "", parentModel, parentName },
            });
            // console.log(data);
          } else {
            this.$message.error("产品未上传");
          }
        })
        .catch((err) => {
          console.log(err);
        });
    },
    getParent(obj, arr, i) {
      let len = arr.length - 1;
      if (i > len) {
        return false;
      }
      // if (i == 0) {
      //   return obj;
      // }
      // if (i == 1) {
      //   return obj[arr[0]];
      // }
      let res = obj;
      let tmp = {};
      for (let m = 1; m <= i; m++) {
        // tmp[arr[m]] = {};
        // tmp = tmp[arr[m]];
        tmp = arr[m - 1];
        res = res[tmp];
      }
      return res;
    },
    format(list) {
      let counter = this.counter();
      let obj = {
        counter,
        key: "root",
        children: [],
      };
      // let root = {
      //   counter,
      //   key: "root",
      //   children: [],
      // };
      list.forEach((v) => {
        let url = v.fileName;
        let fileTime = v.fileTime;
        let arr = url.split("/");
        let fileName = arr.pop();
        let tmp = obj;
        for (let i = 0, len = arr.length; i < len; i++) {
          let parent = this.getParent(obj, arr, i);
          if (!tmp[arr[i]]) {
            tmp[arr[i]] = {
              parent,
              title: arr[i],
              key: parent.key + "-" + parent.counter(),
              children: [],
              counter: this.counter(),
            };
            // tmp[arr[i]].parent.children.push(tmp[arr[i]]);
            parent.children.push(tmp[arr[i]]);
          }
          tmp = tmp[arr[i]];
        }
        // console.log(tmp.children, 'children')
        tmp.children.push({
          fileName,
          fileTime,
          key: tmp.key + "-" + tmp.counter(),
          title: fileName + "  " + fileTime,
          isLeaf: true,
        });
        // console.log(obj, '......')
        // for (let i = 0, len = arr.length; i < len; i++) {
        //   // 判断有没有父级 i为0没有 i为大于1就有
        //   let parent = i > 0 ? tmp[arr[i - 1]] : root;
        //   if (!obj[item]) {
        //     obj[item] = {
        //       title: item,
        //       key: parent.key + "-" + parent.counter(),
        //       children: [],
        //       counter: this.counter(),
        //     };
        //   }
        // }
      });
      return obj;
    },
    counter() {
      let count = 0;
      return () => {
        return count++;
      };
    },
    viewRar() {
      let loading = this.$layer.loading();
      // console.log(this.originalZipUrl);
      getzipAndRarInfo(this.originalZipUrl)
        .then((res) => {
          let { code, data, data2 } = res.data;
          let list = [];
          if (code && data) {
            console.log(data2);
            list = this.format(data2);
          }
          this.$layer.close(loading);
          this.fileTree = list.children;
          this.fileTreeVisible = true;
          // { title: 'Tree Node', key: '2', isLeaf: true },
          console.log(list, '===list');
        })
        .catch((err) => {
          this.$layer.close(loading);
          console.log(err);
      });
    },
  },
@@ -1377,9 +1555,12 @@
  /deep/.ant-table-row-level-1.ant-table-row-level-1:hover > td {
    background: #ffbcc9;
  }
  /deep/.is-08_09 > td,
  /deep/.is-0120 > td {
    background: #ffae00;
  }
  /deep/.is-08_09.is-08_09.ant-table-row-hover > td,
  /deep/.is-08_09.is-08_09:hover > td,
  /deep/.is-0120.is-0120.ant-table-row-hover > td,
  /deep/.is-0120.is-0120:hover > td {
    background: #f8c34f;
src/pages/resourceManage/product/list.vue
@@ -41,6 +41,9 @@
                  >新增</a-button
                >
                <a-button type="primary" @click="prodDiff">产品比较</a-button>
                <a-button type="primary" @click="ownerDownloadLog"
                  >我的锁定记录</a-button
                >
              </a-space>
            </template>
            <template slot="enabled" slot-scope="{ record }">
@@ -351,7 +354,9 @@
            <div>
              <span class="user">{{ item.owner }}</span> 在
              <span class="time">{{ item.createTime }}</span>
              {{ {"-1": "上传", "0": "激活", "1": "锁定"}[item.lockFlag] }}了版本
              {{
                { "-1": "上传", "0": "激活", "1": "锁定" }[item.lockFlag]
              }}了版本
              <span class="version">{{ item.versionTime }}</span>
            </div>
            <div>操作原因: {{ item.reason ? item.reason : "无" }}</div>
@@ -494,6 +499,19 @@
      :type="12"
      :oprate-info="oprateInfo"
    ></download-logs>
    <a-modal
      :visible="ownerLogVisible"
      title="我的下载记录"
      width="100%"
      :destroyOnClose="true"
      @cancel="ownerLogClose"
      wrapClassName="full-modal"
    >
      <owner-download></owner-download>
      <template v-slot:footer>
        <a-button @click="ownerLogClose">关闭</a-button>
      </template>
    </a-modal>
  </div>
</template>
@@ -532,6 +550,7 @@
import createWs from "@/assets/js/websocket";
import DiffList from "@/pages/components/diffList";
import FeedbackForm from "../components/feedbackForm.vue";
import OwnerDownload from "../components/ownerDownload";
const WSMixin = createWs("product");
export default {
@@ -618,6 +637,7 @@
      },
    ];
    return {
      ownerLogVisible: false,
      reason: "",
      reasonVisible: false,
      oprateInfo: "",
@@ -848,6 +868,7 @@
    FeedbackForm,
    DownloadReason,
    DownloadLogs,
    OwnerDownload,
  },
  methods: {
    rowClassFn(record) {
@@ -1487,6 +1508,12 @@
      this.oprateInfo = parentCode + "_" + customCode;
      this.downloadlogVisible = true;
    },
    ownerDownloadLog() {
      this.ownerLogVisible = true;
    },
    ownerLogClose() {
      this.ownerLogVisible = false;
    },
  },
  watch: {
    update(n) {
@@ -1727,3 +1754,26 @@
  background: #fcd583;
}
</style>
<style lang="less">
.full-modal {
  height: 100%;
  .ant-modal {
    max-width: 100%;
    height: 100%;
    top: 0;
    padding-bottom: 0;
    margin: 0;
  }
  .ant-modal-content {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    // height: calc(100vh);
  }
  .ant-modal-body {
    flex: 1;
  }
}
</style>
src/router/config.js
@@ -98,6 +98,16 @@
              },
              component: () => import('@/pages/resourceManage/product/details'),
            },
            // 08|09二级产品详情
            {
              path: 'product-details-0809',
              name: '二级产品详情',
              meta: {
                invisible: true,
                highlight: '/resource/product'
              },
              component: () => import('@/pages/resourceManage/product/details'),
            },
            {
              path: 'software',
              name: '软件中心',