From fa75b87fbcd545245fe67272ef7f736361c01144 Mon Sep 17 00:00:00 2001 From: "Oliver.Ke" Date: Tue, 6 Sep 2022 14:29:31 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E4=BB=A3=E7=A0=81=20feat:=20?= =?UTF-8?q?=E7=BB=99=E4=B8=8B=E6=8B=89=E6=A1=86=E4=B8=80=E4=B8=AA=E5=AE=8C?= =?UTF-8?q?=E5=85=A8=E8=87=AA=E7=94=B1=E6=8E=A7=E5=88=B6=E7=9A=84tooltip?= =?UTF-8?q?=E6=96=B9=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../combo/textvaluecombo/combo.textvalue.js | 30 +++++++++++-------- 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/src/case/combo/textvaluecombo/combo.textvalue.js b/src/case/combo/textvaluecombo/combo.textvalue.js index dc39d1b1e..b9aaac2ba 100644 --- a/src/case/combo/textvaluecombo/combo.textvalue.js +++ b/src/case/combo/textvaluecombo/combo.textvalue.js @@ -14,7 +14,8 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { value: "", defaultText: "", 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 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 = { type: "bi.select_text_trigger", ref: ref => this.trigger = ref, @@ -43,17 +59,7 @@ BI.TextValueCombo = BI.inherit(BI.Widget, { height: o.height, text: o.text, value: o.value, - title: () => { - if (this.options.status === "error") { - return { - level: "warning", - text: o.warningTitle, - }; - } - return { - level: "success", - }; - }, + title, allowClear: o.allowClear, defaultText: o.defaultText, listeners: [