Browse Source

BI-89239 fix: 提示修复

master
windy 4 years ago
parent
commit
8fbe498815
  1. 22
      src/widget/singleselect/search/singleselect.search.pane.insert.js

22
src/widget/singleselect/search/singleselect.search.pane.insert.js

@ -27,17 +27,8 @@ BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, {
BI.SingleSelectSearchInsertPane.superclass._init.apply(this, arguments);
var self = this, o = this.options;
this.tooltipClick = BI.createWidget({
type: "bi.label",
invisible: true,
text: BI.i18nText("BI-Click_Blank_To_Select"),
cls: "single-select-toolbar",
height: this.constants.height
});
this.addNotMatchTip = BI.createWidget({
type: "bi.label",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: this.constants.height,
cls: "bi-high-light",
@ -66,7 +57,7 @@ BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, {
element: this,
items: [{
type: "bi.vertical",
items: [this.tooltipClick, this.addNotMatchTip],
items: [this.addNotMatchTip],
height: this.constants.height
}, {
el: this.loader
@ -75,18 +66,11 @@ BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, {
},
setKeyword: function (keyword) {
var o = this.options;
var hasSameValue = BI.some(this.loader.getAllButtons(), function (idx, btn) {
return keyword === (o.valueFormatter(btn.getValue()) || btn.getValue());
});
var isMatchTipVisible = this.loader.getAllButtons().length > 0 && hasSameValue;
this.tooltipClick.setVisible(isMatchTipVisible);
this.addNotMatchTip.setVisible(!isMatchTipVisible);
!isMatchTipVisible && this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
},
hasMatched: function () {
return this.tooltipClick.isVisible();
return false;
},
setValue: function (v) {

Loading…
Cancel
Save