研发图纸文件管理系统-前端项目
he wei
2023-02-09 dfe4de372a466a1324e39fee2b8bda1dc4adb72a
U 产品包含0120 在详情页面可以跳转到 0120的详情页面
3个文件已修改
76 ■■■■ 已修改文件
src/pages/resourceManage/product/details/details.vue 63 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/list.vue 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/router/config.js 10 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/product/details/details.vue
@@ -51,12 +51,7 @@
                  :pagination="false"
                  :expandRowByClick="true"
                  :row-key="(record, index) => record.subCode + '_' + index"
                  :rowClassName="
                    (record) =>
                      record.children && record.children.length
                        ? 'is-replace'
                        : ''
                  "
                  :rowClassName="rowClassFn"
                >
                  <template slot="dataIndex" slot-scope="text, record, index">
                    {{ index + 1 }}
@@ -114,6 +109,19 @@
                        <a>软件列表</a>
                      </a-popover>
                    </template>
                    <template v-if="/^0120/.test(record.subCode)">
                      <a-divider
                        v-if="
                          record.softwares &&
                          record.softwares.length &&
                          canDownloadSoftware
                        "
                        type="vertical"
                      ></a-divider>
                      <a href="javascript:;" @click="toDetails0120(record)"
                        >详情</a
                      >
                    </template>
                  </template>
                </a-table>
              </a-spin>
@@ -167,13 +175,13 @@
            >
            <a-button
              type="primary"
              v-if="!currentVersion.enabled && canLockBom"
              v-if="!currentVersion.enabled && canLockBom && maxVersionid == currentVersion.id"
              @click="changeStatus"
              >激活版本</a-button
            >
            <a-button
              type="primary"
              v-if="currentVersion.enabled && canLockBom"
              v-if="currentVersion.enabled && canLockBom && maxVersionid == currentVersion.id"
              @click="changeStatus"
              >锁定版本</a-button
            >
@@ -386,6 +394,9 @@
      webUrl: getWebUrl(),
      record: {},
      currentVersion: -1,
      // 0120的锁定激活只能操作版本列表中第一个(最大版本号)
      // 最新的版本的id
      maxVersionid: -1,
      spinning: false,
      loading: false,
      total: 0,
@@ -608,6 +619,9 @@
    canLockBom() {
      return checkPermit(PERMITS.lockBom, this.permits);
    },
    is0120() {
      return /^0120/.test(this.parentCode);
    },
  },
  watch: {
    update(n) {
@@ -694,9 +708,14 @@
        // res = res.data;
        const { code, data, data2 } = res;
        let list = [];
        let maxVersionid = -1;
        if (code && data) {
          list = data2;
          list.forEach((v) => {
            maxVersionid = v.id > maxVersionid ? v.id : maxVersionid;
          });
        }
        this.maxVersionid = maxVersionid;
        this.versionList = list;
      }
    },
@@ -972,6 +991,27 @@
    toggleSide() {
      this.sideVisible = !this.sideVisible;
    },
    rowClassFn(record) {
      let classList = [];
      if (record.children && record.children.length) {
        classList.push("is-replace");
      }
      if (/^0120/.test(record.subCode)) {
        classList.push("is-0120");
      }
      return classList;
    },
    toDetails0120(record) {
      const {
        subCode: parentCode,
        subModel: parentModel,
        subName: parentName,
      } = record;
      this.$router.push({
        path: "/resource/product-details-0120",
        query: { parentCode, customCode: "", parentModel, parentName },
      });
    },
  },
  mounted() {
    this.sendMessage();
@@ -1119,6 +1159,13 @@
  /deep/.ant-table-row-level-1.ant-table-row-level-1:hover > td {
    background: #ffbcc9;
  }
  /deep/.is-0120 > td {
    background: #ffae00;
  }
  /deep/.is-0120.is-0120.ant-table-row-hover > td,
  /deep/.is-0120.is-0120:hover > td {
    background: #f8c34f;
  }
}
/deep/.ant-descriptions-row > th,
/deep/.ant-descriptions-row > td {
src/pages/resourceManage/product/list.vue
@@ -681,8 +681,9 @@
    goDetails(record) {
      // console.log(record);
      const { parentCode, customCode, parentModel, parentName } = record;
      let is0120 = /^0120/.test(parentCode);
      this.$router.push({
        path: "/resource/product-details",
        path: is0120 ? "/resource/product-details-0120" : "/resource/product-details",
        query: { parentCode, customCode, parentModel, parentName },
      });
    },
src/router/config.js
@@ -88,6 +88,16 @@
              },
              component: () => import('@/pages/resourceManage/product/prodDiff'),
            },
            // 0120详情
            {
              path: 'product-details-0120',
              name: '钣金件详情',
              meta: {
                invisible: true,
                highlight: '/resource/product'
              },
              component: () => import('@/pages/resourceManage/product/details'),
            },
            {
              path: 'software',
              name: '软件中心',