Browse Source

Pull request #2031: BI-90461 fix:优化全选逻辑

Merge in VISUAL/fineui from ~JIMMY.CHAI/fineui:master to master

* commit 'c7f463589927ea6b98c5af552f003ccde64dbcb5':
  BI-90461 fix:优化全选逻辑
  BI-90461 fix:优化全选逻辑
es6
Jimmy.Chai 3 years ago
parent
commit
784ccdb2aa
  1. 25
      src/widget/multiselect/multiselect.combo.js
  2. 22
      src/widget/multiselect/multiselect.combo.nobar.js
  3. 22
      src/widget/multiselect/multiselect.insert.combo.js
  4. 22
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  5. 20
      src/widget/multiselectlist/multiselectlist.insert.js
  6. 20
      src/widget/multiselectlist/multiselectlist.insert.nobar.js
  7. 22
      src/widget/multiselectlist/multiselectlist.js

25
src/widget/multiselect/multiselect.combo.js

@ -336,26 +336,27 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
var self = this; var o = this.options;
this._assertValue(res);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()],
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
var map = this._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), 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;
change && (this.storeValue.value = BI.values(map));
this._adjust(callback);
return;
}
o.itemsCreator({
type: BI.MultiSelectCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

22
src/widget/multiselect/multiselect.combo.nobar.js

@ -363,25 +363,27 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
var self = this, o = this.options;
this._assertValue(res);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectNoBarCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
var map = self._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), 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);
change && (this.storeValue.value = BI.values(map));
this._adjust(callback);
return;
}
o.itemsCreator({
type: BI.MultiSelectNoBarCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

22
src/widget/multiselect/multiselect.insert.combo.js

@ -350,25 +350,27 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
var self = this, o = this.options;
this._assertValue(res);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
var map = this._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), 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);
change && (this.storeValue.value = BI.values(map));
this._adjust(callback);
return;
}
o.itemsCreator({
type: BI.MultiSelectInsertCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

22
src/widget/multiselect/multiselect.insert.combo.nobar.js

@ -348,25 +348,27 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
var self = this, o = this.options;
this._assertValue(res);
this.requesting = true;
o.itemsCreator({
type: BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
var map = this._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), 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);
change && (this.storeValue.value = BI.values(map));
this._adjust(callback);
return;
}
o.itemsCreator({
type: BI.MultiSelectInsertNoBarCombo.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

20
src/widget/multiselectlist/multiselectlist.insert.js

@ -239,24 +239,26 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: [self.trigger.getKeyword()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
var map = this._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
change && (this.storeValue.value = BI.values(map));
callback();
return;
}
o.itemsCreator({
type: BI.MultiSelectInsertList.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKeyword()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

20
src/widget/multiselectlist/multiselectlist.insert.nobar.js

@ -243,24 +243,26 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: [self.trigger.getKeyword()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
var map = this._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
change && (this.storeValue.value = BI.values(map));
callback();
return;
}
o.itemsCreator({
type: BI.MultiSelectInsertNoBarList.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKeyword()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

22
src/widget/multiselectlist/multiselectlist.js

@ -229,24 +229,26 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
_joinAll: function (res, callback) {
var self = this, o = this.options;
this._assertValue(res);
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()]
}, function (ob) {
var items = BI.map(ob.items, "value");
if (self.storeValue.type === res.type) {
if (this.storeValue.type === res.type) {
var result = BI.Func.getSearchResult(this.storeValue.value, this.trigger.getKey());
var change = false;
var map = self._makeMap(self.storeValue.value);
BI.each(items, function (i, v) {
var map = this._makeMap(this.storeValue.value);
BI.each(BI.concat(result.match, result.find), function (i, v) {
if (BI.isNotNull(map[v])) {
change = true;
delete map[v];
}
});
change && (self.storeValue.value = BI.values(map));
self._adjust(callback);
change && (this.storeValue.value = BI.values(map));
this._adjust(callback);
return;
}
o.itemsCreator({
type: BI.MultiSelectList.REQ_GET_ALL_DATA,
keywords: [this.trigger.getKey()],
selectedValues: this.storeValue.value,
}, function (ob) {
var items = BI.map(ob.items, "value");
var selectedMap = self._makeMap(self.storeValue.value);
var notSelectedMap = self._makeMap(res.value);
var newItems = [];

Loading…
Cancel
Save