fix:调整人脸列表加载逻辑
This commit is contained in:
parent
3552d15429
commit
99813877b6
@ -22,6 +22,7 @@ class FaceListLogic extends BaseGetXController {
|
||||
|
||||
// 获取解析后的数据
|
||||
late StreamSubscription<Reply> _replySubscription;
|
||||
|
||||
void _initReplySubscription() {
|
||||
_replySubscription =
|
||||
EventBusManager().eventBus!.on<Reply>().listen((Reply reply) {
|
||||
@ -77,11 +78,15 @@ class FaceListLogic extends BaseGetXController {
|
||||
userID: (await Storage.getUid())!,
|
||||
faceNo: state.deletFaceNo,
|
||||
useCountLimit: 0xffff,
|
||||
operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
operate: state.isDeletAll == true ? 3 : 2,
|
||||
// 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin: 0,
|
||||
isForce: 0, // 是否是胁迫
|
||||
isRound: 0, // 是否是循环
|
||||
weekRound: 0, // 周循环
|
||||
isForce: 0,
|
||||
// 是否是胁迫
|
||||
isRound: 0,
|
||||
// 是否是循环
|
||||
weekRound: 0,
|
||||
// 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime: '0',
|
||||
@ -277,11 +282,15 @@ class FaceListLogic extends BaseGetXController {
|
||||
userID: (await Storage.getUid())!,
|
||||
faceNo: state.deletFaceNo,
|
||||
useCountLimit: 0xffff,
|
||||
operate: state.isDeletAll == true ? 3 : 2, // 0:注册 1:修改 2:删除 3:删除全部
|
||||
operate: state.isDeletAll == true ? 3 : 2,
|
||||
// 0:注册 1:修改 2:删除 3:删除全部
|
||||
isAdmin: 0,
|
||||
isForce: 0, // 是否是胁迫
|
||||
isRound: 0, // 是否是循环
|
||||
weekRound: 0, // 周循环
|
||||
isForce: 0,
|
||||
// 是否是胁迫
|
||||
isRound: 0,
|
||||
// 是否是循环
|
||||
weekRound: 0,
|
||||
// 周循环
|
||||
startDate: 0x11223344,
|
||||
endDate: 0x11223344,
|
||||
startTime: '0',
|
||||
@ -348,8 +357,8 @@ class FaceListLogic extends BaseGetXController {
|
||||
lockId: state.lockId.value,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('删除成功'.tr, something: () {
|
||||
getFaceListData(isRefresh: true);
|
||||
showToast('删除成功'.tr, something: () async {
|
||||
await getFaceListData(isRefresh: true);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -366,8 +375,8 @@ class FaceListLogic extends BaseGetXController {
|
||||
lockId: state.lockId.value,
|
||||
);
|
||||
if (entity.errorCode!.codeIsSuccessful) {
|
||||
showToast('重置成功'.tr, something: () {
|
||||
getFaceListData(isRefresh: true);
|
||||
showToast('重置成功'.tr, something: () async{
|
||||
await getFaceListData(isRefresh: true);
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -403,11 +412,12 @@ class FaceListLogic extends BaseGetXController {
|
||||
|
||||
// 监听修改完详情之后刷新列表
|
||||
late StreamSubscription _teamEvent;
|
||||
|
||||
void _initRefreshAction() {
|
||||
_teamEvent = eventBus
|
||||
.on<OtherTypeRefreshListEvent>()
|
||||
.listen((OtherTypeRefreshListEvent event) {
|
||||
getFaceListData(isRefresh: true);
|
||||
.listen((OtherTypeRefreshListEvent event) async {
|
||||
await getFaceListData(isRefresh: true);
|
||||
});
|
||||
}
|
||||
|
||||
@ -434,6 +444,7 @@ class FaceListLogic extends BaseGetXController {
|
||||
|
||||
// senderCheckingUserInfoCount();
|
||||
}
|
||||
getFaceListData(isRefresh: true);
|
||||
}
|
||||
|
||||
@override
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_easyloading/flutter_easyloading.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
@ -31,24 +30,6 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
||||
final FaceListLogic logic = Get.put(FaceListLogic());
|
||||
final FaceListState state = Get.find<FaceListLogic>().state;
|
||||
|
||||
Future<void> getHttpData({required bool isRefresh}) async {
|
||||
final bool? isDemoMode = await Storage.getBool(ifIsDemoModeOrNot);
|
||||
if (isDemoMode == false) {
|
||||
logic.getFaceListData(isRefresh: isRefresh).then((FingerprintListDataEntity value) {
|
||||
if (mounted) {
|
||||
setState(() {});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
|
||||
getHttpData(isRefresh: true);
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
@ -92,17 +73,17 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
||||
),
|
||||
body: EasyRefreshTool(
|
||||
onRefresh: () {
|
||||
getHttpData(isRefresh: true);
|
||||
logic.getFaceListData(isRefresh: true);
|
||||
},
|
||||
onLoad: () {
|
||||
getHttpData(isRefresh: false);
|
||||
logic.getFaceListData(isRefresh: false);
|
||||
},
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
KeySearchWidget(
|
||||
editingController: state.searchController,
|
||||
onSubmittedAction: () {
|
||||
getHttpData(isRefresh: true);
|
||||
logic.getFaceListData(isRefresh: true);
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
@ -110,14 +91,15 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
||||
),
|
||||
Expanded(child: _buildMainUI()),
|
||||
AddBottomWhiteBtn(
|
||||
btnName:
|
||||
'添加人脸'.tr,
|
||||
btnName: '添加人脸'.tr,
|
||||
onClick: () async {
|
||||
await Get.toNamed(Routers.addFaceTypePage, arguments: <String, int>{
|
||||
await Get.toNamed(Routers.addFaceTypePage,
|
||||
arguments: <String, int>{
|
||||
'lockId': state.lockId.value,
|
||||
'fromType': 1 // 1从添加钥匙列表进入 2从考勤添加员工入口进入
|
||||
})!.then((value) {
|
||||
getHttpData(isRefresh: true);
|
||||
})!
|
||||
.then((value) {
|
||||
logic.getFaceListData(isRefresh: true);
|
||||
});
|
||||
},
|
||||
),
|
||||
@ -154,9 +136,11 @@ class _FaceListPageState extends State<FaceListPage> with RouteAware {
|
||||
logic.getKeyType(getFaceItemData),
|
||||
logic.getKeyDateType(getFaceItemData), () async {
|
||||
await Get.toNamed(Routers.faceDetailPage,
|
||||
arguments: <String, FingerprintItemData>{
|
||||
arguments: <String, FingerprintItemData>{
|
||||
'faceItemData': getFaceItemData,
|
||||
})!.then((value) => getHttpData(isRefresh: true));
|
||||
})!
|
||||
.then((value) =>
|
||||
logic.getFaceListData(isRefresh: true));
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user