修复编辑项目文件问题

This commit is contained in:
weibl
2026-01-23 11:25:43 +08:00
parent ec70578835
commit d5fbf29ace

View File

@@ -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 });
}