From a3d64171508d15e2730a1bf1a152676a3d9f12ef Mon Sep 17 00:00:00 2001 From: catchonme Date: Tue, 14 May 2019 10:09:36 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcombo=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=A4=B1=E8=B4=A5=E5=90=8E=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=EF=BC=8C=E5=8F=AA=E9=AA=8C=E8=AF=81=E5=BD=93=E5=89=8Ditem?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Form/Control.tsx | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/src/renderers/Form/Control.tsx b/src/renderers/Form/Control.tsx index ffcaea7d..febd9289 100644 --- a/src/renderers/Form/Control.tsx +++ b/src/renderers/Form/Control.tsx @@ -9,7 +9,8 @@ import { } from '../../factory'; import { ComboStore, - IComboStore + IComboStore, + IUniqueGroup } from '../../store/combo'; import { anyChanged, @@ -302,11 +303,15 @@ export default class FormControl extends React.Component } = this.props; if (this.model) { - this.model.validate(this.hook); - - // 可能出现同名的表单项 - form.getItemsByName(this.model.name) - .forEach(item => item !== this.model && item.validate()) + if (form.parentStore && form.parentStore.storeType === 'ComboStore') { + const combo = form.parentStore as IComboStore; + const group = combo.uniques.get(this.model.name) as IUniqueGroup; + group.items.forEach(item => item.validate()); + } else { + this.model.validate(this.hook); + form.getItemsByName(this.model.name) + .forEach(item => item !== this.model && item.validate()) + } } }