37 lines
1.2 KiB
Dart
37 lines
1.2 KiB
Dart
|
|
import 'package:get/get.dart';
|
|
|
|
import '../../../../network/api_repository.dart';
|
|
import '../../../../tools/baseGetXController.dart';
|
|
import '../../../../tools/eventBusEventManage.dart';
|
|
import '../../../../tools/toast.dart';
|
|
import 'groupEditLock_state.dart';
|
|
|
|
class GroupEditLockLogic extends BaseGetXController {
|
|
final GroupEditLockState state = GroupEditLockState();
|
|
|
|
//锁分组里面添加锁
|
|
Future<void> lockGroupAddLock(List lockId) async {
|
|
var entity = await ApiRepository.to.lockGroupAddLock(
|
|
lockIds: lockId,
|
|
groupId: state.seletGroupListItem.keyGroupId!);
|
|
if (entity.errorCode!.codeIsSuccessful) {
|
|
Toast.show(msg: "添加成功");
|
|
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
|
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
|
Get.close(2);
|
|
}
|
|
}
|
|
|
|
//锁分组里面添加锁
|
|
Future<void> lockGroupDeletLock(List lockId) async {
|
|
var entity = await ApiRepository.to.lockGroupDeletLock(lockIds: lockId);
|
|
if (entity.errorCode!.codeIsSuccessful) {
|
|
Toast.show(msg: "删除成功");
|
|
eventBus.fire(LockGroupEditGroupLockRefreshEvent());
|
|
eventBus.fire(RefreshLockListInfoDataEvent());
|
|
Get.close(2);
|
|
}
|
|
}
|
|
|
|
} |