From eb6ef9503bfe787a78f66e9fd56fe063e835f991 Mon Sep 17 00:00:00 2001 From: "Jimmy.Chai" Date: Mon, 23 Aug 2021 21:14:07 +0800 Subject: [PATCH] =?UTF-8?q?BI-92460=20fix=EF=BC=9A=E4=BF=AE=E6=AD=A3?= =?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 --- src/widget/multiselect/multiselect.combo.js | 10 ++++++++-- src/widget/multiselect/multiselect.combo.nobar.js | 12 +++++++++--- src/widget/multiselect/multiselect.insert.combo.js | 10 ++++++++-- .../multiselect/multiselect.insert.combo.nobar.js | 10 ++++++++-- src/widget/multiselectlist/multiselectlist.insert.js | 10 ++++++++-- .../multiselectlist/multiselectlist.insert.nobar.js | 10 ++++++++-- src/widget/multiselectlist/multiselectlist.js | 10 ++++++++-- 7 files changed, 57 insertions(+), 15 deletions(-) diff --git a/src/widget/multiselect/multiselect.combo.js b/src/widget/multiselect/multiselect.combo.js index 2d023f2f2..a458f0c09 100644 --- a/src/widget/multiselect/multiselect.combo.js +++ b/src/widget/multiselect/multiselect.combo.js @@ -338,10 +338,16 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, { this._assertValue(res); this.requesting = true; if (this.storeValue.type === res.type) { - var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey()); + var result = BI.Func.getSearchResult(BI.map(this.storeValue.value, function (_i, v) { + return { + text: o.valueFormatter(v) || v, + value: v + }; + }), this.trigger.getKey()); var change = false; var map = this._makeMap(this.storeValue.value); - BI.each(BI.concat(result.match, result.find), function (i, v) { + BI.each(BI.concat(result.match, result.find), function (i, obj) { + var v = obj.value; if (BI.isNotNull(map[v])) { change = true; self.storeValue.assist && self.storeValue.assist.push(map[v]); diff --git a/src/widget/multiselect/multiselect.combo.nobar.js b/src/widget/multiselect/multiselect.combo.nobar.js index eab1f4b2f..fd7844f23 100644 --- a/src/widget/multiselect/multiselect.combo.nobar.js +++ b/src/widget/multiselect/multiselect.combo.nobar.js @@ -364,10 +364,16 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, { this._assertValue(res); this.requesting = true; if (this.storeValue.type === res.type) { - var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey()); + var result = BI.Func.getSearchResult(BI.map(this.storeValue.value, function (_i, v) { + return { + text: o.valueFormatter(v) || v, + value: v + }; + }), this.trigger.getKey()); var change = false; - var map = self._makeMap(this.storeValue.value); - BI.each(BI.concat(result.match, result.find), function (i, v) { + var map = this._makeMap(this.storeValue.value); + BI.each(BI.concat(result.match, result.find), function (i, obj) { + var v = obj.value; if (BI.isNotNull(map[v])) { change = true; self.storeValue.assist && self.storeValue.assist.push(map[v]); diff --git a/src/widget/multiselect/multiselect.insert.combo.js b/src/widget/multiselect/multiselect.insert.combo.js index 6728ca81d..88fd16411 100644 --- a/src/widget/multiselect/multiselect.insert.combo.js +++ b/src/widget/multiselect/multiselect.insert.combo.js @@ -352,10 +352,16 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, { this._assertValue(res); this.requesting = true; if (this.storeValue.type === res.type) { - var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey()); + var result = BI.Func.getSearchResult(BI.map(this.storeValue.value, function (_i, v) { + return { + text: o.valueFormatter(v) || v, + value: v + }; + }), this.trigger.getKey()); var change = false; var map = this._makeMap(this.storeValue.value); - BI.each(BI.concat(result.match, result.find), function (i, v) { + BI.each(BI.concat(result.match, result.find), function (i, obj) { + var v = obj.value; if (BI.isNotNull(map[v])) { change = true; self.storeValue.assist && self.storeValue.assist.push(map[v]); diff --git a/src/widget/multiselect/multiselect.insert.combo.nobar.js b/src/widget/multiselect/multiselect.insert.combo.nobar.js index a4a67579d..2552449f8 100644 --- a/src/widget/multiselect/multiselect.insert.combo.nobar.js +++ b/src/widget/multiselect/multiselect.insert.combo.nobar.js @@ -349,10 +349,16 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, { this._assertValue(res); this.requesting = true; if (this.storeValue.type === res.type) { - var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey()); + var result = BI.Func.getSearchResult(BI.map(this.storeValue.value, function (_i, v) { + return { + text: o.valueFormatter(v) || v, + value: v + }; + }), this.trigger.getKey()); var change = false; var map = this._makeMap(this.storeValue.value); - BI.each(BI.concat(result.match, result.find), function (i, v) { + BI.each(BI.concat(result.match, result.find), function (i, obj) { + var v = obj.value; if (BI.isNotNull(map[v])) { change = true; self.storeValue.assist && self.storeValue.assist.push(map[v]); diff --git a/src/widget/multiselectlist/multiselectlist.insert.js b/src/widget/multiselectlist/multiselectlist.insert.js index a7b5bf274..db3edb080 100644 --- a/src/widget/multiselectlist/multiselectlist.insert.js +++ b/src/widget/multiselectlist/multiselectlist.insert.js @@ -240,10 +240,16 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, { var self = this, o = this.options; this._assertValue(res); if (this.storeValue.type === res.type) { - var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey()); + var result = BI.Func.getSearchResult(BI.map(this.storeValue.value, function (_i, v) { + return { + text: o.valueFormatter(v) || v, + value: v + }; + }), this.trigger.getKey()); var change = false; var map = this._makeMap(this.storeValue.value); - BI.each(BI.concat(result.match, result.find), function (i, v) { + BI.each(BI.concat(result.match, result.find), function (i, obj) { + var v = obj.value; if (BI.isNotNull(map[v])) { change = true; delete map[v]; diff --git a/src/widget/multiselectlist/multiselectlist.insert.nobar.js b/src/widget/multiselectlist/multiselectlist.insert.nobar.js index 80f55f1d0..30be9c653 100644 --- a/src/widget/multiselectlist/multiselectlist.insert.nobar.js +++ b/src/widget/multiselectlist/multiselectlist.insert.nobar.js @@ -244,10 +244,16 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, { var self = this, o = this.options; this._assertValue(res); if (this.storeValue.type === res.type) { - var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey()); + var result = BI.Func.getSearchResult(BI.map(this.storeValue.value, function (_i, v) { + return { + text: o.valueFormatter(v) || v, + value: v + }; + }), this.trigger.getKey()); var change = false; var map = this._makeMap(this.storeValue.value); - BI.each(BI.concat(result.match, result.find), function (i, v) { + BI.each(BI.concat(result.match, result.find), function (i, obj) { + var v = obj.value; if (BI.isNotNull(map[v])) { change = true; delete map[v]; diff --git a/src/widget/multiselectlist/multiselectlist.js b/src/widget/multiselectlist/multiselectlist.js index 3eafb0269..50f370653 100644 --- a/src/widget/multiselectlist/multiselectlist.js +++ b/src/widget/multiselectlist/multiselectlist.js @@ -230,10 +230,16 @@ BI.MultiSelectList = BI.inherit(BI.Widget, { var self = this, o = this.options; this._assertValue(res); if (this.storeValue.type === res.type) { - var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey()); + var result = BI.Func.getSearchResult(BI.map(this.storeValue.value, function (_i, v) { + return { + text: o.valueFormatter(v) || v, + value: v + }; + }), this.trigger.getKey()); var change = false; var map = this._makeMap(this.storeValue.value); - BI.each(BI.concat(result.match, result.find), function (i, v) { + BI.each(BI.concat(result.match, result.find), function (i, obj) { + var v = obj.value; if (BI.isNotNull(map[v])) { change = true; delete map[v];