增加UPLOAD_FILE_TYPE_ENUM项

master
LiuJiaNan 2025-11-10 10:46:50 +08:00
parent 16c5205aa1
commit d1678d7bb9
2 changed files with 4 additions and 2 deletions

View File

@ -64,6 +64,7 @@ export const UPLOAD_FILE_TYPE_ENUM = {
135: 135, 135: 135,
136: 136, 136: 136,
137: 137, 137: 137,
138: 138,
}; };
/** /**
@ -132,4 +133,5 @@ export const UPLOAD_FILE_PATH_ENUM = {
135: "branch_manager_approval_signature", 135: "branch_manager_approval_signature",
136: "accident_incident", 136: "accident_incident",
137: "accident_incident", 137: "accident_incident",
138: "hidden_disposal_plan",
}; };

View File

@ -39,7 +39,7 @@ function useUploadFile(returnType = "object") {
// 当single为false时foreignKey是必需的 // 当single为false时foreignKey是必需的
if (!single) { if (!single) {
if (!params.hasOwnProperty('foreignKey')) if (!params.hasOwnProperty("foreignKey"))
throw new Error("请传入 options.params.foreignKey"); throw new Error("请传入 options.params.foreignKey");
// 如果 foreignKey 是 undefined设置默认值为空字符串 // 如果 foreignKey 是 undefined设置默认值为空字符串
if (params.foreignKey === undefined || params.foreignKey === null) if (params.foreignKey === undefined || params.foreignKey === null)
@ -51,7 +51,7 @@ function useUploadFile(returnType = "object") {
setLoading(false); setLoading(false);
resolve( resolve(
single single
? { filePath: '' } ? { filePath: "" }
: { id: params.foreignKey }, : { id: params.foreignKey },
); );
return; return;