5e98a132 by lihua

fix: 上传文件不符合条件删除问题

1 parent 0f5106a8
......@@ -39,7 +39,7 @@ const onUpload = async (file, list) => {
const isExcel = file.raw.type === 'application/vnd.ms-excel' || file.raw.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' || file.raw.type == 'text/csv';
if (!isExcel) {
const fileUpload = fileUploadRef.value[0] || fileUploadRef.value
fileUpload?.handleRemove(file)
fileUpload?.handleRemove(file.file)
ElMessage.error('上传文件只能是 .xls, .xlsx 格式');
return false;
}
......
......@@ -260,13 +260,13 @@ const uploadFile = (file) => {
uploadTime.value = Moment(Date.now()).format('YYYY-MM-DD HH:mm:ss');
ElMessage.success('上传成功');
} else {
uploadRef.value.handleRemove(file);
uploadRef.value.handleRemove(file.file);
ElMessage.error('上传失败,请重新上传!');
}
})
})
.catch(() => {
uploadRef.value.handleRemove(file);
uploadRef.value.handleRemove(file.file);
ElMessage.error('上传失败,请重新上传');
});
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!