From caa043a93131607b5888f557d224df7da802aa64 Mon Sep 17 00:00:00 2001 From: zsmj Date: Tue, 31 May 2022 13:53:56 +0800 Subject: [PATCH] =?UTF-8?q?KERNEL-11422=20feat:=20=E7=BB=99=E4=B8=8B?= =?UTF-8?q?=E6=8B=89=E6=A1=86=E9=83=BD=E6=B7=BB=E5=8A=A0valueFormatter?= =?UTF-8?q?=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/case/trigger/trigger.text.select.js | 2 +- src/widget/multilayersingletree/multilayersingletree.combo.js | 4 +++- src/widget/singletree/singletree.trigger.js | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/case/trigger/trigger.text.select.js b/src/case/trigger/trigger.text.select.js index 5461292c1..6871a8740 100644 --- a/src/case/trigger/trigger.text.select.js +++ b/src/case/trigger/trigger.text.select.js @@ -61,7 +61,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, { if (result.length > 0) { return { textCls: "", - text: result.join(",") + text: o.valueFormatter(vals[0]) || result.join(","), // 只保留单个value的场景,后续会把BI.isArray(vals) ? vals : [vals];这种都去掉 }; } else { return { diff --git a/src/widget/multilayersingletree/multilayersingletree.combo.js b/src/widget/multilayersingletree/multilayersingletree.combo.js index f98501baa..cdc9dad91 100644 --- a/src/widget/multilayersingletree/multilayersingletree.combo.js +++ b/src/widget/multilayersingletree/multilayersingletree.combo.js @@ -19,7 +19,8 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { allowEdit: false, allowSearchValue: false, allowInsertValue: false, - isNeedAdjustWidth: true + isNeedAdjustWidth: true, + valueFormatter: BI.emptyFn, }); }, @@ -183,6 +184,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, { value: o.value, tipType: o.tipType, warningTitle: o.warningTitle, + valueFormatter: o.valueFormatter, } }); }, diff --git a/src/widget/singletree/singletree.trigger.js b/src/widget/singletree/singletree.trigger.js index f4a4ca7df..8c5193d2d 100644 --- a/src/widget/singletree/singletree.trigger.js +++ b/src/widget/singletree/singletree.trigger.js @@ -13,6 +13,7 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, { items: [], value: "", allowClear: false, + valueFormatter: BI.emptyFn, }); }, @@ -31,6 +32,7 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, { tipType: o.tipType, value: o.value, allowClear: o.allowClear, + valueFormatter: o.valueFormatter, listeners: [ { eventName: BI.SelectTextTrigger.EVENT_CLEAR,