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) { _digest: function (val, items) {
var o = this.options; var o = this.options;
val = BI.isArray(val) ? val[0] : val; 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 result = [];
var formatItems = BI.Tree.transformToArrayFormat(items); var formatItems = BI.Tree.transformToArrayFormat(items);
BI.each(formatItems, function (i, item) { BI.each(formatItems, function (i, item) {
if (val === item.value && !BI.contains(result, item.text || item.value)) { 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) { if (result.length > 0) {
return { return {
textCls: "", textCls: "",
text: o.valueFormatter(val) ?? result.join(","), text: result.join(","),
}; };
} else { } else {
var text = BI.isFunction(o.text) ? o.text() : o.text; 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; self.textTrigger = _ref;
}, },
text: o.text, text: o.text,
defaultText: o.defaultText,
height: o.height, height: o.height,
items: o.items, items: o.items,
value: o.value, value: o.value,

Loading…
Cancel
Save