Browse Source

Pull request #1993: BI-89195 fix: 内部分隔符不使用_

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit '8fbe4988153134c42a5d60b9e2a1a45cef288e04':
  BI-89239 fix: 提示修复
  BI-89195 fix: 内部分隔符不使用_
es6
windy 3 years ago
parent
commit
99cb924d91
  1. 4
      src/widget/downlist/item.downlistgroup.js
  2. 2
      src/widget/downlist/popup.downlist.js
  3. 22
      src/widget/singleselect/search/singleselect.search.pane.insert.js

4
src/widget/downlist/item.downlistgroup.js

@ -73,7 +73,7 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, {
_getLevel: function () { _getLevel: function () {
var child = BI.first(this.options.childValues); var child = BI.first(this.options.childValues);
return BI.isNotNull(child) ? (child + "").split("_").length : 0; return BI.isNotNull(child) ? (child + "").split(BI.BlankSplitChar).length : 0;
}, },
_digest: function (v) { _digest: function (v) {
@ -81,7 +81,7 @@ BI.DownListGroupItem = BI.inherit(BI.BasicButton, {
v = BI.isArray(v) ? v : [v]; v = BI.isArray(v) ? v : [v];
var level = this._getLevel(); var level = this._getLevel();
return BI.any(v, function (idx, value) { return BI.any(v, function (idx, value) {
return BI.contains(o.childValues, (value + "").split("_").slice(0, level).join("_")); return BI.contains(o.childValues, (value + "").split(BI.BlankSplitChar).slice(0, level).join(BI.BlankSplitChar));
}); });
}, },

2
src/widget/downlist/popup.downlist.js

@ -183,7 +183,7 @@ BI.DownListPopup = BI.inherit(BI.Pane, {
}, },
_createChildValue: function (fatherValue, childValue) { _createChildValue: function (fatherValue, childValue) {
return fatherValue + "_" + childValue; return fatherValue + BI.BlankSplitChar + childValue;
}, },
_digest: function (valueItem) { _digest: function (valueItem) {

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); BI.SingleSelectSearchInsertPane.superclass._init.apply(this, arguments);
var self = this, o = this.options; 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({ this.addNotMatchTip = BI.createWidget({
type: "bi.label", type: "bi.label",
invisible: true,
text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""), text: BI.i18nText("BI-Basic_Click_To_Add_Text", ""),
height: this.constants.height, height: this.constants.height,
cls: "bi-high-light", cls: "bi-high-light",
@ -66,7 +57,7 @@ BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, {
element: this, element: this,
items: [{ items: [{
type: "bi.vertical", type: "bi.vertical",
items: [this.tooltipClick, this.addNotMatchTip], items: [this.addNotMatchTip],
height: this.constants.height height: this.constants.height
}, { }, {
el: this.loader el: this.loader
@ -75,18 +66,11 @@ BI.SingleSelectSearchInsertPane = BI.inherit(BI.Widget, {
}, },
setKeyword: function (keyword) { setKeyword: function (keyword) {
var o = this.options; this.addNotMatchTip.setText(BI.i18nText("BI-Basic_Click_To_Add_Text", keyword));
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));
}, },
hasMatched: function () { hasMatched: function () {
return this.tooltipClick.isVisible(); return false;
}, },
setValue: function (v) { setValue: function (v) {

Loading…
Cancel
Save