Browse Source

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

es6
zsmj 2 years ago
parent
commit
5ffe80cdaa
  1. 3
      demo/js/component/demo.treevaluechoosercombo.js
  2. 1
      src/component/treevaluechooser/combo.treevaluechooser.js
  3. 1
      src/component/valuechooser/combo.valuechooser.js
  4. 3
      src/component/valuechooser/combo.valuechooser.nobar.js
  5. 4
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js

3
demo/js/component/demo.treevaluechoosercombo.js

@ -10,7 +10,8 @@ Demo.TreeValueChooser = BI.inherit(BI.Widget, {
// items: BI.deepClone(Demo.CONSTANTS.TREEITEMS), // items: BI.deepClone(Demo.CONSTANTS.TREEITEMS),
itemsCreator: function (op, callback) { itemsCreator: function (op, callback) {
callback(BI.deepClone(Demo.CONSTANTS.TREEITEMS)); callback(BI.deepClone(Demo.CONSTANTS.TREEITEMS));
} },
defaultText: "请选择",
}); });
return { return {
type: "bi.vertical", type: "bi.vertical",

1
src/component/treevaluechooser/combo.treevaluechooser.js

@ -28,6 +28,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, {
type: "bi.multi_tree_combo", type: "bi.multi_tree_combo",
simple: o.simple, simple: o.simple,
text: o.text, text: o.text,
defaultText: o.defaultText,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
value: o.value, value: o.value,
watermark: o.watermark, watermark: o.watermark,

1
src/component/valuechooser/combo.valuechooser.js

@ -31,6 +31,7 @@ BI.ValueChooserCombo = BI.inherit(BI.AbstractValueChooser, {
element: this, element: this,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
text: o.text, text: o.text,
defaultText: o.defaultText,
value: this._assertValue(o.value), value: this._assertValue(o.value),
itemsCreator: BI.bind(this._itemsCreator, this), itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this), valueFormatter: BI.bind(this._valueFormatter, this),

3
src/component/valuechooser/combo.valuechooser.nobar.js

@ -25,6 +25,7 @@ BI.ValueChooserNoBarCombo = BI.inherit(BI.AbstractValueChooser, {
simple: o.simple, simple: o.simple,
allowEdit: o.allowEdit, allowEdit: o.allowEdit,
text: o.text, text: o.text,
defaultText: o.defaultText,
value: this._assertValue(o.value), value: this._assertValue(o.value),
itemsCreator: BI.bind(this._itemsCreator, this), itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this), valueFormatter: BI.bind(this._valueFormatter, this),
@ -64,7 +65,7 @@ BI.ValueChooserNoBarCombo = BI.inherit(BI.AbstractValueChooser, {
self.fireEvent(BI.ValueChooserNoBarCombo.EVENT_CONFIRM); self.fireEvent(BI.ValueChooserNoBarCombo.EVENT_CONFIRM);
} }
}] }]
} };
}, },
setValue: function (v) { setValue: function (v) {

4
src/widget/multilayerselecttree/multilayerselecttree.trigger.js

@ -37,11 +37,11 @@ BI.MultiLayerSelectTreeTrigger = BI.inherit(BI.Trigger, {
}, },
isAutoSearch: false, isAutoSearch: false,
el: { el: {
type: "bi.state_editor", type: "bi.default_text_editor",
ref: function () { ref: function () {
self.editor = this; self.editor = this;
}, },
defaultText: o.text, defaultText: o.defaultText,
text: this._digest(o.value), text: this._digest(o.value),
value: o.value, value: o.value,
height: o.height, height: o.height,

Loading…
Cancel
Save