fix(ProjectAttachment): 修复删除附件后未及时更新文件列表的问题- 在删除文件后添加了更新文件列表的逻辑

- 优化了获取本地文件列表的方法
- 调整了文件列表的初始化位置
This commit is contained in:
dj
2025-05-22 22:56:06 +08:00
parent 673e4fa20a
commit c7329f2f6d

View File

@@ -65,7 +65,7 @@
</template>
<script setup lang="jsx">
import {addTag, delTag, getTagList, getTags, updateTag} from "@/api/project-manage";
import {addTag, delTag, getTagList, updateTag} from "@/api/project-manage";
import {ElLoading, ElMessageBox, ElNotification} from "element-plus";
import {searchImplementationFileList, uploadFileList} from "@/api/project-manage/attachment";
import {deleteFile, downloadFile} from "@/api/project-demand";
@@ -336,7 +336,6 @@ const handleSubmit = async () => {
message: res.msg,
type: 'error'
})
fileList.value = []
} else {
ElNotification({
title: '提示',
@@ -348,6 +347,7 @@ const handleSubmit = async () => {
// otherAttachmentList.value.push(item)
// })
}
fileList.value = []
// changeFileList('all',true)
}
}
@@ -398,8 +398,7 @@ const changeFileList = (tag, flag) => {
}
const getLocalList = () => {
if (localStorage.getItem(`implementAllFileList-${route.query.projectId}`) && JSON.parse(localStorage.getItem(`implementAllFileList-${route.query.projectId}`))) {
const list = JSON.parse(localStorage.getItem(`implementAllFileList-${route.query.projectId}`))
return list
return JSON.parse(localStorage.getItem(`implementAllFileList-${route.query.projectId}`))
} else {
return []
}