From 500866cc40d6dba659952ae7f0a9dc9456d01ccd Mon Sep 17 00:00:00 2001 From: wyw <571921741@qq.com> Date: Fri, 20 Mar 2026 14:47:24 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E5=A4=9A=E6=96=87=E6=9C=AC=20?= =?UTF-8?q?=E5=AD=97=E7=AC=A6=E9=95=BF=E5=BA=A6=E8=B6=85=E5=87=BA=E5=81=9A?= =?UTF-8?q?=E5=AE=8C=E5=96=84=E6=8F=90=E7=A4=BA=202=E3=80=81=E9=99=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=8A=E4=BC=A0=20=E5=A4=84=E7=90=86=E6=8C=89?= =?UTF-8?q?=E9=92=AE=E5=8F=AF=E6=93=8D=E4=BD=9C=E3=80=81=E8=A7=86=E9=A2=91?= =?UTF-8?q?=E5=90=8D=E7=A7=B0=E6=98=BE=E7=A4=BA=E7=AD=89=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/baseComponents/EditBaseComponent/index.js | 2 +- src/files/edit/PF147.js | 21 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/baseComponents/EditBaseComponent/index.js b/src/baseComponents/EditBaseComponent/index.js index c368cd9..4c54b3b 100644 --- a/src/baseComponents/EditBaseComponent/index.js +++ b/src/baseComponents/EditBaseComponent/index.js @@ -803,7 +803,7 @@ params【字段属性】=值 if (tempVal.length < minLen) { errors.push(errVerifyMsg || `至少输入${minLen}个字符`) } else if (tempVal.length > maxLen && maxLen !== 0) { - errors.push(errVerifyMsg || `最多允许${maxLen}个字符`) + errors.push(errVerifyMsg || `最多允许${maxLen}个字符,现已输入${tempVal.length}个字符`) } break; case 7: diff --git a/src/files/edit/PF147.js b/src/files/edit/PF147.js index 2642732..66760f5 100644 --- a/src/files/edit/PF147.js +++ b/src/files/edit/PF147.js @@ -48,18 +48,15 @@ export default { // if (params.record.Nav_Files && params.record.Nav_Files.length > 0) { // params.record['Files'] = params.record.Nav_Files // } - - // 2. 上传前校验函数(核心) const beforeUpload = (file) => { // 1. 定义文件大小限制(示例:限制最大2MB) - const MAX_FILE_SIZE = 30 * 1024 * 1024; // 2MB = 2*1024*1024 Byte + const MAX_FILE_SIZE = 500 * 1024 * 1024; // 2MB = 2*1024*1024 Byte // 校验文件大小 if (file.size > MAX_FILE_SIZE) { - message.error(`文件大小不能超过 30MB!当前文件大小:${(file.size / 1024 / 1024).toFixed(2)}MB`); + message.error(`文件大小不能超过 500MB!当前文件大小:${(file.size / 1024 / 1024).toFixed(2)}MB`); return false; // 返回false阻止上传 // 也可使用Promise方式:return Promise.reject(new Error('文件大小超过限制')); } - // 校验通过,允许上传 return true; }; @@ -129,10 +126,12 @@ export default { } if (info.file.status != 'done') { //上传成功回调不处理数据赋值 - const temps2 = []; - temps2.push({ field: 'Nav_Files', value: params.record['Files'] }) - temps2.push({ field: 'NAME', value: info.file.name }) - params.setFieldValueByBatch(temps2); + if (info.file.size < 500 * 1024 * 1024) { + const temps2 = []; + temps2.push({ field: 'Nav_Files', value: params.record['Files'] }) + temps2.push({ field: 'NAME', value: info.file.name }) + params.setFieldValueByBatch(temps2); + } } }, }; @@ -141,7 +140,7 @@ export default {