From adf265507037d042d8ceb0fd9b95dfc283abc41e Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 16 Aug 2022 12:30:59 +0800 Subject: [PATCH] =?UTF-8?q?REPORT-77978=20fix:=20=E4=B8=8B=E6=8B=89?= =?UTF-8?q?=E6=A0=91=E6=B0=B4=E5=8D=B0=E8=A1=A8=E7=8E=B0=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/trigger/trigger.text.select.js | 11 ++++++++++- .../multilayersingletree.combo.js | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/case/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js index 57cfadcb9..52d3878fb 100644 --- a/src/case/trigger/trigger.text.select.js +++ b/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; diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index ba67f0c3a..8f5272545 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/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,