操作记录新增清空记录权限(仅锁的拥有者可清空)

This commit is contained in:
Daisy 2024-05-16 16:45:00 +08:00
parent de060cdae8
commit df3e763fd3
2 changed files with 18 additions and 13 deletions

View File

@ -63,7 +63,7 @@ class DoorLockLogLogic extends BaseGetXController {
var passwordData = indexList.sublist(7, 17); var passwordData = indexList.sublist(7, 17);
var password = utf8String(passwordData); var password = utf8String(passwordData);
indexMap["user"] = password.toString(); indexMap["user"] = password.toString();
int userNo = (indexList[1]*256) + indexList[2]; int userNo = (indexList[1] * 256) + indexList[2];
indexMap["user"] = userNo.toString(); indexMap["user"] = userNo.toString();
} }
@ -143,7 +143,7 @@ class DoorLockLogLogic extends BaseGetXController {
DoorLockLogEntity entity = await ApiRepository.to.lockEventList( DoorLockLogEntity entity = await ApiRepository.to.lockEventList(
lockId: state.keyInfos.value.lockId!, lockId: state.keyInfos.value.lockId!,
lockEventType: state.dropdownValue.value, lockEventType: state.dropdownValue.value,
pageNo: pageNo, // pageNo: pageNo,
pageSize: int.parse(pageSize), pageSize: int.parse(pageSize),
startDate: state.startDate.value, startDate: state.startDate.value,
endDate: state.endDate.value); endDate: state.endDate.value);

View File

@ -7,6 +7,7 @@ import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_entity.dart';
import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_logic.dart'; import 'package:star_lock/main/lockDetail/doorLockLog/doorLockLog_logic.dart';
import 'package:star_lock/tools/EasyRefreshTool.dart'; import 'package:star_lock/tools/EasyRefreshTool.dart';
import 'package:star_lock/tools/advancedCalendar/src/widget.dart'; import 'package:star_lock/tools/advancedCalendar/src/widget.dart';
import 'package:star_lock/tools/commonDataManage.dart';
import 'package:star_lock/tools/menuItem/xsDropDownWidget.dart'; import 'package:star_lock/tools/menuItem/xsDropDownWidget.dart';
import 'package:star_lock/tools/noData.dart'; import 'package:star_lock/tools/noData.dart';
import 'package:star_lock/tools/showCupertinoAlertView.dart'; import 'package:star_lock/tools/showCupertinoAlertView.dart';
@ -37,17 +38,21 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
actionsList: [ actionsList: [
TextButton( Visibility(
onPressed: () { visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
ShowCupertinoAlertView().showClearOperationRecordAlert( ? true
clearClick: () { : false,
logic.clearOperationRecordRequest(); child: TextButton(
}); onPressed: () {
}, ShowCupertinoAlertView().showClearOperationRecordAlert(
child: Text( clearClick: () {
'清空记录'.tr, logic.clearOperationRecordRequest();
style: TextStyle(color: Colors.white, fontSize: 24.sp), });
)), },
child: Text(
'清空记录'.tr,
style: TextStyle(color: Colors.white, fontSize: 24.sp),
))),
], ],
), ),
body: Column( body: Column(