feat: 增加门禁管理页
This commit is contained in:
parent
e09eddd6f5
commit
b176893a39
BIN
assets/icon/bar/access_control.png
Normal file
BIN
assets/icon/bar/access_control.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
BIN
assets/icon/bar/access_control_selected.png
Normal file
BIN
assets/icon/bar/access_control_selected.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
@ -63,5 +63,7 @@ class AppImages{
|
|||||||
static const String iconNotificationSelected = 'assets/icon/bar/notification_selected.png';
|
static const String iconNotificationSelected = 'assets/icon/bar/notification_selected.png';
|
||||||
static const String iconMine = 'assets/icon/bar/mine.png';
|
static const String iconMine = 'assets/icon/bar/mine.png';
|
||||||
static const String iconMineSelected = 'assets/icon/bar/mine_selected.png';
|
static const String iconMineSelected = 'assets/icon/bar/mine_selected.png';
|
||||||
|
static const String iconAccessControl = 'assets/icon/bar/access_control.png';
|
||||||
|
static const String iconAccessControlSelected = 'assets/icon/bar/access_control_selected.png';
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -8,6 +8,7 @@ class CustomAppBarWidget extends StatelessWidget implements PreferredSizeWidget
|
|||||||
final bool centerTitle;
|
final bool centerTitle;
|
||||||
final Color? backgroundColor;
|
final Color? backgroundColor;
|
||||||
final double? elevation;
|
final double? elevation;
|
||||||
|
final bool? showBackButton;
|
||||||
|
|
||||||
const CustomAppBarWidget({
|
const CustomAppBarWidget({
|
||||||
super.key,
|
super.key,
|
||||||
@ -17,6 +18,7 @@ class CustomAppBarWidget extends StatelessWidget implements PreferredSizeWidget
|
|||||||
this.centerTitle = true,
|
this.centerTitle = true,
|
||||||
this.backgroundColor = Colors.white,
|
this.backgroundColor = Colors.white,
|
||||||
this.elevation,
|
this.elevation,
|
||||||
|
this.showBackButton = true,
|
||||||
});
|
});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -32,9 +34,10 @@ class CustomAppBarWidget extends StatelessWidget implements PreferredSizeWidget
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
actions: actions,
|
actions: actions,
|
||||||
|
automaticallyImplyLeading: this.showBackButton ?? true,
|
||||||
// 根据是否有自定义leading来决定使用什么
|
// 根据是否有自定义leading来决定使用什么
|
||||||
leading: leading ??
|
leading: leading ??
|
||||||
(showBackButton
|
(showBackButton && this.showBackButton == true
|
||||||
? IconButton(
|
? IconButton(
|
||||||
icon: const Icon(Icons.arrow_back_ios_new_rounded),
|
icon: const Icon(Icons.arrow_back_ios_new_rounded),
|
||||||
onPressed: () => Navigator.of(context).pop(),
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
import 'package:starwork_flutter/routes/app_routes.dart';
|
import 'package:starwork_flutter/routes/app_routes.dart';
|
||||||
|
import 'package:starwork_flutter/views/accessControlManage/access_control_manage_binding.dart';
|
||||||
|
import 'package:starwork_flutter/views/accessControlManage/access_control_manage_view.dart';
|
||||||
import 'package:starwork_flutter/views/device/confirmPairDevice/confirm_pair_device_binding.dart';
|
import 'package:starwork_flutter/views/device/confirmPairDevice/confirm_pair_device_binding.dart';
|
||||||
import 'package:starwork_flutter/views/device/confirmPairDevice/confirm_pair_device_view.dart';
|
import 'package:starwork_flutter/views/device/confirmPairDevice/confirm_pair_device_view.dart';
|
||||||
import 'package:starwork_flutter/views/device/deviceBasisInfo/device_basis_info_binding.dart';
|
import 'package:starwork_flutter/views/device/deviceBasisInfo/device_basis_info_binding.dart';
|
||||||
@ -179,5 +181,10 @@ class AppPages {
|
|||||||
page: () => VolumeSettingView(),
|
page: () => VolumeSettingView(),
|
||||||
binding: VolumeSettingBinding(),
|
binding: VolumeSettingBinding(),
|
||||||
),
|
),
|
||||||
|
GetPage(
|
||||||
|
name: AppRoutes.accessControlManage,
|
||||||
|
page: () => AccessControlManageView(),
|
||||||
|
binding: AccessControlManageBinding(),
|
||||||
|
),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,4 +25,5 @@ class AppRoutes{
|
|||||||
static const String deviceBasisInfo = '/device/deviceBasisInfo';
|
static const String deviceBasisInfo = '/device/deviceBasisInfo';
|
||||||
static const String deviceSettingAutoCloseLock = '/device/deviceSetting/autoCloseLock';
|
static const String deviceSettingAutoCloseLock = '/device/deviceSetting/autoCloseLock';
|
||||||
static const String deviceSettingVolumeSetting = '/device/deviceSetting/volumeSetting';
|
static const String deviceSettingVolumeSetting = '/device/deviceSetting/volumeSetting';
|
||||||
|
static const String accessControlManage = '/home/accessControlManage';
|
||||||
}
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:starwork_flutter/views/accessControlManage/accessControl/access_control_controller.dart';
|
||||||
|
|
||||||
|
class AccessControlBinding extends Bindings {
|
||||||
|
@override
|
||||||
|
void dependencies() {
|
||||||
|
Get.lazyPut(() => AccessControlController());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:starwork_flutter/base/base_controller.dart';
|
||||||
|
|
||||||
|
class AccessControlController extends BaseController{
|
||||||
|
// 搜索输入框
|
||||||
|
TextEditingController searchInputController = TextEditingController();
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,182 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:starwork_flutter/common/constant/app_colors.dart';
|
||||||
|
import 'package:starwork_flutter/common/constant/app_images.dart';
|
||||||
|
import 'package:starwork_flutter/common/widgets/custome_app_bar_wdiget.dart';
|
||||||
|
import 'package:starwork_flutter/views/accessControlManage/accessControl/access_control_controller.dart';
|
||||||
|
|
||||||
|
class AccessControlView extends GetView<AccessControlController> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.scaffoldBackgroundColor,
|
||||||
|
appBar: CustomAppBarWidget(
|
||||||
|
title: '门禁控制'.tr,
|
||||||
|
showBackButton: false,
|
||||||
|
backgroundColor: AppColors.scaffoldBackgroundColor,
|
||||||
|
),
|
||||||
|
body: SafeArea(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 10.w,
|
||||||
|
vertical: 10.h,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
_buildSearchBar(),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.h,
|
||||||
|
),
|
||||||
|
_buildList(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_buildSearchBar() {
|
||||||
|
return TextField(
|
||||||
|
controller: controller.searchInputController,
|
||||||
|
textInputAction: TextInputAction.search,
|
||||||
|
decoration: InputDecoration(
|
||||||
|
hintText: '输入门禁点名称搜索'.tr,
|
||||||
|
hintStyle: TextStyle(
|
||||||
|
fontSize: 14.sp,
|
||||||
|
color: const Color(0xFF999999),
|
||||||
|
),
|
||||||
|
prefixIcon: const Icon(
|
||||||
|
Icons.search,
|
||||||
|
color: Color(0xFF999999),
|
||||||
|
),
|
||||||
|
filled: true,
|
||||||
|
// 启用背景填充
|
||||||
|
fillColor: const Color(0xFFf0f0f0),
|
||||||
|
// 灰色背景(可调整色值)
|
||||||
|
border: InputBorder.none,
|
||||||
|
// 设置内边距
|
||||||
|
contentPadding: EdgeInsets.symmetric(horizontal: 6.w, vertical: 6.h),
|
||||||
|
focusedBorder: OutlineInputBorder(
|
||||||
|
borderSide: const BorderSide(
|
||||||
|
color: Colors.blue,
|
||||||
|
width: 1.5,
|
||||||
|
),
|
||||||
|
borderRadius: BorderRadius.circular(8.0.r),
|
||||||
|
),
|
||||||
|
enabledBorder: OutlineInputBorder(
|
||||||
|
borderSide: const BorderSide(color: Colors.transparent),
|
||||||
|
borderRadius: BorderRadius.circular(8.0.r),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_buildList() {
|
||||||
|
return GridView.builder(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 2,
|
||||||
|
childAspectRatio: 2.2,
|
||||||
|
mainAxisSpacing: 10.0.w,
|
||||||
|
crossAxisSpacing: 10.0.h,
|
||||||
|
),
|
||||||
|
itemCount: 5,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return _buildItem();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_buildItem() {
|
||||||
|
return Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8.0.r),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 10.w,
|
||||||
|
vertical: 10.h,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Image(
|
||||||
|
image: const AssetImage(AppImages.iconLockTypeDoorLock),
|
||||||
|
width: 20.w,
|
||||||
|
height: 20.w,
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
gaplessPlayback: true,
|
||||||
|
// 防止闪烁
|
||||||
|
filterQuality: FilterQuality.medium,
|
||||||
|
// 优化过滤质量
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
return Icon(
|
||||||
|
Icons.image_not_supported,
|
||||||
|
size: 26.sp,
|
||||||
|
color: Colors.grey,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.h,
|
||||||
|
),
|
||||||
|
Text('设备昵称')
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.all(
|
||||||
|
Radius.circular(20.r),
|
||||||
|
),
|
||||||
|
border: Border.all(
|
||||||
|
color: Colors.grey.shade200,
|
||||||
|
width: 3.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
padding: const EdgeInsets.all(5.0),
|
||||||
|
child: Icon(
|
||||||
|
Icons.key,
|
||||||
|
color: Colors.grey,
|
||||||
|
size: 18.sp,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Positioned(
|
||||||
|
top: 0,
|
||||||
|
right: 0,
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 6.w,
|
||||||
|
vertical: 2.h,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.green,
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topRight: Radius.circular(8.0.r),
|
||||||
|
bottomLeft: Radius.circular(8.0.r),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
'在线 '.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 8.sp,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:starwork_flutter/views/accessControlManage/accessControlManageHome/access_control_manage_home_controller.dart';
|
||||||
|
|
||||||
|
class AccessControlManageHomeBinding implements Bindings {
|
||||||
|
@override
|
||||||
|
void dependencies() {
|
||||||
|
Get.lazyPut(() => AccessControlManageHomeController());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,5 @@
|
|||||||
|
import 'package:starwork_flutter/base/base_controller.dart';
|
||||||
|
|
||||||
|
class AccessControlManageHomeController extends BaseController{
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,411 @@
|
|||||||
|
import 'package:flutter/cupertino.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:starwork_flutter/common/constant/app_colors.dart';
|
||||||
|
import 'package:starwork_flutter/common/constant/app_images.dart';
|
||||||
|
import 'package:starwork_flutter/common/widgets/custome_app_bar_wdiget.dart';
|
||||||
|
import 'package:starwork_flutter/routes/app_routes.dart';
|
||||||
|
import 'package:starwork_flutter/views/accessControlManage/accessControlManageHome/access_control_manage_home_controller.dart';
|
||||||
|
|
||||||
|
class AccessControlManageHomeView extends GetView<AccessControlManageHomeController> {
|
||||||
|
const AccessControlManageHomeView({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
// 每个分类对应的功能列表
|
||||||
|
final Map<String, List<Map<String, dynamic>>> functionData = {
|
||||||
|
'门禁管理': [
|
||||||
|
{'icon': AppImages.iconAccessManagement, 'title': '人员管理', 'route': AppRoutes.accessControlManage},
|
||||||
|
{'icon': AppImages.iconAccessAuthorization, 'title': '门禁授权', 'route': AppRoutes.accessControlManage},
|
||||||
|
{'icon': AppImages.iconTrafficRecord, 'title': '通行记录', 'route': AppRoutes.accessControlManage},
|
||||||
|
{'icon': AppImages.iconVisitorManagement, 'title': '消息订阅', 'route': AppRoutes.accessControlManage},
|
||||||
|
{'icon': AppImages.iconMyVisitor, 'title': '门自动常开', 'route': AppRoutes.accessControlManage},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
|
||||||
|
final List<Map<String, dynamic>> moreApplications = [
|
||||||
|
{'subtitle': '访客人员,临时通行', 'title': '访客', 'route': AppRoutes.accessControlManage},
|
||||||
|
{'subtitle': '广告、欢迎词发布到屏幕', 'title': '信息发布', 'route': AppRoutes.accessControlManage},
|
||||||
|
{'subtitle': '预约随需应变,灵活管理', 'title': '预约管理', 'route': AppRoutes.accessControlManage},
|
||||||
|
];
|
||||||
|
|
||||||
|
final currentFunctions = functionData['门禁管理'] ?? [];
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.scaffoldBackgroundColor,
|
||||||
|
body: SafeArea(
|
||||||
|
child: SingleChildScrollView(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 10.w,
|
||||||
|
vertical: 10.h,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 10.w,
|
||||||
|
),
|
||||||
|
width: 1.sw,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Transform(
|
||||||
|
transform: Matrix4.skewX(-0.1), // 👈 调整这个值来控制倾斜度
|
||||||
|
child: Text(
|
||||||
|
'门禁开局引导'.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 24.sp,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontFamily: 'PingFangSC',
|
||||||
|
// 注意:这里可以保留 italic,也可以去掉
|
||||||
|
// fontStyle: FontStyle.italic,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
onPressed: () {
|
||||||
|
controller.showFunctionNotOpen();
|
||||||
|
},
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 4.w,
|
||||||
|
vertical: 8.h,
|
||||||
|
), // 去除内边距
|
||||||
|
minimumSize: const Size(0, 0), // 去除最小尺寸
|
||||||
|
tapTargetSize: MaterialTapTargetSize.shrinkWrap,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'点击查看'.tr,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.sp,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
color: Colors.blue,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Icon(
|
||||||
|
Icons.arrow_forward,
|
||||||
|
size: 16.sp,
|
||||||
|
color: Colors.blue,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 10.w,
|
||||||
|
vertical: 10.h,
|
||||||
|
),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'1',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.sp,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.h,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'团队人员',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.sp,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'1',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.h,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'团队人员',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.sp,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'1',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.h,
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
'团队人员',
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 14.sp,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 10.w,
|
||||||
|
vertical: 10.h,
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
textBaseline: TextBaseline.alphabetic,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.circle,
|
||||||
|
size: 6.sp,
|
||||||
|
color: Colors.red,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 6.w,
|
||||||
|
),
|
||||||
|
const Text(
|
||||||
|
'您有1个人员、1条信息未同步到设备',
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Icon(
|
||||||
|
Icons.arrow_forward_ios_rounded,
|
||||||
|
size: 16.sp,
|
||||||
|
color: Colors.grey,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 10.w,
|
||||||
|
vertical: 10.h,
|
||||||
|
),
|
||||||
|
child: GridView.builder(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 4,
|
||||||
|
childAspectRatio: 1.4,
|
||||||
|
),
|
||||||
|
itemCount: currentFunctions.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final function = currentFunctions[index];
|
||||||
|
return _buildFunctionItem(
|
||||||
|
icon: function['icon'],
|
||||||
|
title: function['title'],
|
||||||
|
routePath: function['route'],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 10.w,
|
||||||
|
vertical: 10.h,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
'更多应用'.tr,
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
GridView.builder(
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
shrinkWrap: true,
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 2,
|
||||||
|
childAspectRatio: 2.8,
|
||||||
|
mainAxisSpacing: 10.0.w,
|
||||||
|
crossAxisSpacing: 10.0.h,
|
||||||
|
),
|
||||||
|
itemCount: moreApplications.length,
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
final function = moreApplications[index];
|
||||||
|
return _buildMoreApplicationsItem(
|
||||||
|
subtitle: function['subtitle'],
|
||||||
|
title: function['title'],
|
||||||
|
routePath: function['route'],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildFunctionItem({required dynamic icon, required String title, required String routePath}) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(routePath);
|
||||||
|
},
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
mainAxisSize: MainAxisSize.min, // 重要:让Column最小化
|
||||||
|
children: [
|
||||||
|
// 优化后的图片渲染
|
||||||
|
icon is String
|
||||||
|
? _buildOptimizedImage(icon)
|
||||||
|
: Icon(
|
||||||
|
icon,
|
||||||
|
size: 26.sp,
|
||||||
|
color: Colors.blue.shade600,
|
||||||
|
),
|
||||||
|
SizedBox(height: 4.h), // 减少间距
|
||||||
|
Flexible(
|
||||||
|
// 使用Flexible而不是Expanded
|
||||||
|
child: Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 10.sp, // 稍微减小字体
|
||||||
|
color: Colors.black87,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildOptimizedImage(String imagePath) {
|
||||||
|
return RepaintBoundary(
|
||||||
|
child: Image(
|
||||||
|
image: AssetImage(imagePath),
|
||||||
|
width: 26.w,
|
||||||
|
height: 26.w,
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
gaplessPlayback: true,
|
||||||
|
// 防止闪烁
|
||||||
|
filterQuality: FilterQuality.medium,
|
||||||
|
// 优化过滤质量
|
||||||
|
errorBuilder: (context, error, stackTrace) {
|
||||||
|
return Icon(
|
||||||
|
Icons.image_not_supported,
|
||||||
|
size: 26.sp,
|
||||||
|
color: Colors.grey,
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget _buildMoreApplicationsItem({
|
||||||
|
required subtitle,
|
||||||
|
required title,
|
||||||
|
required routePath,
|
||||||
|
}) {
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
Get.toNamed(routePath);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.grey[50],
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 10.w,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Text(
|
||||||
|
title,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 12.sp,
|
||||||
|
color: Colors.black87,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
|
Icon(
|
||||||
|
Icons.play_circle_outline_rounded,
|
||||||
|
size: 16.sp,
|
||||||
|
color: Colors.grey,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Text(
|
||||||
|
subtitle,
|
||||||
|
style: TextStyle(
|
||||||
|
fontSize: 10.sp,
|
||||||
|
color: Colors.grey,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
maxLines: 1,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,14 @@
|
|||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:starwork_flutter/base/base_controller.dart';
|
||||||
|
import 'package:starwork_flutter/views/accessControlManage/accessControl/access_control_controller.dart';
|
||||||
|
import 'package:starwork_flutter/views/accessControlManage/accessControlManageHome/access_control_manage_home_controller.dart';
|
||||||
|
import 'package:starwork_flutter/views/accessControlManage/access_control_manage_controller.dart';
|
||||||
|
|
||||||
|
class AccessControlManageBinding extends Bindings {
|
||||||
|
@override
|
||||||
|
void dependencies() {
|
||||||
|
Get.lazyPut(() => AccessControlManageController());
|
||||||
|
Get.lazyPut(() => AccessControlManageHomeController());
|
||||||
|
Get.lazyPut(() => AccessControlController());
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,24 @@
|
|||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:starwork_flutter/base/base_controller.dart';
|
||||||
|
import 'package:starwork_flutter/views/accessControlManage/accessControl/access_control_view.dart';
|
||||||
|
import 'package:starwork_flutter/views/accessControlManage/accessControlManageHome/access_control_manage_home_view.dart';
|
||||||
|
import 'package:starwork_flutter/views/home/home_view.dart';
|
||||||
|
import 'package:starwork_flutter/views/messages/messages_view.dart';
|
||||||
|
import 'package:starwork_flutter/views/mine/mine_view.dart';
|
||||||
|
|
||||||
|
class AccessControlManageController extends BaseController {
|
||||||
|
// 当前选中的索引
|
||||||
|
var currentIndex = 0.obs;
|
||||||
|
|
||||||
|
// 页面列表
|
||||||
|
final pages = [
|
||||||
|
AccessControlManageHomeView(),
|
||||||
|
AccessControlView(),
|
||||||
|
];
|
||||||
|
|
||||||
|
// 更新索引
|
||||||
|
void changeIndex(int index) {
|
||||||
|
currentIndex.value = index;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter/src/widgets/framework.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:starwork_flutter/common/constant/app_colors.dart';
|
||||||
|
import 'package:starwork_flutter/common/constant/app_images.dart';
|
||||||
|
import 'package:starwork_flutter/common/widgets/custome_app_bar_wdiget.dart';
|
||||||
|
import 'package:starwork_flutter/views/accessControlManage/access_control_manage_controller.dart';
|
||||||
|
import 'package:starwork_flutter/views/main/widget/main_left_drawer_widget.dart';
|
||||||
|
|
||||||
|
class AccessControlManageView extends GetView<AccessControlManageController> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
|
||||||
|
// 使用 Obx 响应 currentIndex 的变化
|
||||||
|
body: Obx(
|
||||||
|
() => IndexedStack(
|
||||||
|
index: controller.currentIndex.value,
|
||||||
|
children: controller.pages,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
bottomNavigationBar: Obx(
|
||||||
|
() => BottomNavigationBar(
|
||||||
|
currentIndex: controller.currentIndex.value,
|
||||||
|
onTap: (index) => controller.changeIndex(index),
|
||||||
|
items: bottomNavItems,
|
||||||
|
type: BottomNavigationBarType.fixed,
|
||||||
|
// 多于3个时建议 fixed
|
||||||
|
selectedFontSize: 12.sp,
|
||||||
|
unselectedFontSize: 12.sp,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 定义底部导航的标题和图标
|
||||||
|
List<BottomNavigationBarItem> get bottomNavItems => [
|
||||||
|
BottomNavigationBarItem(
|
||||||
|
icon: _buildTabIcon(AppImages.iconHome, AppImages.iconHomeSelected, 0),
|
||||||
|
label: '首页',
|
||||||
|
),
|
||||||
|
BottomNavigationBarItem(
|
||||||
|
icon: _buildTabIcon(AppImages.iconAccessControl, AppImages.iconAccessControlSelected, 1),
|
||||||
|
label: '门禁控制',
|
||||||
|
),
|
||||||
|
];
|
||||||
|
|
||||||
|
// 构建自定义图标组件
|
||||||
|
Widget _buildTabIcon(String unselectedIcon, String selectedIcon, int index) {
|
||||||
|
return Obx(
|
||||||
|
() => Image.asset(
|
||||||
|
controller.currentIndex.value == index ? selectedIcon : unselectedIcon,
|
||||||
|
width: 24.w,
|
||||||
|
height: 24.w,
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -24,6 +24,7 @@ class DeviceManageView extends GetView<DeviceManageController> {
|
|||||||
backgroundColor: AppColors.scaffoldBackgroundColor,
|
backgroundColor: AppColors.scaffoldBackgroundColor,
|
||||||
appBar: CustomAppBarWidget(
|
appBar: CustomAppBarWidget(
|
||||||
title: '设备管理'.tr,
|
title: '设备管理'.tr,
|
||||||
|
showBackButton: false,
|
||||||
),
|
),
|
||||||
body: SafeArea(
|
body: SafeArea(
|
||||||
child: Padding(
|
child: Padding(
|
||||||
|
|||||||
@ -3,6 +3,7 @@ import 'package:get/get_rx/get_rx.dart';
|
|||||||
import 'package:starcloud/entity/star_cloud_lock_list.dart';
|
import 'package:starcloud/entity/star_cloud_lock_list.dart';
|
||||||
import 'package:starcloud/net/entity/api_response.dart';
|
import 'package:starcloud/net/entity/api_response.dart';
|
||||||
import 'package:starcloud/sdk/entity/entity_sender/enable_lock_settings.dart';
|
import 'package:starcloud/sdk/entity/entity_sender/enable_lock_settings.dart';
|
||||||
|
import 'package:starcloud/sdk/sdk_lock_operate_extension.dart';
|
||||||
|
|
||||||
import 'package:starcloud/sdk/sdk_lock_setting_operate_extension.dart';
|
import 'package:starcloud/sdk/sdk_lock_setting_operate_extension.dart';
|
||||||
import 'package:starcloud/sdk/starcloud.dart';
|
import 'package:starcloud/sdk/starcloud.dart';
|
||||||
@ -12,6 +13,7 @@ import 'package:starwork_flutter/common/constant/app_view_parameter_keys.dart';
|
|||||||
import 'package:starwork_flutter/common/constant/lock_function_number.dart';
|
import 'package:starwork_flutter/common/constant/lock_function_number.dart';
|
||||||
import 'package:starwork_flutter/common/events/refresh_device_list_event.dart';
|
import 'package:starwork_flutter/common/events/refresh_device_list_event.dart';
|
||||||
import 'package:starwork_flutter/common/utils/event_bus_util.dart';
|
import 'package:starwork_flutter/common/utils/event_bus_util.dart';
|
||||||
|
import 'package:starwork_flutter/views/main/main_controller.dart';
|
||||||
|
|
||||||
class DeviceSettingController extends BaseController {
|
class DeviceSettingController extends BaseController {
|
||||||
// 锁信息
|
// 锁信息
|
||||||
@ -24,6 +26,8 @@ class DeviceSettingController extends BaseController {
|
|||||||
final lockFeatureMap = <String, dynamic>{}.obs;
|
final lockFeatureMap = <String, dynamic>{}.obs;
|
||||||
final lockSettingMap = <String, dynamic>{}.obs;
|
final lockSettingMap = <String, dynamic>{}.obs;
|
||||||
|
|
||||||
|
final mainController = Get.find<MainController>();
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
super.onReady();
|
super.onReady();
|
||||||
@ -99,4 +103,29 @@ class DeviceSettingController extends BaseController {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void removeDevice() async {
|
||||||
|
showLoading();
|
||||||
|
var teamInfo = mainController.selectedTeam.value;
|
||||||
|
var teamCloudInfo = teamInfo.teamCloudInfo;
|
||||||
|
|
||||||
|
if (teamCloudInfo == null) {
|
||||||
|
showToast('没找到对应的星云账户信息');
|
||||||
|
hideLoading();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await StarCloudSDK.instance.resetLock(
|
||||||
|
lockId: lockInfo?.lockId ?? 0,
|
||||||
|
cloudUid: teamCloudInfo.uid,
|
||||||
|
onSuccess: () {
|
||||||
|
showSuccess();
|
||||||
|
EventBusUtil().instance.fire(RefreshDeviceListEvent());
|
||||||
|
Get.back();
|
||||||
|
},
|
||||||
|
onError: (err) {
|
||||||
|
hideLoading();
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -195,7 +195,9 @@ class DeviceSettingView extends GetView<DeviceSettingController> {
|
|||||||
SizedBox(
|
SizedBox(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: ElevatedButton(
|
child: ElevatedButton(
|
||||||
onPressed: () {}.debounce(),
|
onPressed: () {
|
||||||
|
controller.removeDevice();
|
||||||
|
}.debounce(),
|
||||||
style: ElevatedButton.styleFrom(
|
style: ElevatedButton.styleFrom(
|
||||||
backgroundColor: Colors.red,
|
backgroundColor: Colors.red,
|
||||||
padding: EdgeInsets.symmetric(vertical: 12.h),
|
padding: EdgeInsets.symmetric(vertical: 12.h),
|
||||||
|
|||||||
@ -2,18 +2,18 @@ import 'package:flutter/cupertino.dart';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/widgets.dart';
|
import 'package:flutter/widgets.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:starwork_flutter/common/constant/app_images.dart';
|
import 'package:starwork_flutter/common/constant/app_images.dart';
|
||||||
|
import 'package:starwork_flutter/routes/app_routes.dart';
|
||||||
|
|
||||||
class HomeFunctionListAreaWidget extends StatefulWidget {
|
class HomeFunctionListAreaWidget extends StatefulWidget {
|
||||||
HomeFunctionListAreaWidget({super.key});
|
HomeFunctionListAreaWidget({super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<HomeFunctionListAreaWidget> createState() =>
|
State<HomeFunctionListAreaWidget> createState() => _HomeFunctionListAreaWidgetState();
|
||||||
_HomeFunctionListAreaWidgetState();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class _HomeFunctionListAreaWidgetState extends State<HomeFunctionListAreaWidget>
|
class _HomeFunctionListAreaWidgetState extends State<HomeFunctionListAreaWidget> with SingleTickerProviderStateMixin {
|
||||||
with SingleTickerProviderStateMixin {
|
|
||||||
late TabController _tabController;
|
late TabController _tabController;
|
||||||
|
|
||||||
// 图片缓存Map
|
// 图片缓存Map
|
||||||
@ -162,7 +162,7 @@ class _HomeFunctionListAreaWidgetState extends State<HomeFunctionListAreaWidget>
|
|||||||
print('菜单被点击');
|
print('菜单被点击');
|
||||||
},
|
},
|
||||||
child: Image(
|
child: Image(
|
||||||
image: AssetImage(AppImages.iconTableMenu),
|
image: AssetImage(AppImages.iconTableMenu),
|
||||||
width: 20.w,
|
width: 20.w,
|
||||||
height: 20.w,
|
height: 20.w,
|
||||||
fit: BoxFit.contain,
|
fit: BoxFit.contain,
|
||||||
@ -197,64 +197,64 @@ class _HomeFunctionListAreaWidgetState extends State<HomeFunctionListAreaWidget>
|
|||||||
// 每个分类对应的功能列表
|
// 每个分类对应的功能列表
|
||||||
final Map<String, List<Map<String, dynamic>>> functionData = {
|
final Map<String, List<Map<String, dynamic>>> functionData = {
|
||||||
'人员通行': [
|
'人员通行': [
|
||||||
{'icon': AppImages.iconAccessManagement, 'title': '门禁管理'},
|
{'icon': AppImages.iconAccessManagement, 'title': '门禁管理', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconAccessAuthorization, 'title': '门禁授权'},
|
{'icon': AppImages.iconAccessAuthorization, 'title': '门禁授权', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconOneClickOpenDoor, 'title': '一键开门'},
|
{'icon': AppImages.iconOneClickOpenDoor, 'title': '一键开门', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconPasswordOpenDoor, 'title': '密码开门'},
|
{'icon': AppImages.iconPasswordOpenDoor, 'title': '密码开门', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconTrafficRecord, 'title': '通行记录'},
|
{'icon': AppImages.iconTrafficRecord, 'title': '通行记录', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconVisitorManagement, 'title': '访客管理'},
|
{'icon': AppImages.iconVisitorManagement, 'title': '访客管理', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconMyVisitor, 'title': '我的访客'},
|
{'icon': AppImages.iconMyVisitor, 'title': '我的访客', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconVisitorInvitation, 'title': '访客邀约'},
|
{'icon': AppImages.iconVisitorInvitation, 'title': '访客邀约', 'route': AppRoutes.accessControlManage},
|
||||||
],
|
],
|
||||||
'考勤': [
|
'考勤': [
|
||||||
{'icon': AppImages.iconAttendanceSetting, 'title': '考勤设置'},
|
{'icon': AppImages.iconAttendanceSetting, 'title': '考勤设置', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconAttendanceStatistics, 'title': '考勤统计'},
|
{'icon': AppImages.iconAttendanceStatistics, 'title': '考勤统计', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconMyAttendance, 'title': '我的考勤'},
|
{'icon': AppImages.iconMyAttendance, 'title': '我的考勤', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconMobileCheckin, 'title': '手机打卡'},
|
{'icon': AppImages.iconMobileCheckin, 'title': '手机打卡', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconLeaveRequest, 'title': '请假'},
|
{'icon': AppImages.iconLeaveRequest, 'title': '请假', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconMakeUpCard, 'title': '补卡'},
|
{'icon': AppImages.iconMakeUpCard, 'title': '补卡', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconBusinessTrip, 'title': '出差'},
|
{'icon': AppImages.iconBusinessTrip, 'title': '出差', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconGoOut, 'title': '外出'},
|
{'icon': AppImages.iconGoOut, 'title': '外出', 'route': AppRoutes.accessControlManage},
|
||||||
],
|
],
|
||||||
'审批': [
|
'审批': [
|
||||||
{'icon': AppImages.iconInitiateApproval, 'title': '发起审批'},
|
{'icon': AppImages.iconInitiateApproval, 'title': '发起审批', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconApprovalRecord, 'title': '审批记录'},
|
{'icon': AppImages.iconApprovalRecord, 'title': '审批记录', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.pending, 'title': '审批中'},
|
{'icon': Icons.pending, 'title': '审批中', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.history, 'title': '审批历史'},
|
{'icon': Icons.history, 'title': '审批历史', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.rule, 'title': '审批规则'},
|
{'icon': Icons.rule, 'title': '审批规则', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.group, 'title': '审批流程'},
|
{'icon': Icons.group, 'title': '审批流程', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.notifications, 'title': '审批提醒'},
|
{'icon': Icons.notifications, 'title': '审批提醒', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.analytics, 'title': '审批统计'},
|
{'icon': Icons.analytics, 'title': '审批统计', 'route': AppRoutes.accessControlManage},
|
||||||
],
|
],
|
||||||
'可视对讲': [
|
'可视对讲': [
|
||||||
{'icon': AppImages.iconIntercomDevice, 'title': '对讲设备'},
|
{'icon': AppImages.iconIntercomDevice, 'title': '对讲设备', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconCallRelationship, 'title': '呼叫关系'},
|
{'icon': AppImages.iconCallRelationship, 'title': '呼叫关系', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconCallReminder, 'title': '呼叫提醒'},
|
{'icon': AppImages.iconCallReminder, 'title': '呼叫提醒', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.video_call, 'title': '视频通话'},
|
{'icon': Icons.video_call, 'title': '视频通话', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.volume_up, 'title': '广播通知'},
|
{'icon': Icons.volume_up, 'title': '广播通知', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.settings_phone, 'title': '设备设置'},
|
{'icon': Icons.settings_phone, 'title': '设备设置', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.group_add, 'title': '群组管理'},
|
{'icon': Icons.group_add, 'title': '群组管理', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.emergency, 'title': '紧急呼叫'},
|
{'icon': Icons.emergency, 'title': '紧急呼叫', 'route': AppRoutes.accessControlManage},
|
||||||
],
|
],
|
||||||
'信息发布': [
|
'信息发布': [
|
||||||
{'icon': AppImages.iconBroadcast, 'title': '广播'},
|
{'icon': AppImages.iconBroadcast, 'title': '广播', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconAnnouncement, 'title': '公告'},
|
{'icon': AppImages.iconAnnouncement, 'title': '公告', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconInfoPublish, 'title': '信息发布'},
|
{'icon': AppImages.iconInfoPublish, 'title': '信息发布', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.schedule_send, 'title': '定时发布'},
|
{'icon': Icons.schedule_send, 'title': '定时发布', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.group, 'title': '目标群体'},
|
{'icon': Icons.group, 'title': '目标群体', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.analytics, 'title': '发布统计'},
|
{'icon': Icons.analytics, 'title': '发布统计', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.edit, 'title': '编辑模板'},
|
{'icon': Icons.edit, 'title': '编辑模板', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': Icons.history, 'title': '发布历史'},
|
{'icon': Icons.history, 'title': '发布历史', 'route': AppRoutes.accessControlManage},
|
||||||
],
|
],
|
||||||
'其他应用': [
|
'其他应用': [
|
||||||
{'icon': AppImages.iconPersonnelManagement, 'title': '人员管理'},
|
{'icon': AppImages.iconPersonnelManagement, 'title': '人员管理', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconTeamQrcode, 'title': '团队二维码'},
|
{'icon': AppImages.iconTeamQrcode, 'title': '团队二维码', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconDeviceManagement, 'title': '设备管理'},
|
{'icon': AppImages.iconDeviceManagement, 'title': '设备管理', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconVideoCenter, 'title': '视频中心'},
|
{'icon': AppImages.iconVideoCenter, 'title': '视频中心', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconIntelligentInspection, 'title': '智能巡检'},
|
{'icon': AppImages.iconIntelligentInspection, 'title': '智能巡检', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconVideoSearch, 'title': '录像智搜'},
|
{'icon': AppImages.iconVideoSearch, 'title': '录像智搜', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconIntelligentAnalysis, 'title': '智能分析'},
|
{'icon': AppImages.iconIntelligentAnalysis, 'title': '智能分析', 'route': AppRoutes.accessControlManage},
|
||||||
{'icon': AppImages.iconPersonCapture, 'title': '人员抓拍'},
|
{'icon': AppImages.iconPersonCapture, 'title': '人员抓拍', 'route': AppRoutes.accessControlManage},
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -267,7 +267,7 @@ class _HomeFunctionListAreaWidgetState extends State<HomeFunctionListAreaWidget>
|
|||||||
return GridView.builder(
|
return GridView.builder(
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
shrinkWrap: true,
|
shrinkWrap: true,
|
||||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
crossAxisCount: 4,
|
crossAxisCount: 4,
|
||||||
childAspectRatio: 1.4,
|
childAspectRatio: 1.4,
|
||||||
),
|
),
|
||||||
@ -277,6 +277,7 @@ class _HomeFunctionListAreaWidgetState extends State<HomeFunctionListAreaWidget>
|
|||||||
return _buildFunctionItem(
|
return _buildFunctionItem(
|
||||||
icon: function['icon'],
|
icon: function['icon'],
|
||||||
title: function['title'],
|
title: function['title'],
|
||||||
|
routePath: function['route'],
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
@ -285,11 +286,10 @@ class _HomeFunctionListAreaWidgetState extends State<HomeFunctionListAreaWidget>
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildFunctionItem({required dynamic icon, required String title}) {
|
Widget _buildFunctionItem({required dynamic icon, required String title, required String routePath}) {
|
||||||
return GestureDetector(
|
return GestureDetector(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
print('点击了: $title');
|
Get.toNamed(routePath);
|
||||||
// 处理功能项点击事件
|
|
||||||
},
|
},
|
||||||
child: Column(
|
child: Column(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
|||||||
@ -216,6 +216,7 @@ class MainController extends BaseController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void _requestTeamDeviceList() async {
|
void _requestTeamDeviceList() async {
|
||||||
|
if (selectedTeam.value.teamCloudInfo == null) return;
|
||||||
showLoading();
|
showLoading();
|
||||||
await StarCloudSDK.instance.getDeviceList(
|
await StarCloudSDK.instance.getDeviceList(
|
||||||
pageNo: 1,
|
pageNo: 1,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user