@@ -60,6 +60,7 @@ import { messageInstance } from "lowcoder-design/src/components/GlobalInstances"
6060import { styled } from "styled-components" ;
6161import { styleControl } from "@lowcoder-ee/comps/controls/styleControl" ;
6262import { AnimationStyle } from "@lowcoder-ee/comps/controls/styleControlConstants" ;
63+ import { StringControl } from "comps/controls/codeControl" ;
6364
6465const FormWrapper = styled . div `
6566 height: 100%;
@@ -80,7 +81,8 @@ const childrenMap = {
8081 disableSubmit : BoolCodeControl ,
8182 loading : BoolCodeControl ,
8283 onEvent : eventHandlerControl ( eventOptions ) ,
83- animationStyle : styleControl ( AnimationStyle )
84+ animationStyle : styleControl ( AnimationStyle ) ,
85+ invalidFormMessage : StringControl
8486} ;
8587
8688type FormProps = TriContainerViewProps &
@@ -230,6 +232,7 @@ const FormBaseComp = (function () {
230232 { ( useContext ( EditorContext ) . editorModeStatus === "logic" || useContext ( EditorContext ) . editorModeStatus === "both" ) && (
231233 < Section name = { sectionNames . advanced } >
232234 { children . initialData . propertyView ( { label : trans ( "formComp.initialData" ) } ) }
235+ { children . invalidFormMessage . propertyView ( { label : trans ( "formComp.invalidFormMessage" ) } ) }
233236 </ Section >
234237 ) }
235238
@@ -363,7 +366,8 @@ let FormTmpComp = class extends FormBaseComp implements IForm {
363366 return Promise . resolve ( ) ;
364367 } ) ;
365368 } else {
366- messageInstance . error ( trans ( "formComp.notValidForm" ) ) ;
369+ const customMessage = this . children . invalidFormMessage . getView ( ) ;
370+ messageInstance . error ( customMessage || trans ( "formComp.notValidForm" ) ) ;
367371 return Promise . reject ( "formComp.notValidForm" ) ;
368372 }
369373 }
0 commit comments