Merge pull request #10618 from hzh11012/master

fix: 配置面板-未配置自定义schema的校验规则丢失默认schema
This commit is contained in:
张涛 2024-07-11 09:35:40 +08:00 committed by GitHub
commit 94ef0a00b2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -147,14 +147,17 @@ export default class ValidationItem extends React.Component<
}
if (rendererSchema) {
let rendererSchemaArr = Array.isArray(rendererSchema)
const rendererSchemaArr = Array.isArray(rendererSchema)
? rendererSchema
: [rendererSchema];
rendererSchemaArr.forEach(item => {
if (item.validateName === this.validator.name) {
control = control.concat(item as SchemaCollection);
}
});
let filteredControl = rendererSchemaArr.filter(
item => item.validateName === this.validator.name
);
if (!filteredControl.length && this.validator.schema) {
filteredControl = filteredControl.concat(this.validator.schema);
}
control = filteredControl;
} else if (this.validator.schema) {
control = control.concat(this.validator.schema as SchemaCollection);
}