Browse Source

BI-67148 fix: 传递valueFormater后完全匹配项可能出现新增提示

es6
windy 5 years ago
parent
commit
1aa75e65d9
  1. 1
      changelog.md
  2. 3
      src/widget/multiselect/search/multiselect.search.insert.pane.js
  3. 4
      src/widget/multiselect/search/multiselect.search.pane.js
  4. 3
      src/widget/singleselect/search/singleselect.search.pane.insert.js
  5. 4
      src/widget/singleselect/search/singleselect.search.pane.js

1
changelog.md

@ -1,5 +1,6 @@
# 更新日志
2.0(2020-06)
- 修复了新增值的下拉控件传递valueFormatter搜索完全匹配项提示新增
- 修复了选色控件历史记录没有选中的问题的问题
- 修复了单选下拉框新增值的时候没有发事件的问题
- 修复了单选标红combo类setValue为空字符串会标红的问题

3
src/widget/multiselect/search/multiselect.search.insert.pane.js

@ -76,8 +76,9 @@ BI.MultiSelectSearchInsertPane = BI.inherit(BI.Widget, {
},
setKeyword: function (keyword) {
var o = this.options;
var hasSameValue = BI.some(this.loader.getAllButtons(), function (idx, btn) {
return keyword === btn.getValue();
return keyword === (o.valueFormatter(btn.getValue()) || btn.getValue());
});
var isMatchTipVisible = this.loader.getAllButtons().length > 0 && hasSameValue;
this.tooltipClick.setVisible(isMatchTipVisible);

4
src/widget/multiselect/search/multiselect.search.pane.js

@ -64,8 +64,8 @@ BI.MultiSelectSearchPane = BI.inherit(BI.Widget, {
},
setKeyword: function (keyword) {
var btn;
var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue());
var btn, o = this.options;
var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === (o.valueFormatter(btn.getValue()) || btn.getValue()));
if (isVisible !== this.tooltipClick.isVisible()) {
this.tooltipClick.setVisible(isVisible);
this.resizer.attr("items")[0].height = (isVisible ? this.constants.height : 0);

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

@ -78,8 +78,9 @@ 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 === btn.getValue();
return keyword === (o.valueFormatter(btn.getValue()) || btn.getValue());
});
var isMatchTipVisible = this.loader.getAllButtons().length > 0 && hasSameValue;
this.tooltipClick.setVisible(isMatchTipVisible);

4
src/widget/singleselect/search/singleselect.search.pane.js

@ -66,8 +66,8 @@ BI.SingleSelectSearchPane = BI.inherit(BI.Widget, {
},
setKeyword: function (keyword) {
var btn;
var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === btn.getValue());
var btn, o = this.options;
var isVisible = this.loader.getAllButtons().length > 0 && (btn = this.loader.getAllButtons()[0]) && (keyword === (o.valueFormatter(btn.getValue()) || btn.getValue()));
if (isVisible !== this.tooltipClick.isVisible()) {
this.tooltipClick.setVisible(isVisible);
this.resizer.attr("items")[0].height = (isVisible ? this.constants.height : 0);

Loading…
Cancel
Save