From e4e26c3537f5752b5c54136c7c5d2083bb5c4772 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 8 Jun 2020 15:57:11 +0800 Subject: [PATCH 1/2] =?UTF-8?q?BI-66444=20fix:=20setValue=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E5=92=8C=E7=A9=BA=E6=95=B0=E7=BB=84=E8=A1=8C=E4=B8=BA?= =?UTF-8?q?=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/combo/icontextvaluecombo/combo.icontextvalue.js | 5 ++++- src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js | 5 ++++- src/case/combo/textvaluecombo/combo.textvalue.js | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js index b69ad7307..ba3fead5b 100644 --- a/src/case/combo/icontextvaluecombo/combo.icontextvalue.js +++ b/src/case/combo/icontextvaluecombo/combo.icontextvalue.js @@ -67,7 +67,10 @@ BI.IconTextValueCombo = BI.inherit(BI.Widget, { }, _checkError: function (v) { - if(BI.isNotNull(v)) { + if(BI.isNull(v) || BI.isEmptyArray(v)) { + this.trigger.options.tipType = "success"; + this.element.removeClass("combo-error"); + } else { v = BI.isArray(v) ? v : [v]; var result = BI.find(this.options.items, function (idx, item) { return BI.contains(v, item.value); diff --git a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js index 5ce41c6af..ba6376b03 100644 --- a/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js +++ b/src/case/combo/searchtextvaluecombo/combo.searchtextvalue.js @@ -124,7 +124,10 @@ BI.SearchTextValueCombo = BI.inherit(BI.Widget, { }, _checkError: function (v) { - if(BI.isNotNull(v)) { + if(BI.isNull(v) || BI.isEmptyArray(v)) { + this.trigger.options.tipType = "success"; + this.element.removeClass("combo-error"); + } else { v = BI.isArray(v) ? v : [v]; var result = BI.find(this.options.items, function (idx, item) { return BI.contains(v, item.value); diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index 4dc9b330a..982b263ea 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -62,7 +62,10 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { }, _checkError: function (v) { - if(BI.isNotNull(v)) { + if(BI.isNull(v) || BI.isEmptyArray(v)) { + this.trigger.options.tipType = "success"; + this.element.removeClass("combo-error"); + } else { v = BI.isArray(v) ? v : [v]; var result = BI.find(this.options.items, function (idx, item) { return BI.contains(v, item.value); From c858274279489788b320f44e2025e9ae74866bf1 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 8 Jun 2020 15:58:06 +0800 Subject: [PATCH 2/2] update --- changelog.md | 1 + 1 file changed, 1 insertion(+) diff --git a/changelog.md b/changelog.md index 570603d63..c44655889 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-06) +- 修复了单选标红combo类setValue为空和空数组行为不一致的问题 - 单选列表支持新增选项 - 增加组件shortcut未定义的错误提示