From d2b512ff91ff187989aff35eaab8a089c707e680 Mon Sep 17 00:00:00 2001 From: dap <15891557205@163.com> Date: Sat, 21 Sep 2024 10:56:13 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BC=98=E5=8C=96select=E7=AD=89?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=E7=9A=84=E9=BB=98=E8=AE=A4=E6=A0=A1=E9=AA=8C?= =?UTF-8?q?=E8=A7=84=E5=88=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/web-antd/src/adapter/form.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/web-antd/src/adapter/form.ts b/apps/web-antd/src/adapter/form.ts index 4bf00abf..282f3c32 100644 --- a/apps/web-antd/src/adapter/form.ts +++ b/apps/web-antd/src/adapter/form.ts @@ -32,6 +32,7 @@ import { TreeSelect, Upload, } from 'ant-design-vue'; +import { isArray } from 'lodash-es'; // 业务表单组件适配 @@ -107,7 +108,10 @@ setupVbenForm({ return true; }, selectRequired: (value, _params, ctx) => { - if (value === undefined || value === null) { + if ( + [false, null, undefined].includes(value) || + (isArray(value) && value.length === 0) + ) { return $t('formRules.selectRequired', [ctx.label]); } return true;