调试指纹、卡模块接口
This commit is contained in:
parent
d680902ae0
commit
a074e7acb2
@ -404,5 +404,6 @@
|
|||||||
"wifiPwd":"WiFi password",
|
"wifiPwd":"WiFi password",
|
||||||
"pleaseEnterWifiPwd":"Please Enter WiFi Password",
|
"pleaseEnterWifiPwd":"Please Enter WiFi Password",
|
||||||
"edit":"Edit",
|
"edit":"Edit",
|
||||||
"stressFingerprint":"Stress Fingerprint"
|
"stressFingerprint":"Stress Fingerprint",
|
||||||
|
"effectiveDay":"Effective Day"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -404,6 +404,6 @@
|
|||||||
"wifiPwd":"wifiPwd",
|
"wifiPwd":"wifiPwd",
|
||||||
"pleaseEnterWifiPwd":"pleaseEnterWifiPwd",
|
"pleaseEnterWifiPwd":"pleaseEnterWifiPwd",
|
||||||
"edit":"edit",
|
"edit":"edit",
|
||||||
"stressFingerprint":"stressFingerprint"
|
"stressFingerprint":"stressFingerprint",
|
||||||
|
"effectiveDay":"effectiveDay"
|
||||||
}
|
}
|
||||||
@ -407,5 +407,6 @@
|
|||||||
"wifiPwd":"WiFi名字",
|
"wifiPwd":"WiFi名字",
|
||||||
"pleaseEnterWifiPwd":"请输入WiFi密码",
|
"pleaseEnterWifiPwd":"请输入WiFi密码",
|
||||||
"edit":"编辑",
|
"edit":"编辑",
|
||||||
"stressFingerprint":"胁迫指纹"
|
"stressFingerprint":"胁迫指纹",
|
||||||
|
"effectiveDay":"有效日"
|
||||||
}
|
}
|
||||||
@ -40,7 +40,7 @@
|
|||||||
</Testables>
|
</Testables>
|
||||||
</TestAction>
|
</TestAction>
|
||||||
<LaunchAction
|
<LaunchAction
|
||||||
buildConfiguration = "Release"
|
buildConfiguration = "Debug"
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||||
launchStyle = "0"
|
launchStyle = "0"
|
||||||
|
|||||||
@ -69,6 +69,8 @@ import 'main/lockDetail/lcokSet/wirelessKeyboard/seletWirelessKeyboard/seletWire
|
|||||||
import 'main/lockDetail/lcokSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart';
|
import 'main/lockDetail/lcokSet/wirelessKeyboard/wirelessKeyboardList/wirelessKeyboard_page.dart';
|
||||||
import 'main/lockDetail/otherTypeKey/addFingerprint/addFingerprint/addFingerprint_page.dart';
|
import 'main/lockDetail/otherTypeKey/addFingerprint/addFingerprint/addFingerprint_page.dart';
|
||||||
import 'main/lockDetail/otherTypeKey/addFingerprint/addFingerprintTip/addFingerprintTip_page.dart';
|
import 'main/lockDetail/otherTypeKey/addFingerprint/addFingerprintTip/addFingerprintTip_page.dart';
|
||||||
|
import 'main/lockDetail/otherTypeKey/otherTypeKeyChangeDate/otherTypeKeyChangeDate_page.dart';
|
||||||
|
import 'main/lockDetail/otherTypeKey/otherTypeKeyChangeValidityDate/otherTypeKeyChangeValidityDate_page.dart';
|
||||||
import 'mine/about/about_page.dart';
|
import 'mine/about/about_page.dart';
|
||||||
import 'mine/addLock/addLock/addLock_page.dart';
|
import 'mine/addLock/addLock/addLock_page.dart';
|
||||||
import 'main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_page.dart';
|
import 'main/lockDetail/authorizedAdmin/authorizedAdmin/authorizedAdminManage/authorizedAdminManage_page.dart';
|
||||||
@ -158,10 +160,10 @@ abstract class Routers {
|
|||||||
static const passwordKeyManagePage = '/PasswordKeyManagePage'; // 密码钥匙
|
static const passwordKeyManagePage = '/PasswordKeyManagePage'; // 密码钥匙
|
||||||
static const passwordKeyDetailPage = '/PasswordKeyDetailPage'; // 密码钥匙详情
|
static const passwordKeyDetailPage = '/PasswordKeyDetailPage'; // 密码钥匙详情
|
||||||
static const otherTypeKeyListPage = '/OtherTypeKeyListPage'; // 卡、指纹、遥控钥匙列表
|
static const otherTypeKeyListPage = '/OtherTypeKeyListPage'; // 卡、指纹、遥控钥匙列表
|
||||||
static const otherTypeKeyDetailPage =
|
static const otherTypeKeyDetailPage = '/OtherTypeKeyDetailPage'; // 卡、指纹、遥控钥匙详情
|
||||||
'/OtherTypeKeyDetailPage'; // 卡、指纹、遥控钥匙详情
|
static const otherTypeKeyManagePage = '/OtherTypeKeyManagePage'; // 卡、指纹、遥控钥匙添加
|
||||||
static const otherTypeKeyManagePage =
|
static const otherTypeKeyChangeDatePage = '/OtherTypeKeyChangeDatePage'; // 卡、指纹、遥控钥匙详情修改日期
|
||||||
'/OtherTypeKeyManagePage'; // 卡、指纹、遥控钥匙添加
|
static const otherTypeKeyChangeValidityDatePage = '/OtherTypeKeyChangeValidityDatePage'; // 卡、指纹、遥控钥匙详情修改有效期
|
||||||
|
|
||||||
static const addFingerprintTipPage = '/AddFingerprintTipPage'; // 添加指纹提示
|
static const addFingerprintTipPage = '/AddFingerprintTipPage'; // 添加指纹提示
|
||||||
static const addFingerprintPage = '/AddFingerprintPage'; // 添加指纹
|
static const addFingerprintPage = '/AddFingerprintPage'; // 添加指纹
|
||||||
@ -778,6 +780,12 @@ abstract class AppRouters {
|
|||||||
page: () => const AdministratorDetailsPage()),
|
page: () => const AdministratorDetailsPage()),
|
||||||
GetPage(
|
GetPage(
|
||||||
name: Routers.expireLockListPage,
|
name: Routers.expireLockListPage,
|
||||||
page: () => const ExpireLockListPage())
|
page: () => const ExpireLockListPage()),
|
||||||
|
GetPage(
|
||||||
|
name: Routers.otherTypeKeyChangeDatePage,
|
||||||
|
page: () => const OtherTypeKeyChangeDatePage()),
|
||||||
|
GetPage(
|
||||||
|
name: Routers.otherTypeKeyChangeValidityDatePage,
|
||||||
|
page: () => const OtherTypeKeyChangeValidityDatePage())
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,7 @@ class _ElectronicKeyDetailChangeDateState
|
|||||||
late List weekDays = [];
|
late List weekDays = [];
|
||||||
late String pwdId = '';
|
late String pwdId = '';
|
||||||
late String lockId = '';
|
late String lockId = '';
|
||||||
|
late String fromType = '';// 1 从指纹详情进入
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
@ -49,7 +50,9 @@ class _ElectronicKeyDetailChangeDateState
|
|||||||
if (obj != null && (obj["lockId"] != null)) {
|
if (obj != null && (obj["lockId"] != null)) {
|
||||||
lockId = obj["lockId"];
|
lockId = obj["lockId"];
|
||||||
}
|
}
|
||||||
|
if (obj != null && (obj["fromType"] != null)) {
|
||||||
|
fromType = obj["fromType"];
|
||||||
|
}
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
@ -64,10 +67,14 @@ class _ElectronicKeyDetailChangeDateState
|
|||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
),
|
),
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
if (lockId.isNotEmpty && pwdId.isNotEmpty) {
|
if(fromType == "1"){
|
||||||
updatePwdRequest();
|
|
||||||
} else {
|
}else{
|
||||||
updateKeyDateRequest();
|
if (lockId.isNotEmpty && pwdId.isNotEmpty) {
|
||||||
|
updatePwdRequest();
|
||||||
|
} else {
|
||||||
|
updateKeyDateRequest();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -151,6 +158,7 @@ class _ElectronicKeyDetailChangeDateState
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
String intToStr(int v) {
|
String intToStr(int v) {
|
||||||
return (v < 10) ? "0$v" : "$v";
|
return (v < 10) ? "0$v" : "$v";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,8 +12,10 @@ import '../../../../../blue/io_tool/io_manager.dart';
|
|||||||
import '../../../../../blue/io_tool/io_tool.dart';
|
import '../../../../../blue/io_tool/io_tool.dart';
|
||||||
import '../../../../../blue/io_tool/manager_event_bus.dart';
|
import '../../../../../blue/io_tool/manager_event_bus.dart';
|
||||||
import '../../../../../blue/sender_manage.dart';
|
import '../../../../../blue/sender_manage.dart';
|
||||||
|
import '../../../../../network/api_repository.dart';
|
||||||
import '../../../../../tools/baseGetXController.dart';
|
import '../../../../../tools/baseGetXController.dart';
|
||||||
import '../../../../../tools/storage.dart';
|
import '../../../../../tools/storage.dart';
|
||||||
|
import '../../../../../tools/toast.dart';
|
||||||
import 'addFingerprint_state.dart';
|
import 'addFingerprint_state.dart';
|
||||||
|
|
||||||
class AddFingerprintLogic extends BaseGetXController {
|
class AddFingerprintLogic extends BaseGetXController {
|
||||||
@ -201,6 +203,37 @@ class AddFingerprintLogic extends BaseGetXController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 添加指纹
|
||||||
|
void addFingerprintsData() async{
|
||||||
|
var entity = await ApiRepository.to.addFingerprintsData(
|
||||||
|
lockId: state.lockId.value.toString(),
|
||||||
|
endDate: state.endDate.value,
|
||||||
|
addType:state.addType.value,
|
||||||
|
fingerprintName: state.fingerprintName.value,
|
||||||
|
fingerprintNumber: "123456",
|
||||||
|
fingerprintType: state.fingerprintType.value,
|
||||||
|
isCoerced: state.isCoerced.value,
|
||||||
|
startDate: state.startDate.value,
|
||||||
|
weekDay: state.weekDay.value,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "添加成功");
|
||||||
|
updateFingerprintUserNoLoadData("");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void updateFingerprintUserNoLoadData(String fingerprintId) async{
|
||||||
|
var entity = await ApiRepository.to.updateFingerprintUserNoLoadData(
|
||||||
|
fingerprintId: fingerprintId,
|
||||||
|
lockId: state.lockId.value.toString(),
|
||||||
|
fingerprintUserNo: "0",
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "添加成功");
|
||||||
|
Get.close(3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
|
|||||||
@ -4,4 +4,27 @@ import 'package:get/get.dart';
|
|||||||
class AddFingerprintState{
|
class AddFingerprintState{
|
||||||
var ifConnectScuess = false.obs;
|
var ifConnectScuess = false.obs;
|
||||||
var addFingerprintProcessNumber = 0.obs;
|
var addFingerprintProcessNumber = 0.obs;
|
||||||
|
final lockId = 0.obs;
|
||||||
|
final endDate = "".obs;
|
||||||
|
final addType = "".obs;
|
||||||
|
final fingerprintName = "".obs;
|
||||||
|
final fingerprintNumber = "".obs;
|
||||||
|
final fingerprintType = "".obs;
|
||||||
|
final isCoerced = "".obs;
|
||||||
|
final startDate = "".obs;
|
||||||
|
final weekDay = [].obs;
|
||||||
|
|
||||||
|
AddFingerprintState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
lockId.value = map["lockId"];
|
||||||
|
endDate.value = map["endDate"];
|
||||||
|
addType.value = map["addType"];
|
||||||
|
fingerprintName.value = map["fingerprintName"];
|
||||||
|
fingerprintNumber.value = map["fingerprintNumber"];
|
||||||
|
fingerprintType.value = map["fingerprintType"];
|
||||||
|
isCoerced.value = map["isCoerced"];
|
||||||
|
startDate.value = map["startDate"];
|
||||||
|
lockId.value = map["lockId"];
|
||||||
|
weekDay.value = map["weekDay"];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,9 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
import 'addFingerprintTip_state.dart';
|
||||||
|
|
||||||
|
class AddFingerprintTipLogic extends BaseGetXController{
|
||||||
|
AddFingerprintTipState state = AddFingerprintTipState();
|
||||||
|
}
|
||||||
@ -8,6 +8,7 @@ import '../../../../../app_settings/app_colors.dart';
|
|||||||
import '../../../../../tools/submitBtn.dart';
|
import '../../../../../tools/submitBtn.dart';
|
||||||
import '../../../../../tools/titleAppBar.dart';
|
import '../../../../../tools/titleAppBar.dart';
|
||||||
import '../../../../../translations/trans_lib.dart';
|
import '../../../../../translations/trans_lib.dart';
|
||||||
|
import 'addFingerprintTip_logic.dart';
|
||||||
|
|
||||||
class AddFingerprintTipPage extends StatefulWidget {
|
class AddFingerprintTipPage extends StatefulWidget {
|
||||||
const AddFingerprintTipPage({Key? key}) : super(key: key);
|
const AddFingerprintTipPage({Key? key}) : super(key: key);
|
||||||
@ -17,6 +18,9 @@ class AddFingerprintTipPage extends StatefulWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class _AddFingerprintTipPageState extends State<AddFingerprintTipPage> {
|
class _AddFingerprintTipPageState extends State<AddFingerprintTipPage> {
|
||||||
|
final logic = Get.put(AddFingerprintTipLogic());
|
||||||
|
final state = Get.find<AddFingerprintTipLogic>().state;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
@ -66,7 +70,17 @@ class _AddFingerprintTipPageState extends State<AddFingerprintTipPage> {
|
|||||||
btnName: "开始添加",//TranslationLoader.lanKeys!.next!.tr,
|
btnName: "开始添加",//TranslationLoader.lanKeys!.next!.tr,
|
||||||
borderRadius: 20.w,
|
borderRadius: 20.w,
|
||||||
onClick: () {
|
onClick: () {
|
||||||
Get.toNamed(Routers.addFingerprintPage);
|
Get.toNamed(Routers.addFingerprintPage, arguments: {
|
||||||
|
"lockId": state.lockId.value,
|
||||||
|
"endDate": state.endDate.value,
|
||||||
|
"addType": state.addType.value,
|
||||||
|
"fingerprintName": state.fingerprintName.value,
|
||||||
|
"fingerprintNumber": state.fingerprintNumber.value,
|
||||||
|
"fingerprintType": state.fingerprintType.value,
|
||||||
|
"isCoerced": state.isCoerced.value,
|
||||||
|
"startDate": state.startDate.value,
|
||||||
|
"weekDay": state.weekDay.value,
|
||||||
|
});
|
||||||
}),
|
}),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|||||||
@ -0,0 +1,28 @@
|
|||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
class AddFingerprintTipState{
|
||||||
|
final lockId = 0.obs;
|
||||||
|
final endDate = "".obs;
|
||||||
|
final addType = "".obs;
|
||||||
|
final fingerprintName = "".obs;
|
||||||
|
final fingerprintNumber = "".obs;
|
||||||
|
final fingerprintType = "".obs;
|
||||||
|
final isCoerced = "".obs;
|
||||||
|
final startDate = "".obs;
|
||||||
|
final weekDay = [].obs;
|
||||||
|
|
||||||
|
AddFingerprintTipState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
lockId.value = map["lockId"];
|
||||||
|
endDate.value = map["endDate"];
|
||||||
|
addType.value = map["addType"];
|
||||||
|
fingerprintName.value = map["fingerprintName"];
|
||||||
|
fingerprintNumber.value = map["fingerprintNumber"];
|
||||||
|
fingerprintType.value = map["fingerprintType"];
|
||||||
|
isCoerced.value = map["isCoerced"];
|
||||||
|
startDate.value = map["startDate"];
|
||||||
|
lockId.value = map["lockId"];
|
||||||
|
weekDay.value = map["weekDay"];
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,9 @@
|
|||||||
|
|
||||||
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
import '../../../../tools/toast.dart';
|
import '../../../../tools/toast.dart';
|
||||||
@ -9,24 +12,126 @@ import 'otherTypeAddKey_state.dart';
|
|||||||
class OtherTypeAddKeyLogic extends BaseGetXController {
|
class OtherTypeAddKeyLogic extends BaseGetXController {
|
||||||
OtherTypeAddKeyState state = OtherTypeAddKeyState();
|
OtherTypeAddKeyState state = OtherTypeAddKeyState();
|
||||||
|
|
||||||
// 获取指纹列表
|
// 添加指纹
|
||||||
void addFingerprintsData() async{
|
void addFingerprintsData() async{
|
||||||
|
var fingerprintType = 0;// 永久:1;限时2,单次3,循环:4
|
||||||
|
var startDate = "";
|
||||||
|
var endDate = "";
|
||||||
|
if(state.seletType.value == "0"){
|
||||||
|
fingerprintType = 1;
|
||||||
|
}else if(state.seletType.value == "1"){
|
||||||
|
fingerprintType = 2;
|
||||||
|
if(state.beginTimeTimestamp.value.isEmpty){
|
||||||
|
Toast.show(msg: "请选择开始时间");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(state.endTimeTimestamp.value.isEmpty){
|
||||||
|
Toast.show(msg: "请选择开始时间");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var entity = await ApiRepository.to.addFingerprintsData(
|
// if(DateTime.now().millisecondsSinceEpoch > int.parse(state.beginTimeTimestamp.value)){
|
||||||
lockId: state.lockId.value.toString(),
|
// Toast.show(msg: "生效时间要大于当前时间");
|
||||||
endDate: state.fromType.value == 0 ? "0" : state.endTimeTimestamp.toString(),
|
// return;
|
||||||
addType:"1",
|
// }
|
||||||
fingerprintName: state.nameController.text,
|
|
||||||
fingerprintNumber: "123456",
|
print("fasdfasdfasdf:${int.parse(state.beginTimeTimestamp.value)} == ${int.parse(state.endTimeTimestamp.value)}");
|
||||||
fingerprintType: state.fromType.value == 2 ? "4" : "1",
|
if(int.parse(state.beginTimeTimestamp.value) >= int.parse(state.endTimeTimestamp.value)){
|
||||||
isCoerced: state.isStressFingerprint.value ? "1" : "0",
|
Toast.show(msg: "失效时间要大于生效时间");
|
||||||
startDate: state.fromType.value == 0 ? "0" : state.beginTimeTimestamp.toString(),
|
return;
|
||||||
cyclicConfig: '',
|
}
|
||||||
);
|
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
startDate = state.beginTimeTimestamp.value;
|
||||||
Toast.show(msg: "添加成功");
|
endDate = state.endTimeTimestamp.value;
|
||||||
Get.back(result: "addScuess");
|
}else if(state.seletType.value == "2"){
|
||||||
|
if(state.effectiveDateTime.value <= 0){
|
||||||
|
Toast.show(msg: "请选择生效时间");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if(state.failureDateTime.value <= 0){
|
||||||
|
Toast.show(msg: "请选择失效时间");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(state.weekdaysList.value.isEmpty){
|
||||||
|
Toast.show(msg: "请选择有效日");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// if(DateTime.now().millisecondsSinceEpoch >= state.effectiveDateTime.value){
|
||||||
|
// Toast.show(msg: "生效时间要大于当前时间");
|
||||||
|
// return;
|
||||||
|
// }
|
||||||
|
|
||||||
|
if(state.effectiveDateTime.value >= state.failureDateTime.value){
|
||||||
|
Toast.show(msg: "失效时间要大于生效时间");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
startDate = state.effectiveDateTime.value.toString();
|
||||||
|
endDate = state.failureDateTime.value.toString();
|
||||||
|
fingerprintType = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if(state.fromType.value == 1){
|
||||||
|
// Get.toNamed(Routers.addFingerprintTipPage, arguments: {
|
||||||
|
// "lockId": state.lockId.value,
|
||||||
|
// "endDate": endDate,
|
||||||
|
// "addType": "1",
|
||||||
|
// "fingerprintName": state.nameController.text,
|
||||||
|
// "fingerprintNumber": "123456",
|
||||||
|
// "fingerprintType": fingerprintType.toString(),
|
||||||
|
// "isCoerced": state.isStressFingerprint.value ? "1" : "2",
|
||||||
|
// "startDate": startDate,
|
||||||
|
// "weekDay": state.weekdaysList.value,
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
|
||||||
|
switch (state.fromType.value) {
|
||||||
|
case 0:
|
||||||
|
// 卡
|
||||||
|
var entity = await ApiRepository.to.addICCardData(
|
||||||
|
lockId: state.lockId.value.toString(),
|
||||||
|
endDate: endDate,
|
||||||
|
cardName: state.nameController.text,
|
||||||
|
cardNumber: (Random().nextInt(100000000) + 10000000).floor().toString(),
|
||||||
|
cardType: fingerprintType.toString(),
|
||||||
|
addType:"1",
|
||||||
|
startDate: startDate,
|
||||||
|
isCoerced: state.isStressFingerprint.value ? "1" : "2",
|
||||||
|
weekDay: state.weekdaysList.value,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "添加成功");
|
||||||
|
Get.back(result: "addScuess");
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// 指纹
|
||||||
|
var entity = await ApiRepository.to.addFingerprintsData(
|
||||||
|
lockId: state.lockId.value.toString(),
|
||||||
|
endDate: endDate,
|
||||||
|
addType:"1",
|
||||||
|
fingerprintName: state.nameController.text,
|
||||||
|
fingerprintNumber: (Random().nextInt(100000000) + 10000000).floor().toString(),
|
||||||
|
fingerprintType: fingerprintType.toString(),
|
||||||
|
isCoerced: state.isStressFingerprint.value ? "1" : "2",
|
||||||
|
startDate: startDate,
|
||||||
|
weekDay: state.weekdaysList.value,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "添加成功");
|
||||||
|
Get.back(result: "addScuess");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// 遥控
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import 'package:flutter_pickers/pickers.dart';
|
|||||||
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
import 'package:get_storage/get_storage.dart';
|
||||||
import 'package:star_lock/appRouters.dart';
|
import 'package:star_lock/appRouters.dart';
|
||||||
|
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
@ -16,7 +17,7 @@ import 'otherTypeAddKey_logic.dart';
|
|||||||
class OtherTypeAddKeyPage extends StatefulWidget {
|
class OtherTypeAddKeyPage extends StatefulWidget {
|
||||||
final String seletType;
|
final String seletType;
|
||||||
final int lockType; // 0卡 1指纹 2钥匙
|
final int lockType; // 0卡 1指纹 2钥匙
|
||||||
final int lockId; // 0卡 1指纹 2钥匙
|
final int lockId;
|
||||||
const OtherTypeAddKeyPage(
|
const OtherTypeAddKeyPage(
|
||||||
{Key? key, required this.seletType, required this.lockType, required this.lockId}) : super(key: key);
|
{Key? key, required this.seletType, required this.lockType, required this.lockId}) : super(key: key);
|
||||||
|
|
||||||
@ -30,6 +31,10 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
state.seletType.value = widget.seletType;
|
||||||
|
state.fromType.value = widget.lockType;
|
||||||
|
state.lockId.value = widget.lockId;
|
||||||
|
|
||||||
return indexChangeWidget();
|
return indexChangeWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,17 +73,15 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
|
|||||||
perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr,
|
perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr,
|
||||||
TranslationLoader.lanKeys!.pleaseEnter!.tr, state.nameController),
|
TranslationLoader.lanKeys!.pleaseEnter!.tr, state.nameController),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () async {
|
||||||
// Map result = await Get.toNamed(Routers.electronicKeyPeriodValidityPage);
|
Map result = await Get.toNamed(Routers.electronicKeyPeriodValidityPage);
|
||||||
// // result as Map<String, dynamic>;
|
state.weekdaysList.value = result['validityValue'];
|
||||||
// weekdaysList = result['validityValue'];
|
state.effectiveDateTime.value = result['starDate'].millisecondsSinceEpoch;
|
||||||
// _effectiveDateTime = result['starDate'];
|
state.failureDateTime.value = result['endDate'].millisecondsSinceEpoch;
|
||||||
// _failureDateTime = result['endDate'];
|
print('得到的有效期数据:${state.weekdaysList.value} == ${state.effectiveDateTime.value} == ${state.failureDateTime.value}');
|
||||||
// print(
|
|
||||||
// '得到的有效期数据:$weekdaysList $_effectiveDateTime $_failureDateTime');
|
|
||||||
}),
|
}),
|
||||||
SizedBox(height: 10.h),
|
SizedBox(height: 10.h),
|
||||||
keyBottomWidget()
|
keyBottomWidget()
|
||||||
@ -121,14 +124,14 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.beginTime.value = '${p.year}-${p.month!.toString().padLeft(2,'0')}-${p.day!.toString().padLeft(2,'0')} ${p.hour!.toString().padLeft(2,'0')}:${p.minute!.toString().padLeft(2,'0')}';
|
state.beginTime.value = '${p.year}-${p.month!.toString().padLeft(2,'0')}-${p.day!.toString().padLeft(2,'0')} ${p.hour!.toString().padLeft(2,'0')}:${p.minute!.toString().padLeft(2,'0')}';
|
||||||
state.beginTimeTimestamp.value = DateTime.parse(state.beginTime.value).toString();
|
state.beginTimeTimestamp.value = DateTime.parse(state.beginTime.value).millisecondsSinceEpoch.toString();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
})),
|
})),
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||||
rightTitle: "2020.06.20 11:49",
|
rightTitle: state.endTime.value,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
@ -136,11 +139,11 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
|
|||||||
setState(() {
|
setState(() {
|
||||||
setState(() {
|
setState(() {
|
||||||
state.endTime.value = '${p.year}-${p.month!.toString().padLeft(2,'0')}-${p.day!.toString().padLeft(2,'0')} ${p.hour!.toString().padLeft(2,'0')}:${p.minute!.toString().padLeft(2,'0')}';
|
state.endTime.value = '${p.year}-${p.month!.toString().padLeft(2,'0')}-${p.day!.toString().padLeft(2,'0')} ${p.hour!.toString().padLeft(2,'0')}:${p.minute!.toString().padLeft(2,'0')}';
|
||||||
state.endTimeTimestamp.value = DateTime.parse(state.beginTime.value).toString();
|
state.endTimeTimestamp.value = DateTime.parse(state.endTime.value).millisecondsSinceEpoch.toString();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}),
|
})),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
@ -150,7 +153,7 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
|
|||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: "胁迫指纹",
|
leftTitel: TranslationLoader.lanKeys!.stressFingerprint!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isTipsImg: false,
|
isTipsImg: false,
|
||||||
isHaveRightWidget: true,
|
isHaveRightWidget: true,
|
||||||
@ -162,11 +165,7 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
|
|||||||
Toast.show(msg: "请输入姓名");
|
Toast.show(msg: "请输入姓名");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
logic.addFingerprintsData();
|
||||||
// if(widget.lockType == 1){
|
|
||||||
Get.toNamed(Routers.addFingerprintTipPage);
|
|
||||||
// }
|
|
||||||
// logic.addFingerprintsData();
|
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|||||||
@ -5,7 +5,8 @@ import 'package:get/get.dart';
|
|||||||
|
|
||||||
class OtherTypeAddKeyState{
|
class OtherTypeAddKeyState{
|
||||||
final lockId = 0.obs;
|
final lockId = 0.obs;
|
||||||
final fromType = 0.obs;
|
final seletType = "0".obs;// 0永久 1显示 2循环
|
||||||
|
final fromType = 0.obs;// 0卡 1指纹 2钥匙
|
||||||
final isStressFingerprint = false.obs;
|
final isStressFingerprint = false.obs;
|
||||||
|
|
||||||
var beginTime = "".obs;// 开始时间
|
var beginTime = "".obs;// 开始时间
|
||||||
@ -13,6 +14,10 @@ class OtherTypeAddKeyState{
|
|||||||
var beginTimeTimestamp = "".obs;// 开始时间时间戳
|
var beginTimeTimestamp = "".obs;// 开始时间时间戳
|
||||||
var endTimeTimestamp = "".obs;// 结束时间时间戳
|
var endTimeTimestamp = "".obs;// 结束时间时间戳
|
||||||
|
|
||||||
|
var effectiveDateTime = 0.obs;// 生效时间
|
||||||
|
var failureDateTime = 0.obs;// 失效时间
|
||||||
|
var weekdaysList = [].obs;
|
||||||
|
|
||||||
final TextEditingController nameController = TextEditingController();
|
final TextEditingController nameController = TextEditingController();
|
||||||
OtherTypeAddKeyState() {
|
OtherTypeAddKeyState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
|
|||||||
@ -0,0 +1,52 @@
|
|||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
|
import 'otherTypeKeyChangeDate_state.dart';
|
||||||
|
|
||||||
|
class OtherTypeKeyChangeDateLogic extends BaseGetXController{
|
||||||
|
OtherTypeKeyChangeDateState state = OtherTypeKeyChangeDateState();
|
||||||
|
|
||||||
|
// 修改指纹信息
|
||||||
|
void editFingerprintsData() async{
|
||||||
|
var entity = await ApiRepository.to.editFingerprintsData(
|
||||||
|
fingerprintId: state.fingerprintItemData.value.fingerprintId.toString(),
|
||||||
|
lockId: state.fingerprintItemData.value.lockId.toString(),
|
||||||
|
weekDay: state.fingerprintItemData.value.weekDay!,
|
||||||
|
startDate: state.beginTimeTimestamp.value.toString(),
|
||||||
|
endDate: state.endTimeTimestamp.value.toString(),
|
||||||
|
isCoerced: state.fingerprintItemData.value.isCoerced == 1 ? "2" : "1",
|
||||||
|
fingerprintName: state.fingerprintItemData.value.fingerprintName!,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "修改成功");
|
||||||
|
Get.back(result: {
|
||||||
|
"beginTimeTimestamp":state.beginTimeTimestamp.value,
|
||||||
|
"endTimeTimestamp":state.endTimeTimestamp.value,
|
||||||
|
});
|
||||||
|
eventBus.fire(OtherTypeRefreshListEvent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编辑iC卡
|
||||||
|
void editICCardData() async{
|
||||||
|
var entity = await ApiRepository.to.editICCardData(
|
||||||
|
cardId: state.fingerprintItemData.value.cardId.toString(),
|
||||||
|
lockId: state.fingerprintItemData.value.lockId.toString(),
|
||||||
|
weekDay: state.fingerprintItemData.value.weekDay!,
|
||||||
|
startDate: state.beginTimeTimestamp.value.toString(),
|
||||||
|
endDate: state.endTimeTimestamp.value.toString(),
|
||||||
|
isCoerced: state.fingerprintItemData.value.isCoerced == 1 ? "2" : "1",
|
||||||
|
cardName: state.fingerprintItemData.value.cardName!,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "修改成功");
|
||||||
|
Get.back(result: {
|
||||||
|
"beginTimeTimestamp":state.beginTimeTimestamp.value,
|
||||||
|
"endTimeTimestamp":state.endTimeTimestamp.value,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,99 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_pickers/pickers.dart';
|
||||||
|
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../tools/commonItem.dart';
|
||||||
|
import '../../../../tools/titleAppBar.dart';
|
||||||
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
import 'otherTypeKeyChangeDate_logic.dart';
|
||||||
|
|
||||||
|
class OtherTypeKeyChangeDatePage extends StatefulWidget {
|
||||||
|
const OtherTypeKeyChangeDatePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<OtherTypeKeyChangeDatePage> createState() => _OtherTypeKeyChangeDatePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _OtherTypeKeyChangeDatePageState extends State<OtherTypeKeyChangeDatePage> {
|
||||||
|
final logic = Get.put(OtherTypeKeyChangeDateLogic());
|
||||||
|
final state = Get.find<OtherTypeKeyChangeDateLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.periodValidity!.tr}",
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor,
|
||||||
|
actionsList: [
|
||||||
|
TextButton(
|
||||||
|
child: Text(
|
||||||
|
TranslationLoader.lanKeys!.sure!.tr,
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
// print("state.pushType.value:${state.pushType.value}");
|
||||||
|
switch (state.pushType.value) {
|
||||||
|
case 0:
|
||||||
|
// 卡
|
||||||
|
logic.editICCardData();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// 指纹
|
||||||
|
logic.editFingerprintsData();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
body: buildMainUI(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildMainUI() {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
|
||||||
|
rightTitle: state.beginTime.value,
|
||||||
|
isHaveLine: true,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
|
onConfirm: (p) {
|
||||||
|
setState(() {
|
||||||
|
state.beginTimeTimestamp.value = DateTime.parse(
|
||||||
|
'${p.year}-${p.month.toString().padLeft(2,'0')}-${p.day.toString().padLeft(2,'0')} ${p.hour!.toString().padLeft(2,'0')}:${p.minute!.toString().padLeft(2,'0')}').millisecondsSinceEpoch;
|
||||||
|
state.beginTime.value = "${p.year}.${p.month.toString().padLeft(2,'0')}.${p.day.toString().padLeft(2,'0')} ${p.hour.toString().padLeft(2,'0')}:${p.minute!.toString().padLeft(2,'0')}";
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
|
||||||
|
rightTitle: state.endTime.value,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
|
onConfirm: (p) {
|
||||||
|
setState(() {
|
||||||
|
state.endTimeTimestamp.value = DateTime.parse(
|
||||||
|
'${p.year}-${p.month.toString().padLeft(2,'0')}-${p.day.toString().padLeft(2,'0')} ${p.hour!.toString().padLeft(2,'0')}:${p.minute!.toString().padLeft(2,'0')}').millisecondsSinceEpoch;
|
||||||
|
state.endTime.value = "${p.year}.${p.month.toString().padLeft(2,'0')}.${p.day.toString().padLeft(2,'0')} ${p.hour.toString().padLeft(2,'0')}:${p.minute!.toString().padLeft(2,'0')}";
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../../tools/dateTool.dart';
|
||||||
|
import '../otherTypeKeyList/fingerprintListData_entity.dart';
|
||||||
|
|
||||||
|
class OtherTypeKeyChangeDateState{
|
||||||
|
final fingerprintItemData = FingerprintItemData().obs;
|
||||||
|
|
||||||
|
var beginTime = "".obs;// 开始时间
|
||||||
|
var endTime = "".obs;// 结束时间
|
||||||
|
var beginTimeTimestamp = 0.obs;// 开始时间时间戳
|
||||||
|
var endTimeTimestamp = 0.obs;// 结束时间时间戳
|
||||||
|
|
||||||
|
var pushType = 0.obs;// 0卡 1指纹 2遥控
|
||||||
|
|
||||||
|
OtherTypeKeyChangeDateState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
pushType.value = map["pushType"];
|
||||||
|
fingerprintItemData.value = map["fingerprintItemData"];
|
||||||
|
|
||||||
|
beginTime.value = DateTool().dateToYMDHNString(fingerprintItemData.value.startDate.toString());
|
||||||
|
endTime.value = DateTool().dateToYMDHNString(fingerprintItemData.value.endDate.toString());
|
||||||
|
beginTimeTimestamp.value = fingerprintItemData.value.startDate!;
|
||||||
|
endTimeTimestamp.value = fingerprintItemData.value.endDate!;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
|
import '../../../../network/api_repository.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
|
import 'otherTypeKeyChangeValidityDate_state.dart';
|
||||||
|
|
||||||
|
class OtherTypeKeyChangeValidityDateLogic extends BaseGetXController{
|
||||||
|
OtherTypeKeyChangeValidityDateState state = OtherTypeKeyChangeValidityDateState();
|
||||||
|
|
||||||
|
// 修改指纹信息
|
||||||
|
void editFingerprintsData() async{
|
||||||
|
var entity = await ApiRepository.to.editFingerprintsData(
|
||||||
|
fingerprintId: state.fingerprintItemData.value.fingerprintId.toString(),
|
||||||
|
lockId: state.fingerprintItemData.value.lockId.toString(),
|
||||||
|
weekDay: state.weekDay.value,
|
||||||
|
startDate: state.beginTimeTimestamp.value.toString(),
|
||||||
|
endDate: state.endTimeTimestamp.value.toString(),
|
||||||
|
isCoerced: state.fingerprintItemData.value.isCoerced == 1 ? "2" : "1",
|
||||||
|
fingerprintName: state.fingerprintItemData.value.fingerprintName!,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "修改成功");
|
||||||
|
Get.back(result: {
|
||||||
|
"beginTimeTimestamp":state.beginTimeTimestamp.value,
|
||||||
|
"endTimeTimestamp":state.endTimeTimestamp.value,
|
||||||
|
"weekDay":state.weekDay.value,
|
||||||
|
});
|
||||||
|
eventBus.fire(OtherTypeRefreshListEvent());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编辑iC卡
|
||||||
|
void editICCardData() async{
|
||||||
|
var entity = await ApiRepository.to.editICCardData(
|
||||||
|
cardId: state.fingerprintItemData.value.cardId.toString(),
|
||||||
|
lockId: state.fingerprintItemData.value.lockId.toString(),
|
||||||
|
weekDay: state.weekDay.value,
|
||||||
|
startDate: state.beginTimeTimestamp.value.toString(),
|
||||||
|
endDate: state.endTimeTimestamp.value.toString(),
|
||||||
|
isCoerced: state.fingerprintItemData.value.isCoerced == 1 ? "2" : "1",
|
||||||
|
cardName: state.fingerprintItemData.value.cardName!,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "修改成功");
|
||||||
|
Get.back(result: {
|
||||||
|
"beginTimeTimestamp":state.beginTimeTimestamp.value,
|
||||||
|
"endTimeTimestamp":state.endTimeTimestamp.value,
|
||||||
|
"weekDay":state.weekDay.value,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,193 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_pickers/pickers.dart';
|
||||||
|
import 'package:flutter_pickers/time_picker/model/date_mode.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../../app_settings/app_colors.dart';
|
||||||
|
import '../../../../tools/commonItem.dart';
|
||||||
|
import '../../../../tools/submitBtn.dart';
|
||||||
|
import '../../../../tools/titleAppBar.dart';
|
||||||
|
import '../../../../translations/trans_lib.dart';
|
||||||
|
import 'otherTypeKeyChangeValidityDate_logic.dart';
|
||||||
|
|
||||||
|
class OtherTypeKeyChangeValidityDatePage extends StatefulWidget {
|
||||||
|
const OtherTypeKeyChangeValidityDatePage({Key? key}) : super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<OtherTypeKeyChangeValidityDatePage> createState() => _OtherTypeKeyChangeValidityDatePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _OtherTypeKeyChangeValidityDatePageState extends State<OtherTypeKeyChangeValidityDatePage> {
|
||||||
|
final logic = Get.put(OtherTypeKeyChangeValidityDateLogic());
|
||||||
|
final state = Get.find<OtherTypeKeyChangeValidityDateLogic>().state;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
|
appBar: TitleAppBar(
|
||||||
|
barTitle: TranslationLoader.lanKeys!.normallyOpenMode!.tr,
|
||||||
|
haveBack: true,
|
||||||
|
backgroundColor: AppColors.mainColor),
|
||||||
|
body: ListView(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 10.h,
|
||||||
|
color: AppColors.mainBackgroundColor,
|
||||||
|
),
|
||||||
|
topWidget(),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
bottomWidget(),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 30.h),
|
||||||
|
child: SubmitBtn(
|
||||||
|
btnName: TranslationLoader.lanKeys!.save!.tr,
|
||||||
|
onClick: () {
|
||||||
|
if(state.pushType.value == 0){
|
||||||
|
logic.editICCardData();
|
||||||
|
}else if(state.pushType.value == 1){
|
||||||
|
logic.editFingerprintsData();
|
||||||
|
}
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget topWidget() {
|
||||||
|
return Container(
|
||||||
|
height: 160.h,
|
||||||
|
width: 1.sw,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 60.h,
|
||||||
|
// color: Colors.red,
|
||||||
|
padding: EdgeInsets.only(left: 30.w, top: 15.h),
|
||||||
|
child: Text(TranslationLoader.lanKeys!.effectiveDay!.tr, style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w600))),
|
||||||
|
Container(
|
||||||
|
height: 100.h,
|
||||||
|
padding: EdgeInsets.only(left: 10.w, right: 10.w, bottom: 10.h),
|
||||||
|
child: GridView.builder(
|
||||||
|
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 7, childAspectRatio: 1.0),
|
||||||
|
itemCount: 7,
|
||||||
|
physics: const NeverScrollableScrollPhysics(),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
index += 1;
|
||||||
|
return btnItem(index);
|
||||||
|
})),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget btnItem(int index) {
|
||||||
|
String dateStr;
|
||||||
|
switch (index) {
|
||||||
|
case 1:
|
||||||
|
dateStr = TranslationLoader.lanKeys!.mondayShort!.tr;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
dateStr = TranslationLoader.lanKeys!.tuesdayShort!.tr;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
dateStr = TranslationLoader.lanKeys!.wednesdayShort!.tr;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
dateStr = TranslationLoader.lanKeys!.thursdayShort!.tr;
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
dateStr = TranslationLoader.lanKeys!.fridayShort!.tr;
|
||||||
|
break;
|
||||||
|
case 6:
|
||||||
|
dateStr = TranslationLoader.lanKeys!.saturdayShort!.tr;
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
dateStr = TranslationLoader.lanKeys!.sundayShort!.tr;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
dateStr = "";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return GestureDetector(
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
if(state.weekDay.value.contains(index)){
|
||||||
|
state.weekDay.value.remove(index);
|
||||||
|
}else{
|
||||||
|
state.weekDay.value.add(index);
|
||||||
|
}
|
||||||
|
state.weekDay.value.sort();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: Obx(() => Container(
|
||||||
|
width: 40.w,
|
||||||
|
height: 40.w,
|
||||||
|
margin: EdgeInsets.all(10.w),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: state.weekDay.value.contains(index) ? AppColors.mainColor :Colors.white,
|
||||||
|
border: Border.all(width: 1, color: AppColors.btnDisableColor),
|
||||||
|
borderRadius: BorderRadius.circular(30.w),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Text(
|
||||||
|
dateStr,
|
||||||
|
style: TextStyle(fontSize: 20.sp, color: state.weekDay.value.contains(index) ? Colors.white : AppColors.darkGrayTextColor),
|
||||||
|
)),
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget bottomWidget() {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel:
|
||||||
|
"${TranslationLoader.lanKeys!.begin!.tr}${TranslationLoader.lanKeys!.time!.tr}",
|
||||||
|
rightTitle: state.beginTime.value,
|
||||||
|
isHaveDirection: true,
|
||||||
|
isHaveLine: true,
|
||||||
|
action: () {
|
||||||
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
|
onConfirm: (p) {
|
||||||
|
setState(() {
|
||||||
|
state.beginTimeTimestamp.value = DateTime.parse(
|
||||||
|
'${p.year}-${p.month.toString().padLeft(2,'0')}-${p.day.toString().padLeft(2,'0')} ${p.hour!.toString().padLeft(2,'0')}:${p.minute!.toString().padLeft(2,'0')}').millisecondsSinceEpoch;
|
||||||
|
state.beginTime.value = "${p.year}.${p.month.toString().padLeft(2,'0')}.${p.day.toString().padLeft(2,'0')} ${p.hour.toString().padLeft(2,'0')}:${p.minute!.toString().padLeft(2,'0')}";
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel:
|
||||||
|
"${TranslationLoader.lanKeys!.end!.tr}${TranslationLoader.lanKeys!.time!.tr}",
|
||||||
|
rightTitle: state.endTime.value,
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () {
|
||||||
|
Pickers.showDatePicker(context, mode: DateMode.YMDHM,
|
||||||
|
onConfirm: (p) {
|
||||||
|
setState(() {
|
||||||
|
state.endTimeTimestamp.value = DateTime.parse(
|
||||||
|
'${p.year}-${p.month.toString().padLeft(2,'0')}-${p.day.toString().padLeft(2,'0')} ${p.hour!.toString().padLeft(2,'0')}:${p.minute!.toString().padLeft(2,'0')}').millisecondsSinceEpoch;
|
||||||
|
state.endTime.value = "${p.year}.${p.month.toString().padLeft(2,'0')}.${p.day.toString().padLeft(2,'0')} ${p.hour.toString().padLeft(2,'0')}:${p.minute!.toString().padLeft(2,'0')}";
|
||||||
|
});
|
||||||
|
});
|
||||||
|
})),
|
||||||
|
Container(height: 10.h),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,29 @@
|
|||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../../tools/dateTool.dart';
|
||||||
|
import '../otherTypeKeyList/fingerprintListData_entity.dart';
|
||||||
|
|
||||||
|
class OtherTypeKeyChangeValidityDateState{
|
||||||
|
final fingerprintItemData = FingerprintItemData().obs;
|
||||||
|
|
||||||
|
var beginTime = "".obs;// 开始时间
|
||||||
|
var endTime = "".obs;// 结束时间
|
||||||
|
var beginTimeTimestamp = 0.obs;// 开始时间时间戳
|
||||||
|
var endTimeTimestamp = 0.obs;// 结束时间时间戳
|
||||||
|
|
||||||
|
var pushType = 0.obs;// 0卡 1指纹 2遥控
|
||||||
|
var weekDay = [].obs;
|
||||||
|
|
||||||
|
OtherTypeKeyChangeValidityDateState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
pushType.value = map["pushType"];
|
||||||
|
fingerprintItemData.value = map["fingerprintItemData"];
|
||||||
|
|
||||||
|
beginTime.value = DateTool().dateToYMDHNString(fingerprintItemData.value.startDate.toString());
|
||||||
|
endTime.value = DateTool().dateToYMDHNString(fingerprintItemData.value.endDate.toString());
|
||||||
|
beginTimeTimestamp.value = fingerprintItemData.value.startDate!;
|
||||||
|
endTimeTimestamp.value = fingerprintItemData.value.endDate!;
|
||||||
|
weekDay.value = fingerprintItemData.value.weekDay!;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,11 +1,74 @@
|
|||||||
|
|
||||||
|
|
||||||
|
import 'package:get/get.dart';
|
||||||
import 'package:star_lock/tools/baseGetXController.dart';
|
import 'package:star_lock/tools/baseGetXController.dart';
|
||||||
|
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
import 'otherTypeKeyDetail_state.dart';
|
import 'otherTypeKeyDetail_state.dart';
|
||||||
|
|
||||||
class OtherTypeKeyDetailLogic extends BaseGetXController{
|
class OtherTypeKeyDetailLogic extends BaseGetXController{
|
||||||
OtherTypeKeyDetailState state = OtherTypeKeyDetailState();
|
OtherTypeKeyDetailState state = OtherTypeKeyDetailState();
|
||||||
|
|
||||||
|
// 编辑指纹
|
||||||
|
void editFingerprintsData() async{
|
||||||
|
var entity = await ApiRepository.to.editFingerprintsData(
|
||||||
|
fingerprintId: state.keyId.value.toString(),
|
||||||
|
lockId: state.fingerprintItemData.value.lockId.toString(),
|
||||||
|
weekDay: state.weekDay.value,
|
||||||
|
startDate: state.effectiveDateTime.value.toString(),
|
||||||
|
endDate: state.failureDateTime.value.toString(),
|
||||||
|
isCoerced: state.isStressFingerprint.value ? "2" : "1",
|
||||||
|
fingerprintName: state.changeNameController.text,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "修改成功");
|
||||||
|
Get.back(result: "addScuess");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除指纹
|
||||||
|
void deletFingerprintsData() async{
|
||||||
|
var entity = await ApiRepository.to.deletFingerprintsData(
|
||||||
|
fingerprintId: state.fingerprintItemData.value.fingerprintId.toString(),
|
||||||
|
lockId: state.fingerprintItemData.value.lockId.toString(),
|
||||||
|
type: "0",
|
||||||
|
deleteType:"1"
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "删除成功");
|
||||||
|
Get.back(result: "addScuess");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编辑iC卡
|
||||||
|
void editICCardData() async{
|
||||||
|
var entity = await ApiRepository.to.editICCardData(
|
||||||
|
cardId: state.keyId.value.toString(),
|
||||||
|
lockId: state.fingerprintItemData.value.lockId.toString(),
|
||||||
|
weekDay: state.weekDay.value,
|
||||||
|
startDate: state.effectiveDateTime.value.toString(),
|
||||||
|
endDate: state.failureDateTime.value.toString(),
|
||||||
|
isCoerced: state.isStressFingerprint.value ? "2" : "1",
|
||||||
|
cardName: state.changeNameController.text,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "修改成功");
|
||||||
|
Get.back(result: "addScuess");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除IC卡
|
||||||
|
void deletICCardData() async{
|
||||||
|
var entity = await ApiRepository.to.deletIcCardData(
|
||||||
|
cardId: state.fingerprintItemData.value.cardId.toString(),
|
||||||
|
lockId: state.fingerprintItemData.value.lockId.toString(),
|
||||||
|
type: "0",
|
||||||
|
deleteType:"1"
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "删除成功");
|
||||||
|
Get.back(result: "addScuess");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -6,8 +6,11 @@ import 'package:get/get.dart';
|
|||||||
import '../../../../appRouters.dart';
|
import '../../../../appRouters.dart';
|
||||||
import '../../../../app_settings/app_colors.dart';
|
import '../../../../app_settings/app_colors.dart';
|
||||||
import '../../../../tools/commonItem.dart';
|
import '../../../../tools/commonItem.dart';
|
||||||
|
import '../../../../tools/dateTool.dart';
|
||||||
|
import '../../../../tools/showTFView.dart';
|
||||||
import '../../../../tools/submitBtn.dart';
|
import '../../../../tools/submitBtn.dart';
|
||||||
import '../../../../tools/titleAppBar.dart';
|
import '../../../../tools/titleAppBar.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
import '../../../../translations/trans_lib.dart';
|
import '../../../../translations/trans_lib.dart';
|
||||||
import 'otherTypeKeyDetail_logic.dart';
|
import 'otherTypeKeyDetail_logic.dart';
|
||||||
|
|
||||||
@ -24,71 +27,171 @@ class _OtherTypeKeyDetailPageState extends State<OtherTypeKeyDetailPage> {
|
|||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
var type = ModalRoute.of(context)?.settings.arguments as int;
|
|
||||||
|
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
backgroundColor: AppColors.mainBackgroundColor,
|
backgroundColor: AppColors.mainBackgroundColor,
|
||||||
appBar: TitleAppBar(
|
appBar: TitleAppBar(
|
||||||
barTitle: "${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}",
|
barTitle: "${getAppBarTitle(state.type.value)}${TranslationLoader.lanKeys!.number!.tr}",
|
||||||
haveBack: true,
|
haveBack: true,
|
||||||
backgroundColor: AppColors.mainColor,
|
backgroundColor: AppColors.mainColor,
|
||||||
actionsList: [
|
// actionsList: [
|
||||||
TextButton(
|
// TextButton(
|
||||||
child: Text(TranslationLoader.lanKeys!.share!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp),),
|
// child: Text(TranslationLoader.lanKeys!.share!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp),),
|
||||||
onPressed: () {
|
// onPressed: () {
|
||||||
|
//
|
||||||
},
|
// },
|
||||||
),
|
// ),
|
||||||
],
|
// ],
|
||||||
),
|
),
|
||||||
body: Column(
|
body: Column(
|
||||||
children: [
|
children: [
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: "${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}",
|
leftTitel: "${getAppBarTitle(state.type.value)}${TranslationLoader.lanKeys!.number!.tr}",
|
||||||
rightTitle: "98765432",
|
rightTitle: state.typeNumber.value,
|
||||||
isHaveDirection: true,
|
isHaveDirection: false,
|
||||||
isHaveLine: true,
|
isHaveLine: true)),
|
||||||
action: () {
|
Obx(() => CommonItem(
|
||||||
showCupertinoAlertDialog(context);
|
|
||||||
}),
|
|
||||||
CommonItem(
|
|
||||||
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
leftTitel: TranslationLoader.lanKeys!.name!.tr,
|
||||||
rightTitle: "你好",
|
rightTitle: state.typeName.value,
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
isHaveLine: true,
|
isHaveLine: true,
|
||||||
action: () {
|
action: () {
|
||||||
showCupertinoAlertDialog(context);
|
showCupertinoAlertDialog(context);
|
||||||
}),
|
})),
|
||||||
CommonItem(
|
Obx(() => Visibility(
|
||||||
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
visible: (state.keyType.value == 4 || state.keyType.value == 2) ? true : false,
|
||||||
rightTitle: "永久",
|
child: CommonItem(
|
||||||
isHaveDirection: true,
|
leftTitel: TranslationLoader.lanKeys!.periodValidity!.tr,
|
||||||
action: () {
|
allHeight: 70.h,
|
||||||
Navigator.pushNamed(context, Routers.electronicKeyDetailChangeDate);
|
// rightTitle:"2023.09.19 11:27\n2023.09.25 11:27",
|
||||||
}),
|
rightTitle: state.keyType.value == 1 ? "永久" : "${DateTool().dateToYMDHNString(state.effectiveDateTime.value.toString())}\n${DateTool().dateToYMDHNString(state.failureDateTime.value.toString())}",
|
||||||
|
isHaveDirection: true,
|
||||||
|
isHaveLine: true,
|
||||||
|
action: () async {
|
||||||
|
// switch(state.type.value){
|
||||||
|
// case 0:
|
||||||
|
// // 卡
|
||||||
|
//
|
||||||
|
// break;
|
||||||
|
// case 1:
|
||||||
|
// 当是指纹的时候
|
||||||
|
if(state.keyType.value == 2){
|
||||||
|
// 限时
|
||||||
|
var data = await Get.toNamed(Routers.otherTypeKeyChangeDatePage, arguments: {
|
||||||
|
"pushType": state.type.value,
|
||||||
|
"fingerprintItemData": state.fingerprintItemData.value,
|
||||||
|
});
|
||||||
|
if(data != null) {
|
||||||
|
setState(() {
|
||||||
|
state.effectiveDateTime.value = data["beginTimeTimestamp"];
|
||||||
|
state.failureDateTime.value = data["endTimeTimestamp"];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}else if(state.keyType.value == 4){
|
||||||
|
// 循环
|
||||||
|
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: {
|
||||||
|
"pushType": state.type.value,
|
||||||
|
"fingerprintItemData": state.fingerprintItemData.value,
|
||||||
|
});
|
||||||
|
if(data != null) {
|
||||||
|
setState(() {
|
||||||
|
state.effectiveDateTime.value = data["beginTimeTimestamp"];
|
||||||
|
state.failureDateTime.value = data["endTimeTimestamp"];
|
||||||
|
state.weekDay.value = data["weekDay"];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// break;
|
||||||
|
// case 2:
|
||||||
|
// // 遥控
|
||||||
|
//
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
}))),
|
||||||
|
Obx(() => Visibility(
|
||||||
|
visible: state.keyType.value == 4 ? true : false,
|
||||||
|
child: Obx(() => CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.effectiveDay!.tr,
|
||||||
|
rightTitle: state.weekDay.value.join(','),
|
||||||
|
isHaveDirection: true,
|
||||||
|
action: () async {
|
||||||
|
// switch(state.type.value){
|
||||||
|
// case 0:
|
||||||
|
// // 卡
|
||||||
|
//
|
||||||
|
// break;
|
||||||
|
// case 1:
|
||||||
|
// 当是指纹的时候
|
||||||
|
var data = await Get.toNamed(Routers.otherTypeKeyChangeValidityDatePage, arguments: {
|
||||||
|
"pushType": state.type.value,
|
||||||
|
"fingerprintItemData": state.fingerprintItemData.value,
|
||||||
|
});
|
||||||
|
if(data != null) {
|
||||||
|
setState(() {
|
||||||
|
state.effectiveDateTime.value = data["beginTimeTimestamp"];
|
||||||
|
state.failureDateTime.value = data["endTimeTimestamp"];
|
||||||
|
state.weekDay.value = data["weekDay"];
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// break;
|
||||||
|
// case 2:
|
||||||
|
// // 遥控
|
||||||
|
//
|
||||||
|
// break;
|
||||||
|
// }
|
||||||
|
})))
|
||||||
|
),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.additive!.tr,
|
leftTitel: TranslationLoader.lanKeys!.additive!.tr,
|
||||||
rightTitle: "15080825640",
|
rightTitle: state.adder.value,
|
||||||
action: () {
|
action: () {
|
||||||
|
|
||||||
}),
|
})),
|
||||||
CommonItem(
|
Obx(() => CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.addTime!.tr,
|
leftTitel: TranslationLoader.lanKeys!.addTime!.tr,
|
||||||
rightTitle: "2020.06.21 11:49",
|
rightTitle: DateTool().dateToYMDHNString(state.addTime.value.toString()),
|
||||||
action: () {
|
action: () {
|
||||||
|
|
||||||
}),
|
})),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
Obx(() => CommonItem(
|
||||||
|
leftTitel: TranslationLoader.lanKeys!.stressFingerprint!.tr,
|
||||||
|
rightTitle: "",
|
||||||
|
isTipsImg: false,
|
||||||
|
isHaveRightWidget: true,
|
||||||
|
rightWidget: SizedBox(
|
||||||
|
width: 60.w, height: 50.h, child: _isStressFingerprint()))),
|
||||||
Container(height: 10.h),
|
Container(height: 10.h),
|
||||||
CommonItem(
|
CommonItem(
|
||||||
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
|
||||||
rightTitle: "",
|
rightTitle: "",
|
||||||
isHaveDirection: true,
|
isHaveDirection: true,
|
||||||
action: () {
|
action: () {
|
||||||
Get.toNamed(Routers.keyOperationRecordPage);
|
switch (state.type.value) {
|
||||||
|
case 0:
|
||||||
|
// 卡
|
||||||
|
Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
||||||
|
'lockId': state.fingerprintItemData.value.lockId.toString(),
|
||||||
|
'cardId': state.fingerprintItemData.value.cardId.toString()
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// 指纹
|
||||||
|
Get.toNamed(Routers.keyOperationRecordPage, arguments: {
|
||||||
|
'lockId': state.fingerprintItemData.value.lockId.toString(),
|
||||||
|
'fingerprintId': state.fingerprintItemData.value.fingerprintId.toString()
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
}),
|
}),
|
||||||
SizedBox(height: 40.h),
|
// SizedBox(height: 40.h),
|
||||||
addControlsBtn(type),
|
// addControlsBtn(type),
|
||||||
SizedBox(height: 30.h),
|
SizedBox(height: 30.h),
|
||||||
SubmitBtn(
|
SubmitBtn(
|
||||||
btnName: TranslationLoader.lanKeys!.delete!.tr,
|
btnName: TranslationLoader.lanKeys!.delete!.tr,
|
||||||
@ -97,13 +200,57 @@ class _OtherTypeKeyDetailPageState extends State<OtherTypeKeyDetailPage> {
|
|||||||
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
|
||||||
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
|
||||||
onClick: () {
|
onClick: () {
|
||||||
|
switch (state.type.value) {
|
||||||
|
case 0:
|
||||||
|
// 卡
|
||||||
|
logic.deletICCardData();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// 指纹
|
||||||
|
logic.deletFingerprintsData();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//isStressFingerprint false:不是胁迫指纹 ture:胁迫指纹
|
||||||
|
CupertinoSwitch _isStressFingerprint() {
|
||||||
|
return CupertinoSwitch(
|
||||||
|
activeColor: CupertinoColors.activeBlue,
|
||||||
|
trackColor: CupertinoColors.systemGrey5,
|
||||||
|
thumbColor: CupertinoColors.white,
|
||||||
|
value: state.isStressFingerprint.value,
|
||||||
|
onChanged: (value) {
|
||||||
|
setState(() {
|
||||||
|
state.isStressFingerprint.value = value;
|
||||||
|
switch(state.type.value){
|
||||||
|
case 0:
|
||||||
|
// 卡
|
||||||
|
logic.editICCardData();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// 指纹
|
||||||
|
logic.editFingerprintsData();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// 遥控
|
||||||
|
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Widget addControlsBtn(int type) {
|
Widget addControlsBtn(int type) {
|
||||||
List<Widget> widgetList = [];
|
List<Widget> widgetList = [];
|
||||||
List<Map<String, dynamic>> routerList = [];
|
List<Map<String, dynamic>> routerList = [];
|
||||||
@ -212,139 +359,38 @@ class _OtherTypeKeyDetailPageState extends State<OtherTypeKeyDetailPage> {
|
|||||||
return title;
|
return title;
|
||||||
}
|
}
|
||||||
|
|
||||||
Widget commonItem(String leftTitle, String rightTitle,
|
|
||||||
{bool isHaveDirection = false,
|
|
||||||
bool isHaveLine = false,
|
|
||||||
bool isHaveRightWidget = false,
|
|
||||||
Widget? rightWidget,
|
|
||||||
Function()? action}) {
|
|
||||||
return GestureDetector(
|
|
||||||
onTap: action,
|
|
||||||
child: Column(
|
|
||||||
// mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
Container(
|
|
||||||
// height: 80.h,
|
|
||||||
color: Colors.white,
|
|
||||||
padding: EdgeInsets.only(
|
|
||||||
left: 20.w, right: 10.w, top: 20.w, bottom: 20.w),
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
SizedBox(width: 20.w),
|
|
||||||
Text(
|
|
||||||
leftTitle,
|
|
||||||
style:
|
|
||||||
TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500),
|
|
||||||
),
|
|
||||||
SizedBox(width: 20.w),
|
|
||||||
Expanded(
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
isHaveRightWidget
|
|
||||||
? rightWidget!
|
|
||||||
: Text(
|
|
||||||
rightTitle,
|
|
||||||
textAlign: TextAlign.end,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 28.sp, fontWeight: FontWeight.w500),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 5.w),
|
|
||||||
isHaveDirection
|
|
||||||
? Image.asset(
|
|
||||||
'images/icon_right.png',
|
|
||||||
width: 50.w,
|
|
||||||
height: 50.w,
|
|
||||||
)
|
|
||||||
: SizedBox(width: 10.w),
|
|
||||||
// SizedBox(width:10.w),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
isHaveLine
|
|
||||||
? Container(
|
|
||||||
height: 0.5.h,
|
|
||||||
color: Colors.grey,
|
|
||||||
)
|
|
||||||
: Container()
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
void showCupertinoAlertDialog(BuildContext context) {
|
void showCupertinoAlertDialog(BuildContext context) {
|
||||||
showDialog(
|
showDialog(
|
||||||
context: context,
|
context: context,
|
||||||
builder: (BuildContext context) {
|
builder: (BuildContext context) {
|
||||||
return Card(
|
return ShowTFView(
|
||||||
color: const Color(0x00FFFFFF),
|
title: "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}",
|
||||||
child: CupertinoAlertDialog(
|
tipTitle: "",
|
||||||
title: const Text("修改密码"),
|
controller: state.changeNameController,
|
||||||
content: Column(
|
sureClick: () {
|
||||||
children: <Widget>[
|
if(state.changeNameController.text.isEmpty){
|
||||||
const SizedBox(
|
Toast.show(msg: "请输入姓名");
|
||||||
height: 10,
|
return;
|
||||||
),
|
}
|
||||||
Container(
|
Get.back();
|
||||||
height: 80.h,
|
switch(state.type.value){
|
||||||
// color: Colors.white,
|
case 0:
|
||||||
margin: EdgeInsets.all(10.w),
|
// 卡
|
||||||
child: const TextField(
|
logic.editICCardData();
|
||||||
//输入框一行
|
break;
|
||||||
maxLines: 1,
|
case 1:
|
||||||
// controller: _controller,
|
// 指纹
|
||||||
autofocus: false,
|
logic.editFingerprintsData();
|
||||||
decoration: InputDecoration(
|
break;
|
||||||
//输入里面输入文字内边距设置
|
case 2:
|
||||||
// contentPadding: const EdgeInsets.only(
|
// 遥控
|
||||||
// top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
|
||||||
hintText: "请输入要修改的名字",
|
break;
|
||||||
//不需要输入框下划线
|
}
|
||||||
border: InputBorder.none,
|
},
|
||||||
//左边图标设置
|
cancelClick: () {
|
||||||
// icon: Padding(
|
Get.back();
|
||||||
// padding: EdgeInsets.only(top:30.w, bottom: 20.w, right: 20.w, left: 20.w),
|
},);
|
||||||
// child: Image.asset('images/main/icon_main_search.png', width: 40.w, height: 40.w,),
|
|
||||||
// ),
|
|
||||||
// //右边图标设置
|
|
||||||
// suffixIcon: GestureDetector(
|
|
||||||
// onTap: () {
|
|
||||||
// //addPostFrameCallback是 StatefulWidge 渲染结束的回调,只会被调用一次
|
|
||||||
// // SchedulerBinding.instance.addPostFrameCallback((_) {
|
|
||||||
// // _controller.text = "";
|
|
||||||
// // });
|
|
||||||
// },
|
|
||||||
// child: Padding(
|
|
||||||
// padding: EdgeInsets.all(8),
|
|
||||||
// child: Image.asset('images/main/icon_main_cell.png', width: 50.w, height: 50.w,),
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
actions: <Widget>[
|
|
||||||
CupertinoDialogAction(
|
|
||||||
child: const Text("取消"),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
// print("取消");
|
|
||||||
},
|
|
||||||
),
|
|
||||||
CupertinoDialogAction(
|
|
||||||
child: const Text("确定"),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.pop(context);
|
|
||||||
// print("确定");
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,4 +1,62 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
|
import '../../../../tools/dateTool.dart';
|
||||||
|
import '../otherTypeKeyList/fingerprintListData_entity.dart';
|
||||||
|
|
||||||
class OtherTypeKeyDetailState{
|
class OtherTypeKeyDetailState{
|
||||||
|
final fingerprintItemData = FingerprintItemData().obs;
|
||||||
|
final type = 0.obs;// 0卡 1指纹 2遥控
|
||||||
|
|
||||||
|
final TextEditingController changeNameController = TextEditingController();
|
||||||
|
|
||||||
|
final typeNumber = "".obs;// 指纹号
|
||||||
|
final typeName = "".obs;// 指纹名字
|
||||||
|
var effectiveDateTime = 0.obs;// 生效时间
|
||||||
|
var failureDateTime = 0.obs;// 失效时间
|
||||||
|
final keyType = 0.obs;// 永久:1;限时2,单次3,循环:4
|
||||||
|
var weekDay = [].obs;// 有效日
|
||||||
|
var adder = "".obs;// 添加者
|
||||||
|
var addTime = 0.obs;// 添加时间
|
||||||
|
var keyId = 0.obs;// 添加时间
|
||||||
|
|
||||||
|
final isStressFingerprint = false.obs;
|
||||||
|
OtherTypeKeyDetailState() {
|
||||||
|
Map map = Get.arguments;
|
||||||
|
type.value = map["type"];
|
||||||
|
if(type.value == 0){
|
||||||
|
// 0卡
|
||||||
|
fingerprintItemData.value = map["fingerprintItemData"];
|
||||||
|
keyId.value = fingerprintItemData.value.cardId!;
|
||||||
|
typeNumber.value = fingerprintItemData.value.cardNumber!;
|
||||||
|
typeName.value = fingerprintItemData.value.cardName!;
|
||||||
|
changeNameController.text = typeName.value;
|
||||||
|
effectiveDateTime.value = fingerprintItemData.value.startDate!;
|
||||||
|
failureDateTime.value = fingerprintItemData.value.endDate!;
|
||||||
|
keyType.value = fingerprintItemData.value.cardType!;
|
||||||
|
adder.value = fingerprintItemData.value.senderUsername!;
|
||||||
|
addTime.value = fingerprintItemData.value.createDate!;
|
||||||
|
isStressFingerprint.value = fingerprintItemData.value.isCoerced! == 2 ? true : false;
|
||||||
|
weekDay.value = fingerprintItemData.value.weekDay!;
|
||||||
|
}else if(type.value == 1){
|
||||||
|
// 1指纹
|
||||||
|
fingerprintItemData.value = map["fingerprintItemData"];
|
||||||
|
keyId.value = fingerprintItemData.value.fingerprintId!;
|
||||||
|
typeNumber.value = fingerprintItemData.value.fingerprintNumber!;
|
||||||
|
typeName.value = fingerprintItemData.value.fingerprintName!;
|
||||||
|
changeNameController.text = typeName.value;
|
||||||
|
effectiveDateTime.value = fingerprintItemData.value.startDate!;
|
||||||
|
failureDateTime.value = fingerprintItemData.value.endDate!;
|
||||||
|
keyType.value = fingerprintItemData.value.fingerprintType!;
|
||||||
|
adder.value = fingerprintItemData.value.senderUsername!;
|
||||||
|
addTime.value = fingerprintItemData.value.createDate!;
|
||||||
|
isStressFingerprint.value = fingerprintItemData.value.isCoerced! == 2 ? true : false;
|
||||||
|
weekDay.value = fingerprintItemData.value.weekDay!;
|
||||||
|
}else if(type.value == 2){
|
||||||
|
// 2遥控
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -62,62 +62,86 @@ class Data {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class FingerprintItemData {
|
class FingerprintItemData {
|
||||||
int? status;
|
int? fingerprintStatus;
|
||||||
int? lockId;
|
int? lockId;
|
||||||
int? createDate;
|
int? createDate;
|
||||||
String? fingerprintName;
|
String? fingerprintName;
|
||||||
int? endDate;
|
int? endDate;
|
||||||
String? userId;
|
int? apiUserId;
|
||||||
String? nickName;
|
String? nickName;
|
||||||
int? isCoerced;
|
int? isCoerced;
|
||||||
int? startDate;
|
int? startDate;
|
||||||
String? fingerprintNumber;
|
String? fingerprintNumber;
|
||||||
int? fingerprintType;
|
int? fingerprintType;
|
||||||
int? fingerprintId;
|
int? fingerprintId;
|
||||||
|
String? senderUsername;
|
||||||
|
List? weekDay;
|
||||||
|
|
||||||
|
String? cardName;
|
||||||
|
String? cardNumber;
|
||||||
|
int? cardType;
|
||||||
|
int? cardId;
|
||||||
FingerprintItemData(
|
FingerprintItemData(
|
||||||
{this.status,
|
{ this.fingerprintStatus,
|
||||||
this.lockId,
|
this.lockId,
|
||||||
this.createDate,
|
this.createDate,
|
||||||
this.fingerprintName,
|
this.fingerprintName,
|
||||||
this.endDate,
|
this.endDate,
|
||||||
this.userId,
|
this.apiUserId,
|
||||||
this.nickName,
|
this.nickName,
|
||||||
this.isCoerced,
|
this.isCoerced,
|
||||||
this.startDate,
|
this.startDate,
|
||||||
this.fingerprintNumber,
|
this.fingerprintNumber,
|
||||||
this.fingerprintType,
|
this.fingerprintType,
|
||||||
this.fingerprintId});
|
this.fingerprintId,
|
||||||
|
this.senderUsername,
|
||||||
|
this.weekDay,
|
||||||
|
this.cardName,
|
||||||
|
this.cardNumber,
|
||||||
|
this.cardType,
|
||||||
|
this.cardId});
|
||||||
|
|
||||||
FingerprintItemData.fromJson(Map<String, dynamic> json) {
|
FingerprintItemData.fromJson(Map<String, dynamic> json) {
|
||||||
status = json['status'];
|
fingerprintStatus = json['fingerprintStatus'];
|
||||||
lockId = json['lockId'];
|
lockId = json['lockId'];
|
||||||
createDate = json['createDate'];
|
createDate = json['createDate'];
|
||||||
fingerprintName = json['fingerprintName'];
|
fingerprintName = json['fingerprintName'];
|
||||||
endDate = json['endDate'];
|
endDate = json['endDate'];
|
||||||
userId = json['userId'];
|
apiUserId = json['apiUserId'];
|
||||||
nickName = json['nickName'];
|
nickName = json['nickName'];
|
||||||
isCoerced = json['isCoerced'];
|
isCoerced = json['isCoerced'];
|
||||||
startDate = json['startDate'];
|
startDate = json['startDate'];
|
||||||
fingerprintNumber = json['fingerprintNumber'];
|
fingerprintNumber = json['fingerprintNumber'];
|
||||||
fingerprintType = json['fingerprintType'];
|
fingerprintType = json['fingerprintType'];
|
||||||
fingerprintId = json['fingerprintId'];
|
fingerprintId = json['fingerprintId'];
|
||||||
|
senderUsername = json['senderUsername'];
|
||||||
|
weekDay = json['weekDay'];
|
||||||
|
cardName = json['cardName'];
|
||||||
|
cardNumber = json['cardNumber'];
|
||||||
|
cardType = json['cardType'];
|
||||||
|
cardId = json['cardId'];
|
||||||
}
|
}
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final Map<String, dynamic> data = <String, dynamic>{};
|
final Map<String, dynamic> data = <String, dynamic>{};
|
||||||
data['status'] = status;
|
data['fingerprintStatus'] = fingerprintStatus;
|
||||||
data['lockId'] = lockId;
|
data['lockId'] = lockId;
|
||||||
data['createDate'] = createDate;
|
data['createDate'] = createDate;
|
||||||
data['fingerprintName'] = fingerprintName;
|
data['fingerprintName'] = fingerprintName;
|
||||||
data['endDate'] = endDate;
|
data['endDate'] = endDate;
|
||||||
data['userId'] = userId;
|
data['apiUserId'] = apiUserId;
|
||||||
data['nickName'] = nickName;
|
data['nickName'] = nickName;
|
||||||
data['isCoerced'] = isCoerced;
|
data['isCoerced'] = isCoerced;
|
||||||
data['startDate'] = startDate;
|
data['startDate'] = startDate;
|
||||||
data['fingerprintNumber'] = fingerprintNumber;
|
data['fingerprintNumber'] = fingerprintNumber;
|
||||||
data['fingerprintType'] = fingerprintType;
|
data['fingerprintType'] = fingerprintType;
|
||||||
data['fingerprintId'] = fingerprintId;
|
data['fingerprintId'] = fingerprintId;
|
||||||
|
data['senderUsername'] = senderUsername;
|
||||||
|
data['weekDay'] = weekDay;
|
||||||
|
data['cardName'] = cardName;
|
||||||
|
data['cardNumber'] = cardNumber;
|
||||||
|
data['cardType'] = cardType;
|
||||||
|
data['cardId'] = cardId;
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -14,7 +14,9 @@ import '../../../../blue/io_tool/manager_event_bus.dart';
|
|||||||
import '../../../../blue/sender_manage.dart';
|
import '../../../../blue/sender_manage.dart';
|
||||||
import '../../../../network/api_repository.dart';
|
import '../../../../network/api_repository.dart';
|
||||||
import '../../../../tools/baseGetXController.dart';
|
import '../../../../tools/baseGetXController.dart';
|
||||||
|
import '../../../../tools/eventBusEventManage.dart';
|
||||||
import '../../../../tools/storage.dart';
|
import '../../../../tools/storage.dart';
|
||||||
|
import '../../../../tools/toast.dart';
|
||||||
import 'otherTypeKeyList_state.dart';
|
import 'otherTypeKeyList_state.dart';
|
||||||
|
|
||||||
class OtherTypeKeyListLogic extends BaseGetXController{
|
class OtherTypeKeyListLogic extends BaseGetXController{
|
||||||
@ -267,13 +269,62 @@ class OtherTypeKeyListLogic extends BaseGetXController{
|
|||||||
lockId: state.lockId.value.toString(),
|
lockId: state.lockId.value.toString(),
|
||||||
pageNo: '1',
|
pageNo: '1',
|
||||||
pageSize: '20',
|
pageSize: '20',
|
||||||
searchStr: '',
|
searchStr: state.searchController.text,
|
||||||
);
|
);
|
||||||
if(entity.errorCode!.codeIsSuccessful){
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
state.fingerprintItemListData.value = entity.data!.list!;
|
state.fingerprintItemListData.value = entity.data!.list!;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 重置所有的指纹
|
||||||
|
void deletAllFingerprintsData() async{
|
||||||
|
var entity = await ApiRepository.to.deletFingerprintsData(
|
||||||
|
fingerprintId: "",
|
||||||
|
lockId: state.lockId.value.toString(),
|
||||||
|
type: "1",
|
||||||
|
deleteType:"1"
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "重置成功");
|
||||||
|
getFingerprintsListData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取IC卡列表
|
||||||
|
void getICCardListData() async{
|
||||||
|
var entity = await ApiRepository.to.getICCardListData(
|
||||||
|
lockId: state.lockId.value.toString(),
|
||||||
|
pageNo: '1',
|
||||||
|
pageSize: '20',
|
||||||
|
searchStr: state.searchController.text,
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
state.fingerprintItemListData.value = entity.data!.list!;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除所有IC卡
|
||||||
|
void deletICCardData() async{
|
||||||
|
var entity = await ApiRepository.to.deletIcCardData(
|
||||||
|
cardId: "",
|
||||||
|
lockId: state.lockId.value.toString(),
|
||||||
|
type: "1",
|
||||||
|
deleteType:"1"
|
||||||
|
);
|
||||||
|
if(entity.errorCode!.codeIsSuccessful){
|
||||||
|
Toast.show(msg: "重置成功");
|
||||||
|
getICCardListData();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 监听修改完详情之后刷新列表
|
||||||
|
late StreamSubscription _teamEvent;
|
||||||
|
void _initRefreshAction() {
|
||||||
|
_teamEvent = eventBus.on<OtherTypeRefreshListEvent>().listen((event) {
|
||||||
|
getFingerprintsListData();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void onReady() {
|
void onReady() {
|
||||||
// TODO: implement onReady
|
// TODO: implement onReady
|
||||||
@ -282,7 +333,24 @@ class OtherTypeKeyListLogic extends BaseGetXController{
|
|||||||
|
|
||||||
_initReplySubscription();
|
_initReplySubscription();
|
||||||
|
|
||||||
getFingerprintsListData();
|
_initRefreshAction();
|
||||||
|
|
||||||
|
switch (state.fromType.value) {
|
||||||
|
case 0:
|
||||||
|
// 卡
|
||||||
|
getICCardListData();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// 指纹
|
||||||
|
getFingerprintsListData();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// 遥控
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@ -301,5 +369,6 @@ class OtherTypeKeyListLogic extends BaseGetXController{
|
|||||||
// TODO: implement onClose
|
// TODO: implement onClose
|
||||||
super.onClose();
|
super.onClose();
|
||||||
_replySubscription.cancel();
|
_replySubscription.cancel();
|
||||||
|
_teamEvent.cancel();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -37,7 +37,24 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
|||||||
TranslationLoader.lanKeys!.reset!.tr,
|
TranslationLoader.lanKeys!.reset!.tr,
|
||||||
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
style: TextStyle(color: Colors.white, fontSize: 24.sp),
|
||||||
),
|
),
|
||||||
onPressed: () {},
|
onPressed: () {
|
||||||
|
switch (state.fromType.value) {
|
||||||
|
case 0:
|
||||||
|
// 卡
|
||||||
|
logic.deletICCardData();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// 指纹
|
||||||
|
logic.deletAllFingerprintsData();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// 遥控
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
},
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
@ -49,15 +66,29 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
|||||||
),
|
),
|
||||||
Expanded(child: _buildMainUI(state.fromType.value)),
|
Expanded(child: _buildMainUI(state.fromType.value)),
|
||||||
AddBottomWhiteBtn(
|
AddBottomWhiteBtn(
|
||||||
btnName:
|
btnName: '${TranslationLoader.lanKeys!.add!.tr}${getAppBarTitle(state.fromType.value)}',
|
||||||
'${TranslationLoader.lanKeys!.add!.tr}${getAppBarTitle(state.fromType.value)}',
|
|
||||||
onClick: () async {
|
onClick: () async {
|
||||||
var data = await Get.toNamed(Routers.otherTypeKeyManagePage, arguments: {
|
var data = await Get.toNamed(Routers.otherTypeKeyManagePage, arguments: {
|
||||||
"lockId": state.lockId.value,
|
"lockId": state.lockId.value,
|
||||||
"fromType": state.fromType.value
|
"fromType": state.fromType.value
|
||||||
});
|
});
|
||||||
if(data != null) {
|
if(data != null) {
|
||||||
logic.getFingerprintsListData();
|
switch (state.fromType.value) {
|
||||||
|
case 0:
|
||||||
|
// 卡
|
||||||
|
logic.getICCardListData();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// 指纹
|
||||||
|
logic.getFingerprintsListData();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// 遥控
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
@ -96,13 +127,36 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
|||||||
child: TextField(
|
child: TextField(
|
||||||
//输入框一行
|
//输入框一行
|
||||||
maxLines: 1,
|
maxLines: 1,
|
||||||
// controller: _controller,
|
controller: state.searchController,
|
||||||
autofocus: false,
|
autofocus: false,
|
||||||
|
onChanged: (value){
|
||||||
|
print("onChanged:$value");
|
||||||
|
},
|
||||||
|
onEditingComplete: (){
|
||||||
|
print("onEditingComplete:");
|
||||||
|
},
|
||||||
|
onSubmitted: (value){
|
||||||
|
switch (state.fromType.value) {
|
||||||
|
case 0:
|
||||||
|
// 卡
|
||||||
|
logic.getICCardListData();
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// 指纹
|
||||||
|
logic.getFingerprintsListData();
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// 遥控
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
decoration: InputDecoration(
|
decoration: InputDecoration(
|
||||||
//输入里面输入文字内边距设置
|
//输入里面输入文字内边距设置
|
||||||
contentPadding: const EdgeInsets.only(
|
contentPadding: const EdgeInsets.only(top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
||||||
top: 12.0, left: -19.0, right: -15.0, bottom: 8.0),
|
|
||||||
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
hintText: TranslationLoader.lanKeys!.pleaseEnter!.tr,
|
||||||
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
|
hintStyle: TextStyle(fontSize: 22.sp, height: 3.0),
|
||||||
//不需要输入框下划线
|
//不需要输入框下划线
|
||||||
@ -123,26 +177,54 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Widget _buildMainUI(int type) {
|
Widget _buildMainUI(int type) {
|
||||||
String typeImgName = "";
|
// String typeImgName = "";
|
||||||
if (type == 0) {
|
// if (type == 0) {
|
||||||
//卡
|
// //卡
|
||||||
typeImgName = 'images/icon_card.png';
|
// typeImgName = 'images/icon_card.png';
|
||||||
} else if (type == 1) {
|
// } else if (type == 1) {
|
||||||
//指纹
|
// //指纹
|
||||||
typeImgName = 'images/icon_fingerprint.png';
|
// typeImgName = 'images/icon_fingerprint.png';
|
||||||
} else {
|
// } else if (type == 2) {
|
||||||
//遥控
|
// //遥控
|
||||||
typeImgName = 'images/icon_card.png';
|
// typeImgName = 'images/icon_card.png';
|
||||||
}
|
// }
|
||||||
|
|
||||||
return Obx(() => state.fingerprintItemListData.value.isNotEmpty ? ListView.separated(
|
return Obx(() => state.fingerprintItemListData.value.isNotEmpty ? ListView.separated(
|
||||||
itemCount: state.fingerprintItemListData.value.length,
|
itemCount: state.fingerprintItemListData.value.length,
|
||||||
itemBuilder: (c, index) {
|
itemBuilder: (c, index) {
|
||||||
FingerprintItemData fingerprintItemData = state.fingerprintItemListData.value[index];
|
FingerprintItemData fingerprintItemData = state.fingerprintItemListData.value[index];
|
||||||
return _keyItem(typeImgName, fingerprintItemData.fingerprintName!, fingerprintItemData.fingerprintType! == 1 ? "永久" : "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}", () {
|
switch (state.fromType.value) {
|
||||||
Get.toNamed(Routers.otherTypeKeyDetailPage,
|
case 0:
|
||||||
arguments: type);
|
// 卡
|
||||||
});
|
return _keyItem('images/icon_card.png', fingerprintItemData.cardName!, fingerprintItemData.cardType! == 1 ? "永久" : "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}", () async {
|
||||||
|
var data = await Get.toNamed(Routers.otherTypeKeyDetailPage, arguments: {
|
||||||
|
"fingerprintItemData": fingerprintItemData,
|
||||||
|
"type": type,
|
||||||
|
});
|
||||||
|
if(data != null) {
|
||||||
|
logic.getICCardListData();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
// 指纹
|
||||||
|
return _keyItem('images/icon_fingerprint.png', fingerprintItemData.fingerprintName!, fingerprintItemData.fingerprintType! == 1 ? "永久" : "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}", () async {
|
||||||
|
var data = await Get.toNamed(Routers.otherTypeKeyDetailPage, arguments: {
|
||||||
|
"fingerprintItemData": fingerprintItemData,
|
||||||
|
"type": type,
|
||||||
|
});
|
||||||
|
if(data != null) {
|
||||||
|
logic.getFingerprintsListData();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
// 遥控
|
||||||
|
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
separatorBuilder: (BuildContext context, int index) {
|
separatorBuilder: (BuildContext context, int index) {
|
||||||
return const Divider(
|
return const Divider(
|
||||||
|
|||||||
@ -1,4 +1,5 @@
|
|||||||
|
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
import 'package:get/get.dart';
|
import 'package:get/get.dart';
|
||||||
|
|
||||||
import 'fingerprintListData_entity.dart';
|
import 'fingerprintListData_entity.dart';
|
||||||
@ -8,6 +9,7 @@ class OtherTypeKeyListState{
|
|||||||
final fromType = 0.obs;
|
final fromType = 0.obs;
|
||||||
|
|
||||||
final fingerprintItemListData = <FingerprintItemData>[].obs;
|
final fingerprintItemListData = <FingerprintItemData>[].obs;
|
||||||
|
final TextEditingController searchController = TextEditingController();
|
||||||
|
|
||||||
OtherTypeKeyListState() {
|
OtherTypeKeyListState() {
|
||||||
Map map = Get.arguments;
|
Map map = Get.arguments;
|
||||||
|
|||||||
@ -10,7 +10,7 @@ import '../otherTypeAddKey/otherTypeAddKey_page.dart';
|
|||||||
class OtherTypeKeyManageTabbar extends StatefulWidget {
|
class OtherTypeKeyManageTabbar extends StatefulWidget {
|
||||||
var initialIndex = 1;
|
var initialIndex = 1;
|
||||||
var lockType = 0;
|
var lockType = 0;
|
||||||
var lockId = 0; // 0卡 1指纹 2钥匙
|
var lockId = 0;
|
||||||
OtherTypeKeyManageTabbar(
|
OtherTypeKeyManageTabbar(
|
||||||
{Key? key, required this.initialIndex, required this.lockType, required this.lockId})
|
{Key? key, required this.initialIndex, required this.lockType, required this.lockId})
|
||||||
: super(key: key);
|
: super(key: key);
|
||||||
|
|||||||
@ -79,6 +79,14 @@ abstract class Api {
|
|||||||
|
|
||||||
final String getFingerprintListURL = '/fingerprint/list'; // 指纹列表
|
final String getFingerprintListURL = '/fingerprint/list'; // 指纹列表
|
||||||
final String addFingerprintURL = '/fingerprint/add'; // 添加指纹
|
final String addFingerprintURL = '/fingerprint/add'; // 添加指纹
|
||||||
|
final String editFingerprintURL = '/fingerprint/changePeriod'; // 编辑指纹
|
||||||
|
final String deleteFingerprintURL = '/fingerprint/delete'; // 删除指纹
|
||||||
|
final String updateFingerprintUserNoURL = '/fingerprint/updateFingerprintUserNo'; // 更新指纹用户序号
|
||||||
|
|
||||||
|
final String getICCardListURL = '/identityCard/list'; // IC卡列表
|
||||||
|
final String addICCardURL = '/identityCard/add'; // 添加IC卡
|
||||||
|
final String editICCardURL = '/identityCard/update'; // 编辑IC卡
|
||||||
|
final String deleteICCardURL = '/identityCard/delete'; // 删除IC卡
|
||||||
|
|
||||||
final String getKeyDetailURL = '/key/get'; //获取单把钥匙详情信息
|
final String getKeyDetailURL = '/key/get'; //获取单把钥匙详情信息
|
||||||
final String lockUserListURL = '/keyUser/listKeyUser'; //锁用户列表
|
final String lockUserListURL = '/keyUser/listKeyUser'; //锁用户列表
|
||||||
|
|||||||
@ -804,7 +804,7 @@ class ApiProvider extends BaseProvider {
|
|||||||
String fingerprintType,
|
String fingerprintType,
|
||||||
String isCoerced,
|
String isCoerced,
|
||||||
String startDate,
|
String startDate,
|
||||||
String cyclicConfig,) =>
|
List weekDay,) =>
|
||||||
post(
|
post(
|
||||||
addFingerprintURL.toUrl,
|
addFingerprintURL.toUrl,
|
||||||
jsonEncode({
|
jsonEncode({
|
||||||
@ -816,9 +816,135 @@ class ApiProvider extends BaseProvider {
|
|||||||
'fingerprintType': fingerprintType,
|
'fingerprintType': fingerprintType,
|
||||||
'isCoerced': isCoerced,
|
'isCoerced': isCoerced,
|
||||||
'startDate': startDate,
|
'startDate': startDate,
|
||||||
'cyclicConfig': cyclicConfig,
|
'weekDay': weekDay,
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
// 编辑指纹
|
||||||
|
Future<Response> editFingerprintsData(
|
||||||
|
String fingerprintId,
|
||||||
|
String lockId,
|
||||||
|
List weekDay,
|
||||||
|
String startDate,
|
||||||
|
String endDate,
|
||||||
|
String isCoerced,
|
||||||
|
String fingerprintName) =>
|
||||||
|
post(
|
||||||
|
editFingerprintURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'fingerprintId': fingerprintId,
|
||||||
|
'lockId': lockId,
|
||||||
|
'weekDay': weekDay,
|
||||||
|
'startDate': startDate,
|
||||||
|
'endDate': endDate,
|
||||||
|
'isCoerced': isCoerced,
|
||||||
|
'fingerprintName': fingerprintName
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// 删除指纹
|
||||||
|
Future<Response> deletFingerprintsData(
|
||||||
|
String fingerprintId,
|
||||||
|
String lockId,
|
||||||
|
String type,
|
||||||
|
String deleteType) =>
|
||||||
|
post(
|
||||||
|
deleteFingerprintURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'fingerprintId': fingerprintId,
|
||||||
|
'lockId': lockId,
|
||||||
|
'type': type,
|
||||||
|
'deleteType': deleteType
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// 更新指纹用户序号
|
||||||
|
Future<Response> updateFingerprintUserNoLoadData(
|
||||||
|
String fingerprintId,
|
||||||
|
String lockId,
|
||||||
|
String fingerprintUserNo) =>
|
||||||
|
post(
|
||||||
|
updateFingerprintUserNoURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'fingerprintId': fingerprintId,
|
||||||
|
'lockId': lockId,
|
||||||
|
'fingerprintUserNo': fingerprintUserNo
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// 获取IC卡列表
|
||||||
|
Future<Response> getICCardListData(String lockId, String pageNo, String pageSize, String searchStr) =>
|
||||||
|
post(
|
||||||
|
getICCardListURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
'pageNo': pageNo,
|
||||||
|
'pageSize': pageSize,
|
||||||
|
'searchStr': searchStr,
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 添加卡
|
||||||
|
Future<Response> addICCardData(
|
||||||
|
String lockId,
|
||||||
|
String endDate,
|
||||||
|
String cardName,
|
||||||
|
String cardNumber,
|
||||||
|
String cardType,
|
||||||
|
String addType,
|
||||||
|
String startDate,
|
||||||
|
String isCoerced,
|
||||||
|
List weekDay,) =>
|
||||||
|
post(
|
||||||
|
addICCardURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
'endDate': endDate,
|
||||||
|
'cardName': cardName,
|
||||||
|
'cardNumber': cardNumber,
|
||||||
|
'cardType': cardType,
|
||||||
|
'addType': addType,
|
||||||
|
'startDate': startDate,
|
||||||
|
'isCoerced': isCoerced,
|
||||||
|
'weekDay': weekDay
|
||||||
|
}));
|
||||||
|
|
||||||
|
// 编辑ICCard
|
||||||
|
Future<Response> editICCardData(
|
||||||
|
String lockId,
|
||||||
|
String cardId,
|
||||||
|
String cardName,
|
||||||
|
String startDate,
|
||||||
|
String endDate,
|
||||||
|
String isCoerced,
|
||||||
|
List weekDay) =>
|
||||||
|
post(
|
||||||
|
editICCardURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'lockId': lockId,
|
||||||
|
'cardId': cardId,
|
||||||
|
'cardName': cardName,
|
||||||
|
'startDate': startDate,
|
||||||
|
'endDate': endDate,
|
||||||
|
'isCoerced': isCoerced,
|
||||||
|
'weekDay': weekDay
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
// 删除卡
|
||||||
|
Future<Response> deletIcCardData(
|
||||||
|
String cardId,
|
||||||
|
String lockId,
|
||||||
|
String type,
|
||||||
|
String deleteType) =>
|
||||||
|
post(
|
||||||
|
deleteICCardURL.toUrl,
|
||||||
|
jsonEncode({
|
||||||
|
'cardId': cardId,
|
||||||
|
'lockId': lockId,
|
||||||
|
'type': type,
|
||||||
|
'deleteType': deleteType
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
Future<Response> listLockByGroup(String type, String keyGroupId) => post(
|
Future<Response> listLockByGroup(String type, String keyGroupId) => post(
|
||||||
listLockByGroupURL.toUrl,
|
listLockByGroupURL.toUrl,
|
||||||
jsonEncode({'type': type, 'keyGroupId': keyGroupId}));
|
jsonEncode({'type': type, 'keyGroupId': keyGroupId}));
|
||||||
|
|||||||
@ -885,10 +885,111 @@ class ApiRepository {
|
|||||||
required String fingerprintType,
|
required String fingerprintType,
|
||||||
required String isCoerced,
|
required String isCoerced,
|
||||||
required String startDate,
|
required String startDate,
|
||||||
required String cyclicConfig,
|
required List weekDay,
|
||||||
}) async {
|
}) async {
|
||||||
final res =
|
final res =
|
||||||
await apiProvider.addFingerprintsData(lockId, endDate, addType, fingerprintName, fingerprintNumber, fingerprintType, isCoerced, startDate, cyclicConfig);
|
await apiProvider.addFingerprintsData(lockId, endDate, addType, fingerprintName, fingerprintNumber, fingerprintType, isCoerced, startDate, weekDay);
|
||||||
return CheckingInListMonthEntity.fromJson(res.body);
|
return CheckingInListMonthEntity.fromJson(res.body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 编辑指纹
|
||||||
|
Future<LoginEntity> editFingerprintsData(
|
||||||
|
{
|
||||||
|
required String fingerprintId,
|
||||||
|
required String lockId,
|
||||||
|
required List weekDay,
|
||||||
|
required String startDate,
|
||||||
|
required String endDate,
|
||||||
|
required String isCoerced,
|
||||||
|
required String fingerprintName
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.editFingerprintsData(fingerprintId, lockId, weekDay, startDate, endDate, isCoerced, fingerprintName);
|
||||||
|
return LoginEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除指纹
|
||||||
|
Future<LoginEntity> deletFingerprintsData(
|
||||||
|
{
|
||||||
|
required String fingerprintId,
|
||||||
|
required String lockId,
|
||||||
|
required String type,
|
||||||
|
required String deleteType
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.deletFingerprintsData(fingerprintId, lockId, type, deleteType);
|
||||||
|
return LoginEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 更新指纹用户序号
|
||||||
|
Future<LoginEntity> updateFingerprintUserNoLoadData(
|
||||||
|
{
|
||||||
|
required String fingerprintId,
|
||||||
|
required String lockId,
|
||||||
|
required String fingerprintUserNo
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.updateFingerprintUserNoLoadData(fingerprintId, lockId, fingerprintUserNo);
|
||||||
|
return LoginEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取Ic卡列表
|
||||||
|
Future<FingerprintListDataEntity> getICCardListData(
|
||||||
|
{
|
||||||
|
required String lockId,
|
||||||
|
required String pageNo,
|
||||||
|
required String pageSize,
|
||||||
|
required String searchStr,
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.getICCardListData(lockId, pageNo, pageSize, searchStr);
|
||||||
|
return FingerprintListDataEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 添加ID卡
|
||||||
|
Future<CheckingInListMonthEntity> addICCardData(
|
||||||
|
{
|
||||||
|
required String lockId,
|
||||||
|
required String endDate,
|
||||||
|
required String cardName,
|
||||||
|
required String cardNumber,
|
||||||
|
required String cardType,
|
||||||
|
required String addType,
|
||||||
|
required String startDate,
|
||||||
|
required String isCoerced,
|
||||||
|
required List weekDay,
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.addICCardData(lockId, endDate, cardName, cardNumber, cardType, addType, startDate, isCoerced, weekDay);
|
||||||
|
return CheckingInListMonthEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 编辑IC卡
|
||||||
|
Future<LoginEntity> editICCardData(
|
||||||
|
{
|
||||||
|
required String lockId,
|
||||||
|
required String cardId,
|
||||||
|
required String cardName,
|
||||||
|
required String startDate,
|
||||||
|
required String endDate,
|
||||||
|
required String isCoerced,
|
||||||
|
required List weekDay
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.editICCardData(lockId, cardId, cardName, startDate, endDate, isCoerced, weekDay);
|
||||||
|
return LoginEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 删除ic卡
|
||||||
|
Future<LoginEntity> deletIcCardData(
|
||||||
|
{
|
||||||
|
required String cardId,
|
||||||
|
required String lockId,
|
||||||
|
required String type,
|
||||||
|
required String deleteType
|
||||||
|
}) async {
|
||||||
|
final res =
|
||||||
|
await apiProvider.deletIcCardData(cardId, lockId, type, deleteType);
|
||||||
|
return LoginEntity.fromJson(res.body);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,8 +61,8 @@ class CommonItem extends StatelessWidget {
|
|||||||
: Text(
|
: Text(
|
||||||
rightTitle ?? "",
|
rightTitle ?? "",
|
||||||
textAlign: TextAlign.end,
|
textAlign: TextAlign.end,
|
||||||
overflow: TextOverflow.ellipsis,
|
// overflow: TextOverflow.ellipsis,
|
||||||
maxLines: 1,
|
// maxLines: 1,
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 22.sp,
|
fontSize: 22.sp,
|
||||||
color: AppColors.darkGrayTextColor),
|
color: AppColors.darkGrayTextColor),
|
||||||
|
|||||||
@ -19,3 +19,8 @@ class PassCurrentLockInformationEvent{
|
|||||||
KeyInfos keyInfo;
|
KeyInfos keyInfo;
|
||||||
PassCurrentLockInformationEvent(this.keyInfo);
|
PassCurrentLockInformationEvent(this.keyInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 卡、密码、指纹修改之后刷新列表
|
||||||
|
class OtherTypeRefreshListEvent{
|
||||||
|
OtherTypeRefreshListEvent();
|
||||||
|
}
|
||||||
|
|||||||
@ -388,7 +388,9 @@ class LanKeyEntity {
|
|||||||
this.pleaseEnterWifiPwd,
|
this.pleaseEnterWifiPwd,
|
||||||
this.wifiDistributionNetwork,
|
this.wifiDistributionNetwork,
|
||||||
this.attendanceRecord,
|
this.attendanceRecord,
|
||||||
this.edit
|
this.edit,
|
||||||
|
this.stressFingerprint,
|
||||||
|
this.effectiveDay
|
||||||
});
|
});
|
||||||
|
|
||||||
LanKeyEntity.fromJson(dynamic json) {
|
LanKeyEntity.fromJson(dynamic json) {
|
||||||
@ -811,6 +813,8 @@ class LanKeyEntity {
|
|||||||
wifiDistributionNetwork = json['wifiDistributionNetwork'];
|
wifiDistributionNetwork = json['wifiDistributionNetwork'];
|
||||||
attendanceRecord = json['attendanceRecord'];
|
attendanceRecord = json['attendanceRecord'];
|
||||||
edit = json['edit'];
|
edit = json['edit'];
|
||||||
|
stressFingerprint = json['stressFingerprint'];
|
||||||
|
effectiveDay = json['effectiveDay'];
|
||||||
}
|
}
|
||||||
String? starLock;
|
String? starLock;
|
||||||
String? clickUnlockAndHoldDownClose;
|
String? clickUnlockAndHoldDownClose;
|
||||||
@ -1219,6 +1223,8 @@ class LanKeyEntity {
|
|||||||
String? wifiDistributionNetwork;
|
String? wifiDistributionNetwork;
|
||||||
String? attendanceRecord;
|
String? attendanceRecord;
|
||||||
String? edit;
|
String? edit;
|
||||||
|
String? stressFingerprint;
|
||||||
|
String? effectiveDay;
|
||||||
Map<String, dynamic> toJson() {
|
Map<String, dynamic> toJson() {
|
||||||
final map = <String, dynamic>{};
|
final map = <String, dynamic>{};
|
||||||
map['starLock'] = starLock;
|
map['starLock'] = starLock;
|
||||||
@ -1637,6 +1643,8 @@ class LanKeyEntity {
|
|||||||
map['wifiDistributionNetwork'] = wifiDistributionNetwork;
|
map['wifiDistributionNetwork'] = wifiDistributionNetwork;
|
||||||
map['attendanceRecord'] = attendanceRecord;
|
map['attendanceRecord'] = attendanceRecord;
|
||||||
map['edit'] = edit;
|
map['edit'] = edit;
|
||||||
|
map['stressFingerprint'] = stressFingerprint;
|
||||||
|
map['effectiveDay'] = effectiveDay;
|
||||||
return map;
|
return map;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user