Browse Source

BI-98494 fix: 提示不对

es6
windy 3 years ago
parent
commit
69a2ec1bf1
  1. 4
      src/widget/multiselect/multiselect.insert.combo.js
  2. 4
      src/widget/multiselect/multiselect.insert.combo.nobar.js
  3. 15
      src/widget/multiselect/trigger/searcher.multiselect.insert.js
  4. 8
      src/widget/multiselectlist/multiselectlist.insert.js
  5. 8
      src/widget/multiselectlist/multiselectlist.insert.nobar.js

4
src/widget/multiselect/multiselect.insert.combo.js

@ -81,7 +81,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords.slice(0, last === BI.BlankSplitChar ? 1999 : 2000), function () {
self._joinKeywords(keywords, function () {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.combo.setValue(self.storeValue);
assertShowValue();
@ -93,7 +93,7 @@ BI.MultiSelectInsertCombo = BI.inherit(BI.Single, {
}
self._dataChange = true;
});
keywords.length > 2000 && BI.Msg.alert(BI.i18nText("BI-Basic_Prompt"), BI.i18nText("BI-Basic_Too_Much_Value_Get_Two_Thousand"));
this.getSearcher().getKeywordsLength() > 2000 && BI.Msg.alert(BI.i18nText("BI-Basic_Prompt"), BI.i18nText("BI-Basic_Too_Much_Value_Get_Two_Thousand"));
}
self.fireEvent(BI.MultiSelectInsertCombo.EVENT_SEARCHING);
});

4
src/widget/multiselect/multiselect.insert.combo.nobar.js

@ -76,7 +76,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
var last = BI.last(keywords);
keywords = BI.initial(keywords || []);
if (keywords.length > 0) {
self._joinKeywords(keywords.slice(0, last === BI.BlankSplitChar ? 1999 : 2000), function () {
self._joinKeywords(keywords, function () {
if (BI.endWith(last, BI.BlankSplitChar)) {
self.combo.setValue(self.storeValue);
assertShowValue();
@ -88,7 +88,7 @@ BI.MultiSelectInsertNoBarCombo = BI.inherit(BI.Single, {
}
self._dataChange = true;
});
keywords.length > 2000 && BI.Msg.alert(BI.i18nText("BI-Basic_Prompt"), BI.i18nText("BI-Basic_Too_Much_Value_Get_Two_Thousand"));
this.getSearcher().getKeywordsLength() > 2000 && BI.Msg.alert(BI.i18nText("BI-Basic_Prompt"), BI.i18nText("BI-Basic_Too_Much_Value_Get_Two_Thousand"));
}
});

15
src/widget/multiselect/trigger/searcher.multiselect.insert.js

@ -89,7 +89,7 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
});
this.searcher.on(BI.Searcher.EVENT_SEARCHING, function () {
var keywords = this.getKeywords();
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_SEARCHING, keywords);
self.fireEvent(BI.MultiSelectInsertSearcher.EVENT_SEARCHING, keywords.length > 2000 ? keywords.slice(0, 2000).concat([BI.BlankSplitChar]) : keywords.slice(0, 2000));
});
if (BI.isNotNull(o.value)) {
this.setState(o.value);
@ -108,8 +108,19 @@ BI.MultiSelectInsertSearcher = BI.inherit(BI.Widget, {
this.searcher.stopSearch();
},
getKeywordsLength: function () {
var keywords = this.editor.getKeywords();
return keywords[keywords.length - 1] === BI.BlankSplitChar ? keywords.length - 1 : keywords.length;
},
getKeyword: function () {
return this.editor.getKeyword();
var keywords = this.editor.getKeywords().slice(0, 2000);
if (keywords[keywords.length - 1] === BI.BlankSplitChar) {
keywords = keywords.slice(0, keywords.length - 1);
}
return BI.isEmptyArray(keywords) ? "" : keywords[keywords.length - 1];
},
hasMatched: function () {

8
src/widget/multiselectlist/multiselectlist.insert.js

@ -138,7 +138,7 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
}
self.fireEvent(BI.MultiSelectInsertList.EVENT_CHANGE);
});
keywords.length > 2000 && BI.Msg.alert(BI.i18nText("BI-Basic_Prompt"), BI.i18nText("BI-Basic_Too_Much_Value_Get_Two_Thousand"));
self._getKeywordsLength() > 2000 && BI.Msg.alert(BI.i18nText("BI-Basic_Prompt"), BI.i18nText("BI-Basic_Too_Much_Value_Get_Two_Thousand"));
}
}
}, {
@ -197,6 +197,12 @@ BI.MultiSelectInsertList = BI.inherit(BI.Single, {
return keywords;
},
_getKeywordsLength: function () {
var keywords = this._getKeywords();
return keywords[keywords.length - 1] === BI.BlankSplitChar ? keywords.length - 1 : keywords.length;
},
_showAdapter: function () {
this.adapter.setVisible(true);
this.searcherPane.setVisible(false);

8
src/widget/multiselectlist/multiselectlist.insert.nobar.js

@ -141,7 +141,7 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
}
self.fireEvent(BI.MultiSelectInsertNoBarList.EVENT_CHANGE);
});
keywords.length > 2000 && BI.Msg.alert(BI.i18nText("BI-Basic_Prompt"), BI.i18nText("BI-Basic_Too_Much_Value_Get_Two_Thousand"));
self._getKeywordsLength() > 2000 && BI.Msg.alert(BI.i18nText("BI-Basic_Prompt"), BI.i18nText("BI-Basic_Too_Much_Value_Get_Two_Thousand"));
}
}
}, {
@ -203,6 +203,12 @@ BI.MultiSelectInsertNoBarList = BI.inherit(BI.Single, {
return keywords;
},
_getKeywordsLength: function () {
var keywords = this._getKeywords();
return keywords[keywords.length - 1] === BI.BlankSplitChar ? keywords.length - 1 : keywords.length;
},
_showAdapter: function () {
this.adapter.setVisible(true);
this.searcherPane.setVisible(false);

Loading…
Cancel
Save