EcpUnitPicker constructor
EcpUnitPicker({
- Key? key,
- int limitNum = noLimit,
- bool allowEmpty = false,
- List<
BusinessGroupItemEntity> ? selectUserList, - String? title = '选择单位',
- bool appBarVisible = true,
- bool? clickWithoutConfirm = false,
- dynamic onParentSelect(
- List<
BusinessGroupEntity> parents
- List<
- OnSelected<
BusinessGroupItemEntity> ? onSelected, - bool? showSelectedList,
- bool refreshEnable = false,
- bool loadMoreEnable = false,
- bool isAutoLeading = true,
- List<
BusinessGroupItemEntity> ? frozenList,
Implementation
EcpUnitPicker({
super.key,
super.limitNum,
super.allowEmpty,
super.selectUserList,
super.title = '选择单位',
super.appBarVisible,
super.clickWithoutConfirm = false,
super.onParentSelect,
// super.searchHint = '请输入人员姓名进行搜索',
super.onSelected,
super.showSelectedList,
super.refreshEnable = false,
super.loadMoreEnable = false,
super.isAutoLeading = true,
super.frozenList,
}) : super(
userSelectorBuilder: (ctx, proxy, item) {
return EcpPickerTileItem<BusinessGroupItemEntity>(
wrapper: item,
showCheckBox: true,
onDisplay: (data) => data.itemName ?? "",
);
},
userSelectedBuilder: (ctx, item) {
return EcpPickerTileItem<BusinessGroupItemEntity>(
wrapper: item,
showCheckBox: true,
onDisplay: (data) => data.itemName ?? "",
);
},
departmentBuilder: (ctx, proxy, group) {
return EcpPickerTileItem<BusinessGroupEntity>(
wrapper: SelectWrapper(origin: group),
onDisplay: (data) => data.groupName ?? "",
showCheckBox: false,
);
},
crumbBuilder: (ctx, proxy, group) {
return CrumbItem<BusinessGroupEntity>(
crumb: group,
last: proxy.crumbsList.isLast(group),
onDisplay: (data) => data.groupName,
);
},
userRepo: (group, index) async {
if (group == null) {
return null;
}
return EcpGlobalApi.getSysBusinessGroupItem(
groupId: group.id,
pageIndex: index,
);
},
searchRepo: null,
departmentRepo: (group) async {
if (group == null) {
return EcpGlobalApi.getSysBusinessGroup();
}
return null;
},
showIndex: false,
);