Browse Source

Merge pull request #163781 in DEC/fineui from final/11.0 to release/11.0

* commit '181e96b6d59b53f0991145ee93b3f3bc0be23355':
  同步代码 feat: 给下拉框一个完全自由控制的tooltip方式
research/test
superman 2 years ago
parent
commit
c8e9338dc7
  1. 30
      src/case/combo/textvaluecombo/combo.textvalue.js

30
src/case/combo/textvaluecombo/combo.textvalue.js

@ -14,7 +14,8 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
value: "", value: "",
defaultText: "", defaultText: "",
allowClear: false, allowClear: false,
status: "success", // success | warning | error status: "success", // success | warning | error,
title: null,
}); });
}, },
@ -35,6 +36,21 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
const o = this.options; const o = this.options;
const title = () => {
if (BI.isFunction(o.title)) {
return o.title();
}
if (this.options.status === "error") {
return {
level: "warning",
text: o.warningTitle,
};
}
return {
level: "success",
};
};
const trigger = { const trigger = {
type: "bi.select_text_trigger", type: "bi.select_text_trigger",
ref: ref => this.trigger = ref, ref: ref => this.trigger = ref,
@ -43,17 +59,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, {
height: o.height, height: o.height,
text: o.text, text: o.text,
value: o.value, value: o.value,
title: () => { title,
if (this.options.status === "error") {
return {
level: "warning",
text: o.warningTitle,
};
}
return {
level: "success",
};
},
allowClear: o.allowClear, allowClear: o.allowClear,
defaultText: o.defaultText, defaultText: o.defaultText,
listeners: [ listeners: [

Loading…
Cancel
Save