修复combo未设置唯一值,修改单个item时无法验证的问题

This commit is contained in:
catchonme 2019-05-14 11:16:53 +08:00
parent 40710a6d2f
commit 8810e4dfe5
1 changed files with 3 additions and 2 deletions

View File

@ -303,12 +303,13 @@ export default class FormControl extends React.Component<FormControlProps, any>
} = this.props;
if (this.model) {
this.model.validate(this.hook);
if (form.parentStore && form.parentStore.storeType === 'ComboStore') {
const combo = form.parentStore as IComboStore;
const group = combo.uniques.get(this.model.name) as IUniqueGroup;
group && group.items.forEach(item => item.validate());
group && group.items.forEach(item => item !== this.model && item.validate());
} else {
this.model.validate(this.hook);
form.getItemsByName(this.model.name)
.forEach(item => item !== this.model && item.validate())
}