Browse Source

Pull request #3277: BI-117667 fix: 【6.0.5冒烟】数值下拉选择多个选项,查看已选点击加载更多展示重复数据

Merge in VISUAL/fineui from ~DAILER/fineui:master to master

* commit '1d0e5930c1d2e6cc0cef7fec87d632b1479f0a17':
  BI-117667 fix: 【6.0.5冒烟】数值下拉选择多个选项,查看已选点击加载更多展示重复数据
master
Dailer-刘荣歆 2 years ago
parent
commit
dd627cbe4a
  1. 21
      src/widget/multiselect/check/multiselect.display.js

21
src/widget/multiselect/check/multiselect.display.js

@ -40,10 +40,12 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
}, },
items: this._createItems(opts.items), items: this._createItems(opts.items),
chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI, chooseType: BI.ButtonGroup.CHOOSE_TYPE_MULTI,
layouts: [{ layouts: [
type: "bi.vertical", {
lgap: 10 type: "bi.vertical",
}] lgap: 10
}
]
}, },
itemsCreator: function (options, callback) { itemsCreator: function (options, callback) {
if (options.times === 1) { if (options.times === 1) {
@ -53,10 +55,7 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
if (cacheItems.length > 0) { if (cacheItems.length > 0) {
var renderedItems = cacheItems.slice(0, 100); var renderedItems = cacheItems.slice(0, 100);
cacheItems = cacheItems.slice(100); cacheItems = cacheItems.slice(100);
self.hasNext = true; self.hasNext = cacheItems.length > 0;
if (cacheItems.length === 0) {
self.hasNext = false;
}
callback(self._createItems(renderedItems)); callback(self._createItems(renderedItems));
return; return;
} }
@ -65,8 +64,8 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
self.hasNext = !!ob.hasNext; self.hasNext = !!ob.hasNext;
var firstItemsCount = 100 + ob.items.length % 100; var firstItemsCount = 100 + ob.items.length % 100;
if (ob.items.length > 100) { if (ob.items.length > 100) {
cacheItems = ob.items.slice(100 + ob.items.length % 100); cacheItems = ob.items.slice(firstItemsCount);
self.hasNext = true; self.hasNext = (firstItemsCount === ob.items.length) ? false : true;
} }
callback(self._createItems(ob.items.slice(0, firstItemsCount))); callback(self._createItems(ob.items.slice(0, firstItemsCount)));
}); });
@ -104,4 +103,4 @@ BI.DisplaySelectedList = BI.inherit(BI.Pane, {
} }
}); });
BI.shortcut("bi.display_selected_list", BI.DisplaySelectedList); BI.shortcut("bi.display_selected_list", BI.DisplaySelectedList);

Loading…
Cancel
Save