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);