From 29268d2b6459f5e8324c9a7140cacfa1ba9025ba Mon Sep 17 00:00:00 2001 From: windy <1374721899@qq.com> Date: Sun, 26 Apr 2020 16:36:00 +0800 Subject: [PATCH] =?UTF-8?q?BI-64399=20fix:=20=E4=BF=AE=E5=A4=8D=E5=A4=8D?= =?UTF-8?q?=E9=80=89=E4=B8=8B=E6=8B=89=E5=8B=BE=E9=80=89=E5=80=BC=E5=92=8C?= =?UTF-8?q?=E6=90=9C=E7=B4=A2=E7=BB=93=E6=9E=9C=E4=B8=AD=E5=90=AB=E6=9C=89?= =?UTF-8?q?=E7=88=B6=E5=AD=90=E4=B8=B2=E5=85=B3=E7=B3=BB=E6=97=B6=E6=8F=90?= =?UTF-8?q?=E7=A4=BA=E4=B8=8D=E6=AD=A3=E7=A1=AE=E7=9A=84=E9=97=AE=E9=A2=98?= 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 | 6 ++++-- .../singleselect/search/singleselect.search.pane.insert.js | 6 ++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/changelog.md b/changelog.md index 5da0b0a52..eff83fc03 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,6 @@ # 更新日志 2.0(2020-04) +- 修复了复选下拉勾选值和搜索结果中含有父子串关系时提示不正确的问题 - searcher提供可配是否支持搜索空格的allSearchBlank - 修复了复选下拉全选状态下使用空格添加值trigger显示更新不对的问题 - 复选下拉树展开节点提供分页加载和滚动加载两种方式 diff --git a/src/widget/multiselect/search/multiselect.search.insert.pane.js b/src/widget/multiselect/search/multiselect.search.insert.pane.js index ff98742f0..e4ca3774a 100644 --- a/src/widget/multiselect/search/multiselect.search.insert.pane.js +++ b/src/widget/multiselect/search/multiselect.search.insert.pane.js @@ -76,8 +76,10 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, { }, setKeyword: function (keyword) { - var btn; - var isMatchTipVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue()); + var hasSameValue = BI.some(this.loader.getAllButtons(), function (idx, btn) { + return keyword === btn.getValue(); + }); + var isMatchTipVisible = this.loader.getAllButtons().length > 0 && hasSameValue; this.tooltipClick.setVisible(isMatchTipVisible); this.addNotMatchTip.setVisible(!isMatchTipVisible); !isMatchTipVisible && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword)); diff --git a/src/widget/singleselect/search/singleselect.search.pane.insert.js b/src/widget/singleselect/search/singleselect.search.pane.insert.js index 69d037dc3..3f95c349a 100644 --- a/src/widget/singleselect/search/singleselect.search.pane.insert.js +++ b/src/widget/singleselect/search/singleselect.search.pane.insert.js @@ -78,8 +78,10 @@ BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, { }, setKeyword: function (keyword) { - var btn; - var isMatchTipVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue()); + var hasSameValue = BI.some(this.loader.getAllButtons(), function (idx, btn) { + return keyword === btn.getValue(); + }); + var isMatchTipVisible = this.loader.getAllButtons().length > 0 && hasSameValue; this.tooltipClick.setVisible(isMatchTipVisible); this.addNotMatchTip.setVisible(!isMatchTipVisible); !isMatchTipVisible && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));