feat(upload): 优化文件上传组件逻辑

- 在删除文件时,将删除的文件信息存储到本地存储中
- 在选择文件时,检查本地存储中是否有删除的文件信息,并从选择的文件中移除
- 优化了文件上传流程,提高了用户体验
This commit is contained in:
dj
2025-06-25 17:41:15 +08:00
parent 41a455338f
commit 8b03d62a75
2 changed files with 27 additions and 8 deletions

View File

@@ -426,6 +426,7 @@ const handleDelete = (row, type) => {
allFileList.value.splice(allFileList.value.findIndex((item) => item.fileId === row.fileId), 1);
isHaveOneFile.value = !(allFileList.value && allFileList.value?.length == 0);
console.log('allFileList.value',allFileList.value)
localStorage.setItem('deleteFileRow', JSON.stringify(row))
if (localStorage.getItem('collectData')) {
let collectData = JSON.parse(localStorage.getItem('collectData'))
collectData.fileList = allFileList.value
@@ -462,6 +463,7 @@ const getOtherFile = (val) => {
} else {
allFileList.value = _otherFileListValue.value
}
isHaveOneFile.value = true
emit('getOtherFile', val)
}