Browse Source

BI-90461 fix:优化全选逻辑

es6
Jimmy.Chai 3 years ago
parent
commit
82da0fbda8
  1. 26
      src/widget/multiselect/multiselect.insert.combo.js

26
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 = [];

Loading…
Cancel
Save