| | |
| | | <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> |
| | |
| | | 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; |
| | |
| | | this.resize(); |
| | | }, |
| | | panelShow(obj) { |
| | | console.log(obj); |
| | | const { id, dwgUrl, attachLocks, subModel } = obj; |
| | | this.currentObj = obj; |
| | | let reg = new RegExp("^" + subModel, "i"); |
| | |
| | | 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; |
| | | }, |
| | |
| | | .type-grp { |
| | | margin-bottom: 20px; |
| | | } |
| | | a.not-can-use { |
| | | color: #808080; |
| | | } |
| | | </style> |