Browse Source

Pull request #2989: REPORT-77978 && KERNEL-11286 KERNEL-11286 下拉树水印表现异常问题

Merge in VISUAL/fineui from ~DAILER/fineui:master to master

* commit '5ffe80cdaad61abc59453387509b0698f767ef54':
  KERNEL-11286 feat: 下拉框value,text,defaultText属性规则统一
  REPORT-77978 fix: 下拉树水印表现异常问题
es6
Dailer 2 years ago
parent
commit
34aa49b261
  1. 3
      demo/js/component/demo.treevaluechoosercombo.js
  2. 7
      src/case/editor/editor.defaulttext.js
  3. 3
      src/component/treevaluechooser/combo.treevaluechooser.js
  4. 3
      src/component/valuechooser/combo.valuechooser.js
  5. 7
      src/component/valuechooser/combo.valuechooser.nobar.js
  6. 4
      src/widget/multilayerselecttree/multilayerselecttree.trigger.js
  7. 1
      src/widget/multilayersingletree/multilayersingletree.combo.js
  8. 11
      src/widget/multilayersingletree/multilayersingletree.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),
itemsCreator: function (op, callback) {
callback(BI.deepClone(Demo.CONSTANTS.TREEITEMS));
}
},
defaultText: "请选择",
});
return {
type: "bi.vertical",

7
src/case/editor/editor.defaulttext.js

@ -46,12 +46,15 @@ BI.DefaultTextEditor = BI.inherit(BI.Widget, {
errorText: o.errorText,
invisible: true,
});
var showText = BI.isFunction(o.text) ? o.text() : o.text;
this.text = BI.createWidget({
type: "bi.text_button",
cls: BI.isKey(o.text) ? "tip-text-style" : "bi-water-mark tip-text-style",
cls: BI.isKey(showText) ? "tip-text-style" : "bi-water-mark tip-text-style",
textAlign: "left",
height: o.height,
text: BI.isKey(o.text) ? o.text : o.defaultText,
text: showText || o.defaultText,
hgap: o.hgap + 2,
handler: function () {
self._showInput();

3
src/component/treevaluechooser/combo.treevaluechooser.js

@ -28,6 +28,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, {
type: "bi.multi_tree_combo",
simple: o.simple,
text: o.text,
defaultText: o.defaultText,
allowEdit: o.allowEdit,
value: o.value,
watermark: o.watermark,
@ -96,7 +97,7 @@ BI.TreeValueChooserCombo = BI.inherit(BI.AbstractTreeValueChooser, {
return this.combo.getValue();
},
getAllValue: function() {
getAllValue: function () {
return this.buildCompleteTree(this.combo.getValue());
},

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

@ -31,6 +31,7 @@ BI.ValueChooserCombo = BI.inherit(BI.AbstractValueChooser, {
element: this,
allowEdit: o.allowEdit,
text: o.text,
defaultText: o.defaultText,
value: this._assertValue(o.value),
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
@ -82,7 +83,7 @@ BI.ValueChooserCombo = BI.inherit(BI.AbstractValueChooser, {
};
},
getAllValue: function() {
getAllValue: function () {
var val = this.combo.getValue() || {};
if (val.type === BI.Selection.Multi) {
return val.value || [];

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

@ -25,12 +25,13 @@ BI.ValueChooserNoBarCombo = BI.inherit(BI.AbstractValueChooser, {
simple: o.simple,
allowEdit: o.allowEdit,
text: o.text,
defaultText: o.defaultText,
value: this._assertValue(o.value),
itemsCreator: BI.bind(this._itemsCreator, this),
valueFormatter: BI.bind(this._valueFormatter, this),
width: o.width,
height: o.height,
ref: function(_ref) {
ref: function (_ref) {
self.combo = _ref;
},
listeners: [{
@ -64,7 +65,7 @@ BI.ValueChooserNoBarCombo = BI.inherit(BI.AbstractValueChooser, {
self.fireEvent(BI.ValueChooserNoBarCombo.EVENT_CONFIRM);
}
}]
}
};
},
setValue: function (v) {
@ -75,7 +76,7 @@ BI.ValueChooserNoBarCombo = BI.inherit(BI.AbstractValueChooser, {
return this.combo.getValue();
},
getAllValue: function() {
getAllValue: function () {
return this.getValue();
},

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

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

1
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -105,6 +105,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
valueFormatter: o.valueFormatter,
height: o.height,
text: o.text,
defaultText: o.defaultText,
value: o.value,
tipType: o.tipType,
warningTitle: o.warningTitle,

11
src/widget/multilayersingletree/multilayersingletree.trigger.js

@ -37,11 +37,11 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
},
isAutoSearch: false,
el: {
type: "bi.state_editor",
type: "bi.default_text_editor",
ref: function () {
self.editor = this;
},
defaultText: o.text,
defaultText: o.defaultText,
text: this._digest(o.value),
value: o.value,
height: o.height,
@ -192,16 +192,11 @@ BI.MultiLayerSingleTreeTrigger = BI.inherit(BI.Trigger, {
return o.valueFormatter(v);
}
if (o.itemsCreator === BI.emptyFn) {
var result = BI.find(o.items, function (i, item) {
return item.value === v;
});
return BI.isNotNull(result) ? result.text : o.text;
}
return v;
return BI.isNotNull(result) ? result.text : (o.text ?? v);
},
_getShowText: function () {

Loading…
Cancel
Save