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) {
return {
textCls: "",
text: result.join(",")
text: o.valueFormatter(vals[0]) || result.join(","), // 只保留单个value的场景,后续会把BI.isArray(vals) ? vals : [vals];这种都去掉
};
} else {
return {

4
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,
}
});
},

2
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,

Loading…
Cancel
Save