From 717177b471d26cfc1a3b780b1096baf95df51c30 Mon Sep 17 00:00:00 2001 From: Junyi Date: Thu, 24 Apr 2025 16:16:22 +0800 Subject: [PATCH] fix(client): adjust upload message (#6757) --- packages/core/client/src/locale/zh-CN.json | 2 +- .../core/client/src/schema-component/antd/upload/Upload.tsx | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/core/client/src/locale/zh-CN.json b/packages/core/client/src/locale/zh-CN.json index 0f8fa660a2..4da8259285 100644 --- a/packages/core/client/src/locale/zh-CN.json +++ b/packages/core/client/src/locale/zh-CN.json @@ -819,7 +819,7 @@ "File size exceeds the limit": "文件大小超过限制", "File type is not allowed": "文件类型不允许", "Uploading": "上传中", - "Incomplete uploading files need to be resolved": "未完成上传的文件需要处理", + "Some files are not uploaded correctly, please check.": "部分文件未上传成功,请检查。", "Default title for each record": "用作数据的默认标题", "If collection inherits, choose inherited collections as templates": "当前表有继承关系时,可选择继承链路上的表作为模板来源", "Select an existing piece of data as the initialization data for the form": "选择一条已有的数据作为表单的初始化数据", diff --git a/packages/core/client/src/schema-component/antd/upload/Upload.tsx b/packages/core/client/src/schema-component/antd/upload/Upload.tsx index 6c42d7bd68..76edd26fc0 100644 --- a/packages/core/client/src/schema-component/antd/upload/Upload.tsx +++ b/packages/core/client/src/schema-component/antd/upload/Upload.tsx @@ -393,10 +393,11 @@ export function Uploader({ rules, ...props }: UploadProps) { useEffect(() => { if (pendingList.length) { + const errorFiles = pendingList.filter((item) => item.status === 'error'); field.setFeedback({ type: 'error', code: 'ValidateError', - messages: [t('Incomplete uploading files need to be resolved')], + messages: [errorFiles.length ? t('Some files are not uploaded correctly, please check.') : ' '], }); } else { field.setFeedback({});