feat:适配多租户
This commit is contained in:
1 parent
cdbb69f843
commit
b370be9111
13 files changed
+175
-8
No files matched your search
@@ -29,3 +29,4 @@ export './order/order_supermarket_common.dart';
|
||||
export './setting/setting_password_dialog.dart';
|
||||
|
||||
export './user/user_info.dart';
|
||||
export './user/user_tenant_dialog.dart';
|
||||
@@ -0,0 +1,50 @@
|
||||
import 'package:common_utils/common_utils.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:forui/forui.dart';
|
||||
|
||||
import 'package:pj_supermarket_cloud/common/index.dart';
|
||||
|
||||
Widget appTenantDialog(
|
||||
BuildContext context,
|
||||
FRadioSelectGroupController<String> controller, {
|
||||
required List<ServiceTenant> list,
|
||||
}) {
|
||||
final theme = FTheme.of(context);
|
||||
final selectList = list.where((v) => ObjectUtil.isNotEmpty(v.code));
|
||||
return FSelectMenuTile<String>(
|
||||
title: Text(
|
||||
"单位",
|
||||
style: theme.typography.base,
|
||||
),
|
||||
groupController: controller,
|
||||
validator: (value) => value == null ? '请选择' : null,
|
||||
autoHide: true,
|
||||
prefixIcon: FIcon(
|
||||
FAssets.icons.building2,
|
||||
size: theme.typography.xl.fontSize,
|
||||
),
|
||||
menu: selectList.map((v) {
|
||||
return FSelectTile(
|
||||
title: Text(
|
||||
v.name!,
|
||||
style: theme.typography.base,
|
||||
),
|
||||
value: v.code!,
|
||||
);
|
||||
}).toList(),
|
||||
details: ListenableBuilder(
|
||||
listenable: controller,
|
||||
builder: (context, _) {
|
||||
final v = controller.value.firstOrNull;
|
||||
if (v == null) return const SizedBox();
|
||||
final target = selectList.firstWhere((i) => i.code == v);
|
||||
return Text(
|
||||
target.name!,
|
||||
style: theme.typography.base.copyWith(
|
||||
color: theme.colorScheme.primary,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user