From 810757e8286bebc187d7b8822463f8ddc9af6780 Mon Sep 17 00:00:00 2001 From: dj <1042039504@qq.com> Date: Wed, 9 Apr 2025 23:11:06 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E9=99=84=E4=BB=B6?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E5=92=8C=E5=B1=95=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DetailComponent/ProjectAttachment.vue | 30 ++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/src/components/DetailComponent/ProjectAttachment.vue b/src/components/DetailComponent/ProjectAttachment.vue index 956675d..351a811 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 @@
- + 编辑 @@ -204,6 +204,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: '取消', @@ -222,8 +230,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) => { @@ -381,10 +397,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)