Browse Source

KERNEL-11422 feat: 给下拉框都添加valueFormatter属性

es6
zsmj 3 years ago
parent
commit
caa043a931
  1. 2
      src/case/trigger/trigger.text.select.js
  2. 4
      src/widget/multilayersingletree/multilayersingletree.combo.js
  3. 2
      src/widget/singletree/singletree.trigger.js

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

@ -61,7 +61,7 @@ BI.SelectTextTrigger = BI.inherit(BI.Trigger, {
if (result.length > 0) { if (result.length > 0) {
return { return {
textCls: "", textCls: "",
text: result.join(",") text: o.valueFormatter(vals[0]) || result.join(","), // 只保留单个value的场景,后续会把BI.isArray(vals) ? vals : [vals];这种都去掉
}; };
} else { } else {
return { return {

4
src/widget/multilayersingletree/multilayersingletree.combo.js

@ -19,7 +19,8 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
allowEdit: false, allowEdit: false,
allowSearchValue: false, allowSearchValue: false,
allowInsertValue: false, allowInsertValue: false,
isNeedAdjustWidth: true isNeedAdjustWidth: true,
valueFormatter: BI.emptyFn,
}); });
}, },
@ -183,6 +184,7 @@ BI.MultiLayerSingleTreeCombo = BI.inherit(BI.Widget, {
value: o.value, value: o.value,
tipType: o.tipType, tipType: o.tipType,
warningTitle: o.warningTitle, warningTitle: o.warningTitle,
valueFormatter: o.valueFormatter,
} }
}); });
}, },

2
src/widget/singletree/singletree.trigger.js

@ -13,6 +13,7 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
items: [], items: [],
value: "", value: "",
allowClear: false, allowClear: false,
valueFormatter: BI.emptyFn,
}); });
}, },
@ -31,6 +32,7 @@ BI.SingleTreeTrigger = BI.inherit(BI.Trigger, {
tipType: o.tipType, tipType: o.tipType,
value: o.value, value: o.value,
allowClear: o.allowClear, allowClear: o.allowClear,
valueFormatter: o.valueFormatter,
listeners: [ listeners: [
{ {
eventName: BI.SelectTextTrigger.EVENT_CLEAR, eventName: BI.SelectTextTrigger.EVENT_CLEAR,

Loading…
Cancel
Save