mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-29 18:48:45 +08:00
Merge pull request #10618 from hzh11012/master
fix: 配置面板-未配置自定义schema的校验规则丢失默认schema
This commit is contained in:
commit
94ef0a00b2
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user