Browse Source

REPORT-77978 fix: 下拉树水印表现异常问题

es6
zsmj 2 years ago
parent
commit
adf2655070
  1. 11
      src/case/trigger/trigger.text.select.js
  2. 1
      src/widget/multilayersingletree/multilayersingletree.combo.js

11
src/case/trigger/trigger.text.select.js

@ -53,7 +53,16 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
_digest: function (val, items) {
var o = this.options;
val = BI.isArray(val) ? val[0] : val;
// 提升valueFormatter的优先级
if (o.valueFormatter !== BI.emptyFn && BI.isFunction(o.valueFormatter)) {
return {
text: o.valueFormatter(val),
};
}
var result = [];
var formatItems = BI.Tree.transformToArrayFormat(items);
BI.each(formatItems, function (i, item) {
if (val === item.value && !BI.contains(result, item.text || item.value)) {
@ -64,7 +73,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
if (result.length > 0) {
return {
textCls: "",
text: o.valueFormatter(val) ?? result.join(","),
text: result.join(","),
};
} else {
var text = BI.isFunction(o.text) ? o.text() : o.text;

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

@ -200,6 +200,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
self.textTrigger = _ref;
},
text: o.text,
defaultText: o.defaultText,
height: o.height,
items: o.items,
value: o.value,

Loading…
Cancel
Save