From 82da0fbda8767ffc4abd7a04b6c81378d95e7903 Mon Sep 17 00:00:00 2001 From: "Jimmy.Chai" Date: Tue, 20 Jul 2021 15:34:12 +0800 Subject: [PATCH] =?UTF-8?q?BI-90461=20fix=EF=BC=9A=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E5=85=A8=E9=80=89=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../multiselect/multiselect.insert.combo.js | 26 ++++++++----------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index 9c3b97909..479f9891c 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/src/widget/multiselect/multiselect.insert.combo.js @@ -350,25 +350,21 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { var self = this, o = this.options; this._assertValue(res); this.requesting = true; + if (this.storeValue.type === res.type) { + var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey()); + var resultArray = BI.concat(result.match, result.find); + this.storeValue.value = BI.filter(this.storeValue.value, function (i, value) { + return !BI.contains(resultArray, value); + }) || []; + this._adjust(callback); + return; + } o.itemsCreator({ type: BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA, - keywords: [this.trigger.getKey()] + keywords: [this.trigger.getKey()], + selectedValues: this.storeValue.value, }, function (ob) { var items = BI.map(ob.items, "value"); - if (self.storeValue.type === res.type) { - var change = false; - var map = self._makeMap(self.storeValue.value); - BI.each(items, function (i, v) { - if (BI.isNotNull(map[v])) { - change = true; - self.storeValue.assist && self.storeValue.assist.push(map[v]); - delete map[v]; - } - }); - change && (self.storeValue.value = BI.values(map)); - self._adjust(callback); - return; - } var selectedMap = self._makeMap(self.storeValue.value); var notSelectedMap = self._makeMap(res.value); var newItems = [];