fix: 优化文件删除逻辑(采用前端删除文件)

This commit is contained in:
dj
2024-12-20 22:27:22 +08:00
parent 10f1afe23c
commit 06af12ca88
5 changed files with 49 additions and 50 deletions

View File

@@ -340,16 +340,16 @@ const handleDownload = (row) => {
})
}
const handleDelete = (row) => {
deleteFile(row.fileId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
// deleteFile(row.fileId).then(res => {
// ElNotification({
// title: '提示',
// message: res.msg,
// type: res.code === 1000 ? 'success' : 'error'
// })
// if (res.code === 1000) {
fileList.value.splice(fileList.value.findIndex((item) => item.fileId === row.fileId), 1);
}
});
// }
// });
}
//匹配字典值,返回对应值的字典标签
const filterDict = (data, value) => {

View File

@@ -391,17 +391,17 @@ const filterDict = (data, value) => {
return label
}
const handleDelete = (row) => {
deleteFile(row.fileId).then(res => {
ElNotification({
title: '提示',
message: res.msg,
type: res.code === 1000 ? 'success' : 'error'
})
if (res.code === 1000) {
// deleteFile(row.fileId).then(res => {
// ElNotification({
// title: '提示',
// message: res.msg,
// type: res.code === 1000 ? 'success' : 'error'
// })
// if (res.code === 1000) {
fileList.value.splice(fileList.value.findIndex((item) => item.fileId === row.fileId), 1);
changeImplementFile()
}
});
// }
// });
}
const handleDownload = (row) => {