From 1aa75e65d9e5ba6f59d2149387b5924d179e0cc8 Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Mon, 22 Jun 2020 18:36:18 +0800 Subject: [PATCH] =?UTF-8?q?BI-67148=20fix:=20=E4=BC=A0=E9=80=92valueFormat?= =?UTF-8?q?er=E5=90=8E=E5=AE=8C=E5=85=A8=E5=8C=B9=E9=85=8D=E9=A1=B9?= =?UTF-8?q?=E5=8F=AF=E8=83=BD=E5=87=BA=E7=8E=B0=E6=96=B0=E5=A2=9E=E6=8F=90?= =?UTF-8?q?=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog.md | 1 + .../multiselect/search/multiselect.search.insert.pane.js | 3 ++- src/widget/multiselect/search/multiselect.search.pane.js | 4 ++-- .../singleselect/search/singleselect.search.pane.insert.js | 3 ++- src/widget/singleselect/search/singleselect.search.pane.js | 4 ++-- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index c17a004e8..bef9a247c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-06) +- 修复了新增值的下拉控件传递valueFormatter搜索完全匹配项提示新增 - 修复了选色控件历史记录没有选中的问题的问题 - 修复了单选下拉框新增值的时候没有发事件的问题 - 修复了单选标红combo类setValue为空字符串会标红的问题 diff --git a/src/widget/multiselect/search/multiselect.search.insert.pane.js b/src/widget/multiselect/search/multiselect.search.insert.pane.js index e4ca3774a..bab589731 100644 --- a/src/widget/multiselect/search/multiselect.search.insert.pane.js +++ b/src/widget/multiselect/search/multiselect.search.insert.pane.js @@ -76,8 +76,9 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, { }, setKeyword: function (keyword) { + var o = this.options; var hasSameValue = BI.some(this.loader.getAllButtons(), function (idx, btn) { - return keyword === btn.getValue(); + return keyword === (o.valueFormatter(btn.getValue()) || btn.getValue()); }); var isMatchTipVisible = this.loader.getAllButtons().length > 0 && hasSameValue; this.tooltipClick.setVisible(isMatchTipVisible); diff --git a/src/widget/multiselect/search/multiselect.search.pane.js b/src/widget/multiselect/search/multiselect.search.pane.js index 67351b55d..6a8dced7b 100644 --- a/src/widget/multiselect/search/multiselect.search.pane.js +++ b/src/widget/multiselect/search/multiselect.search.pane.js @@ -64,8 +64,8 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, { }, setKeyword: function (keyword) { - var btn; - var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue()); + var btn, o = this.options; + var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === (o.valueFormatter(btn.getValue()) || btn.getValue())); if (isVisible !== this.tooltipClick.isVisible()) { this.tooltipClick.setVisible(isVisible); this.resizer.attr("items")[0].height = (isVisible ? this.constants.height : 0); diff --git a/src/widget/singleselect/search/singleselect.search.pane.insert.js b/src/widget/singleselect/search/singleselect.search.pane.insert.js index 3f95c349a..df6036a42 100644 --- a/src/widget/singleselect/search/singleselect.search.pane.insert.js +++ b/src/widget/singleselect/search/singleselect.search.pane.insert.js @@ -78,8 +78,9 @@ BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, { }, setKeyword: function (keyword) { + var o = this.options; var hasSameValue = BI.some(this.loader.getAllButtons(), function (idx, btn) { - return keyword === btn.getValue(); + return keyword === (o.valueFormatter(btn.getValue()) || btn.getValue()); }); var isMatchTipVisible = this.loader.getAllButtons().length > 0 && hasSameValue; this.tooltipClick.setVisible(isMatchTipVisible); diff --git a/src/widget/singleselect/search/singleselect.search.pane.js b/src/widget/singleselect/search/singleselect.search.pane.js index 3c98ab03e..e5364e261 100644 --- a/src/widget/singleselect/search/singleselect.search.pane.js +++ b/src/widget/singleselect/search/singleselect.search.pane.js @@ -66,8 +66,8 @@ BI.SingleSelectSearchPane = BI.inherit(BI.Widget, { }, setKeyword: function (keyword) { - var btn; - var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue()); + var btn, o = this.options; + var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === (o.valueFormatter(btn.getValue()) || btn.getValue())); if (isVisible !== this.tooltipClick.isVisible()) { this.tooltipClick.setVisible(isVisible); this.resizer.attr("items")[0].height = (isVisible ? this.constants.height : 0);