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

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,7 +38,11 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
actionsList: [ actionsList: [
TextButton( Visibility(
visible: CommonDataManage().currentKeyInfo.isLockOwner == 1
? true
: false,
child: TextButton(
onPressed: () { onPressed: () {
ShowCupertinoAlertView().showClearOperationRecordAlert( ShowCupertinoAlertView().showClearOperationRecordAlert(
clearClick: () { clearClick: () {
@ -47,7 +52,7 @@ class _DoorLockLogPageState extends State<DoorLockLogPage> with RouteAware {
child: Text( child: Text(
'清空记录'.tr, '清空记录'.tr,
style: TextStyle(color: Colors.white, fontSize: 24.sp), style: TextStyle(color: Colors.white, fontSize: 24.sp),
)), ))),
], ],
), ),
body: Column( body: Column(