Merge pull request #32 from catchonme/master

修复combo未设置唯一值,修改单个item时无法验证的问题
This commit is contained in:
liaoxuezhi 2019-05-14 12:09:10 +08:00 committed by GitHub
commit d1d45cb475
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

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