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;