From 6c30ffe46a0d6f8116dc0f01059cac78cecb738f Mon Sep 17 00:00:00 2001 From: catchonme Date: Tue, 14 May 2019 11:16:53 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dcombo=E6=9C=AA=E8=AE=BE?= =?UTF-8?q?=E7=BD=AE=E5=94=AF=E4=B8=80=E5=80=BC=EF=BC=8C=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=8D=95=E4=B8=AAitem=E6=97=B6=E6=97=A0=E6=B3=95=E9=AA=8C?= =?UTF-8?q?=E8=AF=81=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 | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/renderers/Form/Control.tsx b/src/renderers/Form/Control.tsx index 36a30d69b..47feacde5 100644 --- a/src/renderers/Form/Control.tsx +++ b/src/renderers/Form/Control.tsx @@ -303,12 +303,13 @@ export default class FormControl extends React.Component } = 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()) } From 92f8a372949a20200d21b69894e6da2ae05f3b03 Mon Sep 17 00:00:00 2001 From: catchonme Date: Tue, 14 May 2019 11:51:08 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Form/Control.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/renderers/Form/Control.tsx b/src/renderers/Form/Control.tsx index 47feacde5..966210ac1 100644 --- a/src/renderers/Form/Control.tsx +++ b/src/renderers/Form/Control.tsx @@ -303,13 +303,12 @@ export default class FormControl extends React.Component } = this.props; if (this.model) { - this.model.validate(this.hook); - - 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 !== this.model && item.validate()); + group && group.items.forEach(item => item.validate()); } else { + this.model.validate(this.hook); form.getItemsByName(this.model.name) .forEach(item => item !== this.model && item.validate()) } From 86baa93d6a7bfe98075e5a81e78ed9c8e4aa20d8 Mon Sep 17 00:00:00 2001 From: catchonme Date: Tue, 14 May 2019 12:08:20 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderers/Form/Control.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/renderers/Form/Control.tsx b/src/renderers/Form/Control.tsx index 966210ac1..f6177c1be 100644 --- a/src/renderers/Form/Control.tsx +++ b/src/renderers/Form/Control.tsx @@ -306,7 +306,7 @@ export default class FormControl extends React.Component 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)