From 3802ca38f8ed89282735fa012834b2730c3f9363 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=AB=E9=9B=A8=E6=B0=B4=E8=BF=87=E6=BB=A4=E7=9A=84?= =?UTF-8?q?=E7=A9=BA=E6=B0=94-Rain?= <958414905@qq.com> Date: Tue, 7 Nov 2023 21:21:49 +0800 Subject: [PATCH] chore: optimize error message (#2985) --- .../antd/form-item/hooks/useParseDefaultValue.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/core/client/src/schema-component/antd/form-item/hooks/useParseDefaultValue.ts b/packages/core/client/src/schema-component/antd/form-item/hooks/useParseDefaultValue.ts index 2a1c274b44..07d3be3c73 100644 --- a/packages/core/client/src/schema-component/antd/form-item/hooks/useParseDefaultValue.ts +++ b/packages/core/client/src/schema-component/antd/form-item/hooks/useParseDefaultValue.ts @@ -16,6 +16,8 @@ import { transformVariableValue } from '../../../../variables/utils/transformVar import { isSubMode } from '../../association-field/util'; import { isFromDatabase, useSpecialCase } from './useSpecialCase'; +const formilyVariable = ['record']; + /** * 用于解析并设置 FormItem 的默认值 */ @@ -47,6 +49,7 @@ const useParseDefaultValue = () => { useEffect(() => { if ( + (isVariable(fieldSchema.default) && formilyVariable.includes(getVariableName(fieldSchema.default))) || fieldSchema.default == null || isInSetDefaultValueDialog || isInFormDataTemplate ||