研发图纸文件管理系统-前端项目
longyvfengyun
2023-12-01 75bd8ea0946134823ef41cc398f9aad2cfe7fbd5
附件颜色修改
1个文件已修改
38 ■■■■■ 已修改文件
src/pages/resourceManage/materialsCenter/list.vue 38 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/pages/resourceManage/materialsCenter/list.vue
@@ -64,7 +64,7 @@
                <a @click="removeLink(record)">解除关联</a>
              </template>
              <a-divider type="vertical"></a-divider>
              <a @click="panelShow(record)">附件</a>
              <a :class="{'not-can-use': !record.isCanUse}" @click="panelShow(record)">附件</a>
              <template v-if="record.rootModel">
                <a-divider type="vertical"></a-divider>
                <a @click="goHistory(record)">历史</a>
@@ -523,9 +523,11 @@
            const model = v.subModel;
            const reg = /(.*)(-|_)A/;
            const rootModel = reg.test(model) ? model.match(reg)[1] : "";
                        const isCanUse = this.getAttachIsCanUse(v);
            return {
              ...v,
              rootModel,
                            isCanUse
            };
          });
          total = res.data2.total;
@@ -710,6 +712,7 @@
      this.resize();
    },
    panelShow(obj) {
            console.log(obj);
      const { id, dwgUrl, attachLocks, subModel } = obj;
      this.currentObj = obj;
      let reg = new RegExp("^" + subModel, "i");
@@ -733,6 +736,36 @@
        this.fileListShow = true;
      });
    },
        getAttachIsCanUse(obj) {
            const {dwgUrl, attachLocks} = obj;
            let result = false;
            if(attachLocks.length !== 0) {    // 存在未锁定/锁定条目
                let isHasUnlock = false;
                for(let i=0; i<attachLocks.length; i++) {
                    if(attachLocks[i].lockFlag === 0) {
                        isHasUnlock = true;
                        break;
                    }
                }
                if(isHasUnlock) {   // 存在未锁定附件
                    result = true;
                }else if(dwgUrl){   // 存在图纸
                    let isInList = false;
                    for(let i=0; i<attachLocks.length; i++) {
                        let reg = new RegExp(attachLocks[i].attachName, 'i');
                        if(reg.test(dwgUrl)) {
                            isInList = true;
                            break;
                        }
                    }
                    result = !isInList;
                }else {
                    result = false;
                }
            }else result = !!dwgUrl;
            return result;
        },
    fileListCancel() {
      this.fileListShow = false;
    },
@@ -825,4 +858,7 @@
.type-grp {
  margin-bottom: 20px;
}
a.not-can-use {
    color: #808080;
}
</style>