修复编辑项目文件问题
This commit is contained in:
@@ -137,10 +137,9 @@ const openDialog = (type: string, row?: any) => {
|
||||
// nextTick(() => {
|
||||
if (type === 'edit' && row) {
|
||||
row.fileType = String(row.fileType);
|
||||
row.files = [{ name: row.originalName }];
|
||||
row.files = [{ name: row.originalName, id: row.id }];
|
||||
oldFile.value = {
|
||||
id: row.id,
|
||||
uid: row.files[0].uid,
|
||||
};
|
||||
// tableFormRef.value.setFormDataFun(row);
|
||||
editRowInfo.value = { ...row };
|
||||
@@ -231,7 +230,7 @@ const confirmUploadFun = async () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
const oldFileInfo = fromData.files.find((item: any) => item.uid === oldFile.value.uid);
|
||||
const oldFileInfo = fromData.files.find((item: any) => item?.id === oldFile.value.id);
|
||||
if (!oldFileInfo) {
|
||||
dataDelFileApi({ delFileId: oldFile.value.id });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user