diff --git a/src/components/DetailComponent/ProjectAttachment.vue b/src/components/DetailComponent/ProjectAttachment.vue index e449037..73608fa 100644 --- a/src/components/DetailComponent/ProjectAttachment.vue +++ b/src/components/DetailComponent/ProjectAttachment.vue @@ -30,7 +30,7 @@
- + handleDownload(row)}>下载 { - uploadState.value ? + uploadState.value ? deleteSingleFile(row)}/> : '' } @@ -157,6 +157,7 @@ const filePreviewParam = ref({ fileType: 'pdf' }) const filePreviewShow = ref(false) +const uploadLoading = ref(false) const isEdit = ref(false) const isCloseByList = (index) => { // otherAttachmentList.length>0?false:true @@ -173,24 +174,24 @@ const handleDownload = (row) => { } const deleteSingleFile = (row) => { console.log("🚀 ~ file: ", row) - deleteFile(row.fileId).then(res => { - ElNotification({ - title: '提示', - message: res.msg, - type: res.code === 1000 ? 'success' : 'error' - }) - if (res.code === 1000) { - if (row.newFile) { - const finalList = getLocalList().filter(item => item.fileId !== row.fileId); - localStorage.setItem(`implementAllFileList-${route.query.projectId}`, JSON.stringify(finalList)) - }else{ - otherAttachmentList.value.splice(otherAttachmentList.value.findIndex((item) => item.fileId === row.fileId), 1); - } - - getAttachmentList() - activeName.value = 'all' + deleteFile(row.fileId).then(res => { + ElNotification({ + title: '提示', + message: res.msg, + type: res.code === 1000 ? 'success' : 'error' + }) + if (res.code === 1000) { + if (row.newFile) { + const finalList = getLocalList().filter(item => item.fileId !== row.fileId); + localStorage.setItem(`implementAllFileList-${route.query.projectId}`, JSON.stringify(finalList)) + } else { + otherAttachmentList.value.splice(otherAttachmentList.value.findIndex((item) => item.fileId === row.fileId), 1); } - }); + + getAttachmentList() + activeName.value = 'all' + } + }); } const changeTag = async () => { @@ -266,7 +267,7 @@ const getTagName = (name) => { } return tagName } -const handleTabClick = (item) => { +const handleTabClick = (item, e) => { const defaultArray = tagsOption.value.filter(item1 => item1.tagId == item.props.name) if (defaultArray && defaultArray.length > 0) { isDefault.value = defaultArray[0].isDefault == 1 @@ -307,8 +308,9 @@ const compositeParam = (item) => { } } const getFile = (val) => { + console.log('上传文件', val) - fileList.value=getLocalList() + fileList.value = getLocalList() let fileObj = compositeParam(val) fileList.value.push(fileObj) localStorage.setItem(`implementAllFileList-${route.query.projectId}`, JSON.stringify(fileList.value)) @@ -372,6 +374,8 @@ const changeFileList = (tag, flag) => { // targetId: route.query.projectId, // targetState: "30", // } + + otherAttachmentList.value = [...otherAttachmentList.value, ...getLocalList()]; } else { const filw = getLocalList().filter(item1 => item1.tag === tag); const filteredAllFiles = allFiles.value.filter(item1 => item1.tag === tag); diff --git a/src/components/FileUpload.vue b/src/components/FileUpload.vue index ad783c6..fa95fc4 100644 --- a/src/components/FileUpload.vue +++ b/src/components/FileUpload.vue @@ -1,13 +1,14 @@