Browse Source

BI-92460 fix:修正全选逻辑

es6
Jimmy.Chai 3 years ago
parent
commit
eb6ef9503b
  1. 10
      src/widget/multiselect/multiselect.combo.js
  2. 12
      src/widget/multiselect/multiselect.combo.nobar.js
  3. 10
      src/widget/multiselect/multiselect.insert.combo.js
  4. 10
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  5. 10
      src/widget/multiselectlist/multiselectlist.insert.js
  6. 10
      src/widget/multiselectlist/multiselectlist.insert.nobar.js
  7. 10
      src/widget/multiselectlist/multiselectlist.js

10
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]);

12
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]);

10
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]);

10
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]);

10
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];

10
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];

10
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];

Loading…
Cancel
Save