diff --git a/src/components/formFields/form/index.tsx b/src/components/formFields/form/index.tsx index 2c738f130a684c94a69b2857973c72054478a77f..22325f7096d158d1f39c262b961f426fda6e4769 100644 --- a/src/components/formFields/form/index.tsx +++ b/src/components/formFields/form/index.tsx @@ -127,6 +127,7 @@ export default class FormField extends Field = [] const formDataList = cloneDeep(this.state.formDataList) @@ -143,6 +144,10 @@ export default class FormField extends Field 0) { - errors.push(new FieldError(`子项中存在${childrenError}个错误。`)) + const errTips = `${this.props.config.label || ''} ${childrenErrorMsg.map(err => `${err.name}:${err.msg}`).join('; ')}` + errors.push(new FieldError(errTips)) } return errors.length ? errors : true @@ -494,6 +500,7 @@ export default class FormField extends Field = [] const formData = cloneDeep(this.state.formData) @@ -75,11 +76,15 @@ export default class GroupField extends Field 0) { - errors.push(new FieldError(`子项中存在${childrenError}个错误。`)) + const errTips = `${this.props.config.label || ''}子项中存在错误。\n ${childrenErrorMsg.map(err => `${err.name}:${err.msg}`).join('; ')}。` + errors.push(new FieldError(errTips)) } return errors.length ? errors : true @@ -308,6 +314,7 @@ export default class GroupField extends Field { if (!ConditionHelper(formFieldConfig.condition, { record: value, data: this.props.data, step: this.props.step })) { this.formFieldsMounted[formFieldIndex] = false + this.formFields && (this.formFields[formFieldIndex] = null) return null } let hidden: boolean = true diff --git a/src/components/formFields/importSubform/index.tsx b/src/components/formFields/importSubform/index.tsx index 5863faf40970352ad204642aabebc5cd6b8fe52a..77bba232a2b7b83e87b570e7490785218732b2fe 100644 --- a/src/components/formFields/importSubform/index.tsx +++ b/src/components/formFields/importSubform/index.tsx @@ -131,11 +131,13 @@ export default class ImportSubformField extends Field = [] const formData = cloneDeep(this.state.formData) for (const fieldIndex in (this.state.fields || [])) { const formItem = this.formFields[fieldIndex] + const formConfig = this.state.fields?.[fieldIndex] if (formItem !== null && formItem !== undefined && !formItem.props.config.disabled) { const validation = await formItem.validate(getValue(value, this.getFullpath((this.state.fields || [])[fieldIndex].field))) @@ -144,6 +146,10 @@ export default class ImportSubformField extends Field 0) { - errors.push(new FieldError('子项中存在错误')) + const errTips = `${this.props.config.label || ''}子项中错误。\n ${childrenErrorMsg.map(err => `${err.name}:${err.msg}`).join('; ')}。` + errors.push(new FieldError(errTips)) } return errors.length ? errors : true @@ -417,6 +424,7 @@ export default class ImportSubformField extends Field { if (!ConditionHelper(formFieldConfig.condition, { record: value, data, step })) { this.formFieldsMounted[formFieldIndex] = false + this.formFields && (this.formFields[formFieldIndex] = null) return null } let hidden: boolean = true diff --git a/src/components/formFields/object/index.tsx b/src/components/formFields/object/index.tsx index e3ddba50f98f7760fbaa1f0d92ecf34e59b62c38..283a4751b06b665ba786f8e3d6b06dfc3f2520af 100644 --- a/src/components/formFields/object/index.tsx +++ b/src/components/formFields/object/index.tsx @@ -130,7 +130,7 @@ export default class ObjectField extends Field 0) { - errors.push(new FieldError(`子项中存在${childrenError}个错误。`)) + errors.push(new FieldError('子项中存在错误。')) } return errors.length ? errors : true diff --git a/src/components/formFields/tabs/index.tsx b/src/components/formFields/tabs/index.tsx index 6525e9bcc299772361383cdbfb4edb407c3bdd76..169b9598f4ccf0bf4fd36c83ed9f13889e62d50a 100644 --- a/src/components/formFields/tabs/index.tsx +++ b/src/components/formFields/tabs/index.tsx @@ -113,6 +113,7 @@ export default class TabsField extends Field = [] const formDataList = cloneDeep(this.state.formDataList) @@ -133,6 +134,10 @@ export default class TabsField extends Field extends Field 0) { - errors.push(new FieldError(`子项中存在${childrenError}个错误。`)) + const errTips = `${this.props.config.label || ''}子项中存在错误。\n ${childrenErrorMsg.map(err => `${err.name}:${err.msg}`).join('; ')}` + errors.push(new FieldError(errTips)) } return errors.length ? errors : true @@ -380,6 +386,7 @@ export default class TabsField extends Field { children: fields.map((formFieldConfig, formFieldIndex) => { if (!ConditionHelper(formFieldConfig.condition, { record: formValue, data, step })) { this.formFieldsMounted[formFieldIndex] = false + this.formFields && (this.formFields[formFieldIndex] = null) return null } let hidden: boolean = true