Browse Source

BI-139985 fix: bi.down_list_popup的bi.down_list_group里只有一个元素的时候没有选中效果

research/test
Oliver.Ke 1 year ago
parent
commit
d0ccfbdad9
  1. 50
      packages/fineui/src/widget/downlist/popup.downlist.js

50
packages/fineui/src/widget/downlist/popup.downlist.js

@ -1,23 +1,23 @@
import { ButtonTree, Pane } from "@/base"; import { ButtonTree, Pane } from "@/base";
import { import {
Selection, BlankSplitChar,
VerticalLayout,
Layout,
shortcut,
extend,
createWidget,
createItems,
isNotNull,
contains, contains,
createItems,
createWidget,
deepClone,
each, each,
extend,
isEmpty, isEmpty,
map,
isNotEmptyString,
isNotEmptyArray, isNotEmptyArray,
some, isNotEmptyString,
deepClone, isNotNull,
Layout,
map,
Selection,
shortcut,
SIZE_CONSANTS, SIZE_CONSANTS,
BlankSplitChar some,
VerticalLayout,
} from "@/core"; } from "@/core";
import { DownListGroup } from "./group.downlist"; import { DownListGroup } from "./group.downlist";
@ -63,14 +63,14 @@ export class DownListPopup extends Pane {
{}, {},
{ {
adjustLength: -2, adjustLength: -2,
} },
), ),
layouts: [ layouts: [
{ {
type: VerticalLayout.xtype, type: VerticalLayout.xtype,
hgap: this.constants.hgap, hgap: this.constants.hgap,
vgap: this.constants.vgap, vgap: this.constants.vgap,
} },
], ],
value: this._digest(o.value), value: this._digest(o.value),
chooseType: o.chooseType, chooseType: o.chooseType,
@ -142,7 +142,7 @@ export class DownListPopup extends Pane {
layouts: [ layouts: [
{ {
type: VerticalLayout.xtype, type: VerticalLayout.xtype,
} },
], ],
}, },
innerVgap: 5, innerVgap: 5,
@ -163,11 +163,9 @@ export class DownListPopup extends Pane {
item_done.items.push(el_done); item_done.items.push(el_done);
storeItem.push(item); storeItem.push(item);
}); });
if (this._isGroup(item_done.items)) { each(item_done.items, (i, item) => {
each(item_done.items, (i, item) => { this.singleValues.push(item.el.value);
this.singleValues.push(item.el.value); });
});
}
result.push(item_done); result.push(item_done);
this.items.push(storeItem); this.items.push(storeItem);
@ -181,7 +179,7 @@ export class DownListPopup extends Pane {
cls: "bi-down-list-spliter bi-split-top cursor-pointer", cls: "bi-down-list-spliter bi-split-top cursor-pointer",
height: 0, height: 0,
}, },
} },
], ],
cls: "bi-down-list-spliter-container cursor-pointer", cls: "bi-down-list-spliter-container cursor-pointer",
vgap: 5, vgap: 5,
@ -220,10 +218,6 @@ export class DownListPopup extends Pane {
}); });
} }
_isGroup(i) {
return i.length > 1;
}
_needSpliter(i, itemLength) { _needSpliter(i, itemLength) {
return i < itemLength - 1; return i < itemLength - 1;
} }
@ -276,7 +270,7 @@ export class DownListPopup extends Pane {
return true; return true;
} }
}) }),
); );
return value; return value;
@ -295,7 +289,7 @@ export class DownListPopup extends Pane {
{}, {},
{ {
adjustLength: -2, adjustLength: -2,
} },
); );
this.popup.populate(popupItem); this.popup.populate(popupItem);
} }

Loading…
Cancel
Save