研发图纸文件管理系统-前端项目
he wei
2022-09-08 edae03694e0982695762baa9fbf32dcacdb9b839
U 非当前页面不响应resize  测试bug修复
12个文件已修改
238 ■■■■ 已修改文件
src/pages/components/diffList.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/permission/list.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/materialsCenter/editLink.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/materialsCenter/history/history.vue 126 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/materialsCenter/list.vue 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/changeParts.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/details/details.vue 74 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/list.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/software/list.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/system/logs/list.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/user/list.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/workplace/WorkPlace.vue 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/components/diffList.vue
@@ -1,6 +1,6 @@
<template>
  <div class="">
    <a-collapse v-model="activeKey" accordion>
    <a-collapse :defaultActiveKey="activeKey" accordion>
      <a-collapse-panel
        class="add"
        key="1"
src/pages/permission/list.vue
@@ -250,7 +250,7 @@
  },
  watch: {
    update(n) {
      if (-1 != n) {
      if (-1 != n && !this._inactive) {
        this.$nextTick(() => {
          const wrap = this.$refs.tableWrap;
          const header = document.querySelectorAll(
src/pages/resourceManage/materialsCenter/editLink.vue
@@ -317,7 +317,7 @@
        targetKeys,
        linkList,
        info: { nextUser, description },
        comData: { subCode, subName },
        comData: { id: subMaterialId, subCode, subName },
      } = this;
      if (!selectedRowKeys.length) {
        this.$message.error("请选择要处理的产品");
@@ -338,7 +338,7 @@
                parentCode: v.parentCode,
                customCode: v.customCode,
                materialId: val * 1,
                subCode,
                subMaterialId,
                version: v.version,
              });
            }
@@ -375,7 +375,7 @@
        targetKeys,
        linkList,
        info: { nextUser, description },
        comData: { subCode, subName },
        comData: { id: subMaterialId, subCode, subName },
      } = this;
      if (!selectedRowKeys.length) {
        this.$message.error("请选择要处理的产品");
@@ -396,7 +396,7 @@
                parentCode: v.parentCode,
                customCode: v.customCode,
                materialId: val * 1,
                subCode,
                subMaterialId,
                version: v.version,
              });
            }
src/pages/resourceManage/materialsCenter/history/history.vue
@@ -15,7 +15,7 @@
            :columns="columns"
            :data-source="dataSource"
            :pagination="false"
            rowKey="subCode"
            rowKey="id"
          >
          </a-table>
        </a-card>
@@ -61,7 +61,7 @@
                <a-descriptions-item label="图片">
                  <div class="img-wraper">
                    <image-view
                      v-if="record"
                      v-if="record && record.pictureUrl"
                      :url="webUrl + record.pictureUrl"
                    ></image-view>
                  </div>
@@ -78,42 +78,10 @@
              <files-table slot="content" :list="otherDoc"></files-table>
              <a-button type="primary">其他附件</a-button>
            </a-popover>
            <a-button
              type="primary"
              v-if="softwareList.length"
              @click="showSoftwareDownload"
              >软件下载</a-button
            >
          </template>
        </a-card>
      </a-layout-footer>
    </a-layout>
    <!-- 下载软件 -->
    <a-modal
      :visible="softwareDownloadShow"
      :footer="null"
      :width="600"
      title="软件下载"
      :destroyOnClose="true"
      :maskClosable="false"
      @cancel="softwareDownloadCancel"
    >
      <a-table
        ref="aTable"
        size="small"
        :scroll="{ y: 300 }"
        bordered
        :columns="softwareColumns"
        :data-source="softwareList"
        :pagination="false"
        :expandRowByClick="true"
        :row-key="(record, index) => index"
      >
        <template slot="action" slot-scope="text, record">
          <a @click="downloadLog(record)">下载</a>
        </template>
      </a-table>
    </a-modal>
  </a-layout>
</template>
@@ -126,8 +94,6 @@
import getWebUrl from "@/assets/js/tools/getWebUrl";
import { getVersions, getMaterialById } from "../apis";
import { dwgReview } from "@/pages/workplace/apis";
import { downloadLog } from "@/pages/system/logs/apis";
import { mapGetters } from "vuex";
export default {
  name: "",
@@ -145,8 +111,6 @@
      spinning: false,
      loading: false,
      total: 0,
      y: 400,
      update: -1,
      columns: [
        {
          title: "产品名称",
@@ -210,33 +174,8 @@
    DiffList,
  },
  computed: {
    ...mapGetters("setting", ["affixed"]),
  },
  watch: {
    update(n) {
      if (-1 != n) {
        this.$nextTick(() => {
          const wraper = this.$refs.wraper;
          const wraperH = wraper.clientHeight;
          const header = document.querySelectorAll(
            ".wraper .ant-table-header"
          )[0].clientHeight;
          const { paddingBottom, paddingTop } = window.getComputedStyle(
            wraper,
            null
          );
          const h =
            wraperH - header - parseInt(paddingBottom) - parseInt(paddingTop);
          // console.log(h, "h", wraperH, header, paddingBottom, paddingTop);
          this.y = h;
        });
      }
    },
    affixed() {
      setTimeout(() => {
        this.update = Math.random();
      }, 200);
    },
  },
  methods: {
    getVersions() {
@@ -257,32 +196,24 @@
    getInfo() {
      const {
        currentVersion: { id },
        info,
      } = this;
      this.spinning = true;
      getMaterialById(id).then((res) => {
        let { code, data, data2, data3 } = res.data;
        // console.log(res, '909009')
        let list = [];
        let prods = [];
        let softwareList = [];
        let otherDoc = [];
        this.spinning = false;
        if (code && data) {
          list = data2;
          prods = data2.products;
          otherDoc = data3;
          // otherDoc = data4;
        }
        this.dataSource = prods;
        this.record = list;
        this.softwareList = softwareList;
        this.otherDoc = otherDoc;
        if (this.record.dwgUrl) {
          this.otherDoc.unshift(this.record.dwgUrl);
        }
        if (-1 == this.update) {
          this.update = Math.random();
        }
      });
    },
@@ -303,62 +234,9 @@
          console.log(error);
        });
    },
    downloadLog(record) {
      const { parentCode, subModel, dwgUrl, softwareUrl } = record;
      const url = softwareUrl
        ? this.webUrl + softwareUrl
        : this.webUrl + dwgUrl;
      let link = document.createElement("a");
      link.style.display = "none";
      link.href = url;
      // link.download = fileName;
      document.body.appendChild(link);
      link.click();
      document.body.removeChild(link);
      // downloadLog(parentCode, subModel);
    },
    zipDownload() {
      // const { parentCode, currentVersion } = this;
      const {
        currentVersion: { id, version },
      } = this;
      // zipDownload(id, version).then((res) => {
      //   // console.log(res, "===========");
      //   let { headers, data, status } = res;
      //   if (200 == status && data) {
      //     let url = window.URL.createObjectURL(data);
      //     const matchRes = /filename=(.*)/.exec(headers["content-disposition"]);
      //     const fileName = matchRes ? matchRes[1].trim() : "未知文件名.zip";
      //     let link = document.createElement("a");
      //     link.style.display = "none";
      //     link.href = url;
      //     link.download = fileName;
      //     document.body.appendChild(link);
      //     link.click();
      //     document.body.removeChild(link);
      //     window.URL.revokeObjectURL(url);
      //   } else {
      //     this.$message.error("操作失败");
      //   }
      // });
    },
    resize() {
      this.update = Math.random();
    },
    showSoftwareDownload() {
      this.softwareDownloadShow = true;
    },
    softwareDownloadCancel() {
      this.softwareDownloadShow = false;
    },
  },
  mounted() {
    this.getVersions();
    // this.searchData();
    window.addEventListener("resize", this.resize);
  },
  destroyed() {
    window.removeEventListener("resize", this.resize);
  },
};
</script>
src/pages/resourceManage/materialsCenter/list.vue
@@ -10,7 +10,7 @@
            :columns="columns"
            :loading="loading"
            title=""
            row-key="subCode"
            :row-key="(record, index) => record.subCode + '_' + index"
            @search="onSearch"
            @refresh="onRefresh"
            @reset="onReset"
@@ -503,6 +503,7 @@
          const { code, data, msg } = res.data;
          if (code && data) {
            this.$message.success(msg);
            this.fileListShow = false;
          } else {
            this.$message.error(msg);
          }
@@ -588,7 +589,7 @@
  },
  watch: {
    update(n) {
      if (-1 != n) {
      if (-1 != n && !this._inactive) {
        this.$nextTick(() => {
          const table = this.$refs.table;
          const header = document.querySelectorAll(
src/pages/resourceManage/product/changeParts.vue
@@ -313,7 +313,7 @@
        componentsBak,
        parentCode,
        customCode,
        subCode,
        materialId: subMaterialId,
        version,
      } = obj;
      // 取新增的
@@ -323,7 +323,7 @@
          materialId: v.id,
          parentCode,
          customCode,
          subCode,
          subMaterialId,
          version,
        }));
      // 删除的
@@ -333,7 +333,7 @@
          materialId: v.id,
          parentCode,
          customCode,
          subCode,
          subMaterialId,
          version,
        }));
      arrAdd.push(...add);
src/pages/resourceManage/product/details/details.vue
@@ -59,31 +59,31 @@
                      <a @click="dwgReview(record.dwgUrl)">预览</a>
                      <a-divider type="vertical"></a-divider>
                      <a @click="downloadLog(record)">下载</a>
                      <template
                        v-if="record.softwares.length && canUploadSoftware"
                      >
                        <a-divider type="vertical"></a-divider>
                        <a-popover title="" trigger="hover">
                          <div class="" slot="content" style="width: 450px">
                            <a-table
                              size="small"
                              :scroll="{ y: 300 }"
                              bordered
                              :columns="softwareColumns"
                              :data-source="record.softwares"
                              :pagination="false"
                              :expandRowByClick="true"
                              :row-key="(record1, index) => index"
                            >
                              <template slot="action" slot-scope="text, record1">
                                <a @click="downloadLog(record1)">下载</a>
                              </template>
                            </a-table>
                          </div>
                          <a>软件列表</a>
                        </a-popover>
                      </template>
                    </div>
                    <template
                      v-if="record.softwares.length && canDownloadSoftware"
                    >
                      <a-divider v-if="record.dwgUrl" type="vertical"></a-divider>
                      <a-popover title="" trigger="hover">
                        <div class="" slot="content" style="width: 450px">
                          <a-table
                            size="small"
                            :scroll="{ y: 300 }"
                            bordered
                            :columns="softwareColumns"
                            :data-source="record.softwares"
                            :pagination="false"
                            :expandRowByClick="true"
                            :row-key="(record1, index) => index"
                          >
                            <template slot="action" slot-scope="text, record1">
                              <a @click="downloadLog(record1)">下载</a>
                            </template>
                          </a-table>
                        </div>
                        <a>软件列表</a>
                      </a-popover>
                    </template>
                  </template>
                </a-table>
              </a-spin>
@@ -97,16 +97,26 @@
      <a-layout-footer>
        <a-card>
          <template v-if="dataSource.length">
            <a-popover title="" v-if="otherDoc.length && currentVersion.enabled">
            <a-popover
              title=""
              v-if="otherDoc.length && currentVersion.enabled"
            >
              <files-table slot="content" :list="otherDoc"></files-table>
              <a-button type="primary">其他附件</a-button>
            </a-popover>
            <a-button v-if="canDownloadBom && currentVersion.enabled" type="primary" @click="zipDownload"
            <a-button
              v-if="canDownloadBom && currentVersion.enabled"
              type="primary"
              @click="zipDownload"
              >bom下载</a-button
            >
            <a-button
              type="primary"
              v-if="softwareList.length && canUploadSoftware && currentVersion.enabled"
              v-if="
                softwareList.length &&
                canDownloadSoftware &&
                currentVersion.enabled
              "
              @click="showSoftwareDownload"
              >软件下载</a-button
            >
@@ -361,19 +371,19 @@
  computed: {
    ...mapGetters("setting", ["affixed"]),
    ...mapGetters("account", ["permits"]),
    canUploadSoftware() {
      return checkPermit(PERMITS.uploadSoftware, this.permits);
    canDownloadSoftware() {
      return checkPermit(PERMITS.downloadSoftware, this.permits);
    },
    canDownloadBom() {
      return checkPermit(PERMITS.downloadBom, this.permits);
    },
    canLockBom() {
      return checkPermit(PERMITS.lockBom, this.permits);
    }
    },
  },
  watch: {
    update(n) {
      if (-1 != n) {
      if (-1 != n && !this._inactive) {
        this.$nextTick(() => {
          const wraper = this.$refs.wraper;
          const wraperH = wraper.clientHeight;
@@ -491,7 +501,7 @@
        });
    },
    downloadLog(record) {
      const { parentCode, subModel, dwgUrl, softwareUrl } = record;
      const { parentCode, subModel, dwgUrl, fileUrl: softwareUrl } = record;
      const url = softwareUrl
        ? this.webUrl + softwareUrl
        : this.webUrl + dwgUrl;
src/pages/resourceManage/product/list.vue
@@ -669,6 +669,7 @@
    },
    uploadBom() {
      this.file = null;
      this.fromProd = undefined;
      this.bomUploadShow = true;
    },
    bomUploadCancel() {
@@ -735,7 +736,7 @@
  },
  watch: {
    update(n) {
      if (-1 != n) {
      if (-1 != n && !this._inactive) {
        this.$nextTick(() => {
          const table = this.$refs.table;
          const header = document.querySelectorAll(
src/pages/resourceManage/software/list.vue
@@ -334,8 +334,8 @@
      productSoftwareSubmit(formData)
        .then((res) => {
          let { code, data, msg } = res.data;
          if (code && data) {
            this.uploadShow = true;
          if (code) {
            this.uploadShow = false;
            this.$message.success(msg);
          } else {
            this.$message.error(msg);
@@ -350,7 +350,7 @@
  },
  watch: {
    update(n) {
      if (-1 != n) {
      if (-1 != n && !this._inactive) {
        this.$nextTick(() => {
          const table = this.$refs.table;
          const header = document.querySelectorAll(
src/pages/system/logs/list.vue
@@ -101,7 +101,7 @@
  },
  watch: {
    update(n) {
      if (-1 != n) {
      if (-1 != n && !this._inactive) {
        this.$nextTick(() => {
          const table = this.$refs.table;
          const header = document.querySelectorAll(
src/pages/user/list.vue
@@ -147,7 +147,7 @@
  },
  watch: {
    update(n) {
      if (-1 != n) {
      if (-1 != n && !this._inactive) {
        this.$nextTick(() => {
          const table = this.$refs.table;
          const header = document.querySelectorAll(
src/pages/workplace/WorkPlace.vue
@@ -56,7 +56,7 @@
  },
  watch: {
    update(n) {
      if (-1 != n) {
      if (-1 != n && !this._inactive) {
        const bar = document.querySelectorAll(".header-bar")[0].clientHeight;
        const workPlaceTop = document.querySelectorAll(".work-place-top")[0].clientHeight;
        this.y = this.minHeight-bar-workPlaceTop-56;