From b3ffe3ffd471b2ec2d0c1fc11d3ab7b128f2bba8 Mon Sep 17 00:00:00 2001 From: Tangjinxia <1119518763@qq.com> Date: Fri, 5 Mar 2021 17:30:53 +0800 Subject: [PATCH] =?UTF-8?q?BI-81437=20fix:=E5=85=A8=E9=80=89=E5=90=8E?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=A1=A8=E7=8E=B0=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../trigger/searcher.multiselect.insert.js | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/widget/multiselect/trigger/searcher.multiselect.insert.js b/src/widget/multiselect/trigger/searcher.multiselect.insert.js index 0300fc8ee..4ad265126 100644 --- a/src/widget/multiselect/trigger/searcher.multiselect.insert.js +++ b/src/widget/multiselect/trigger/searcher.multiselect.insert.js @@ -55,6 +55,9 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, { popup: BI.extend({ type: "bi.multi_select_search_insert_pane", + ref: function (_ref) { + self.searchPane = _ref; + }, valueFormatter: o.valueFormatter, keywordGetter: function () { return self.editor.getValue(); @@ -70,7 +73,19 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, { listeners: [{ eventName: BI.MultiSelectSearchInsertPane.EVENT_ADD_ITEM, action: function () { - self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM); + var keyword = self.searcher.getKeyword(); + self.storeValue = self.getValue(); + if (!self.searcher.hasMatched()) { + if (self.storeValue.type === BI.Selection.Multi) { + BI.pushDistinct(self.storeValue.value, keyword); + } + self.searchPane.setVisible(false); + self.setValue(self.storeValue); + self.populate(); + if (self.storeValue.type === BI.Selection.Multi) { + self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_ADD_ITEM); + } + } } }] }, o.popup), @@ -79,6 +94,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, { masker: o.masker }); this.searcher.on(BI.Searcher.EVENT_START, function () { + self.searchPane.setVisible(true); self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_START); }); this.searcher.on(BI.Searcher.EVENT_PAUSE, function () {