diff --git a/src/components/DetailComponent/ProjectAttachment.vue b/src/components/DetailComponent/ProjectAttachment.vue index 1dc59c0..e19dfe6 100644 --- a/src/components/DetailComponent/ProjectAttachment.vue +++ b/src/components/DetailComponent/ProjectAttachment.vue @@ -7,7 +7,7 @@ style="margin-left: 15px;margin-top: -10px"> - @@ -30,7 +30,7 @@
- + 编辑 @@ -206,6 +206,14 @@ const changeTag = async () => { tagNameShow.value = false; } const tabRemove = async (val) => { + if(otherAttachmentList.value&&otherAttachmentList.value.length>0){ + ElNotification({ + title: '提示', + message: '该标签下存在文件,不能删除标签。如需删除标签,请先删除该标签下的所有文件。', + type: 'error' + }) + return; + } ElMessageBox.confirm(`确认删除名称为${getTagName(val)}的标签吗?`, '系统提示', { confirmButtonText: '确定', cancelButtonText: '取消', @@ -224,8 +232,16 @@ const tabRemove = async (val) => { }) } const handleEditTag = () => { - tagNameShow.value = true fileParam.value.tagName = getTagName(activeName.value) + if(otherAttachmentList.value&&otherAttachmentList.value.length>0){ + ElNotification({ + title: '提示', + message: '该标签下存在文件,不能编辑标签。如需编辑标签,请先删除该标签下的所有文件。', + type: 'error' + }) + return; + } + tagNameShow.value = true isEdit.value = true } const getTagName = (name) => { @@ -383,10 +399,10 @@ const getTagsOption = (flag) => { list=otherAttachmentList.value } tagsOption.value.forEach((tag, index) => { - const filterArray = list.filter(item => tag.fileTag == item.tag) - console.log("🚀 ~ file:filterArray ", filterArray) - - tagsOption.value[index].isClose = filterArray.length > 0 ? 0 : 1 + // const filterArray = list.filter(item => tag.fileTag == item.tag) + // console.log("🚀 ~ file:filterArray ", filterArray) + tagsOption.value[index].isClose =1 + // tagsOption.value[index].isClose = filterArray.length > 0 ? 0 : 1 }) console.log("🚀 otherAttachmentList.value", allFiles.value) console.log("🚀 ~ file:\tagsOption.value ", tagsOption.value)