Browse Source

KERNEL-12908 fix: 复选列表的value引用问题

es6
zsmj 2 years ago
parent
commit
0547cb0797
  1. 2
      src/widget/multiselect/multiselect.combo.js
  2. 2
      src/widget/multiselect/multiselect.combo.nobar.js
  3. 2
      src/widget/multiselect/multiselect.insert.combo.js
  4. 2
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  5. 2
      src/widget/multiselectlist/multiselectlist.insert.js
  6. 4
      src/widget/multiselectlist/multiselectlist.insert.nobar.js
  7. 2
      src/widget/multiselectlist/multiselectlist.js

2
src/widget/multiselect/multiselect.combo.js

@ -35,7 +35,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue); self.trigger.getSearcher().setState(self.storeValue);
self.numberCounter.setButtonChecked(self.storeValue); self.numberCounter.setButtonChecked(self.storeValue);
}; };
this.storeValue = o.value || {}; this.storeValue = BI.deepClone(o.value) || {};
this._assertValue(this.storeValue); this._assertValue(this.storeValue);

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

@ -34,7 +34,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
}; };
this.storeValue = { this.storeValue = {
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: o.value || [] value: BI.deepClone(o.value) || []
}; };
// 标记正在请求数据 // 标记正在请求数据
this.requesting = false; this.requesting = false;

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

@ -33,7 +33,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
self.trigger.getSearcher().setState(self.storeValue); self.trigger.getSearcher().setState(self.storeValue);
self.numberCounter.setButtonChecked(self.storeValue); self.numberCounter.setButtonChecked(self.storeValue);
}; };
this.storeValue = o.value || {}; this.storeValue = BI.deepClone(o.value) || {};
// 标记正在请求数据 // 标记正在请求数据
this.requesting = false; this.requesting = false;

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

@ -34,7 +34,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
}; };
this.storeValue = { this.storeValue = {
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: o.value || [] value: BI.deepClone(o.value) || []
}; };
// 标记正在请求数据 // 标记正在请求数据
this.requesting = false; this.requesting = false;

2
src/widget/multiselectlist/multiselectlist.insert.js

@ -15,7 +15,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
BI.MultiSelectInsertList.superclass._init.apply(this, arguments); BI.MultiSelectInsertList.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = this._assertValue(o.value || {}); this.storeValue = this._assertValue(BI.deepClone(o.value) || {});
var assertShowValue = function () { var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue)); BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));

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

@ -16,7 +16,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = { this.storeValue = {
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: o.value || [] value: BI.deepClone(o.value) || []
}; };
var assertShowValue = function () { var assertShowValue = function () {
@ -363,4 +363,4 @@ BI.extend(BI.MultiSelectInsertNoBarList, {
}); });
BI.MultiSelectInsertNoBarList.EVENT_CHANGE = "EVENT_CHANGE"; BI.MultiSelectInsertNoBarList.EVENT_CHANGE = "EVENT_CHANGE";
BI.shortcut("bi.multi_select_insert_no_bar_list", BI.MultiSelectInsertNoBarList); BI.shortcut("bi.multi_select_insert_no_bar_list", BI.MultiSelectInsertNoBarList);

2
src/widget/multiselectlist/multiselectlist.js

@ -15,7 +15,7 @@ BI.MultiSelectList = BI.inherit(BI.Widget, {
BI.MultiSelectList.superclass._init.apply(this, arguments); BI.MultiSelectList.superclass._init.apply(this, arguments);
var self = this, o = this.options; var self = this, o = this.options;
this.storeValue = this._assertValue(o.value || {}); this.storeValue = this._assertValue(BI.deepClone(o.value) || {});
var assertShowValue = function () { var assertShowValue = function () {
BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue)); BI.isKey(self._startValue) && (self.storeValue.type === BI.Selection.All ? BI.remove(self.storeValue.value, self._startValue) : BI.pushDistinct(self.storeValue.value, self._startValue));

Loading…
Cancel
Save