import 'package:flutter/material.dart'; import 'package:get/get.dart'; import '../../../../lockMian/entity/lockListInfo_entity.dart'; import '../checkingInSetStaffList/checkingInStaffList_entity.dart'; import 'checkingInAddStaffSelectKey_entity.dart'; class CheckingInAddStaffState { final getKeyInfosData = LockListInfoItemEntity().obs; final companyId = "".obs; final staffListItemData = CheckingInAddStaffListItemEntity().obs; final TextEditingController staffNameController = TextEditingController(); final TextEditingController staffAccountController = TextEditingController(); final selectPrintingMethodType = "1".obs; // 选择打卡类型 1APP 2密码 3卡 4指纹 5人脸 final selectPrintingMethodStr = "APP".obs; // 选择打卡类型字符串 final countryName = "中国".tr.obs; final countryCode = "86".obs; final appUnHaveAccount = true.obs; // 默认没有账号 final keyEntity = [].obs; // 选择钥匙数据 final isAdd = "1".obs; // 1添加 2编辑 final attendanceWayNumber = "".obs; final isCanClick = false.obs; var staffName = ''.obs; var staffAccount = ''.obs; bool get staffNameIsNotEmpty => staffName.value.isNotEmpty; bool get staffAccountIsNotEmpty => staffAccount.value.isNotEmpty; bool get attendanceWayNumberIsNotEmpty => attendanceWayNumber.value.isNotEmpty; CheckingInAddStaffState() { Map map = Get.arguments; getKeyInfosData.value = map["getKeyInfosData"]; companyId.value = map["companyId"]; isAdd.value = map["isAdd"]; if (isAdd.value == "2") { staffListItemData.value = map["staffListItem"]; staffNameController.text = staffListItemData.value.staffName!; selectPrintingMethodType.value = staffListItemData.value.attendanceType.toString(); switch (staffListItemData.value.attendanceType) { case 1: selectPrintingMethodStr.value = "APP"; break; case 2: selectPrintingMethodStr.value = "密码".tr; break; case 3: selectPrintingMethodStr.value = "卡".tr; break; case 4: selectPrintingMethodStr.value = "指纹".tr; break; } if (staffListItemData.value.attendanceWay!.isNotEmpty) { appUnHaveAccount.value = false; attendanceWayNumber.value = staffListItemData.value.attendanceWay!; } else { appUnHaveAccount.value = true; } } } }