Browse Source

KERNEL-11286 feat: 下拉框value,text,defaultText属性规则统一

es6
zsmj 2 years ago
parent
commit
10acbec4dc
  1. 2
      src/widget/multiselect/multiselect.combo.js
  2. 2
      src/widget/multiselect/multiselect.combo.nobar.js
  3. 2
      src/widget/multiselect/trigger/editor/editor.patch.js
  4. 2
      src/widget/multiselect/trigger/searcher.multiselect.js
  5. 1
      src/widget/multitree/multi.tree.combo.js
  6. 33
      src/widget/multitree/multi.tree.insert.combo.js
  7. 1
      src/widget/multitree/multi.tree.list.combo.js

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

@ -47,7 +47,7 @@ BI.MultiSelectCombo = BI.inherit(BI.Single, {
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
height: o.height - (o.simple ? 1 : 2), height: o.height - (o.simple ? 1 : 2),
text: o.text, text: o.text,
// adapter: this.popup, defaultText: o.defaultText,
masker: { masker: {
offset: { offset: {
left: 0, left: 0,

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

@ -43,7 +43,7 @@ BI.MultiSelectNoBarCombo = BI.inherit(BI.Single, {
type: "bi.multi_select_trigger", type: "bi.multi_select_trigger",
height: o.height - (o.simple ? 1 : 2), height: o.height - (o.simple ? 1 : 2),
text: o.text, text: o.text,
// adapter: this.popup, defaultText: o.defaultText,
masker: { masker: {
offset: { offset: {
left: 0, left: 0,

2
src/widget/multiselect/trigger/editor/editor.patch.js

@ -30,7 +30,7 @@ BI.SelectPatchEditor = BI.inherit(BI.Widget, {
watermark: o.watermark, watermark: o.watermark,
allowBlank: true, allowBlank: true,
value: o.value, value: o.value,
defaultText: o.text, defaultText: o.defaultText,
text: o.text, text: o.text,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,

2
src/widget/multiselect/trigger/searcher.multiselect.js

@ -15,7 +15,7 @@ BI.MultiSelectSearcher = BI.inherit(BI.Widget, {
valueFormatter: BI.emptyFn, valueFormatter: BI.emptyFn,
adapter: null, adapter: null,
masker: {}, masker: {},
text: BI.i18nText("BI-Basic_Please_Select"), defaultText: BI.i18nText("BI-Basic_Please_Select"),
itemHeight: 24 itemHeight: 24
}); });
}, },

1
src/widget/multitree/multi.tree.combo.js

@ -32,7 +32,6 @@ BI.MultiTreeCombo = BI.inherit(BI.Single, {
text: o.text, text: o.text,
defaultText: o.defaultText, defaultText: o.defaultText,
watermark: o.watermark, watermark: o.watermark,
// adapter: this.popup,
masker: { masker: {
offset: { offset: {
left: 0, left: 0,

33
src/widget/multitree/multi.tree.insert.combo.js

@ -23,14 +23,16 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
var isInit = false; var isInit = false;
var want2showCounter = false; var want2showCounter = false;
this.storeValue = {value: o.value || {}}; this.storeValue = { value: o.value || {} };
this.trigger = BI.createWidget({ this.trigger = BI.createWidget({
type: "bi.multi_select_trigger", type: "bi.multi_select_trigger",
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
height: o.height - (o.simple ? 1 : 2), height: o.height - (o.simple ? 1 : 2),
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
// adapter: this.popup, text: o.text,
defaultText: o.defaultText,
watermark: o.watermark,
masker: { masker: {
offset: { offset: {
left: 0, left: 0,
@ -41,8 +43,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
}, },
searcher: { searcher: {
type: "bi.multi_tree_searcher", type: "bi.multi_tree_searcher",
text: o.text,
watermark: o.watermark,
itemsCreator: o.itemsCreator, itemsCreator: o.itemsCreator,
popup: { popup: {
type: "bi.multi_tree_search_insert_pane", type: "bi.multi_tree_search_insert_pane",
@ -59,7 +60,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
}] }]
} }
}, },
value: {value: o.value || {}} value: { value: o.value || {} }
}); });
@ -121,7 +122,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
maxWidth: o.isNeedAdjustWidth ? "auto" : 500, maxWidth: o.isNeedAdjustWidth ? "auto" : 500,
}, },
isNeedAdjustWidth: o.isNeedAdjustWidth, isNeedAdjustWidth: o.isNeedAdjustWidth,
value: {value: o.value || {}}, value: { value: o.value || {} },
hideChecker: function (e) { hideChecker: function (e) {
return triggerBtn.element.find(e.target).length === 0 && return triggerBtn.element.find(e.target).length === 0 &&
self.numberCounter.element.find(e.target).length === 0; self.numberCounter.element.find(e.target).length === 0;
@ -147,12 +148,12 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_START, function () {
self.storeValue = {value: self.combo.getValue()}; self.storeValue = { value: self.combo.getValue() };
this.setValue(self.storeValue); this.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue);
}); });
this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () { this.trigger.on(BI.MultiSelectTrigger.EVENT_STOP, function () {
self.storeValue = {value: this.getValue()}; self.storeValue = { value: this.getValue() };
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue);
BI.nextTick(function () { BI.nextTick(function () {
@ -167,11 +168,11 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_SEARCHING); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_SEARCHING);
}); });
function showCounter () { function showCounter() {
if (isSearching()) { if (isSearching()) {
self.storeValue = {value: self.trigger.getValue()}; self.storeValue = { value: self.trigger.getValue() };
} else if (isPopupView()) { } else if (isPopupView()) {
self.storeValue = {value: self.combo.getValue()}; self.storeValue = { value: self.combo.getValue() };
} }
self.trigger.setValue(self.storeValue); self.trigger.setValue(self.storeValue);
self.numberCounter.setValue(self.storeValue); self.numberCounter.setValue(self.storeValue);
@ -185,7 +186,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
var checked = this.getSearcher().hasChecked(); var checked = this.getSearcher().hasChecked();
var val = { var val = {
type: BI.Selection.Multi, type: BI.Selection.Multi,
value: checked ? {1: 1} : {} value: checked ? { 1: 1 } : {}
}; };
this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None); this.getSearcher().setState(checked ? BI.Selection.Multi : BI.Selection.None);
self.numberCounter.setButtonChecked(val); self.numberCounter.setButtonChecked(val);
@ -197,7 +198,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
return; return;
} }
if (change === true) { if (change === true) {
self.storeValue = {value: self.combo.getValue()}; self.storeValue = { value: self.combo.getValue() };
change = false; change = false;
} }
self.combo.setValue(self.storeValue); self.combo.setValue(self.storeValue);
@ -212,9 +213,9 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
} else { } else {
if (isPopupView()) { if (isPopupView()) {
self._stopEditing(); self._stopEditing();
self.storeValue = {value: self.combo.getValue()}; self.storeValue = { value: self.combo.getValue() };
if (clear === true) { if (clear === true) {
self.storeValue = {value: {}}; self.storeValue = { value: {} };
} }
self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM); self.fireEvent(BI.MultiTreeInsertCombo.EVENT_CONFIRM);
} }
@ -322,7 +323,7 @@ BI.MultiTreeInsertCombo = BI.inherit(BI.Single, {
this.numberCounter.setButtonChecked(this.storeValue); this.numberCounter.setButtonChecked(this.storeValue);
}, },
_stopEditing: function() { _stopEditing: function () {
this.trigger.stopEditing(); this.trigger.stopEditing();
this.numberCounter.hideView(); this.numberCounter.hideView();
}, },

1
src/widget/multitree/multi.tree.list.combo.js

@ -35,7 +35,6 @@ BI.MultiTreeListCombo = BI.inherit(BI.Single, {
watermark: o.watermark, watermark: o.watermark,
height: o.height - (o.simple ? 1 : 2), height: o.height - (o.simple ? 1 : 2),
valueFormatter: o.valueFormatter, valueFormatter: o.valueFormatter,
// adapter: this.popup,
masker: { masker: {
offset: { offset: {
left: 0, left: 0,

Loading…
Cancel
Save