From 4bdd341131de4cb4ec6a250abaa624612a40255c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Fri, 15 Sep 2023 16:04:11 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=AE=8C=E6=88=90=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E8=80=83=E5=8B=A4=E6=A8=A1=E5=9D=97=E6=8E=A5=E5=8F=A3=E3=80=81?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E6=8C=87=E7=BA=B9=E9=83=A8=E5=88=86=E6=8E=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/images/icon_unHaveData.png | Bin 8444 -> 7421 bytes star_lock/images/lan/lan_en.json | 6 +- star_lock/images/lan/lan_keys.json | 7 +- star_lock/images/lan/lan_zh.json | 6 +- star_lock/ios/Podfile | 58 ++++ star_lock/ios/Podfile.lock | 14 +- .../ios/Runner.xcodeproj/project.pbxproj | 12 +- star_lock/ios/Runner/Info.plist | 16 +- star_lock/lib/appRouters.dart | 25 +- star_lock/lib/blue/blue_manage.dart | 38 +- .../checkingInDetail_entity.dart | 81 +++++ .../checkingInDetail_logic.dart | 52 +++ .../checkingInDetail_page.dart | 210 +++++------ .../checkingInDetail_state.dart | 26 ++ .../checkingInAddHolidays_logic.dart | 55 +++ .../checkingInAddHolidays_page.dart | 162 +++++++++ .../checkingInAddHolidays_state.dart | 19 + .../checkingInDeletHolidays_logic.dart | 22 ++ .../checkingInDeletHolidays_page.dart | 76 ++++ .../checkingInDeletHolidays_state.dart | 12 + .../checkingInSetHolidays_entity.dart | 111 ++++++ .../checkingInSetHolidays_logic.dart | 45 +++ .../checkingInSetHolidays_page.dart | 291 ++++++++++++++++ .../checkingInSetHolidays_state.dart | 18 + .../checkingInListDay_entity.dart | 109 ++++++ .../checkingInListMonth_entity.dart | 81 +++++ .../checkingInList/checkingInList_logic.dart | 83 +++++ .../checkingInList/checkingInList_page.dart | 326 +++++++++--------- .../checkingInList/checkingInList_state.dart | 19 +- .../checkingInSet/checkingInSet_entity.dart | 69 ++++ .../checkingInSet/checkingInSet_logic.dart | 84 +++++ .../checkingInSet/checkingInSet_page.dart | 85 +++-- .../checkingInSet/checkingInSet_state.dart | 19 +- .../checkingInSetHolidays_page.dart | 218 ------------ .../checkingInSetWorkTime_logic.dart | 20 ++ .../checkingInSetWorkTime_page.dart | 26 +- .../checkingInSetWorkTime_state.dart | 23 ++ .../checkingInSetWorkdaySet_logic.dart | 56 +++ .../checkingInSetWorkdaySet_page.dart | 51 +-- .../checkingInSetWorkdaySet_state.dart | 36 +- .../checkingInAddStaffSeletKey_entity.dart | 52 +++ .../checkingInAddStaff_logic.dart | 171 +++++++++ .../checkingInAddStaff_page.dart | 227 ++++++++++++ .../checkingInAddStaff_state.dart | 64 ++++ .../checkingInStaffList_entity.dart | 69 ++++ .../checkingInStaffList_logic.dart | 54 +++ .../checkingInStaffList_page.dart | 98 ++++++ .../checkingInStaffList_state.dart | 20 ++ .../checkingInStaffDetail_logic.dart | 9 + .../checkingInStaffDetail_page.dart | 70 ++++ .../checkingInStaffDetail_state.dart | 36 ++ .../automaticBlocking_logic.dart | 2 +- .../checkInCreatCompany_page.dart | 1 - .../lcokSet/lockTime/lockTime_logic.dart | 6 +- .../lockDetail/lockDetail_logic.dart | 8 +- .../lockDetail/lockDetail_page.dart | 26 +- .../otherTypeAddKey_logic.dart | 38 +- .../otherTypeAddKey/otherTypeAddKey_page.dart | 100 ++++-- .../otherTypeAddKey_state.dart | 22 ++ .../otherTypeKeyDetail_logic.dart | 11 + .../otherTypeKeyDetail_page.dart | 47 +-- .../otherTypeKeyDetail_state.dart | 4 + .../fingerprintListData_entity.dart | 123 +++++++ .../otherTypeKeyList_logic.dart | 18 +- .../otherTypeKeyList_page.dart | 63 ++-- .../otherTypeKeyList_state.dart | 13 + .../otherTypeKeyManage_page.dart | 8 +- .../otherTypeKeyManage_tabbar.dart | 4 +- .../mine/addLock/saveLock/saveLock_logic.dart | 2 +- star_lock/lib/network/api.dart | 16 + star_lock/lib/network/api_provider.dart | 193 ++++++++++- star_lock/lib/network/api_provider_base.dart | 4 +- star_lock/lib/network/api_repository.dart | 201 ++++++++++- .../lib/network/request_interceptor.dart | 3 +- star_lock/lib/tools/commonItem.dart | 2 +- star_lock/lib/tools/customNetworkImage.dart | 34 ++ star_lock/lib/tools/dateTool.dart | 25 +- star_lock/lib/tools/eventBusEventManage.dart | 5 + star_lock/lib/tools/noData.dart | 2 +- star_lock/lib/translations/lanKeyEntity.dart | 14 +- .../Flutter/GeneratedPluginRegistrant.swift | 2 + star_lock/pubspec.yaml | 3 + 82 files changed, 3818 insertions(+), 719 deletions(-) create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_entity.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_logic.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_state.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_logic.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_page.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_state.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_logic.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_page.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_state.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_entity.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_logic.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_page.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_state.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListDay_entity.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_entity.dart delete mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSetHolidays/checkingInSetHolidays_page.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaffSeletKey_entity.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_logic.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_page.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_state.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_logic.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_page.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_state.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_logic.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_page.dart create mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_state.dart create mode 100644 star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_logic.dart create mode 100644 star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_state.dart create mode 100644 star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart create mode 100644 star_lock/lib/tools/customNetworkImage.dart diff --git a/star_lock/images/icon_unHaveData.png b/star_lock/images/icon_unHaveData.png index 9ca9b958b0d8ff2b8efbdbb75068f195a12b6daf..d20b493c660fe2d031b4f31b4d94f0b0c0d9cf94 100644 GIT binary patch literal 7421 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%0DkKuj5SP!m@ljaXWunE1W5Oyy|W7buB*n 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 Da>zh} diff --git a/star_lock/images/lan/lan_en.json b/star_lock/images/lan/lan_en.json index 472d1f5f..769732d3 100644 --- a/star_lock/images/lan/lan_en.json +++ b/star_lock/images/lan/lan_en.json @@ -110,11 +110,13 @@ "dailyCharts":"Daily Charts", "monthlyLeaderboard":"Monthly Leader board", "noAttendanceRecord":"No Attendance Record", + "attendanceRecord":"Attendance Record", "everyoneIsVeryMotivated":"Everyone Is Very Motivated", "workingHoursWereNotReleased":"Working Hours Were Not Released", "beLate":"Be Late", "leaveEarly":"Leave Early", "noCardPunched":"No Card Punched", + "holidayInfo":"Holiday Info", "basicInformation":"Basic Information", "wirelessKeyboard":"Wireless Keyboard", @@ -400,5 +402,7 @@ "configuringWiFi":"Configuring WiFi", "pleaseEnterWifiName":"Please Enter Wifi Name", "wifiPwd":"WiFi password", - "pleaseEnterWifiPwd":"Please Enter WiFi Password" + "pleaseEnterWifiPwd":"Please Enter WiFi Password", + "edit":"Edit", + "stressFingerprint":"Stress Fingerprint" } diff --git a/star_lock/images/lan/lan_keys.json b/star_lock/images/lan/lan_keys.json index 9bc856b7..6f9d2f91 100644 --- a/star_lock/images/lan/lan_keys.json +++ b/star_lock/images/lan/lan_keys.json @@ -110,11 +110,13 @@ "dailyCharts":"dailyCharts", "monthlyLeaderboard":"monthlyLeaderboard", "noAttendanceRecord":"noAttendanceRecord", + "attendanceRecord":"attendanceRecord", "everyoneIsVeryMotivated":"everyoneIsVeryMotivated", "workingHoursWereNotReleased":"workingHoursWereNotReleased", "beLate":"beLate", "leaveEarly":"leaveEarly", "noCardPunched":"noCardPunched", + "holidayInfo":"holidayInfo", "basicInformation":"basicInformation", "wirelessKeyboard":"wirelessKeyboard", @@ -400,5 +402,8 @@ "configuringWiFi":"configuringWiFi", "pleaseEnterWifiName":"pleaseEnterWifiName", "wifiPwd":"wifiPwd", - "pleaseEnterWifiPwd":"pleaseEnterWifiPwd" + "pleaseEnterWifiPwd":"pleaseEnterWifiPwd", + "edit":"edit", + "stressFingerprint":"stressFingerprint" + } \ No newline at end of file diff --git a/star_lock/images/lan/lan_zh.json b/star_lock/images/lan/lan_zh.json index 3be9ca46..306e0cc3 100644 --- a/star_lock/images/lan/lan_zh.json +++ b/star_lock/images/lan/lan_zh.json @@ -110,11 +110,13 @@ "dailyCharts":"日榜", "monthlyLeaderboard":"月榜", "noAttendanceRecord":"无考勤记录", + "attendanceRecord":"考勤记录", "everyoneIsVeryMotivated":"大家干劲十足", "workingHoursWereNotReleased":"工作时长未出炉", "beLate":"迟到", "leaveEarly":"早退", "noCardPunched":"未打卡", + "holidayInfo":"假日信息", "basicInformation":"基本信息", "wirelessKeyboard":"无线键盘", @@ -403,5 +405,7 @@ "configuringWiFi":"配置WiFi", "pleaseEnterWifiName":"请输入WiFi名字", "wifiPwd":"WiFi名字", - "pleaseEnterWifiPwd":"请输入WiFi密码" + "pleaseEnterWifiPwd":"请输入WiFi密码", + "edit":"编辑", + "stressFingerprint":"胁迫指纹" } \ No newline at end of file diff --git a/star_lock/ios/Podfile b/star_lock/ios/Podfile index 10dd89a0..9ed9ebf9 100644 --- a/star_lock/ios/Podfile +++ b/star_lock/ios/Podfile @@ -35,5 +35,63 @@ end post_install do |installer| installer.pods_project.targets.each do |target| flutter_additional_ios_build_settings(target) + + # Start of the permission_handler configuration + target.build_configurations.each do |config| + + # You can enable the permissions needed here. For example to enable camera + # permission, just remove the `#` character in front so it looks like this: + # + # ## dart: PermissionGroup.camera + # 'PERMISSION_CAMERA=1' + # + # Preprocessor definitions can be found in: https://github.com/Baseflow/flutter-permission-handler/blob/master/permission_handler_apple/ios/Classes/PermissionHandlerEnums.h + config.build_settings['GCC_PREPROCESSOR_DEFINITIONS'] ||= [ + '$(inherited)', + + ## dart: PermissionGroup.calendar + # 'PERMISSION_EVENTS=1', + + ## dart: PermissionGroup.reminders + # 'PERMISSION_REMINDERS=1', + + ## dart: PermissionGroup.contacts + # 'PERMISSION_CONTACTS=1', + + ## dart: PermissionGroup.camera + # 'PERMISSION_CAMERA=1', + + ## dart: PermissionGroup.microphone + # 'PERMISSION_MICROPHONE=1', + + ## dart: PermissionGroup.speech + # 'PERMISSION_SPEECH_RECOGNIZER=1', + + ## dart: PermissionGroup.photos + # 'PERMISSION_PHOTOS=1', + + ## dart: [PermissionGroup.location, PermissionGroup.locationAlways, PermissionGroup.locationWhenInUse] + # 'PERMISSION_LOCATION=1', + + ## dart: PermissionGroup.notification + # 'PERMISSION_NOTIFICATIONS=1', + + ## dart: PermissionGroup.mediaLibrary + # 'PERMISSION_MEDIA_LIBRARY=1', + + ## dart: PermissionGroup.sensors + # 'PERMISSION_SENSORS=1', + + ## dart: PermissionGroup.bluetooth + # 'PERMISSION_BLUETOOTH=1', + + ## dart: PermissionGroup.appTrackingTransparency + # 'PERMISSION_APP_TRACKING_TRANSPARENCY=1', + + ## dart: PermissionGroup.criticalAlerts + # 'PERMISSION_CRITICAL_ALERTS=1' + ] + end + # End of the permission_handler configuration end end diff --git a/star_lock/ios/Podfile.lock b/star_lock/ios/Podfile.lock index bed9bd9a..14a8c1c0 100644 --- a/star_lock/ios/Podfile.lock +++ b/star_lock/ios/Podfile.lock @@ -20,6 +20,9 @@ PODS: - fluttertoast (0.0.2): - Flutter - Toast + - FMDB (2.7.5): + - FMDB/standard (= 2.7.5) + - FMDB/standard (2.7.5) - geocoding_ios (1.0.5): - Flutter - google_maps_flutter_ios (0.0.1): @@ -49,6 +52,9 @@ PODS: - shared_preferences_foundation (0.0.1): - Flutter - FlutterMacOS + - sqflite (0.0.3): + - Flutter + - FMDB (>= 2.7.5) - SwiftProtobuf (1.22.0) - Toast (4.0.0) - url_launcher_ios (0.0.1): @@ -71,6 +77,7 @@ DEPENDENCIES: - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`) - shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) + - sqflite (from `.symlinks/plugins/sqflite/ios`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`) SPEC REPOS: @@ -78,6 +85,7 @@ SPEC REPOS: - AMap3DMap - AMapFoundation - AMapLocation + - FMDB - GoogleMaps - Protobuf - SwiftProtobuf @@ -116,6 +124,8 @@ EXTERNAL SOURCES: :path: ".symlinks/plugins/reactive_ble_mobile/ios" shared_preferences_foundation: :path: ".symlinks/plugins/shared_preferences_foundation/darwin" + sqflite: + :path: ".symlinks/plugins/sqflite/ios" url_launcher_ios: :path: ".symlinks/plugins/url_launcher_ios/ios" @@ -130,6 +140,7 @@ SPEC CHECKSUMS: Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907 fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c + FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a geocoding_ios: a389ea40f6f548de6e63006a2e31bf66ff80769a google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693 @@ -141,10 +152,11 @@ SPEC CHECKSUMS: Protobuf: c6bc59bbab3d38a71c67f62d7cb7ca8f8ea4eca1 reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 + sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a SwiftProtobuf: 40bd808372cb8706108f22d28f8ab4a6b9bc6989 Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 -PODFILE CHECKSUM: 2f695eae20a86ca77f41095e9bd74ba52bd6304c +PODFILE CHECKSUM: 99f32fc524867f7069762a97e548b5edf4ebf43f COCOAPODS: 1.12.1 diff --git a/star_lock/ios/Runner.xcodeproj/project.pbxproj b/star_lock/ios/Runner.xcodeproj/project.pbxproj index 9f133cf6..5ea99da8 100644 --- a/star_lock/ios/Runner.xcodeproj/project.pbxproj +++ b/star_lock/ios/Runner.xcodeproj/project.pbxproj @@ -375,14 +375,14 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ZJ29NYHTV5; + DEVELOPMENT_TEAM = 7NLFRKNVY3; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock"; + PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock123"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; VERSIONING_SYSTEM = "apple-generic"; @@ -506,14 +506,14 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ZJ29NYHTV5; + DEVELOPMENT_TEAM = 7NLFRKNVY3; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock"; + PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock123"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; VERSIONING_SYSTEM = "apple-generic"; @@ -530,14 +530,14 @@ CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_STYLE = Automatic; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; - DEVELOPMENT_TEAM = ZJ29NYHTV5; + DEVELOPMENT_TEAM = 7NLFRKNVY3; ENABLE_BITCODE = NO; INFOPLIST_FILE = Runner/Info.plist; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", ); - PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock"; + PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock123"; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; VERSIONING_SYSTEM = "apple-generic"; diff --git a/star_lock/ios/Runner/Info.plist b/star_lock/ios/Runner/Info.plist index c9c9e8bf..9300b494 100644 --- a/star_lock/ios/Runner/Info.plist +++ b/star_lock/ios/Runner/Info.plist @@ -24,13 +24,13 @@ ???? CFBundleVersion $(FLUTTER_BUILD_NUMBER) + LSRequiresIPhoneOS + NSAppTransportSecurity NSAllowsArbitraryLoads - LSRequiresIPhoneOS - NSBluetoothAlwaysUsageDescription The app uses bluetooth to find, connect and transfer data between different devices NSBluetoothPeripheralUsageDescription @@ -39,16 +39,16 @@ 这是你的自拍照 NSContactsUsageDescription Reason we need access to the contact list + NSLocationAlwaysAndWhenInUseUsageDescription + 应用在前台和后台的时候可以搜到更新的位置信息 + NSLocationAlwaysUsageDescription + 应用在后台的时候可以搜到更新的位置信息 + NSLocationWhenInUseUsageDescription + 应用在前台的时候可以搜到更新的位置信息 NSMicrophoneUsageDescription 用于音频插件 NSPhotoLibraryUsageDescription 用于相册 - NSLocationWhenInUseUsageDescription - 应用在前台的时候可以搜到更新的位置信息 - NSLocationAlwaysUsageDescription - 应用在后台的时候可以搜到更新的位置信息 - NSLocationAlwaysAndWhenInUseUsageDescription - 应用在前台和后台的时候可以搜到更新的位置信息 UIApplicationSupportsIndirectInputEvents UIBackgroundModes diff --git a/star_lock/lib/appRouters.dart b/star_lock/lib/appRouters.dart index fde7e715..d8312234 100644 --- a/star_lock/lib/appRouters.dart +++ b/star_lock/lib/appRouters.dart @@ -1,14 +1,11 @@ -import 'package:flutter/widgets.dart'; + import 'package:get/get.dart'; import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart'; import 'package:star_lock/login/register/starLock_register_binding.dart'; -import 'package:star_lock/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_page.dart'; -import 'package:star_lock/main/lockDetail/electronicKey/electronicKeyList/entity/ElectronicKeyListEntity.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/lockUserList_page.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart'; import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart'; -import 'package:star_lock/main/lockMian/entity/lockInfoEntity.dart'; import 'package:star_lock/mine/minePersonInfo/minePersonInfoEmail/minePersonInfoEmail_page.dart'; import 'package:star_lock/mine/mineSet/authorizedAdministrator/addAuthorizedAdministrator_page.dart'; import 'package:star_lock/mine/mineSet/lockGroup/lockGroupList_page.dart'; @@ -24,14 +21,17 @@ import 'login/forgetPassword/starLock_forgetPassword_page.dart'; import 'login/login/starLock_login_page.dart'; import 'login/register/starLock_register_page.dart'; import 'login/seletCountryRegion/seletCountryRegion_page.dart'; -import 'main/lockDetail/checkingIn/checkingInAddHolidays/checkingInAddHolidays_page.dart'; import 'main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_page.dart'; +import 'main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_page.dart'; +import 'main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_page.dart'; +import 'main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_page.dart'; import 'main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart'; import 'main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart'; -import 'main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_page.dart'; -import 'main/lockDetail/checkingIn/checkingInSetHolidays/checkingInSetHolidays_page.dart'; import 'main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_page.dart'; import 'main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_page.dart'; +import 'main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_page.dart'; +import 'main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_page.dart'; +import 'main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_page.dart'; import 'main/lockDetail/electronicKey/electronicKeyDetail/keyOperationRecord_page.dart'; import 'main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart'; import 'main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_page.dart'; @@ -76,7 +76,6 @@ import 'main/lockDetail/electronicKey/electronicKeyPeriodValidity/electronicKeyP import 'main/lockDetail/electronicKey/massSendElectronicKey/massSendElectronicManageKey/massSendElectronicKeyManage_page.dart'; import 'main/lockDetail/electronicKey/sendElectronicKey/sendElectronicManageKey/sendElectronicKeyManage_page.dart'; import 'main/lockDetail/electronicKey/sendEmailNotification/sendEmailNotification_page.dart'; -import 'main/lockDetail/lockDetail/lockDetail_page.dart'; import 'main/lockDetail/lockOperatingRecord/lockOperatingRecord_page.dart'; import 'main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart'; import 'main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart'; @@ -205,6 +204,7 @@ abstract class Routers { static const checkingInSetPage = '/CheckingInSetPage'; // 考勤设置 static const checkingInStaffManagePage = '/CheckingInStaffManagePage'; // 员工管理 static const checkingInAddStaffPage = '/CheckingInAddStaffPage'; // 添加员工 + static const checkingInStaffDetailPage = '/CheckingInStaffDetailPage'; // 编辑员工 static const checkingInSetWorkTimePage = '/CheckingInSetWorkTimePage'; // 工作时间设置 static const checkingInSetWorkdaySet = '/CheckingInSetWorkdaySet'; // 工作日设置 @@ -212,6 +212,7 @@ abstract class Routers { '/CheckingInSetHolidaysPage'; // 节假日设置 static const checkingInAddHolidaysPage = '/CheckingInAddHolidaysPage'; // 添加假日 static const checkingInDetailPage = '/CheckingInDetailPage'; // 考勤详情 + static const checkingInDeletHolidaysPage = '/CheckingInDeletHolidaysPage'; // 删除考勤 static const mineSetPage = '/MineSetPage'; // 我的设置 static const mineMultiLanguagePage = '/MineMultiLanguagePage'; // 我的设置 @@ -572,6 +573,10 @@ abstract class AppRouters { name: Routers.checkingInAddHolidaysPage, page: () => const CheckingInAddHolidaysPage(), ), + GetPage( + name: Routers.checkingInDeletHolidaysPage, + page: () => const CheckingInDeletHolidaysPage(), + ), GetPage( name: Routers.checkingInDetailPage, page: () => const CheckingInDetailPage(), @@ -757,7 +762,9 @@ abstract class AppRouters { GetPage( name: Routers.lockUserListPage, page: () => const LockUserListPage()), GetPage( - name: Routers.checkInCreatCompanyPage, page: () => const CheckInCreatCompanyPage()) + name: Routers.checkInCreatCompanyPage, page: () => const CheckInCreatCompanyPage()), + GetPage( + name: Routers.checkingInStaffDetailPage, page: () => const CheckingInStaffDetailPage()) ]; } diff --git a/star_lock/lib/blue/blue_manage.dart b/star_lock/lib/blue/blue_manage.dart index 5bb1bd81..d286d403 100644 --- a/star_lock/lib/blue/blue_manage.dart +++ b/star_lock/lib/blue/blue_manage.dart @@ -89,18 +89,20 @@ class BlueManage{ } /// 连接监听状态 - Future connect(String deviceMAC, String deviceName, {ConnectStateCallBack? connectStateCallBack, bool? isFrist = false}) async { + Future connect(String deviceMAC, String deviceName, {ConnectStateCallBack? connectStateCallBack, bool? isFrist = false ,bool isShowLoading = true}) async { connectDeviceMacAddress = deviceMAC; connectDeviceName = deviceName; print("connectDeviceId:$connectDeviceMacAddress connectDeviceName:$connectDeviceName"); - EasyLoading.show(); - Future.delayed(const Duration(seconds: 30), () { //asynchronous delay - print("30s之后 菊花没有隐藏的话,强制隐藏菊花"); - if(EasyLoading.isShow){ - EasyLoading.dismiss(); - } - }); + if(isShowLoading){ + EasyLoading.show(); + Future.delayed(const Duration(seconds: 10), () { //asynchronous delay + print("10s之后 菊花没有隐藏的话,强制隐藏菊花"); + if(EasyLoading.isShow){ + EasyLoading.dismiss(); + } + }); + } _flutterReactiveBle!.connectToDevice(id: connectDeviceMacAddress, connectionTimeout: const Duration(seconds: 100000)).listen((connectionStateUpdate) async { // 获取状态 deviceConnectionState = connectionStateUpdate.connectionState; @@ -177,18 +179,20 @@ class BlueManage{ } // 重新连接 - Future judgeReconnect(String deviceMAC, String deviceName, ConnectStateCallBack? connectStateCallBack) async { + Future judgeReconnect(String deviceMAC, String deviceName, ConnectStateCallBack? connectStateCallBack, {bool isShowLoading = true}) async { if(deviceConnectionState == DeviceConnectionState.connected){ - EasyLoading.show(); - Future.delayed(const Duration(seconds: 30), () { //asynchronous delay - print("30s之后 菊花没有隐藏的话,强制隐藏菊花"); - if(EasyLoading.isShow){ - EasyLoading.dismiss(); - } - }); + if(isShowLoading){ + EasyLoading.show(); + Future.delayed(const Duration(seconds: 10), () { //asynchronous delay + print("10s之后 菊花没有隐藏的话,强制隐藏菊花"); + if(EasyLoading.isShow){ + EasyLoading.dismiss(); + } + }); + } connectStateCallBack!(deviceConnectionState!); }else{ - connect(deviceMAC, deviceName, connectStateCallBack: (state){ + connect(deviceMAC, deviceName, isShowLoading: false, connectStateCallBack: (state){ connectStateCallBack!(deviceConnectionState!); }); } diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_entity.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_entity.dart new file mode 100644 index 00000000..51e47ff1 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_entity.dart @@ -0,0 +1,81 @@ +class CheckingInDetailEntity { + int? errorCode; + String? description; + String? errorMsg; + Data? data; + + CheckingInDetailEntity( + {this.errorCode, this.description, this.errorMsg, this.data}); + + CheckingInDetailEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + int? noPunchTimes; + int? lateTimes; + int? earlyTimes; + List? monthList; + + Data({this.noPunchTimes, this.lateTimes, this.earlyTimes, this.monthList}); + + Data.fromJson(Map json) { + noPunchTimes = json['noPunchTimes']; + lateTimes = json['lateTimes']; + earlyTimes = json['earlyTimes']; + if (json['monthList'] != null) { + monthList = []; + json['monthList'].forEach((v) { + monthList!.add(MonthList.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['noPunchTimes'] = noPunchTimes; + data['lateTimes'] = lateTimes; + data['earlyTimes'] = earlyTimes; + if (monthList != null) { + data['monthList'] = monthList!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class MonthList { + int? openingTimeStart; + int? openingTimeEnd; + int? colorType; + + MonthList({this.openingTimeStart, this.openingTimeEnd, this.colorType}); + + MonthList.fromJson(Map json) { + openingTimeStart = json['openingTimeStart']; + openingTimeEnd = json['openingTimeEnd']; + colorType = json['colorType']; + } + + Map toJson() { + final Map data = {}; + data['openingTimeStart'] = openingTimeStart; + data['openingTimeEnd'] = openingTimeEnd; + data['colorType'] = colorType; + return data; + } +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_logic.dart new file mode 100644 index 00000000..7dbbd897 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_logic.dart @@ -0,0 +1,52 @@ + + +import 'package:star_lock/tools/baseGetXController.dart'; + +import '../../../../network/api_repository.dart'; +import 'checkingInDetail_state.dart'; + +typedef BlockLoadSuccssCallback = void Function(); +class CheckingInDetailLogic extends BaseGetXController{ + CheckingInDetailState state = CheckingInDetailState(); + + // 获取考勤详情 + Future getCheckInDetailData(BlockLoadSuccssCallback loadSuccssCallback) async{ + var entity = await ApiRepository.to.getCheckInDetailData( + companyId: state.companyId.value, + attendanceDate:state.checkDate.value.toString(), + staffId: state.staffId.value.toString(), + ); + if(entity.errorCode!.codeIsSuccessful){ + state.lateTimes.value = entity.data!.lateTimes.toString(); + state.earlyTimes.value = entity.data!.earlyTimes.toString(); + state.noPunchTimes.value = entity.data!.noPunchTimes.toString(); + + state.monthListData.value = entity.data!.monthList!; + loadSuccssCallback(); + } + } + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + print("onReady()"); + + // getCheckInDetailData(); + } + + @override + void onInit() { + // TODO: implement onInit + super.onInit(); + print("onInit()"); + + } + + @override + void onClose() { + // TODO: implement onClose + + } + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_page.dart index 6a0a09d1..cee73291 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_page.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_page.dart @@ -5,6 +5,7 @@ import 'package:get/get.dart'; import '../../../../app_settings/app_colors.dart'; import '../../../../tools/titleAppBar.dart'; import '../../../../translations/trans_lib.dart'; +import 'checkingInDetail_logic.dart'; class CheckingInDetailPage extends StatefulWidget { const CheckingInDetailPage({Key? key}) : super(key: key); @@ -14,6 +15,10 @@ class CheckingInDetailPage extends StatefulWidget { } class _CheckingInDetailPageState extends State { + + final logic = Get.put(CheckingInDetailLogic()); + final state = Get.find().state; + int _year = DateTime.now().year; int _month = DateTime.now().month; int _day = DateTime.now().day; @@ -23,46 +28,40 @@ class _CheckingInDetailPageState extends State { @override void initState() { // TODO: implement initState + super.initState(); + //设置默认当前月日期 _setDatas(year: _year, month: _month); - //设置模拟数据,日历月事件,可根据接口返回的结果 - _loadAttendanceMonthRecord("$_year-$_month"); - //日历日事件 - _loadAttendanceDayRecord("$_year-$_month-$_day"); + logic.getCheckInDetailData((){ + //设置模拟数据,日历月事件,可根据接口返回的结果 + _loadAttendanceMonthRecord("$_year-$_month"); + }); - super.initState(); + //设置模拟数据,日历月事件,可根据接口返回的结果 + // _loadAttendanceMonthRecord("$_year-$_month"); + //日历日事件 + // _loadAttendanceDayRecord("$_year-$_month-$_day"); } //加载月历事件,请求接口 _loadAttendanceMonthRecord(String dateTime) async { - CalendarModel bean1 = - CalendarModel(year: _year, month: _month, day: 1, workType: "2"); - CalendarModel bean2 = - CalendarModel(year: _year, month: _month, day: 2, workType: "1"); - CalendarModel bean3 = - CalendarModel(year: _year, month: _month, day: 3, workType: "2"); - CalendarModel bean4 = - CalendarModel(year: _year, month: _month, day: 4, workType: "0"); - CalendarModel bean5 = - CalendarModel(year: _year, month: _month, day: 5, workType: "0"); - CalendarModel bean6 = - CalendarModel(year: _year, month: _month, day: 6, workType: "1"); - _listDatas.add(bean1); - _listDatas.add(bean2); - _listDatas.add(bean3); - _listDatas.add(bean4); - _listDatas.add(bean5); - _listDatas.add(bean6); + // print("_datas.length:${_datas.length} state.monthListData:${state.monthListData.length}"); + // 显示的上个月的天数 + var placeholderDays = _getPlaceholderDays(year: _year, month: _month); + // 当月多少天 + var currentMonthDays = _getCurrentMonthDays(year: _year, month: _month); + // var changeList = _datas.sublist(placeholderDays, placeholderDays + currentMonthDays); + // print("_datas.length:${_datas.length} placeholderDays:$placeholderDays currentMonthDays:$currentMonthDays"); setState(() { + // 因为_datas这个月上个月都包含的都有 遍历把本月的赋值 for (int i = 0; i < _datas.length; i++) { - for (int j = 0; j < _listDatas.length; j++) { - if (_datas[i].year == _listDatas[j].year && - _datas[i].month == _listDatas[j].month && - _datas[i].day == _listDatas[j].day) { - _datas[i].workType = _listDatas[j].workType; - } + // 因为i从0开始 所以i>=上个月的天数 且小于上个月跟本月天数之和 + if((i >= placeholderDays) && (i < (placeholderDays + currentMonthDays))){ + // print("i:$i placeholderDays:$placeholderDays currentMonthDays:$currentMonthDays state.monthListData.length:${state.monthListData.length}"); + _datas[i].workType = state.monthListData[i-placeholderDays].colorType.toString(); + // print("_datas[i].workType:${_datas[i].workType} i:$i"); } } }); @@ -72,6 +71,12 @@ class _CheckingInDetailPageState extends State { _loadAttendanceDayRecord(String dateTime) async { //可根据接口返回的内容在日历下面打卡信息或者其余内容 print("点击的是$dateTime"); + state.checkDate.value = DateTime.parse(dateTime).millisecondsSinceEpoch; + print("点击的是$dateTime state.checkDate.value:${state.checkDate.value}"); + logic.getCheckInDetailData((){ + //设置模拟数据,日历月事件,可根据接口返回的结果 + _loadAttendanceMonthRecord("$_year-$_month"); + }); } @override @@ -123,35 +128,18 @@ class _CheckingInDetailPageState extends State { }, child: Container( // margin: EdgeInsets.only(left: 20.w), - child: Image( - width: 30.w, - height: 30.w, - image: const AssetImage("images/icon_left_black.png"), - ), + child: Image(width: 50.w, height: 30.w, image: const AssetImage("images/icon_left_black.png"),), ), ), - SizedBox( - width: 60.w, - ), - Text("$_year-$_month", - style: TextStyle( - fontSize: 28.sp, - color: Colors.black, - fontWeight: FontWeight.w500)), - SizedBox( - width: 60.w, - ), + SizedBox(width: 60.w,), + Text("$_year-$_month", style: TextStyle(fontSize: 28.sp, color: Colors.black, fontWeight: FontWeight.w500)), + SizedBox(width: 60.w), GestureDetector( onTap: () { _nextMonth(); }, child: Container( - // margin: EdgeInsets.only(right: 20.sp), - child: Image( - width: 30.w, - height: 30.w, - image: const AssetImage("images/icon_right_black.png"), - ), + child: Image(width: 50.w, height: 30.w, image: const AssetImage("images/icon_right_black.png")), ), ), ], @@ -220,29 +208,42 @@ class _CheckingInDetailPageState extends State { //子组件宽高长度比例 childAspectRatio: 1), itemBuilder: (context, index) { + // print("_datas[index].workType:${_datas[index].workType}"); + Color backColor = Colors.white; + // Color textColor = const Color(0xFFFFFFFF); + if(_datas[index].workType == "1"){ + backColor = const Color(0xFFE83523); + // textColor = Colors.white; + }else if( _datas[index].workType == "2"){ + backColor = const Color(0xFFEDB459); + // textColor = Colors.white; + }else if( _datas[index].workType == "3"){ + backColor = const Color(0xFF666666); + // textColor = Colors.white; + } return GestureDetector( onTap: () { - setState(() { - if (_datas[index].month == _month) { - //判断点击的是否是当月日期,只对当前月点击的日期做处理 - for (int i = 0; i < _datas.length; i++) { - if (i == index) { - //切换至选中的日期 - _day = _datas[i].day!; - _datas[i].isSelect = true; - - //加载选中的日期事件 - _loadAttendanceDayRecord( - "${_datas[i].year}-${_datas[i].month}-${_datas[i].day}"); - } else { - _datas[i].isSelect = false; - } - } - } else { - //不是当月的不做处理 - // _datas[index].is_select=false; - } - }); + // setState(() { + // if (_datas[index].month == _month) { + // //判断点击的是否是当月日期,只对当前月点击的日期做处理 + // for (int i = 0; i < _datas.length; i++) { + // if (i == index) { + // //切换至选中的日期 + // _day = _datas[i].day!; + // _datas[i].isSelect = true; + // + // //加载选中的日期事件 + // _loadAttendanceDayRecord( + // "${_datas[i].year}-${_datas[i].month}-${_datas[i].day}"); + // } else { + // _datas[i].isSelect = false; + // } + // } + // } else { + // //不是当月的不做处理 + // // _datas[index].is_select=false; + // } + // }); }, child: Container( child: Column( @@ -251,12 +252,10 @@ class _CheckingInDetailPageState extends State { width: 40.w, height: 40.w, //设置底部背景 - decoration: _datas[index].isSelect! - ? const BoxDecoration( - color: Color(0xFF2C91F6), - shape: BoxShape.circle, - ) - : const BoxDecoration(), + decoration: BoxDecoration( + color: backColor, + shape: BoxShape.circle, + ), child: Center( child: Text( //不是当前月不显示值 @@ -265,7 +264,7 @@ class _CheckingInDetailPageState extends State { : "", textAlign: TextAlign.center, //设置选中字体颜色,以及周末和工作日颜色 - style: _datas[index].isSelect! + style: (int.parse(_datas[index].workType!) > 0) ? TextStyle( fontSize: 24.sp, color: const Color(0xFFFFFFFF)) : (index % 7 == 5 || index % 7 == 6 @@ -280,19 +279,19 @@ class _CheckingInDetailPageState extends State { ), const SizedBox(height: 5), //设置底部小圆点,非当前月的不显示,设置为透明,其余的根据状态判断显示 - _datas[index].month == _month && - _datas[index].workType != "" && - _datas[index].workType != "0" - ? Container( - height: 6.0, - width: 6.0, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: _datas[index].workType == "1" - ? const Color(0xFFF48835) - : const Color(0xFF2C91F6)), - ) - : Container(), + // _datas[index].month == _month && + // _datas[index].workType != "" && + // _datas[index].workType != "0" + // ? Container( + // height: 6.0, + // width: 6.0, + // decoration: BoxDecoration( + // shape: BoxShape.circle, + // color: _datas[index].workType == "1" + // ? const Color(0xFFF48835) + // : const Color(0xFF2C91F6)), + // ) + // : Container(), ], ), ), @@ -322,9 +321,9 @@ class _CheckingInDetailPageState extends State { ), ], ), - _bottomStatisticsItemWidget(Colors.red, "迟到", "0"), - _bottomStatisticsItemWidget(Colors.orange, "早退", "0"), - _bottomStatisticsItemWidget(Colors.grey, "未打卡", "0"), + _bottomStatisticsItemWidget(const Color(0xFFE83523), "迟到", state.lateTimes.value), + _bottomStatisticsItemWidget(const Color(0xFFEDB459), "早退", state.earlyTimes.value), + _bottomStatisticsItemWidget(const Color(0xFF666666), "未打卡", state.noPunchTimes.value), ], ); } @@ -374,9 +373,9 @@ class _CheckingInDetailPageState extends State { // 获取行数 int _getRowsForMonthYear({int? year, int? month}) { - //当前月天数 + // 当前月天数 var currentMonthDays = _getCurrentMonthDays(year: year, month: month); - // + // 这个月1号前面有几天 var placeholderDays = _getPlaceholderDays(year: year, month: month); int rows = (currentMonthDays + placeholderDays) ~/ 7; @@ -434,7 +433,7 @@ class _CheckingInDetailPageState extends State { month: lastMonth, day: firstDay + i + 1, isSelect: false, - workType: "")); + workType: "0")); } /// 本月显示 @@ -446,14 +445,14 @@ class _CheckingInDetailPageState extends State { month: month, day: i + 1, isSelect: true, - workType: "")); + workType: "0")); } else { _datas.add(CalendarModel( year: year, month: month, day: i + 1, isSelect: false, - workType: "")); + workType: "0")); } } @@ -472,7 +471,7 @@ class _CheckingInDetailPageState extends State { month: nextMonth, day: i + 1, isSelect: false, - workType: "")); + workType: "0")); } } @@ -489,9 +488,9 @@ class _CheckingInDetailPageState extends State { _datas.clear(); _setDatas(year: _year, month: _month); //更新月历事件 - _loadAttendanceMonthRecord("$_year-$_month"); + // _loadAttendanceMonthRecord("$_year-$_month"); //更新日事件 - _loadAttendanceDayRecord("$_year-$_month-$_day"); + _loadAttendanceDayRecord("$_year-${_month.toString().padLeft(2,'0')}-${_day.toString().padLeft(2,'0')}"); }); } @@ -533,7 +532,8 @@ class _CheckingInDetailPageState extends State { //更新月历事件 _loadAttendanceMonthRecord("$_year-$_month"); //更新日事件 - _loadAttendanceDayRecord("$_year-$_month-$_day"); + // _loadAttendanceDayRecord("$_year-$_month-$_day"); + _loadAttendanceDayRecord("$_year-${_month.toString().padLeft(2,'0')}-${_day.toString().padLeft(2,'0')}"); }); } } @@ -543,7 +543,7 @@ class CalendarModel { int? year; int? month; int? day; - String? workType = ""; //日期事件,0,休息,1,异常,2,正常 + String? workType = ""; //日期事件,0休息,1迟到,2早退,3未打卡 bool? isSelect = false; CalendarModel( diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_state.dart new file mode 100644 index 00000000..9451c293 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_state.dart @@ -0,0 +1,26 @@ + +import 'package:get/get.dart'; + +import '../../../lockMian/entity/lockInfoEntity.dart'; +import 'checkingInDetail_entity.dart'; + +class CheckingInDetailState{ + + final getKeyInfosData = KeyInfos().obs; + final companyId = "".obs; + final staffId = 0.obs; + + final checkDate = DateTime.now().millisecondsSinceEpoch.obs; + + var lateTimes = "".obs;// 迟到 + var earlyTimes = "".obs;// 早退 + var noPunchTimes = "".obs;// 未打车 + final monthListData = [].obs; + CheckingInDetailState() { + Map map = Get.arguments; + getKeyInfosData.value = map["getKeyInfosData"]; + companyId.value = map["companyId"]; + staffId.value = map["staffId"]; + } + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_logic.dart new file mode 100644 index 00000000..bca27b16 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_logic.dart @@ -0,0 +1,55 @@ + + +import 'package:date_format/date_format.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/tools/baseGetXController.dart'; +import 'package:star_lock/tools/toast.dart'; +import '../../../../../network/api_repository.dart'; +import 'checkingInAddHolidays_state.dart'; + +class CheckingInAddHolidaysLogic extends BaseGetXController{ + CheckingInAddHolidaysState state = CheckingInAddHolidaysState(); + + // 添加假期 + void editStaffLoadData() async{ + if(state.staffNameController.text.isEmpty){ + Toast.show(msg: "请输入姓名"); + return; + } + + var entity = await ApiRepository.to.addHolidaysData( + companyId: state.companyId.value, + fillClassDate: state.makeUpWorkDate.value.isNotEmpty ? DateTime.parse(state.makeUpWorkDate.value).millisecondsSinceEpoch.toString() : "", + vacationEndDate: DateTime.parse(state.endDate.value).millisecondsSinceEpoch.toString(), + vacationName: state.staffNameController.text, + vacationStartDate: DateTime.parse(state.beginDate.value).millisecondsSinceEpoch.toString() + ); + if(entity.errorCode!.codeIsSuccessful){ + Toast.show(msg: "添加成功"); + Get.back(result: "addScuess"); + } + } + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + print("onReady()"); + + } + + @override + void onInit() { + // TODO: implement onInit + super.onInit(); + print("onInit()"); + + } + + @override + void onClose() { + // TODO: implement onClose + + } + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_page.dart new file mode 100644 index 00000000..e88f95e0 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_page.dart @@ -0,0 +1,162 @@ +import 'package:date_format/date_format.dart'; +import 'package:flutter/material.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/showCalendar.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; +import 'checkingInAddHolidays_logic.dart'; + +class CheckingInAddHolidaysPage extends StatefulWidget { + const CheckingInAddHolidaysPage({Key? key}) : super(key: key); + + @override + State createState() => + _CheckingInAddHolidaysPageState(); +} + +class _CheckingInAddHolidaysPageState extends State { + final logic = Get.put(CheckingInAddHolidaysLogic()); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.addedHoliday!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor), + body: Column( + children: [ + CommonItem( + leftTitel: TranslationLoader.lanKeys!.name!.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, + rightWidget: getTFWidget( + "(${TranslationLoader.lanKeys!.mustFillIn!.tr})")), + Obx(() => CommonItem( + leftTitel: TranslationLoader.lanKeys!.startDate!.tr, + rightTitle: state.beginDate.value.isEmpty ? "(${TranslationLoader.lanKeys!.mustFillIn!.tr})" : state.beginDate.value, + isHaveLine: true, + isHaveDirection: false, + action: () async { + await showDialog( + context: context, + builder: (context) { + return ShowCalendar( + datePickerMode: DatePickerMode.day, + seletAction: (dateTime) { + String beginDate = formatDate(dateTime, [yyyy,'-',mm,'-',dd]); + state.beginDate.value = beginDate; + Get.back(); + // Navigator.of(context).pop(true); + }); + }); + })), + Obx(() => CommonItem( + leftTitel: TranslationLoader.lanKeys!.endDate!.tr, + rightTitle: state.endDate.value.isEmpty ? "(${TranslationLoader.lanKeys!.mustFillIn!.tr})" : state.endDate.value, + isHaveLine: true, + isHaveDirection: false, + action: () async { + await showDialog( + context: context, + builder: (context) { + return ShowCalendar( + datePickerMode: DatePickerMode.day, + seletAction: (dateTime) { + String endDate = formatDate(dateTime, [yyyy,'-',mm,'-',dd]); + state.endDate.value = endDate; + Get.back(); + }); + }); + })), + Obx(() => CommonItem( + leftTitel: TranslationLoader.lanKeys!.coverDate!.tr, + rightTitle: state.makeUpWorkDate.value, + isHaveLine: false, + isHaveDirection: false, + action: () async { + await showDialog( + context: context, + builder: (context) { + return ShowCalendar( + datePickerMode: DatePickerMode.day, + seletAction: (dateTime) { + String makeUpWorkDate = formatDate(dateTime, [yyyy,'-',mm,'-',dd]); + state.makeUpWorkDate.value = makeUpWorkDate; + Get.back(); + }); + }); + })), + SizedBox( + height: 50.w, + ), + SubmitBtn( + btnName: TranslationLoader.lanKeys!.sure!.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () { + logic.editStaffLoadData(); + }), + ], + ), + ); + } + + Widget getTFWidget(String tfStr) { + return Container( + height: 50.h, + width: 300.w, + // color: Colors.red, + child: Row( + children: [ + Expanded( + child: TextField( + //输入框一行 + maxLines: 1, + controller: state.staffNameController, + autofocus: false, + textAlign: TextAlign.end, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), + hintText: tfStr, + hintStyle: TextStyle( + fontSize: 22.sp, color: AppColors.darkGrayTextColor), + //不需要输入框下划线 + border: InputBorder.none, + ), + ), + ), + ], + ), + ); + } + + Widget whetherTheEmployeeHasAKeyWidget(String title, Function action) { + return GestureDetector( + onTap: () {}, + child: Row( + children: [ + Image.asset( + 'images/icon_round_unSelet.png', + width: 40.w, + height: 40.w, + ), + SizedBox( + width: 5.w, + ), + Text(title), + ], + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_state.dart new file mode 100644 index 00000000..d9fbfbe9 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInAddHolidays/checkingInAddHolidays_state.dart @@ -0,0 +1,19 @@ + + +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +class CheckingInAddHolidaysState{ + final TextEditingController staffNameController = TextEditingController(); + + final companyId = "".obs; + final beginDate = "".obs; + final endDate = "".obs; + final makeUpWorkDate = "".obs; + + CheckingInAddHolidaysState() { + Map map = Get.arguments; + companyId.value = map["companyId"]; + } + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_logic.dart new file mode 100644 index 00000000..1ade72e0 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_logic.dart @@ -0,0 +1,22 @@ + +import 'package:get/get.dart'; +import 'package:star_lock/tools/baseGetXController.dart'; +import '../../../../../network/api_repository.dart'; +import '../../../../../tools/toast.dart'; +import 'checkingInDeletHolidays_state.dart'; + +class CheckingInDeletHolidaysLogic extends BaseGetXController{ + CheckingInDeletHolidaysState state = CheckingInDeletHolidaysState(); + + // 删除假期 + void deletStaffLoadData() async{ + var entity = await ApiRepository.to.deletHolidaysData( + vacationId: state.listItem.value.vacationId.toString() + ); + if(entity.errorCode!.codeIsSuccessful){ + Toast.show(msg: "删除成功"); + Get.back(result: "deletScuess"); + } + } + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_page.dart new file mode 100644 index 00000000..6fad2d16 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_page.dart @@ -0,0 +1,76 @@ + +import 'package:flutter/material.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/dateTool.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; +import 'checkingInDeletHolidays_logic.dart'; + +class CheckingInDeletHolidaysPage extends StatefulWidget { + const CheckingInDeletHolidaysPage({Key? key}) : super(key: key); + + @override + State createState() => _CheckingInDeletHolidaysPageState(); +} + +class _CheckingInDeletHolidaysPageState extends State { + final logic = Get.put(CheckingInDeletHolidaysLogic()); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.holidayInfo!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor, + actionsList: [ + TextButton( + child: Text( + TranslationLoader.lanKeys!.delete!.tr, + style: TextStyle(color: Colors.white, fontSize: 24.sp), + ), + onPressed: () { + logic.deletStaffLoadData(); + }, + ), + // GestureDetector( + // onTap: () async { + // logic.deletStaffLoadData(); + // }, + // child: Image.asset( + // 'images/icon_add_white.png', + // width: 36.w, + // height: 36.w, + // )), + // SizedBox( + // width: 30.w, + // ), + ],), + body: Obx(() => Column( + children: [ + CommonItem( + leftTitel: TranslationLoader.lanKeys!.name!.tr, + rightTitle: state.listItem.value.vacationName, + isHaveLine: true), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.startDate!.tr, + rightTitle: DateTool().dateToYMDString(state.listItem.value.vacationStartDate.toString()), + isHaveLine: true), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.endDate!.tr, + rightTitle: DateTool().dateToYMDString(state.listItem.value.vacationEndDate.toString()), + isHaveLine: true), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.coverDate!.tr, + rightTitle: (state.listItem.value.fillClassDate!.isNotEmpty) ? DateTool().dateToYMDString(state.listItem.value.fillClassDate.toString()) : "", + isHaveLine: true), + ], + ))); + } +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_state.dart new file mode 100644 index 00000000..d380556c --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInDeletHolidays/checkingInDeletHolidays_state.dart @@ -0,0 +1,12 @@ + +import 'package:get/get.dart'; +import '../checkingInSetHolidays/checkingInSetHolidays_entity.dart'; + +class CheckingInDeletHolidaysState{ + final listItem = ListItem().obs; + + CheckingInDeletHolidaysState() { + Map map = Get.arguments; + listItem.value = map["listItem"]; + } +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_entity.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_entity.dart new file mode 100644 index 00000000..7ec08c84 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_entity.dart @@ -0,0 +1,111 @@ +class CheckingInSetHolidaysInfoDataEntity { + int? errorCode; + String? description; + String? errorMsg; + HolidaysListData? data; + + CheckingInSetHolidaysInfoDataEntity({this.errorCode, this.description, this.errorMsg, this.data}); + + CheckingInSetHolidaysInfoDataEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + data = json['data'] != null ? HolidaysListData.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class HolidaysListData { + List? holidayList; + + HolidaysListData({this.holidayList}); + + HolidaysListData.fromJson(Map json) { + if (json['list'] != null) { + holidayList = []; + json['list'].forEach((v) { + holidayList!.add(HolidaysMonthListData.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + if (holidayList != null) { + data['list'] = holidayList!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class HolidaysMonthListData { + List? listItem; + + HolidaysMonthListData({this.listItem}); + + HolidaysMonthListData.fromJson(List json) { + listItem = []; + for (var v in json) { + listItem!.add(ListItem.fromJson(v)); + } + } + + Map toJson() { + final Map data = {}; + if (listItem != null) { + data['listItem'] = listItem!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class ListItem { + int? vacationEndDate; + String? vacationName; + int? vacationStartDate; + int? vacationYear; + String? fillClassDate; + int? month; + int? vacationId; + + ListItem( + {this.vacationEndDate, + this.vacationName, + this.vacationStartDate, + this.vacationYear, + this.fillClassDate, + this.month, + this.vacationId}); + + ListItem.fromJson(Map json) { + vacationEndDate = json['vacationEndDate']; + vacationName = json['vacationName']; + vacationStartDate = json['vacationStartDate']; + vacationYear = json['vacationYear']; + fillClassDate = json['fillClassDate']; + month = json['month']; + vacationId = json['vacationId']; + } + + Map toJson() { + final Map data = {}; + data['vacationEndDate'] = vacationEndDate; + data['vacationName'] = vacationName; + data['vacationStartDate'] = vacationStartDate; + data['vacationYear'] = vacationYear; + data['fillClassDate'] = fillClassDate; + data['month'] = month; + data['vacationId'] = vacationId; + return data; + } +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_logic.dart new file mode 100644 index 00000000..7c506e68 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_logic.dart @@ -0,0 +1,45 @@ + + +import 'package:star_lock/tools/baseGetXController.dart'; + +import '../../../../../network/api_repository.dart'; +import 'checkingInSetHolidays_state.dart'; + +class CheckingInSetHolidaysLogic extends BaseGetXController{ + CheckingInSetHolidaysState state = CheckingInSetHolidaysState(); + + // 获取员工列表 + void editStaffLoadData() async{ + var entity = await ApiRepository.to.holidaysListData( + companyId: state.companyId.value, + vacationYear: state.seletYear.value.toString(), + ); + if(entity.errorCode!.codeIsSuccessful){ + state.holidaysListData.value = entity.data!.holidayList!; + } + } + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + print("onReady()"); + + editStaffLoadData(); + } + + @override + void onInit() { + // TODO: implement onInit + super.onInit(); + print("onInit()"); + + } + + @override + void onClose() { + // TODO: implement onClose + + } + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_page.dart new file mode 100644 index 00000000..3b6480e2 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_page.dart @@ -0,0 +1,291 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_pickers/pickers.dart'; +import 'package:flutter_pickers/style/default_style.dart'; +import 'package:flutter_pickers/style/picker_style.dart'; +import 'package:flutter_pickers/time_picker/model/date_mode.dart'; +import 'package:flutter_pickers/time_picker/model/pduration.dart'; +import 'package:flutter_pickers/time_picker/model/suffix.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:star_lock/tools/noData.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/dateTool.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; +import 'checkingInSetHolidays_entity.dart'; +import 'checkingInSetHolidays_logic.dart'; + +class CheckingInSetHolidaysPage extends StatefulWidget { + const CheckingInSetHolidaysPage({Key? key}) : super(key: key); + + @override + State createState() => + _CheckingInSetHolidaysPageState(); +} + +class _CheckingInSetHolidaysPageState extends State { + final logic = Get.put(CheckingInSetHolidaysLogic()); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + haveTitleWidget: true, + titleWidget: titleWidget(), + haveBack: true, + backgroundColor: AppColors.mainColor, + actionsList: [ + GestureDetector( + onTap: () async { + var data = await Get.toNamed(Routers.checkingInAddHolidaysPage, arguments: { + "companyId": state.companyId.value + }); + if(data != null) { + logic.editStaffLoadData(); + } + }, + child: Image.asset( + 'images/icon_add_white.png', + width: 36.w, + height: 36.w, + )), + SizedBox( + width: 30.w, + ), + ], + ), + body: Obx(() { + return state.holidaysListData.value!.isNotEmpty ? ListView.builder( + itemCount: state.holidaysListData.value!.length, + itemBuilder: (c, index) { + HolidaysMonthListData holidaysMonthListData = state.holidaysListData.value![index]; + return _checkingInListMouthItem(holidaysMonthListData); + }):const NoData(); + }) + ); + } + + Widget _checkingInListMouthItem(HolidaysMonthListData holidaysMonthListData) { + return GestureDetector( + child: Container( + height: 140.h*holidaysMonthListData.listItem!.length + 20.w, + padding: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), + child: Row( + children: [ + Container( + color: colorWithMonth(int.parse(holidaysMonthListData.listItem![0].month.toString())), + width: 100.w, + height: 140.h*holidaysMonthListData.listItem!.length, + child: Center( + child: Text( + "${holidaysMonthListData.listItem![0].month}\n${TranslationLoader.lanKeys!.month!.tr}", + textAlign: TextAlign.center, + style: TextStyle(fontSize: 28.sp, color: Colors.white), + ))), + SizedBox( + height: 140.h*holidaysMonthListData.listItem!.length, + width: 1.sw - 100.w - 20.w*2, + child: ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: holidaysMonthListData.listItem!.length, + itemBuilder: (c, index) { + ListItem listItem = holidaysMonthListData.listItem![index]; + return _checkingInListItem(index, listItem.vacationName, DateTool().dateToYMDString(listItem.vacationStartDate.toString()), DateTool().dateToYMDString(listItem.vacationEndDate.toString()), listItem.fillClassDate!.isNotEmpty ? DateTool().dateToYMDString(listItem.fillClassDate.toString()):"", () async { + var data = await Get.toNamed(Routers.checkingInDeletHolidaysPage, arguments: { + "listItem": listItem + }); + if(data != null) { + logic.editStaffLoadData(); + } + }); + }), + ), + ], + ), + ), + ); + } + + Widget _checkingInListItem(int index, String? lockTypeTitle, String? vacationStartDate, String? vacationEndDate, String? makeUpClass, Function() action) { + return GestureDetector( + onTap: action, + child: Column( + children: [ + Container( + color:Colors.white, + height: 140.h, + padding: EdgeInsets.only(left: 20.w, right: 20.w, top: 10.h), + child: Row( + children: [ + Expanded( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text( + lockTypeTitle!, + style: TextStyle(fontSize: 24.sp), + ), + ], + ), + SizedBox(height: 10.h), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + "${TranslationLoader.lanKeys!.libertyDay!.tr}:$vacationStartDate - $vacationEndDate", + style: TextStyle(fontSize: 20.sp), + ), + ], + ), + SizedBox(height: 5.h), + Row( + mainAxisAlignment: MainAxisAlignment.start, + children: [ + Text( + "${TranslationLoader.lanKeys!.coverDate!.tr}:$makeUpClass", + style: TextStyle(fontSize: 20.sp), + ), + ], + ), + ], + ), + ), + SizedBox(width: 20.h), + ], + ), + ), + Container(color: AppColors.mainBackgroundColor, height: 1.h) + ], + ), + ); + } + + Widget titleWidget() { + return GestureDetector( + onTap: () { + showListType(); + }, + child: Obx(() => Container( + width: 300.w, + height: 50.h, + color: AppColors.mainColor, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text( + "${state.seletYear.value}${TranslationLoader.lanKeys!.year!.tr}", + style: TextStyle(color: Colors.white, fontSize: 26.sp), + ), + SizedBox( + width: 5.w, + ), + Image.asset( + 'images/main/icon_lockDetail_checkIn_topTitle.png', + width: 22.w, + height: 16.w, + ) + ], + ), + )), + ); + } + + void showListType() { + Pickers.showDatePicker( + context, + // 模式,详见下方 + mode: DateMode.Y, + // 后缀 默认Suffix.normal(),为空的话Suffix() + suffix: Suffix(years: ' 年'), + // 样式 详见下方样式 + pickerStyle: PickerStyle( + cancelButton: GestureDetector( + onTap: () { + Get.back(); + }, + child: Container( + alignment: Alignment.center, + padding: const EdgeInsets.only(left: 22, right: 12), + child: Text(TranslationLoader.lanKeys!.cancel!.tr, + style: const TextStyle(color: Colors.black, fontSize: 16.0)), + ), + ), + commitButton: GestureDetector( + onTap: () { + Get.back(); + }, + child: Container( + alignment: Alignment.center, + padding: const EdgeInsets.only(left: 22, right: 12), + child: Text(TranslationLoader.lanKeys!.sure!.tr, + style: const TextStyle(color: Colors.black, fontSize: 16.0)), + ), + ), + ), + // 默认选中 + selectDate: PDuration(year: 2023), + minDate: PDuration(year: 1900), + maxDate: PDuration(year: 2100), + onConfirm: (p) { + state.seletYear.value = p.year!; + logic.editStaffLoadData(); + print("longer >>> 返回数据:${p.year}"); + }, + ); + } + + Color colorWithMonth(int month){ + Color colorType; + switch (month){ + case 1: + colorType = const Color(0xFFb8d152); + break; + case 2: + colorType = const Color(0xFF8bb639); + break; + case 3: + colorType = const Color(0xFF5fb15a); + break; + case 4: + colorType = const Color(0xFFeeb582); + break; + case 5: + colorType = const Color(0xFFf3b749); + break; + case 6: + colorType = const Color(0xFFe4893c); + break; + case 7: + colorType = const Color(0xFFafb5d7); + break; + case 8: + colorType = const Color(0xFF9a95b2); + break; + case 9: + colorType = const Color(0xFF585da6); + break; + case 10: + colorType = const Color(0xFFe696a9); + break; + case 11: + colorType = const Color(0xFFb9706c); + break; + case 12: + colorType = const Color(0xFFc8474e); + break; + default: + colorType = const Color(0xFF333333); + break; + } + // print("colorType:$colorType"); + return colorType; + } +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_state.dart new file mode 100644 index 00000000..5356c435 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_state.dart @@ -0,0 +1,18 @@ + + +import 'package:get/get.dart'; + +import 'checkingInSetHolidays_entity.dart'; + +class CheckingInSetHolidaysState{ + final companyId = "".obs; + final mouth = "".obs; + final seletYear = DateTime.now().year.obs; + final holidaysListData = [].obs; + + CheckingInSetHolidaysState() { + Map map = Get.arguments; + companyId.value = map["companyId"]; + } + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListDay_entity.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListDay_entity.dart new file mode 100644 index 00000000..9bfbaaaa --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListDay_entity.dart @@ -0,0 +1,109 @@ +class CheckingInListDayEntity { + int? errorCode; + String? description; + String? errorMsg; + Data? data; + + CheckingInListDayEntity( + {this.errorCode, this.description, this.errorMsg, this.data}); + + CheckingInListDayEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + int? noPunchTimes; + int? lateTimes; + int? earlyTimes; + List? attendanceRecordList; + + Data( + {this.noPunchTimes, + this.lateTimes, + this.earlyTimes, + this.attendanceRecordList}); + + Data.fromJson(Map json) { + noPunchTimes = json['noPunchTimes']; + lateTimes = json['lateTimes']; + earlyTimes = json['earlyTimes']; + if (json['attendanceRecordList'] != null) { + attendanceRecordList = []; + json['attendanceRecordList'].forEach((v) { + attendanceRecordList!.add(AttendanceRecordDayList.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['noPunchTimes'] = noPunchTimes; + data['lateTimes'] = lateTimes; + data['earlyTimes'] = earlyTimes; + if (attendanceRecordList != null) { + data['attendanceRecordList'] = + attendanceRecordList!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class AttendanceRecordDayList { + String? headurl; + int? isSelf; + String? staffName; + int? staffId; + int? attendanceType; + int? openingTimeEnd; + int? openingTimeStart; + int? colorType; + + AttendanceRecordDayList( + {this.headurl, + this.isSelf, + this.staffName, + this.staffId, + this.attendanceType, + this.openingTimeEnd, + this.openingTimeStart, + this.colorType}); + + AttendanceRecordDayList.fromJson(Map json) { + headurl = json['headurl']; + isSelf = json['isSelf']; + staffName = json['staffName']; + staffId = json['staffId']; + attendanceType = json['attendanceType']; + openingTimeEnd = json['openingTimeEnd']; + openingTimeStart = json['openingTimeStart']; + colorType = json['colorType']; + } + + Map toJson() { + final Map data = {}; + data['headurl'] = headurl; + data['isSelf'] = isSelf; + data['staffName'] = staffName; + data['staffId'] = staffId; + data['attendanceType'] = attendanceType; + data['openingTimeEnd'] = openingTimeEnd; + data['openingTimeStart'] = openingTimeStart; + data['colorType'] = colorType; + return data; + } +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart new file mode 100644 index 00000000..859c5002 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart @@ -0,0 +1,81 @@ +class CheckingInListMonthEntity { + int? errorCode; + String? description; + String? errorMsg; + List? data; + + CheckingInListMonthEntity( + {this.errorCode, this.description, this.errorMsg, this.data}); + + CheckingInListMonthEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(AttendanceRecordMonthList.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class AttendanceRecordMonthList { + String? headurl; + int? isSelf; + String? staffName; + int? staffId; + int? attendanceType; + String? countryCode; + int? openingTimeStart; + String? attendanceWay; + int? avgTime; + + AttendanceRecordMonthList( + {this.headurl, + this.isSelf, + this.staffName, + this.staffId, + this.attendanceType, + this.countryCode, + this.openingTimeStart, + this.attendanceWay, + this.avgTime}); + + AttendanceRecordMonthList.fromJson(Map json) { + headurl = json['headurl']; + isSelf = json['isSelf']; + staffName = json['staffName']; + staffId = json['staffId']; + attendanceType = json['attendanceType']; + countryCode = json['countryCode']; + openingTimeStart = json['openingTimeStart']; + attendanceWay = json['attendanceWay']; + avgTime = json['avgTime']; + } + + Map toJson() { + final Map data = {}; + data['headurl'] = headurl; + data['isSelf'] = isSelf; + data['staffName'] = staffName; + data['staffId'] = staffId; + data['attendanceType'] = attendanceType; + data['countryCode'] = countryCode; + data['openingTimeStart'] = openingTimeStart; + data['attendanceWay'] = attendanceWay; + data['avgTime'] = avgTime; + return data; + } +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_logic.dart index 01915d42..30c0e197 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_logic.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_logic.dart @@ -1,5 +1,6 @@ +import 'package:star_lock/main/lockDetail/checkingIn/checkingInList/checkingInListDay_entity.dart'; import 'package:star_lock/tools/baseGetXController.dart'; import '../../../../network/api_repository.dart'; import 'checkingInList_state.dart'; @@ -14,6 +15,88 @@ class CheckingInListLogic extends BaseGetXController{ ); if(entity.errorCode!.codeIsSuccessful){ state.companyId.value = entity.data!.companyId.toString(); + getCheckInListEarlyArrivalWithDateData(); + } + } + + void loadDataByType(){ + if(state.isDay.value == true && (state.listType.value == "1")){ + // 早到日榜 + getCheckInListEarlyArrivalWithDateData(); + }else if(state.isDay.value == false && (state.listType.value == "1")){ + // 早到月榜 + getCheckInListEarlyArrivalWithMonthData(); + }else if(state.isDay.value == true && (state.listType.value == "2")){ + // 迟到日榜 + getCheckInListLateTimesWithDateData(); + }else if(state.isDay.value == false && (state.listType.value == "2")){ + // 迟到月榜 + getCheckInListLateTimesWithMonthData(); + }else { + // 勤奋榜 + getCheckInListHardworkingData(); + } + } + + // 获取考勤信息列表--早到榜(按日期查询) + void getCheckInListEarlyArrivalWithDateData() async{ + var entity = await ApiRepository.to.getCheckInListEarlyArrivalWithDateData( + companyId: state.companyId.value, + attendanceDate:state.checkListDateTimestamp.value.toString(), + ); + if(entity.errorCode!.codeIsSuccessful){ + state.lateTimes.value = entity.data!.lateTimes.toString(); + state.earlyTimes.value = entity.data!.earlyTimes.toString(); + state.noPunchTimes.value = entity.data!.noPunchTimes.toString(); + state.checkingInDayListData.value = entity.data!.attendanceRecordList!; + } + } + + // 获取考勤信息列表--早到榜(按月榜查询) + void getCheckInListEarlyArrivalWithMonthData() async{ + var entity = await ApiRepository.to.getCheckInListEarlyArrivalWithMonthData( + companyId: state.companyId.value, + attendanceDate:state.checkListDateTimestamp.value.toString(), + ); + if(entity.errorCode!.codeIsSuccessful){ + state.checkingInMonthListData.value = entity.data!; + } + } + + // 获取考勤信息列表--迟到榜(按日期查询) + void getCheckInListLateTimesWithDateData() async{ + var entity = await ApiRepository.to.getCheckInListLateTimesWithDateData( + companyId: state.companyId.value, + attendanceDate:state.checkListDateTimestamp.value.toString(), + ); + if(entity.errorCode!.codeIsSuccessful){ + state.lateTimes.value = entity.data!.lateTimes.toString(); + state.earlyTimes.value = entity.data!.earlyTimes.toString(); + state.noPunchTimes.value = entity.data!.noPunchTimes.toString(); + state.checkingInDayListData.value = entity.data!.attendanceRecordList!; + } + } + + // 获取考勤信息列表--迟到榜(按月榜查询) + void getCheckInListLateTimesWithMonthData() async{ + var entity = await ApiRepository.to.getCheckInListLateTimesWithMonthData( + companyId: state.companyId.value, + attendanceDate:state.checkListDateTimestamp.value.toString(), + ); + if(entity.errorCode!.codeIsSuccessful){ + state.checkingInMonthListData.value = entity.data!; + } + } + + // 获取考勤信息列表--勤奋榜(按月榜查询) + void getCheckInListHardworkingData() async{ + var entity = await ApiRepository.to.getCheckInListHardworkingData( + companyId: state.companyId.value, + attendanceDate:state.checkListDateTimestamp.value.toString(), + type: state.isDay.value == true ? "1" : "2", + ); + if(entity.errorCode!.codeIsSuccessful){ + state.checkingInMonthListData.value = entity.data!; } } diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart index ce9921a5..ca8c11f2 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart @@ -1,13 +1,17 @@ +import 'package:date_format/date_format.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; +import 'package:star_lock/main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart'; import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/noData.dart'; import '../../../../tools/showBottomSheetTool.dart'; import '../../../../tools/showCalendar.dart'; import '../../../../tools/titleAppBar.dart'; import '../../../../translations/trans_lib.dart'; +import 'checkingInListDay_entity.dart'; import 'checkingInList_logic.dart'; class CheckingInListPage extends StatefulWidget { @@ -35,27 +39,18 @@ class _CheckingInListPageState extends State { onTap: () { Get.toNamed(Routers.checkingInSetPage, arguments: { "getKeyInfosData": state.getKeyInfosData.value, - "companyId": state.companyId.value }); }, - child: Image.asset( - 'images/main/icon_lockDetail_checkIn_set.png', - width: 36.w, - height: 36.w, - )), - SizedBox( - width: 30.w, - ), + child: Image.asset('images/main/icon_lockDetail_checkIn_set.png', width: 36.w, height: 36.w,)), + SizedBox(width: 30.w), ], ), body: Column( children: [ topInfo(), - SizedBox( - height: 10.h, - ), + SizedBox(height: 10.h), middleDayInfo(), - Expanded(child: bottomList()) + Expanded(child: getBottomList()) ], ), ); @@ -68,60 +63,74 @@ class _CheckingInListPageState extends State { color: Colors.white, child: Column( children: [ - SizedBox( - height: 30.h, - ), - Image.asset('images/main/icon_checkInRankingListTop.png', - width: 120.w, height: 120.w), - SizedBox( - height: 10.h, - ), - Text(TranslationLoader.lanKeys!.noAttendanceRecord!.tr, - style: TextStyle(fontSize: 24.sp)), - SizedBox( - height: 30.h, - ), + SizedBox(height: 30.h), + Image.asset('images/main/icon_checkInRankingListTop.png', width: 120.w, height: 120.w), + SizedBox(height: 10.h), + Text(TranslationLoader.lanKeys!.noAttendanceRecord!.tr, style: TextStyle(fontSize: 24.sp)), + SizedBox(height: 30.h), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ // SizedBox(width: 30.w,), Row( children: [ - SizedBox( - width: 40.w, - ), - Container( - // width: 150.w, - height: 70.h, - // color: Colors.red, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Text(TranslationLoader.lanKeys!.dailyCharts!.tr, - style: TextStyle( - color: AppColors.mainColor, fontSize: 22.sp)), - Container( - width: 20.w, - height: 2.h, - color: AppColors.mainColor) - ], + SizedBox(width: 20.w,), + GestureDetector( + onTap: (){ + setState(() { + setState(() { + state.isDay.value = true; + DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(state.checkListDateTimestamp.value); + String beginDate = formatDate(dateTime, [mm,'-',dd]); + state.checkListDate.value = beginDate; + logic.loadDataByType(); + }); + }); + }, + child: Container( + width: 90.w, + height: 70.h, + color: Colors.white, + child: Obx(() => Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Text(TranslationLoader.lanKeys!.dailyCharts!.tr, style: TextStyle(color: state.isDay.value ? AppColors.mainColor : Colors.black, fontSize: 22.sp)), + Visibility( + visible: state.isDay.value, + child: Container( + width: 20.w, + height: 2.h, + color: state.isDay.value ? AppColors.mainColor : Colors.black + ), + ) + ], + )), ), ), - SizedBox( - width: 40.w, - ), - SizedBox( - // width: 100.w, - height: 70.h, - // color: Colors.red, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - Text(TranslationLoader.lanKeys!.monthlyLeaderboard!.tr, - style: TextStyle( - color: Colors.black, fontSize: 22.sp)), - Container(width: 20.w, height: 2.h, color: Colors.black) - ], + // SizedBox(width: 20.w,), + GestureDetector( + onTap: (){ + setState(() { + state.isDay.value = false; + DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(state.checkListDateTimestamp.value); + String beginDate = formatDate(dateTime, [mm]); + state.checkListDate.value = beginDate; + logic.loadDataByType(); + }); + }, + child: Container( + width: 90.w, + height: 70.h, + color: Colors.white, + child: Obx(() => Column( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + Text(TranslationLoader.lanKeys!.monthlyLeaderboard!.tr, style: TextStyle(color: !state.isDay.value ? AppColors.mainColor : Colors.black, fontSize: 22.sp)), + Visibility( + visible: !state.isDay.value, + child: Container(width: 20.w, height: 2.h, color: !state.isDay.value ? AppColors.mainColor : Colors.black)) + ], + )), ), ), ], @@ -134,25 +143,22 @@ class _CheckingInListPageState extends State { return ShowCalendar( datePickerMode: DatePickerMode.day, seletAction: (dateTime) { - Navigator.of(context).pop(true); + setState(() { + state.checkListDateTimestamp.value = dateTime.millisecondsSinceEpoch; + String beginDate = formatDate(dateTime, state.isDay.value ? [mm,'-',dd] : [mm]); + state.checkListDate.value = beginDate; + logic.loadDataByType(); + Get.back(); + }); }); }); }, child: Row( mainAxisAlignment: MainAxisAlignment.center, children: [ - Text( - "07-12", - style: TextStyle(color: Colors.black, fontSize: 22.sp), - ), - Image.asset( - 'images/icon_grayPullDown.png', - width: 50.w, - height: 30.w, - ), - SizedBox( - width: 10.w, - ), + Text(state.checkListDate.value, style: TextStyle(color: Colors.black, fontSize: 22.sp),), + Image.asset('images/icon_grayPullDown.png', width: 50.w, height: 30.w,), + SizedBox(width: 10.w,), ], ), ) @@ -165,8 +171,8 @@ class _CheckingInListPageState extends State { } Widget middleDayInfo() { - return Visibility( - visible: true, + return Obx(() => Visibility( + visible: state.isDay.value, child: Container( height: 80.h, color: Colors.white, @@ -177,71 +183,83 @@ class _CheckingInListPageState extends State { Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - SizedBox( - height: 5.h, - ), - Text("0", - style: TextStyle(color: Colors.black, fontSize: 20.sp)), - Text(TranslationLoader.lanKeys!.beLate!.tr, - style: TextStyle(color: Colors.black, fontSize: 22.sp)), - SizedBox( - height: 5.h, - ), + SizedBox(height: 5.h), + Text(state.lateTimes.value, style: TextStyle(color: Colors.black, fontSize: 20.sp)), + Text(TranslationLoader.lanKeys!.beLate!.tr, style: TextStyle(color: Colors.black, fontSize: 22.sp)), + SizedBox(height: 5.h), ], ), Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - SizedBox( - height: 5.h, - ), - Text("0", - style: TextStyle(color: Colors.black, fontSize: 20.sp)), - Text(TranslationLoader.lanKeys!.leaveEarly!.tr, - style: TextStyle(color: Colors.black, fontSize: 22.sp)), - SizedBox( - height: 5.h, - ), + SizedBox(height: 5.h), + Text(state.earlyTimes.value, style: TextStyle(color: Colors.black, fontSize: 20.sp)), + Text(TranslationLoader.lanKeys!.leaveEarly!.tr, style: TextStyle(color: Colors.black, fontSize: 22.sp)), + SizedBox(height: 5.h), ], ), Column( mainAxisAlignment: MainAxisAlignment.spaceAround, children: [ - SizedBox( - height: 5.h, - ), - Text("0", - style: TextStyle(color: Colors.black, fontSize: 20.sp)), - Text(TranslationLoader.lanKeys!.noCardPunched!.tr, - style: TextStyle(color: Colors.black, fontSize: 22.sp)), - SizedBox( - height: 5.h, - ), + SizedBox(height: 5.h), + Text(state.noPunchTimes.value, style: TextStyle(color: Colors.black, fontSize: 20.sp)), + Text(TranslationLoader.lanKeys!.noCardPunched!.tr, style: TextStyle(color: Colors.black, fontSize: 22.sp)), + SizedBox(height: 5.h), ], ), ], ), ), - ); + )); } - Widget bottomList() { - return ListView.separated( - itemCount: 10, + Widget getBottomList(){ + if((state.isDay.value == true && (state.listType.value == "1")) || (state.isDay.value == true && (state.listType.value == "2"))){ + return bottomDayList(); + }else{ + return bottomMonthList(); + } + } + + Widget bottomDayList() { + return Obx(() => state.checkingInDayListData.value.isNotEmpty ? ListView.separated( + itemCount: state.checkingInDayListData.value.length, itemBuilder: (c, index) { - return _checkingInListItem('images/controls_user.png', "张三", - "2023.6.21 11.15", "2023.6.21 11.15", () { - Navigator.pushNamed(context, Routers.checkingInDetailPage); + AttendanceRecordDayList attendanceRecordList= state.checkingInDayListData.value[index]; + return _checkingInListItem(index, attendanceRecordList.headurl, attendanceRecordList.staffName,() { + Get.toNamed(Routers.checkingInDetailPage, arguments: { + "getKeyInfosData": state.getKeyInfosData.value, + "companyId": state.companyId.value, + "staffId": attendanceRecordList.staffId, + }); + }); + }, + separatorBuilder: (context, index) { + return const Divider(height: 1, color: AppColors.greyLineColor); + }, + ) :const NoData()); + } + + Widget bottomMonthList() { + return Obx(() => state.checkingInMonthListData.value.isNotEmpty ? ListView.separated( + itemCount: state.checkingInMonthListData.value.length, + itemBuilder: (c, index) { + AttendanceRecordMonthList attendanceRecordList= state.checkingInMonthListData.value[index]; + return _checkingInListItem(index, attendanceRecordList.headurl, attendanceRecordList.staffName, () { + Get.toNamed(Routers.checkingInDetailPage, arguments: { + "getKeyInfosData": state.getKeyInfosData.value, + "companyId": state.companyId.value, + "staffId": attendanceRecordList.staffId, + }); }); }, separatorBuilder: (context, index) { return const Divider(height: 1, color: AppColors.greyLineColor); }, - ); + ) :const NoData()); } - Widget _checkingInListItem(String lockTypeIcon, String lockTypeTitle, - String beginTime, String endTime, Function() action) { + Widget _checkingInListItem(int index, String? headUrl, String? name, Function() action) { return GestureDetector( onTap: action, child: Container( @@ -253,21 +271,10 @@ class _CheckingInListPageState extends State { ), child: Row( children: [ - SizedBox( - width: 30.w, - ), - Text( - "1", - style: TextStyle(fontSize: 20.sp), - ), - SizedBox( - width: 20.w, - ), - Image.asset( - 'images/controls_user.png', - width: 40.w, - height: 40.w, - ), + SizedBox(width: 30.w,), + Text("1", style: TextStyle(fontSize: 20.sp),), + SizedBox(width: 20.w,), + Image.asset('images/controls_user.png', width: 40.w, height: 40.w,), // Container( // width: 60.h, // height: 60.h, @@ -283,21 +290,12 @@ class _CheckingInListPageState extends State { // height: 30.w, // color: Colors.white, // )), - SizedBox( - width: 20.w, - ), + SizedBox(width: 20.w), Expanded( - child: Text( - lockTypeTitle, - style: TextStyle(fontSize: 24.sp), - ), + child: Text(name!, style: TextStyle(fontSize: 24.sp),), ), SizedBox(width: 20.h), - Image.asset( - "images/icon_right_grey.png", - width: 21.w, - height: 21.w, - ), + Image.asset("images/icon_right_grey.png", width: 21.w, height: 21.w,), SizedBox(width: 20.h), ], ), @@ -310,24 +308,19 @@ class _CheckingInListPageState extends State { onTap: () { showListType(); }, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - TranslationLoader.lanKeys!.earlyArrivalList!.tr, - style: TextStyle(color: Colors.white, fontSize: 26.sp), - ), - SizedBox( - width: 5.w, - ), - Image.asset( - 'images/main/icon_lockDetail_checkIn_topTitle.png', - width: 22.w, - height: 16.w, - fit: BoxFit.fill, - ) - ], - ), + child: Obx(() => Container( + width: 200.w, + height: 60.h, + color: AppColors.mainColor, + child: Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Text(state.listTypeStr.value, style: TextStyle(color: Colors.white, fontSize: 26.sp),), + SizedBox(width: 5.w,), + Image.asset('images/main/icon_lockDetail_checkIn_topTitle.png', width: 22.w, height: 16.w, fit: BoxFit.fill,) + ], + ), + )), ); } @@ -350,6 +343,19 @@ class _CheckingInListPageState extends State { //adapter: PickerAdapter(), data: list, //选择事件的回调 - clickCallBack: (int index, var str) {}); + clickCallBack: (int index, var str) { + setState(() { + state.listTypeStr.value = str.toString(); + state.isDay.value = true; + if(index == 0){ + state.listType.value = "1"; + }else if(index == 1){ + state.listType.value = "2"; + }else if(index == 2){ + state.listType.value = "3"; + } + logic.loadDataByType(); + }); + }); } } diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_state.dart index b421ae73..badbede3 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_state.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInList/checkingInList_state.dart @@ -1,14 +1,31 @@ +import 'package:date_format/date_format.dart'; import 'package:get/get.dart'; +import '../../../../translations/trans_lib.dart'; import '../../../lockMian/entity/lockInfoEntity.dart'; +import 'checkingInListDay_entity.dart'; +import 'checkingInListMonth_entity.dart'; class CheckingInListState{ final getKeyInfosData = KeyInfos().obs; final companyId = "".obs; + final listType = "1".obs;// 1早到榜 2迟到榜 3勤奋榜 + final listTypeStr = TranslationLoader.lanKeys!.earlyArrivalList!.tr.obs;// 1早到榜 2迟到榜 3勤奋榜 + final isDay = true.obs;// 日榜还是月榜 + final checkListDateTimestamp = DateTime.now().millisecondsSinceEpoch.obs;// 查询日期时间戳 + final checkListDate = formatDate(DateTime.now(), [mm,'-',dd]).obs;// 查询日期 + + final checkingInDayListData = [].obs; + final checkingInMonthListData = [].obs; + + var lateTimes = "".obs;// 迟到 + var earlyTimes = "".obs;// 早退 + var noPunchTimes = "".obs;// 未打车 + CheckingInListState() { getKeyInfosData.value = Get.arguments as KeyInfos; } -} \ No newline at end of file +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_entity.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_entity.dart new file mode 100644 index 00000000..5ff3067f --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_entity.dart @@ -0,0 +1,69 @@ + +class CheckingInSetEntity { + int? errorCode; + String? description; + String? errorMsg; + CheckingInSetInfo? data; + + CheckingInSetEntity( + {this.errorCode, this.description, this.errorMsg, this.data}); + + CheckingInSetEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + data = json['data'] != null ? CheckingInSetInfo.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = {}; + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class CheckingInSetInfo { + int? staffNum; + int? workEndTime; + int? attendanceType; + int? companyId; + String? companyName; + int? workStartTime; + List? workDay; + + CheckingInSetInfo( + {this.staffNum, + this.workEndTime, + this.attendanceType, + this.companyId, + this.companyName, + this.workStartTime, + this.workDay}); + + CheckingInSetInfo.fromJson(Map json) { + staffNum = json['staffNum']; + workEndTime = json['workEndTime']; + attendanceType = json['attendanceType']; + companyId = json['companyId']; + companyName = json['companyName']; + workStartTime = json['workStartTime']; + workDay = json['workDay'].cast(); + } + + Map toJson() { + final Map data = {}; + data['staffNum'] = staffNum; + data['workEndTime'] = workEndTime; + data['attendanceType'] = attendanceType; + data['companyId'] = companyId; + data['companyName'] = companyName; + data['workStartTime'] = workStartTime; + data['workDay'] = workDay; + return data; + } +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_logic.dart index 28898c8b..ae72c6a9 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_logic.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_logic.dart @@ -1,9 +1,93 @@ +import 'package:get/get.dart'; + +import '../../../../network/api_repository.dart'; import '../../../../tools/baseGetXController.dart'; +import '../../../../tools/dateTool.dart'; +import '../../../../tools/toast.dart'; import 'checkingInSet_state.dart'; class CheckingInSetLogic extends BaseGetXController{ CheckingInSetState state = CheckingInSetState(); + // 开启考勤获取是否有公司 + void openCheckingInData() async{ + var entity = await ApiRepository.to.openCheckingInData( + lockId:state.getKeyInfosData.value.lockId.toString(), + ); + if(entity.errorCode!.codeIsSuccessful){ + state.companyId.value = entity.data!.companyId.toString(); + getCheckInSetInfoData(); + } + } + // 获取获取考勤设置信息 + void getCheckInSetInfoData() async{ + var entity = await ApiRepository.to.getCheckInSetInfoData( + companyId: state.companyId.value, + ); + if(entity.errorCode!.codeIsSuccessful){ + state.checkingInSetInfo.value = entity.data!; + + state.beginTime.value = DateTool().dateToHNString(state.checkingInSetInfo.value.workStartTime.toString()); + state.endTime.value = DateTool().dateToHNString(state.checkingInSetInfo.value.workEndTime.toString()); + state.beginTimeTimestamp.value = state.checkingInSetInfo.value.workStartTime.toString(); + state.endTimeTimestamp.value = state.checkingInSetInfo.value.workEndTime.toString(); + + state.weekDays.value = state.checkingInSetInfo.value.workDay!; + state.weekDaysStr.value = state.weekDays.value.join(","); + + state.staffNumber.value = state.checkingInSetInfo.value.staffNum!.toString(); + state.companyName.value = state.checkingInSetInfo.value.companyName!; + state.changeNameController.text = state.companyName.value; + } + } + + // 编辑考勤设置信息 + void editCheckInSetInfoData() async{ + var entity = await ApiRepository.to.editCheckInSetInfoData( + attendanceType: state.checkingInSetInfo.value.attendanceType.toString(), + companyId: state.checkingInSetInfo.value.companyId.toString(), + type: "1", + companyName: state.changeNameController.text, + workEndTime: state.checkingInSetInfo.value.workEndTime.toString(), + workStartTime: state.checkingInSetInfo.value.workStartTime.toString(), + workDay:state.checkingInSetInfo.value.workDay!, + ); + if(entity.errorCode!.codeIsSuccessful){ + state.companyName.value = state.changeNameController.text; + print("state.checkingInSetInfo.value.companyName:${state.checkingInSetInfo.value.companyName}"); + Toast.show(msg: "修改成功"); + } + } + + // late StreamSubscription _teamEvent; + // void _initLoadDataAction() { + // _teamEvent = eventBus.on().listen((event) { + // getStaffList(); + // }); + // } + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + print("onReady()"); + + // _initLoadDataAction(); + openCheckingInData(); + } + + @override + void onInit() { + // TODO: implement onInit + super.onInit(); + print("onInit()"); + } + + @override + void onClose() { + // TODO: implement onClose + // _teamEvent.cancel(); + } } \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart index 4d4ea511..cd76e01a 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:get/get.dart'; import 'package:star_lock/app_settings/app_colors.dart'; +import 'package:star_lock/tools/toast.dart'; import '../../../../appRouters.dart'; import '../../../../tools/commonItem.dart'; @@ -22,8 +23,6 @@ class _CheckingInSetPageState extends State { final logic = Get.put(CheckingInSetLogic()); final state = Get.find().state; - final TextEditingController _changeNameController = TextEditingController(); - @override Widget build(BuildContext context) { return Scaffold( @@ -35,18 +34,18 @@ class _CheckingInSetPageState extends State { backgroundColor: AppColors.mainColor), body: Column( children: [ - CommonItem( + Obx(() => CommonItem( leftTitel: - "${TranslationLoader.lanKeys!.company!.tr}${TranslationLoader.lanKeys!.name!.tr}", - rightTitle: "深圳市志超科技", + "${TranslationLoader.lanKeys!.company!.tr}${TranslationLoader.lanKeys!.name!.tr}", + rightTitle: state.companyName.value ?? "", isHaveLine: true, isHaveDirection: true, action: () { showCupertinoAlertDialog(context); - }), - CommonItem( + })), + Obx(() => CommonItem( leftTitel: TranslationLoader.lanKeys!.staff!.tr, - rightTitle: "0", + rightTitle: state.staffNumber.value, isHaveLine: true, isHaveDirection: true, action: () { @@ -54,32 +53,61 @@ class _CheckingInSetPageState extends State { "getKeyInfosData": state.getKeyInfosData.value, "companyId": state.companyId.value }); - }), - CommonItem( + })), + Obx(() => CommonItem( leftTitel: - "${TranslationLoader.lanKeys!.work!.tr}${TranslationLoader.lanKeys!.time!.tr}", - rightTitle: "9:00 - 18:00", + "${TranslationLoader.lanKeys!.work!.tr}${TranslationLoader.lanKeys!.time!.tr}", + rightTitle: (state.beginTime.value.isNotEmpty) ? "${state.beginTime.value} - ${state.endTime.value}" : "", isHaveLine: true, isHaveDirection: true, - action: () { - Navigator.pushNamed(context, Routers.checkingInSetWorkTimePage); - }), - CommonItem( + action: () async { + var data = await Get.toNamed(Routers.checkingInSetWorkTimePage, arguments: { + "getKeyInfosData": state.getKeyInfosData.value, + "companyId": state.companyId.value, + "pushType": "2", + "checkingInSetInfo": state.checkingInSetInfo.value, + }); + if(data != null) { + setState(() { + // state.beginTime.value = data["beginTime"]; + // state.endTime.value = data["endTime"]; + // state.beginTimeTimestamp.value = data["beginTimeTimestamp"]; + // state.endTimeTimestamp.value = data["endTimeTimestamp"]; + logic.getCheckInSetInfoData(); + }); + } + })), + Obx(() => CommonItem( leftTitel: - "${TranslationLoader.lanKeys!.workday!.tr}${TranslationLoader.lanKeys!.set!.tr}", - rightTitle: "1,2,3,4,5", + "${TranslationLoader.lanKeys!.workday!.tr}${TranslationLoader.lanKeys!.set!.tr}", + rightTitle: state.weekDaysStr.value, isHaveLine: true, isHaveDirection: true, - action: () { - Navigator.pushNamed(context, Routers.checkingInSetWorkdaySet); - }), + action: () async { + var data = await Get.toNamed(Routers.checkingInSetWorkdaySet, arguments: { + "getKeyInfosData": state.getKeyInfosData.value, + "companyId": state.companyId.value, + "pushType": "2", + "checkingInSetInfo": state.checkingInSetInfo.value, + }); + if(data != null) { + setState(() { + // state.isCustom.value = data["attendanceType"]; + // state.weekDays.value = data["weekDays"]; + // state.weekDaysStr.value = state.weekDays.value.join(","); + logic.getCheckInSetInfoData(); + }); + } + })), CommonItem( leftTitel: TranslationLoader.lanKeys!.holidays!.tr, rightTitle: "", isHaveLine: false, isHaveDirection: true, action: () { - Navigator.pushNamed(context, Routers.checkingInSetHolidaysPage); + Get.toNamed(Routers.checkingInSetHolidaysPage, arguments: { + "companyId": state.companyId.value + }); }), SizedBox( height: 30.h, @@ -103,14 +131,19 @@ class _CheckingInSetPageState extends State { context: context, builder: (BuildContext context) { return ShowTFView( - title: "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}", + title: "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.company!.tr}", tipTitle: "", - controller: _changeNameController, + controller: state.changeNameController, sureClick: () { - + if(state.changeNameController.text.isEmpty){ + Toast.show(msg: "请输入公司姓名"); + return; + } + Get.back(); + logic.editCheckInSetInfoData(); }, cancelClick: () { - Navigator.pop(context); + Get.back(); },); }); } diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_state.dart index e4e37428..8af65e4c 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_state.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSet/checkingInSet_state.dart @@ -1,15 +1,32 @@ +import 'package:flutter/material.dart'; import 'package:get/get.dart'; import '../../../lockMian/entity/lockInfoEntity.dart'; +import 'checkingInSet_entity.dart'; class CheckingInSetState{ final getKeyInfosData = KeyInfos().obs; final companyId = "".obs; + var isCustom = true.obs; + + var weekDays = [].obs;// 工作天数 + var weekDaysStr = "".obs;// 拼接显示的字符串天数 + + var beginTime = "".obs;// 开始时间 + var endTime = "".obs;// 结束时间 + var beginTimeTimestamp = "".obs;// 开始时间时间戳 + var endTimeTimestamp = "".obs;// 结束时间时间戳 + + var staffNumber = "".obs;// 员工数量 + var companyName = "".obs;// 公司名称 + + final TextEditingController changeNameController = TextEditingController(); + + final checkingInSetInfo = CheckingInSetInfo().obs; CheckingInSetState() { Map map = Get.arguments; getKeyInfosData.value = map["getKeyInfosData"]; - companyId.value = map["companyId"]; } } \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetHolidays/checkingInSetHolidays_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetHolidays/checkingInSetHolidays_page.dart deleted file mode 100644 index 6e752337..00000000 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetHolidays/checkingInSetHolidays_page.dart +++ /dev/null @@ -1,218 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_pickers/pickers.dart'; -import 'package:flutter_pickers/style/default_style.dart'; -import 'package:flutter_pickers/style/picker_style.dart'; -import 'package:flutter_pickers/time_picker/model/date_mode.dart'; -import 'package:flutter_pickers/time_picker/model/pduration.dart'; -import 'package:flutter_pickers/time_picker/model/suffix.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; - -import '../../../../appRouters.dart'; -import '../../../../app_settings/app_colors.dart'; -import '../../../../tools/showBottomSheetTool.dart'; -import '../../../../tools/titleAppBar.dart'; -import '../../../../translations/trans_lib.dart'; - -class CheckingInSetHolidaysPage extends StatefulWidget { - const CheckingInSetHolidaysPage({Key? key}) : super(key: key); - - @override - State createState() => - _CheckingInSetHolidaysPageState(); -} - -class _CheckingInSetHolidaysPageState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar( - haveTitleWidget: true, - titleWidget: titleWidget(), - haveBack: true, - backgroundColor: AppColors.mainColor, - actionsList: [ - GestureDetector( - onTap: () { - Navigator.pushNamed( - context, Routers.checkingInAddHolidaysPage); - }, - child: Image.asset( - 'images/icon_add_white.png', - width: 36.w, - height: 36.w, - )), - SizedBox( - width: 30.w, - ), - ], - ), - body: ListView.builder( - itemCount: 10, - itemBuilder: (c, index) { - return _checkingInListItem('images/icon_lock.png', "张三", - "2023.6.21 11.15", "2023.6.21 11.15", () { - // Navigator.pushNamed(context, Routers.electronicKeyDetailPage); - }); - })); - } - - Widget _checkingInListItem(String lockTypeIcon, String lockTypeTitle, - String beginTime, String endTime, Function() action) { - return GestureDetector( - onTap: action, - child: Container( - height: 140.h, - margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.circular(10.w), - ), - child: Row( - children: [ - Container( - color: const Color(0xFFAFB5D7), - width: 100.w, - height: 140.h, - child: Center( - child: Text( - "7\n${TranslationLoader.lanKeys!.month!.tr}", - textAlign: TextAlign.center, - style: TextStyle(fontSize: 28.sp, color: Colors.white), - ))), - SizedBox( - width: 20.w, - ), - Expanded( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - // color: Colors.red, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - lockTypeTitle, - style: TextStyle(fontSize: 24.sp), - ), - ], - ), - ), - SizedBox(height: 10.h), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - "${TranslationLoader.lanKeys!.libertyDay!.tr}:2023.6.21 11.15-2023.6.21 11.15", - style: TextStyle(fontSize: 20.sp), - ), - ], - ), - ), - SizedBox(height: 5.h), - Container( - child: Row( - mainAxisAlignment: MainAxisAlignment.start, - children: [ - Text( - "${TranslationLoader.lanKeys!.coverDate!.tr}:2023.6.21 11.15", - style: TextStyle(fontSize: 20.sp), - ), - ], - ), - ), - ], - ), - ), - SizedBox(width: 20.h), - ], - ), - ), - ); - } - - Widget titleWidget() { - return GestureDetector( - onTap: () { - showListType(); - }, - child: Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Text( - "${DateTime.now().year}${TranslationLoader.lanKeys!.year!.tr}", - style: TextStyle(color: Colors.white, fontSize: 26.sp), - ), - SizedBox( - width: 5.w, - ), - Image.asset( - 'images/main/icon_lockDetail_checkIn_topTitle.png', - width: 22.w, - height: 16.w, - ) - ], - ), - ); - } - - void showListType() { - Pickers.showDatePicker( - context, - // 模式,详见下方 - mode: DateMode.Y, - // 后缀 默认Suffix.normal(),为空的话Suffix() - suffix: Suffix(years: ' 年'), - // 样式 详见下方样式 - pickerStyle: PickerStyle( - cancelButton: GestureDetector( - onTap: () {}, - child: Container( - alignment: Alignment.center, - padding: const EdgeInsets.only(left: 22, right: 12), - child: Text(TranslationLoader.lanKeys!.cancel!.tr, - style: const TextStyle(color: Colors.black, fontSize: 16.0)), - ), - ), - commitButton: GestureDetector( - onTap: () {}, - child: Container( - alignment: Alignment.center, - padding: const EdgeInsets.only(left: 22, right: 12), - child: Text(TranslationLoader.lanKeys!.sure!.tr, - style: const TextStyle(color: Colors.black, fontSize: 16.0)), - ), - ), - ), - // 默认选中 - selectDate: PDuration(year: 2023), - minDate: PDuration(year: 1900), - maxDate: PDuration(year: 2100), - onConfirm: (p) { - print('longer >>> 返回数据:$p'); - }, - // onChanged: (p) => print(p), - ); - // var list = [TranslationLoader.lanKeys.earlyArrivalList.tr, TranslationLoader.lanKeys.lateList.tr, TranslationLoader.lanKeys.hardWorkingList.tr]; - // ShowBottomSheetTool().showSingleRowPicker( - // //上下文 - // context, - // //默认的索引 - // normalIndex: 0, - // title: "", - // cancelTitle: TranslationLoader.lanKeys.cancel.tr, - // sureTitle: TranslationLoader.lanKeys.sure.tr, - // //要显示的列表 - // //可自定义数据适配器 - // //adapter: PickerAdapter(), - // data: list, - // //选择事件的回调 - // clickCallBack: (int index, var str) { - // - // } - // ); - } -} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_logic.dart index c558ce5f..01ea5ccf 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_logic.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_logic.dart @@ -1,9 +1,29 @@ +import 'package:get/get.dart'; import 'package:star_lock/tools/baseGetXController.dart'; +import '../../../../network/api_repository.dart'; +import '../../../../tools/toast.dart'; import 'checkingInSetWorkTime_state.dart'; class CheckingInSetWorkTimeLogic extends BaseGetXController{ CheckingInSetWorkTimeState state = CheckingInSetWorkTimeState(); + // 编辑考勤设置信息 + void editCheckInSetInfoData() async{ + var entity = await ApiRepository.to.editCheckInSetInfoData( + attendanceType: state.checkingInSetInfo.value.attendanceType.toString(), + companyId: state.checkingInSetInfo.value.companyId.toString(), + type: "2", + companyName: state.checkingInSetInfo.value.companyName ?? "", + workEndTime: state.endTimeTimestamp.value.toString(), + workStartTime: state.beginTimeTimestamp.value.toString(), + workDay:state.checkingInSetInfo.value.workDay!, + ); + if(entity.errorCode!.codeIsSuccessful){ + Get.back(result: "scuess"); + // Toast.show(msg: "修改成功"); + } + } + } \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_page.dart index 33fcaa7b..d6801b82 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_page.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_page.dart @@ -64,16 +64,30 @@ class _CheckingInSetWorkTimePageState extends State { margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w), padding: EdgeInsets.only(top: 20.w, bottom: 20.w), onClick: () { + if(state.beginTimeTimestamp.value.isEmpty){ + Toast.show(msg: "请选择开始时间"); + return; + } + + if(state.endTimeTimestamp.value.isEmpty){ + Toast.show(msg: "请选择结束时间"); + return; + } + if(int.parse(state.beginTimeTimestamp.value) > int.parse(state.endTimeTimestamp.value)){ Toast.show(msg: "结束时间不能大于开始时间"); return; } - Get.back(result: { - "beginTime":state.beginTime.value, - "beginTimeTimestamp":state.beginTimeTimestamp.value, - "endTime":state.endTime.value, - "endTimeTimestamp":state.endTimeTimestamp.value, - }); + if(state.pushType.value == "2"){ + logic.editCheckInSetInfoData(); + }else{ + Get.back(result: { + "beginTime":state.beginTime.value, + "beginTimeTimestamp":state.beginTimeTimestamp.value, + "endTime":state.endTime.value, + "endTimeTimestamp":state.endTimeTimestamp.value, + }); + } } ), ], diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_state.dart index eb5c80df..29c639a9 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_state.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_state.dart @@ -1,10 +1,33 @@ import 'package:get/get.dart'; +import '../../../../tools/dateTool.dart'; +import '../../../lockMian/entity/lockInfoEntity.dart'; +import '../checkingInSet/checkingInSet_entity.dart'; + class CheckingInSetWorkTimeState{ + final getKeyInfosData = KeyInfos().obs; + final checkingInSetInfo = CheckingInSetInfo().obs; + final companyId = "".obs; + var beginTime = "".obs;// 开始时间 var endTime = "".obs;// 结束时间 var beginTimeTimestamp = "".obs;// 开始时间时间戳 var endTimeTimestamp = "".obs;// 结束时间时间戳 + var pushType = "".obs;// 2考勤设置信息选择时间 + + CheckingInSetWorkTimeState() { + Map map = Get.arguments; + pushType.value = map["pushType"]; + getKeyInfosData.value = map["getKeyInfosData"]; + companyId.value = map["companyId"]; + checkingInSetInfo.value = map["checkingInSetInfo"]; + + beginTime.value = DateTool().dateToHNString(checkingInSetInfo.value.workStartTime.toString()); + endTime.value = DateTool().dateToHNString(checkingInSetInfo.value.workEndTime.toString()); + beginTimeTimestamp.value = checkingInSetInfo.value.workStartTime.toString(); + endTimeTimestamp.value = checkingInSetInfo.value.workEndTime.toString(); + } + } \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_logic.dart index af0fccba..7cdf017c 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_logic.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_logic.dart @@ -1,9 +1,65 @@ +import 'package:get/get.dart'; import 'package:star_lock/tools/baseGetXController.dart'; +import '../../../../network/api_repository.dart'; import 'checkingInSetWorkdaySet_state.dart'; class CheckingInSetWorkdaySetLogic extends BaseGetXController{ CheckingInSetWorkdaySetState state = CheckingInSetWorkdaySetState(); + // 编辑考勤设置信息 + void editCheckInSetInfoData() async{ + var entity = await ApiRepository.to.editCheckInSetInfoData( + attendanceType: (state.isCustom.value == true) ? "0" : "1", + companyId: state.checkingInSetInfo.value.companyId.toString(), + type: "2", + companyName: state.checkingInSetInfo.value.companyName ?? "", + workEndTime: state.checkingInSetInfo.value.workEndTime.toString(), + workStartTime: state.checkingInSetInfo.value.workStartTime.toString(), + workDay:state.weekDays.value, + ); + if(entity.errorCode!.codeIsSuccessful){ + Get.back(result: "scuess"); + // Toast.show(msg: "修改成功"); + } + } + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + print("onReady()"); + + Map map = Get.arguments; + state.pushType.value = map["pushType"]; + if(state.pushType.value == "2"){ + state.getKeyInfosData.value = map["getKeyInfosData"]; + state.companyId.value = map["companyId"]; + state.checkingInSetInfo.value = map["checkingInSetInfo"]; + + state.weekDays.value = state.checkingInSetInfo.value.workDay!; + state.isCustom.value = (state.checkingInSetInfo.value.attendanceType! == 0) ? true : false; + if(state.isCustom.value == false){ + if(state.checkingInSetInfo.value.workDay!.length == 5){ + state.isSingledayWeekend.value = 1; + }else if(state.checkingInSetInfo.value.workDay!.length == 6){ + state.isSingledayWeekend.value = 0; + } + } + } + } + + @override + void onInit() { + // TODO: implement onInit + super.onInit(); + print("onInit()"); + + } + + @override + void onClose() { + // TODO: implement onClose + // _teamEvent.cancel(); + } } \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_page.dart index 503b3f07..cdac3263 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_page.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_page.dart @@ -33,16 +33,21 @@ class _CheckingInSetWorkdaySetState extends State { body: ListView( children: [ topBtnWidget(), - Obx(() => Visibility(visible: state.isCustom.value == true, child: bottomCustomSeletBtn())), + Obx(() => Visibility(visible: state.isCustom.value, child: bottomCustomSeletBtn())), Obx(() => Visibility(visible: !state.isCustom.value, child: bottomOddOrEvenDaysOffSeletBtn())), SizedBox(height: 50.h,), Container( margin: EdgeInsets.only(left: 20.w, right: 20.w), child: SubmitBtn(btnName: TranslationLoader.lanKeys!.sure!.tr, onClick: () { - Get.back(result: { - "attendanceType":state.isCustom.value, - "weekDays":state.weekDays.value, - }); + if(state.pushType.value == "2"){ + logic.editCheckInSetInfoData(); + }else{ + Get.back(result: { + "attendanceType":state.isCustom.value, + "weekDays":state.weekDays.value, + }); + } + }), ), ], @@ -127,7 +132,7 @@ class _CheckingInSetWorkdaySetState extends State { rightWidget: GestureDetector( onTap: () { setState(() { - state.isSingledayWeekend.value = 0; + state.isSingledayWeekend.value = 1; state.weekDays.value = [1, 2 , 3, 4, 5, 6]; }); }, @@ -147,7 +152,7 @@ class _CheckingInSetWorkdaySetState extends State { rightWidget: GestureDetector( onTap: () { setState(() { - state.isSingledayWeekend.value = 1; + state.isSingledayWeekend.value = 2; state.weekDays.value = [1, 2 , 3, 4, 5]; }); }, @@ -206,22 +211,22 @@ class _CheckingInSetWorkdaySetState extends State { isHaveLine: true, isHaveRightWidget: true, rightWidget: GestureDetector( - onTap: () { - setState(() { - state.isSingledayWeekend.value = 2; - if(state.weekDays.value.contains(index)){ - state.weekDays.value.remove(index); - }else{ - state.weekDays.value.add(index); - } - state.weekDays.value.sort(); - }); - }, - child: Row( - children: [ - Image.asset(state.weekDays.value.contains(index) ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png', width: 30.w, height: 30.w,), - ], - )) + onTap: () { + setState(() { + state.isSingledayWeekend.value = 2; + if(state.weekDays.value.contains(index)){ + state.weekDays.value.remove(index); + }else{ + state.weekDays.value.add(index); + } + state.weekDays.value.sort(); + }); + }, + child: Obx(() => Row( + children: [ + Image.asset(state.weekDays.value.contains(index) ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png', width: 30.w, height: 30.w,), + ], + ))) ); } ), diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_state.dart index 3a232c6e..1b478ee9 100644 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_state.dart +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_state.dart @@ -2,9 +2,37 @@ import 'package:get/get.dart'; -class CheckingInSetWorkdaySetState{ - var isCustom = true.obs; - var isSingledayWeekend = 2.obs; // 0单休 1双休 - var weekDays = [].obs;// 工作天数 +import '../../../lockMian/entity/lockInfoEntity.dart'; +import '../checkingInSet/checkingInSet_entity.dart'; +class CheckingInSetWorkdaySetState{ + var isCustom = true.obs; // 自定义 + var isSingledayWeekend = 2.obs; // 0单休 1双休 + var weekDays = [].obs;// 工作天数 + + final getKeyInfosData = KeyInfos().obs; + final checkingInSetInfo = CheckingInSetInfo().obs; + final companyId = "".obs; + + var pushType = "".obs;// 2考勤设置信息选择时间 1考勤创建公司 + + CheckingInSetWorkdaySetState() { + Map map = Get.arguments; + pushType.value = map["pushType"]; + if(pushType.value == "2"){ + getKeyInfosData.value = map["getKeyInfosData"]; + companyId.value = map["companyId"]; + checkingInSetInfo.value = map["checkingInSetInfo"]; + + weekDays.value = checkingInSetInfo.value.workDay!; + isCustom.value = (checkingInSetInfo.value.attendanceType! == 0) ? true : false; + if(isCustom.value == false){ + if(checkingInSetInfo.value.workDay!.length == 5){ + isSingledayWeekend.value = 1; + }else if(checkingInSetInfo.value.workDay!.length == 6){ + isSingledayWeekend.value = 0; + } + } + } + } } \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaffSeletKey_entity.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaffSeletKey_entity.dart new file mode 100644 index 00000000..5c1e4e40 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaffSeletKey_entity.dart @@ -0,0 +1,52 @@ + +class CheckingInAddStaffSeletKeyEntity { + int? errorCode; + String? description; + String? errorMsg; + List? data; + + CheckingInAddStaffSeletKeyEntity( + {this.errorCode, this.description, this.errorMsg, this.data}); + + CheckingInAddStaffSeletKeyEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(CheckingInAddStaffKeyEntity.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class CheckingInAddStaffKeyEntity { + String? attendanceWay; + String? staffName; + + CheckingInAddStaffKeyEntity({this.attendanceWay, this.staffName}); + + CheckingInAddStaffKeyEntity.fromJson(Map json) { + attendanceWay = json['attendanceWay']; + staffName = json['staffName']; + } + + Map toJson() { + final Map data = {}; + data['attendanceWay'] = attendanceWay; + data['staffName'] = staffName; + return data; + } +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_logic.dart new file mode 100644 index 00000000..74dd5dde --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_logic.dart @@ -0,0 +1,171 @@ + +import 'package:get/get.dart'; +import 'package:star_lock/tools/baseGetXController.dart'; +import 'package:star_lock/tools/toast.dart'; +import '../../../../../network/api_repository.dart'; +import '../../../../../tools/eventBusEventManage.dart'; +import 'checkingInAddStaffSeletKey_entity.dart'; +import 'checkingInAddStaff_state.dart'; + +typedef KeyClickCallback = void Function(List seletKeyList); +class CheckingInAddStaffLogic extends BaseGetXController{ + CheckingInAddStaffState state = CheckingInAddStaffState(); + + // 添加员工 + void addStaffLoadData() async{ + var attendanceWay = ""; + var usernameType = "1"; + switch(int.parse(state.seletPrintingMethodType.value)){ + case 1: + // 打卡方式APP + if(state.appUnHaveAccount.value){ + // 当没有账号的时候 + attendanceWay = state.staffAccountController.text; + + if(attendanceWay.contains("@")){ + usernameType = "2"; + } + + if(attendanceWay.isEmpty){ + Toast.show(msg: "请输入员工账号"); + return; + } + }else { + attendanceWay = state.seletKey.value; + + if(attendanceWay.isEmpty){ + Toast.show(msg: "请选择员工钥匙"); + return; + } + } + + break; + case 2: + + break; + case 3: + + break; + case 4: + + break; + } + + if(state.staffNameController.text.isEmpty){ + Toast.show(msg: "请输入姓名"); + return; + } + + var entity = await ApiRepository.to.addStaffData( + attendanceType: state.seletPrintingMethodType.value, + attendanceWay: attendanceWay, + companyId: state.companyId.value, + have: state.appUnHaveAccount.value ? "2" : "1", + staffName: state.staffNameController.text, + countryCode: state.countryCode.value, + usernameType:usernameType, + ); + if(entity.errorCode!.codeIsSuccessful){ + Get.back(result: "addScuess"); + }else if(entity.errorCode! == 425){ + Toast.show(msg: entity.errorMsg!); + } + } + + // 考勤设置添加员工-选择钥匙 + void addStaffSeletKey(KeyClickCallback kyClickCallback) async{ + var entity = await ApiRepository.to.addStaffSeletKeyData( + companyId: state.companyId.value, + type:"1", + ); + if(entity.errorCode!.codeIsSuccessful){ + state.keyEntity.value = entity.data!; + kyClickCallback(state.keyEntity.value); + } + } + + // 编辑员工 + void editStaffLoadData() async{ + var attendanceWay = ""; + var usernameType = "1"; + switch(int.parse(state.seletPrintingMethodType.value)){ + case 1: + // 打卡方式APP + if(state.appUnHaveAccount.value){ + // 当没有账号的时候 + attendanceWay = state.staffAccountController.text; + + if(attendanceWay.contains("@")){ + usernameType = "2"; + } + + if(attendanceWay.isEmpty){ + Toast.show(msg: "请输入员工账号"); + return; + } + }else { + attendanceWay = state.seletKey.value; + + if(attendanceWay.isEmpty){ + Toast.show(msg: "请选择员工钥匙"); + return; + } + } + + break; + case 2: + + break; + case 3: + + break; + case 4: + + break; + } + + if(state.staffNameController.text.isEmpty){ + Toast.show(msg: "请输入姓名"); + return; + } + + var entity = await ApiRepository.to.editStaffData( + attendanceType: state.seletPrintingMethodType.value, + attendanceWay: attendanceWay, + staffId: state.staffListItemData.value.staffId.toString(), + have: state.appUnHaveAccount.value ? "2" : "1", + staffName: state.staffNameController.text, + countryCode: state.countryCode.value, + usernameType:usernameType, + ); + if(entity.errorCode!.codeIsSuccessful){ + eventBus.fire(RefreshCheckInStaffListDataEvent()); + Get.close(2); + }else if(entity.errorCode! == 425){ + Toast.show(msg: entity.errorMsg!); + } + } + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + print("onReady()"); + + } + + @override + void onInit() { + // TODO: implement onInit + super.onInit(); + print("onInit()"); + + } + + @override + void onClose() { + // TODO: implement onClose + + } + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_page.dart new file mode 100644 index 00000000..0ee9a749 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_page.dart @@ -0,0 +1,227 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/showBottomSheetTool.dart'; +import '../../../../../tools/submitBtn.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; +import 'checkingInAddStaff_logic.dart'; + +class CheckingInAddStaffPage extends StatefulWidget { + const CheckingInAddStaffPage({Key? key}) : super(key: key); + + @override + State createState() => _CheckingInAddStaffPageState(); +} + +class _CheckingInAddStaffPageState extends State { + final logic = Get.put(CheckingInAddStaffLogic()); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: + "${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.staff!.tr}", + haveBack: true, + backgroundColor: AppColors.mainColor), + body: Column( + children: [ + CommonItem( + leftTitel: TranslationLoader.lanKeys!.name!.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, + rightWidget: + getTFWidget(TranslationLoader.lanKeys!.pleaseEnter!.tr, state.staffNameController)), + Obx(() => CommonItem( + leftTitel: TranslationLoader.lanKeys!.punchingMode!.tr, + rightTitle: state.seletPrintingMethodStr.value, + isHaveLine: false, + isHaveDirection: true, + action: () { + var list = ["APP", "密码", "卡", "指纹"]; + _showSeletClockInType(list, "1"); + })), + SizedBox( + height: 10.h, + ), + CommonItem( + leftTitel: + TranslationLoader.lanKeys!.whetherTheEmployeeHasAKey!.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, + rightWidget: Row( + children: [ + whetherTheEmployeeHasAKeyWidget("无", state.appUnHaveAccount.value, () { + setState(() { + state.appUnHaveAccount.value = true; + }); + }), + SizedBox(width: 30.w,), + whetherTheEmployeeHasAKeyWidget("有", !state.appUnHaveAccount.value, () { + setState(() { + state.appUnHaveAccount.value = false; + }); + }), + ], + )), + Obx(() => Visibility( + visible: state.appUnHaveAccount.value, + child: Column( + children: [ + CommonItem( + leftTitel: TranslationLoader.lanKeys!.accountNumber!.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, + rightWidget: + getTFWidget(TranslationLoader.lanKeys!.pleaseEnter!.tr, state.staffAccountController)), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.countryAndRegion!.tr, + rightTitle: "", + isHaveLine: true, + isHaveRightWidget: true, + isHaveDirection: true, + rightWidget: Text( + '${state.countryName.value} +${state.countryCode.value}', + textAlign: TextAlign.end, + style: + TextStyle(fontSize: 22.sp, color: AppColors.darkGrayTextColor), + ), + action: () async { + var result = await Navigator.pushNamed( + context, Routers.seletCountryRegionPage); + result as Map; + state.countryCode.value = result['code']; + state.countryName.value = result['countryName']; + setState(() {}); + }, + ), + ], + ), + )), + Obx(() => Visibility( + visible: !state.appUnHaveAccount.value, + child: CommonItem( + leftTitel: TranslationLoader.lanKeys!.selectKey!.tr, + rightTitle: state.seletKey.value, + isHaveLine: false, + isHaveDirection: true, + action: () { + logic.addStaffSeletKey((v){ + var list = []; + for (var element in v) { + list.add(element.attendanceWay); + } + _showSeletClockInType(list, "2"); + }); + + }), + )), + SizedBox( + height: 50.w, + ), + SubmitBtn( + btnName: TranslationLoader.lanKeys!.sure!.tr, + borderRadius: 20.w, + margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), + padding: EdgeInsets.only(top: 25.w, bottom: 25.w), + onClick: () { + if(state.isAdd.value == "2"){ + logic.editStaffLoadData(); + }else{ + logic.addStaffLoadData(); + } + }), + ], + ), + ); + } + + Widget getTFWidget(String tfStr, TextEditingController tf) { + return SizedBox( + height: 50.h, + width: 300.w, + // color: Colors.red, + child: Row( + children: [ + Expanded( + child: TextField( + //输入框一行 + maxLines: 1, + controller: tf, + autofocus: false, + textAlign: TextAlign.end, + decoration: InputDecoration( + //输入里面输入文字内边距设置 + contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), + hintText: tfStr, + hintStyle: TextStyle(fontSize: 22.sp), + //不需要输入框下划线 + border: InputBorder.none, + ), + ), + ), + ], + ), + ); + } + + // type 1 打卡方式 2选择钥匙 + void _showSeletClockInType(List list, String type) { + ShowBottomSheetTool().showSingleRowPicker( + //上下文 + context, + //默认的索引 + normalIndex: 0, + title: "选择钥匙", + cancelTitle: TranslationLoader.lanKeys!.cancel!.tr, + sureTitle: TranslationLoader.lanKeys!.sure!.tr, + //要显示的列表 + //可自定义数据适配器 + //adapter: PickerAdapter(), + data: list, + //选择事件的回调 + clickCallBack: (int index, var str) { + print("object:$index str:$str"); + if(type == "1"){ + state.seletPrintingMethodType.value = (index+1).toString(); + state.seletPrintingMethodStr.value = str.toString(); + }else{ + state.seletKey.value = str.toString(); + } + }); + } + + Widget whetherTheEmployeeHasAKeyWidget(String title, bool appUnHaveAccount, Function() action) { + return GestureDetector( + onTap: action, + child: Row( + children: [ + Image.asset( + appUnHaveAccount ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png', + width: 26.w, + height: 26.w, + ), + SizedBox( + width: 5.w, + ), + Text( + title, + style: TextStyle( + fontSize: 22.sp, + ), + ), + ], + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_state.dart new file mode 100644 index 00000000..9d54e524 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_state.dart @@ -0,0 +1,64 @@ + +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +import '../../../../lockMian/entity/lockInfoEntity.dart'; +import '../checkingInSetStaffList/checkingInStaffList_entity.dart'; +import 'checkingInAddStaffSeletKey_entity.dart'; + +class CheckingInAddStaffState{ + final getKeyInfosData = KeyInfos().obs; + final companyId = "".obs; + final staffListItemData = CheckingInAddStaffListItemEntity().obs; + + final TextEditingController staffNameController = TextEditingController(); + final TextEditingController staffAccountController = TextEditingController(); + + final seletPrintingMethodType = "1".obs;// 选择打卡类型 + final seletPrintingMethodStr = "APP".obs;// 选择打卡类型字符串 + + final countryName = "中国".obs; + final countryCode = "86".obs; + + final appUnHaveAccount = true.obs;// 默认没有账号 + final keyEntity = [].obs;// 选择钥匙数据 + final seletKey = "".obs; + + final isAdd = "1".obs; // 1添加 2编辑 + + CheckingInAddStaffState() { + Map map = Get.arguments; + getKeyInfosData.value = map["getKeyInfosData"]; + companyId.value = map["companyId"]; + + isAdd.value = map["isAdd"]; + if(isAdd.value == "2"){ + staffListItemData.value = map["staffListItem"]; + staffNameController.text = staffListItemData.value.staffName!; + + seletPrintingMethodType.value = staffListItemData.value.attendanceType.toString(); + switch(staffListItemData.value.attendanceType){ + case 1: + seletPrintingMethodStr.value = "APP"; + break; + case 2: + seletPrintingMethodStr.value = "密码"; + break; + case 3: + seletPrintingMethodStr.value = "卡"; + break; + case 4: + seletPrintingMethodStr.value = "指纹"; + break; + } + + if(staffListItemData.value.attendanceWay!.isNotEmpty){ + appUnHaveAccount.value = false; + seletKey.value = staffListItemData.value.attendanceWay!; + }else{ + appUnHaveAccount.value = true; + } + } + } + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart new file mode 100644 index 00000000..d52c0140 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart @@ -0,0 +1,69 @@ +class CheckingInAddStaffListEntity { + int? errorCode; + String? description; + String? errorMsg; + List? data; + + CheckingInAddStaffListEntity( + {this.errorCode, this.description, this.errorMsg, this.data}); + + CheckingInAddStaffListEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + if (json['data'] != null) { + data = []; + json['data'].forEach((v) { + data!.add(CheckingInAddStaffListItemEntity.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = {}; + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.map((v) => v.toJson()).toList(); + } + return data; + } +} + +class CheckingInAddStaffListItemEntity { + String? headurl; + String? staffName; + int? staffId; + int? attendanceType; + String? countryCode; + String? attendanceWay; + + CheckingInAddStaffListItemEntity( + {this.headurl, + this.staffName, + this.staffId, + this.attendanceType, + this.countryCode, + this.attendanceWay}); + + CheckingInAddStaffListItemEntity.fromJson(Map json) { + headurl = json['headurl']; + staffName = json['staffName']; + staffId = json['staffId']; + attendanceType = json['attendanceType']; + countryCode = json['countryCode']; + attendanceWay = json['attendanceWay']; + } + + Map toJson() { + final Map data = {}; + data['headurl'] = headurl; + data['staffName'] = staffName; + data['staffId'] = staffId; + data['attendanceType'] = attendanceType; + data['countryCode'] = countryCode; + data['attendanceWay'] = attendanceWay; + return data; + } +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_logic.dart new file mode 100644 index 00000000..eb193fbc --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_logic.dart @@ -0,0 +1,54 @@ + +import 'dart:async'; + +import 'package:star_lock/tools/baseGetXController.dart'; +import '../../../../../network/api_repository.dart'; +import '../../../../../tools/eventBusEventManage.dart'; +import 'checkingInStaffList_state.dart'; + +class CheckingInStaffManageLogic extends BaseGetXController{ + CheckingInStaffManageState state = CheckingInStaffManageState(); + + // 获取员工列表 + void getStaffList() async{ + var entity = await ApiRepository.to.getStaffListData( + companyId: state.companyId.value, + lockId:state.getKeyInfosData.value.lockId.toString(), + ); + if(entity.errorCode!.codeIsSuccessful){ + state.staffListData.value = entity.data!; + } + } + + late StreamSubscription _teamEvent; + void _initLoadDataAction() { + _teamEvent = eventBus.on().listen((event) { + getStaffList(); + }); + } + + @override + void onReady() { + // TODO: implement onReady + super.onReady(); + print("onReady()"); + + getStaffList(); + + _initLoadDataAction(); + } + + @override + void onInit() { + // TODO: implement onInit + super.onInit(); + print("onInit()"); + + } + + @override + void onClose() { + // TODO: implement onClose + _teamEvent.cancel(); + } +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_page.dart new file mode 100644 index 00000000..83642832 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_page.dart @@ -0,0 +1,98 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/customNetworkImage.dart'; +import '../../../../../tools/noData.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; +import 'checkingInStaffList_entity.dart'; +import 'checkingInStaffList_logic.dart'; + +class CheckingInStaffListPage extends StatefulWidget { + const CheckingInStaffListPage({Key? key}) : super(key: key); + + @override + State createState() => + _CheckingInStaffListPageState(); +} + +class _CheckingInStaffListPageState extends State { + final logic = Get.put(CheckingInStaffManageLogic()); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.greyBackgroundColor, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.staff!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor, + actionsList: [ + GestureDetector( + onTap: () async { + var data = await Get.toNamed(Routers.checkingInAddStaffPage, arguments: { + "getKeyInfosData": state.getKeyInfosData.value, + "companyId": state.companyId.value, + "isAdd": "1", + }); + if(data != null) { + logic.getStaffList(); + } + }, + child: Image.asset( + 'images/icon_add_white.png', + width: 36.w, + height: 36.w, + )), + SizedBox( + width: 30.w, + ), + ], + ), + body: Container( + color: Colors.white, + child: Obx(() => state.staffListData.value.isNotEmpty ? ListView.separated( + itemCount: state.staffListData.value.length, + itemBuilder: (c, index) { + CheckingInAddStaffListItemEntity staffListItem = state.staffListData[index]; + return _checkingInStaffManageItem(staffListItem, () { + Get.toNamed(Routers.checkingInStaffDetailPage, arguments: { + "staffListItem": staffListItem, + "getKeyInfosData": state.getKeyInfosData.value, + "companyId": state.companyId.value, + }); + }); + }, + separatorBuilder: (context, index) { + return const Divider( + height: 1, indent: 20, color: AppColors.greyLineColor); + }, + ) :const NoData()), + )); + } + + Widget _checkingInStaffManageItem(CheckingInAddStaffListItemEntity staffListItem, Function() action) { + return GestureDetector( + onTap: action, + child: Container( + height: 60.h, + width: 1.sw, + color: Colors.white, + margin: EdgeInsets.only(left: 10.w, right: 10.w, top: 10.h, bottom: 10.h), + child: Row( + children: [ + SizedBox(width: 30.w,), + CustomNetworkImage(url: staffListItem.headurl!, width: 40.w , height: 40.w), + // Image.asset('images/controls_user.png', width: 40.w, height: 40.w), + SizedBox(width: 30.w,), + Text(staffListItem.staffName!, style: TextStyle(fontSize: 24.sp)), + ], + ), + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_state.dart new file mode 100644 index 00000000..6019d433 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_state.dart @@ -0,0 +1,20 @@ + +import 'package:get/get.dart'; + +import '../../../../lockMian/entity/lockInfoEntity.dart'; +import 'checkingInStaffList_entity.dart'; + +class CheckingInStaffManageState{ + final getKeyInfosData = KeyInfos().obs; + final companyId = "".obs; + + final staffListData = [].obs; + + CheckingInStaffManageState() { + Map map = Get.arguments; + getKeyInfosData.value = map["getKeyInfosData"]; + companyId.value = map["companyId"]; + // print("companyId.value:${companyId.value}"); + } + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_logic.dart new file mode 100644 index 00000000..0402fabd --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_logic.dart @@ -0,0 +1,9 @@ + +import 'package:star_lock/tools/baseGetXController.dart'; +import 'checkingInStaffDetail_state.dart'; + +class CheckingInStaffDetailLogic extends BaseGetXController{ + CheckingInStaffDetailState state = CheckingInStaffDetailState(); + + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_page.dart new file mode 100644 index 00000000..9d7afd94 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_page.dart @@ -0,0 +1,70 @@ + +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; + +import '../../../../../appRouters.dart'; +import '../../../../../app_settings/app_colors.dart'; +import '../../../../../tools/commonItem.dart'; +import '../../../../../tools/titleAppBar.dart'; +import '../../../../../translations/trans_lib.dart'; +import 'checkingInStaffDetail_logic.dart'; + +class CheckingInStaffDetailPage extends StatefulWidget { + const CheckingInStaffDetailPage({Key? key}) : super(key: key); + + @override + State createState() => _CheckingInStaffDetailPageState(); +} + +class _CheckingInStaffDetailPageState extends State { + final logic = Get.put(CheckingInStaffDetailLogic()); + final state = Get.find().state; + + @override + Widget build(BuildContext context) { + return Scaffold( + backgroundColor: AppColors.mainBackgroundColor, + appBar: TitleAppBar( + barTitle: TranslationLoader.lanKeys!.staff!.tr, + haveBack: true, + backgroundColor: AppColors.mainColor, + actionsList: [ + TextButton( + child: Text( + TranslationLoader.lanKeys!.edit!.tr, + style: TextStyle(color: Colors.white, fontSize: 24.sp), + ), + onPressed: () { + Get.toNamed(Routers.checkingInAddStaffPage, arguments: { + "getKeyInfosData": state.getKeyInfosData.value, + "companyId": state.companyId.value, + "staffListItem": state.staffListItemData.value, + "isAdd": "2", + }); + }, + ), + ],), + body: Column( + children: [ + Obx(() => CommonItem( + leftTitel: TranslationLoader.lanKeys!.name!.tr, + rightTitle: state.staffListItemData.value.staffName, + isHaveLine: true)), + Obx(() => CommonItem( + leftTitel: TranslationLoader.lanKeys!.punchingMode!.tr, + rightTitle: state.attendanceType.value, + isHaveLine: true)), + Obx(() => CommonItem( + leftTitel: "APP", + rightTitle: state.staffListItemData.value.attendanceWay, + isHaveLine: true)), + CommonItem( + leftTitel: TranslationLoader.lanKeys!.attendanceRecord!.tr, + rightTitle: "", + isHaveDirection: true), + ], + ), + ); + } +} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_state.dart new file mode 100644 index 00000000..bdff3ff6 --- /dev/null +++ b/star_lock/lib/main/lockDetail/checkingIn/checkingInStaff/checkingInStaffDetail/checkingInStaffDetail_state.dart @@ -0,0 +1,36 @@ + +import 'package:get/get.dart'; + +import '../../../../lockMian/entity/lockInfoEntity.dart'; +import '../checkingInSetStaffList/checkingInStaffList_entity.dart'; + +class CheckingInStaffDetailState{ + final getKeyInfosData = KeyInfos().obs; + final companyId = "".obs; + + final staffListItemData = CheckingInAddStaffListItemEntity().obs; + + var attendanceType = "".obs; + + CheckingInStaffDetailState() { + Map map = Get.arguments; + staffListItemData.value = map["staffListItem"]; + getKeyInfosData.value = map["getKeyInfosData"]; + companyId.value = map["companyId"]; + + switch(staffListItemData.value.attendanceType){ + case 1: + attendanceType.value = "APP"; + break; + case 2: + attendanceType.value = "密码"; + break; + case 3: + attendanceType.value = "卡"; + break; + case 4: + attendanceType.value = "指纹"; + break; + } + } +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_logic.dart index 76918278..1c9e7830 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_logic.dart @@ -133,7 +133,7 @@ class AutomaticBlockingLogic extends BaseGetXController{ privateKey:getPrivateKeyList, ); } - }); + }, isShowLoading: false); } // 自动落锁 diff --git a/star_lock/lib/main/lockDetail/lcokSet/checkInCreatCompany/checkInCreatCompany_page.dart b/star_lock/lib/main/lockDetail/lcokSet/checkInCreatCompany/checkInCreatCompany_page.dart index 04f19f23..ab6161c0 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/checkInCreatCompany/checkInCreatCompany_page.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/checkInCreatCompany/checkInCreatCompany_page.dart @@ -66,7 +66,6 @@ class _CheckInCreatCompanyPageState extends State { setState(() { state.isCustom.value = data["attendanceType"]; state.weekDays.value = data["weekDays"]; - state.weekDaysStr.value = ""; state.weekDaysStr.value = state.weekDays.value.join(","); }); } diff --git a/star_lock/lib/main/lockDetail/lcokSet/lockTime/lockTime_logic.dart b/star_lock/lib/main/lockDetail/lcokSet/lockTime/lockTime_logic.dart index a44c56fb..2b4df7ae 100644 --- a/star_lock/lib/main/lockDetail/lcokSet/lockTime/lockTime_logic.dart +++ b/star_lock/lib/main/lockDetail/lcokSet/lockTime/lockTime_logic.dart @@ -53,7 +53,7 @@ class LockTimeLogic extends BaseGetXController{ (0xff & lockTime[2]) << 8 | (0xFF & lockTime[3])); - String dataEime = DateTool().dateToString("${value}"); + String dataEime = DateTool().dateToYMDHNSString("${value}"); state.dateTime.value = dataEime; print("lockTime:$lockTime value:$value dataEime:$dataEime"); break; @@ -126,7 +126,7 @@ class LockTimeLogic extends BaseGetXController{ privateKey:getPrivateKeyList, ); } - }); + }, isShowLoading: false); } // 校验时间 @@ -171,7 +171,7 @@ class LockTimeLogic extends BaseGetXController{ lockId: state.getKeyInfosData.value.lockId.toString(), ); if(entity.errorCode!.codeIsSuccessful){ - String dataEime = DateTool().dateToString("${int.parse(entity.data!.date.toString())~/1000}"); + String dataEime = DateTool().dateToYMDHNSString("${int.parse(entity.data!.date.toString())~/1000}"); state.dateTime.value = dataEime; sendTiming(); } diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart index 668e4c3a..867d7287 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_logic.dart @@ -407,7 +407,7 @@ class LockDetailLogic extends BaseGetXController{ privateKey:getPrivateKeyList, ); } - }); + }, isShowLoading: false); } @override @@ -417,9 +417,9 @@ class LockDetailLogic extends BaseGetXController{ print("onReady()"); _initReplySubscription(); - BlueManage().startScan((v){ - - }); + // BlueManage().startScan((v){ + // + // }); } @override diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart index cb1db5ac..50d342d9 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -205,6 +205,7 @@ class _LockDetailPageState extends State with RouteAware{ "keyInfo": widget.keyInfo }); }), + // 密码 bottomItem('images/main/icon_main_password.png', TranslationLoader.lanKeys!.password!.tr, () { Get.toNamed(Routers.passwordKeyListPage, @@ -213,21 +214,30 @@ class _LockDetailPageState extends State with RouteAware{ "keyInfo": widget.keyInfo }); }), + // ic卡 bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, () { - Get.toNamed(Routers.otherTypeKeyListPage, - arguments: 0); + Get.toNamed(Routers.otherTypeKeyListPage, arguments: { + "lockId": widget.keyInfo.lockId, + "fromType": 0 + }); }), + // 指纹 bottomItem('images/main/icon_main_fingerprint.png', TranslationLoader.lanKeys!.fingerprint!.tr, () { - Get.toNamed(Routers.otherTypeKeyListPage, - arguments: 1); - }), + Get.toNamed(Routers.otherTypeKeyListPage, arguments: { + "lockId": widget.keyInfo.lockId, + "fromType": 1 + }); + }), + // 遥控 bottomItem('images/main/icon_main_remoteControl.png', TranslationLoader.lanKeys!.remoteControl!.tr, () { - Get.toNamed(Routers.otherTypeKeyListPage, - arguments: 2); - }), + Get.toNamed(Routers.otherTypeKeyListPage, arguments: { + "lockId": widget.keyInfo.lockId, + "fromType": 2 + }); + }), ]; showWidgetArr.addAll(defaultWidgetArr); diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_logic.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_logic.dart index b81418f1..e0c729ec 100644 --- a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_logic.dart +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_logic.dart @@ -1,21 +1,33 @@ -import 'dart:async'; +import 'package:get/get.dart'; -import 'package:flutter_reactive_ble/flutter_reactive_ble.dart'; -import 'package:star_lock/blue/io_protocol/io_addFingerprint.dart'; -import 'package:star_lock/blue/io_type.dart'; - -import '../../../../blue/blue_manage.dart'; -import '../../../../blue/io_reply.dart'; -import '../../../../blue/io_protocol/io_senderCustomPasswords.dart'; -import '../../../../blue/io_tool/io_manager.dart'; -import '../../../../blue/io_tool/io_tool.dart'; -import '../../../../blue/io_tool/manager_event_bus.dart'; -import '../../../../blue/sender_manage.dart'; +import '../../../../network/api_repository.dart'; import '../../../../tools/baseGetXController.dart'; -import '../../../../tools/storage.dart'; +import '../../../../tools/toast.dart'; +import 'otherTypeAddKey_state.dart'; class OtherTypeAddKeyLogic extends BaseGetXController { + OtherTypeAddKeyState state = OtherTypeAddKeyState(); + + // 获取指纹列表 + void addFingerprintsData() async{ + + var entity = await ApiRepository.to.addFingerprintsData( + lockId: state.lockId.value.toString(), + endDate: state.fromType.value == 0 ? "0" : state.endTimeTimestamp.toString(), + addType:"1", + fingerprintName: state.nameController.text, + fingerprintNumber: "123456", + fingerprintType: state.fromType.value == 2 ? "4" : "1", + isCoerced: state.isStressFingerprint.value ? "1" : "0", + startDate: state.fromType.value == 0 ? "0" : state.beginTimeTimestamp.toString(), + cyclicConfig: '', + ); + if(entity.errorCode!.codeIsSuccessful){ + Toast.show(msg: "添加成功"); + Get.back(result: "addScuess"); + } + } @override void onReady() { diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_page.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_page.dart index 78f6bb37..c3c7f40d 100644 --- a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_page.dart +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_page.dart @@ -1,4 +1,7 @@ +import 'package:flutter/cupertino.dart'; 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 'package:star_lock/appRouters.dart'; @@ -6,20 +9,24 @@ import 'package:star_lock/appRouters.dart'; import '../../../../app_settings/app_colors.dart'; import '../../../../tools/commonItem.dart'; import '../../../../tools/submitBtn.dart'; +import '../../../../tools/toast.dart'; import '../../../../translations/trans_lib.dart'; +import 'otherTypeAddKey_logic.dart'; class OtherTypeAddKeyPage extends StatefulWidget { final String seletType; final int lockType; // 0卡 1指纹 2钥匙 + final int lockId; // 0卡 1指纹 2钥匙 const OtherTypeAddKeyPage( - {Key? key, required this.seletType, required this.lockType}) : super(key: key); + {Key? key, required this.seletType, required this.lockType, required this.lockId}) : super(key: key); @override State createState() => _OtherTypeAddKeyPageState(); } class _OtherTypeAddKeyPageState extends State { - final TextEditingController _controller = TextEditingController(); + final logic = Get.put(OtherTypeAddKeyLogic()); + final state = Get.find().state; @override Widget build(BuildContext context) { @@ -35,10 +42,7 @@ class _OtherTypeAddKeyPageState extends State { return Column( children: [ perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr, - TranslationLoader.lanKeys!.pleaseEnter!.tr, _controller), - SizedBox( - height: 30.h, - ), + TranslationLoader.lanKeys!.pleaseEnter!.tr, state.nameController), keyBottomWidget() ], ); @@ -49,11 +53,9 @@ class _OtherTypeAddKeyPageState extends State { return Column( children: [ perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr, - TranslationLoader.lanKeys!.pleaseEnter!.tr, _controller), + TranslationLoader.lanKeys!.pleaseEnter!.tr, state.nameController), keyTimeLimitWidget(), - SizedBox( - height: 30.h, - ), + SizedBox(height: 10.h), keyBottomWidget() ], ); @@ -64,17 +66,21 @@ class _OtherTypeAddKeyPageState extends State { return Column( children: [ perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr, - TranslationLoader.lanKeys!.pleaseEnter!.tr, _controller), + TranslationLoader.lanKeys!.pleaseEnter!.tr, state.nameController), CommonItem( leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, rightTitle: "", isHaveDirection: true, action: () { - // _showDatePicker(); + // Map result = await Get.toNamed(Routers.electronicKeyPeriodValidityPage); + // // result as Map; + // weekdaysList = result['validityValue']; + // _effectiveDateTime = result['starDate']; + // _failureDateTime = result['endDate']; + // print( + // '得到的有效期数据:$weekdaysList $_effectiveDateTime $_failureDateTime'); }), - SizedBox( - height: 30.h, - ), + SizedBox(height: 10.h), keyBottomWidget() ], ); @@ -104,20 +110,36 @@ class _OtherTypeAddKeyPageState extends State { Widget keyTimeLimitWidget() { return Column( children: [ - CommonItem( + Obx(() => CommonItem( leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, - rightTitle: "2020.06.20 11:49", + rightTitle: state.beginTime.value, isHaveLine: true, isHaveDirection: true, - action: () { - // _showDatePicker(); - }), + action: () async { + Pickers.showDatePicker(context, mode: DateMode.YMDHM, + onConfirm: (p) { + 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.beginTimeTimestamp.value = DateTime.parse(state.beginTime.value).toString(); + }); + }); + }); + })), CommonItem( leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, rightTitle: "2020.06.20 11:49", isHaveDirection: true, action: () { - // _showDatePicker(); + Pickers.showDatePicker(context, mode: DateMode.YMDHM, + onConfirm: (p) { + 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.endTimeTimestamp.value = DateTime.parse(state.beginTime.value).toString(); + }); + }); + }); }), Container(height: 10.h), ], @@ -127,10 +149,24 @@ class _OtherTypeAddKeyPageState extends State { Widget keyBottomWidget() { return Column( children: [ + CommonItem( + leftTitel: "胁迫指纹", + rightTitle: "", + isTipsImg: false, + isHaveRightWidget: true, + rightWidget: SizedBox( + width: 60.w, height: 50.h, child: _isStressFingerprint())), + SizedBox(height: 30.h), SubmitBtn(btnName: TranslationLoader.lanKeys!.next!.tr, onClick: () { - if(widget.lockType == 1){ - Get.toNamed(Routers.addFingerprintTipPage); + if(state.nameController.text.isEmpty){ + Toast.show(msg: "请输入姓名"); + return; } + + // if(widget.lockType == 1){ + Get.toNamed(Routers.addFingerprintTipPage); + // } + // logic.addFingerprintsData(); }), ], ); @@ -236,7 +272,7 @@ class _OtherTypeAddKeyPageState extends State { child: TextField( //输入框一行 maxLines: 1, - // controller: _controller, + controller: state.nameController, autofocus: false, textAlign: TextAlign.end, decoration: InputDecoration( @@ -256,4 +292,20 @@ class _OtherTypeAddKeyPageState extends State { ), ); } + + //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; + }); + }, + ); + } + } diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_state.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_state.dart index e69de29b..30835b22 100644 --- a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_state.dart +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeAddKey/otherTypeAddKey_state.dart @@ -0,0 +1,22 @@ + + +import 'package:flutter/material.dart'; +import 'package:get/get.dart'; + +class OtherTypeAddKeyState{ + final lockId = 0.obs; + final fromType = 0.obs; + final isStressFingerprint = false.obs; + + var beginTime = "".obs;// 开始时间 + var endTime = "".obs;// 结束时间 + var beginTimeTimestamp = "".obs;// 开始时间时间戳 + var endTimeTimestamp = "".obs;// 结束时间时间戳 + + final TextEditingController nameController = TextEditingController(); + OtherTypeAddKeyState() { + Map map = Get.arguments; + lockId.value = map["lockId"]; + fromType.value = map["fromType"]; + } +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_logic.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_logic.dart new file mode 100644 index 00000000..60fbe6a8 --- /dev/null +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_logic.dart @@ -0,0 +1,11 @@ + + +import 'package:star_lock/tools/baseGetXController.dart'; + +import '../../../../network/api_repository.dart'; +import 'otherTypeKeyDetail_state.dart'; + +class OtherTypeKeyDetailLogic extends BaseGetXController{ + OtherTypeKeyDetailState state = OtherTypeKeyDetailState(); + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart index 833aa55f..9415e50e 100644 --- a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_page.dart @@ -9,6 +9,7 @@ import '../../../../tools/commonItem.dart'; import '../../../../tools/submitBtn.dart'; import '../../../../tools/titleAppBar.dart'; import '../../../../translations/trans_lib.dart'; +import 'otherTypeKeyDetail_logic.dart'; class OtherTypeKeyDetailPage extends StatefulWidget { const OtherTypeKeyDetailPage({Key? key}) : super(key: key); @@ -18,6 +19,9 @@ class OtherTypeKeyDetailPage extends StatefulWidget { } class _OtherTypeKeyDetailPageState extends State { + final logic = Get.put(OtherTypeKeyDetailLogic()); + final state = Get.find().state; + @override Widget build(BuildContext context) { var type = ModalRoute.of(context)?.settings.arguments as int; @@ -25,25 +29,22 @@ class _OtherTypeKeyDetailPageState extends State { return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: - "${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}", + barTitle: "${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}", haveBack: true, backgroundColor: AppColors.mainColor, actionsList: [ TextButton( - child: Text( - TranslationLoader.lanKeys!.share!.tr, - style: TextStyle(color: Colors.white, fontSize: 24.sp), - ), - onPressed: () {}, + child: Text(TranslationLoader.lanKeys!.share!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp),), + onPressed: () { + + }, ), ], ), body: Column( children: [ CommonItem( - leftTitel: - "${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}", + leftTitel: "${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}", rightTitle: "98765432", isHaveDirection: true, isHaveLine: true, @@ -63,41 +64,41 @@ class _OtherTypeKeyDetailPageState extends State { rightTitle: "永久", isHaveDirection: true, action: () { - Navigator.pushNamed( - context, Routers.electronicKeyDetailChangeDate); + Navigator.pushNamed(context, Routers.electronicKeyDetailChangeDate); }), Container(height: 10.h), CommonItem( leftTitel: TranslationLoader.lanKeys!.additive!.tr, rightTitle: "15080825640", - action: () {}), + action: () { + + }), CommonItem( leftTitel: TranslationLoader.lanKeys!.addTime!.tr, rightTitle: "2020.06.21 11:49", - action: () {}), + action: () { + + }), Container(height: 10.h), CommonItem( leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr, rightTitle: "", isHaveDirection: true, action: () { - Navigator.pushNamed(context, Routers.keyOperationRecordPage); + Get.toNamed(Routers.keyOperationRecordPage); }), - SizedBox( - height: 40.h, - ), + SizedBox(height: 40.h), addControlsBtn(type), - SizedBox( - height: 30.h, - ), + SizedBox(height: 30.h), SubmitBtn( btnName: TranslationLoader.lanKeys!.delete!.tr, isDelete: true, borderRadius: 20.w, - 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), - onClick: () {}), + onClick: () { + + }), ], ), ); diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_state.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_state.dart new file mode 100644 index 00000000..73a22aef --- /dev/null +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyDetail/otherTypeKeyDetail_state.dart @@ -0,0 +1,4 @@ + +class OtherTypeKeyDetailState{ + +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart new file mode 100644 index 00000000..5db8a804 --- /dev/null +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart @@ -0,0 +1,123 @@ +class FingerprintListDataEntity { + int? errorCode; + String? description; + String? errorMsg; + Data? data; + + FingerprintListDataEntity( + {this.errorCode, this.description, this.errorMsg, this.data}); + + FingerprintListDataEntity.fromJson(Map json) { + errorCode = json['errorCode']; + description = json['description']; + errorMsg = json['errorMsg']; + data = json['data'] != null ? Data.fromJson(json['data']) : null; + } + + Map toJson() { + final Map data = Map(); + data['errorCode'] = errorCode; + data['description'] = description; + data['errorMsg'] = errorMsg; + if (this.data != null) { + data['data'] = this.data!.toJson(); + } + return data; + } +} + +class Data { + List? list; + int? pageNo; + int? pageSize; + int? pages; + int? total; + + Data({this.list, this.pageNo, this.pageSize, this.pages, this.total}); + + Data.fromJson(Map json) { + if (json['list'] != null) { + list = []; + json['list'].forEach((v) { + list!.add(FingerprintItemData.fromJson(v)); + }); + } + pageNo = json['pageNo']; + pageSize = json['pageSize']; + pages = json['pages']; + total = json['total']; + } + + Map toJson() { + final Map data = {}; + if (list != null) { + data['list'] = list!.map((v) => v.toJson()).toList(); + } + data['pageNo'] = pageNo; + data['pageSize'] = pageSize; + data['pages'] = pages; + data['total'] = total; + return data; + } +} + +class FingerprintItemData { + int? status; + int? lockId; + int? createDate; + String? fingerprintName; + int? endDate; + String? userId; + String? nickName; + int? isCoerced; + int? startDate; + String? fingerprintNumber; + int? fingerprintType; + int? fingerprintId; + + FingerprintItemData( + {this.status, + this.lockId, + this.createDate, + this.fingerprintName, + this.endDate, + this.userId, + this.nickName, + this.isCoerced, + this.startDate, + this.fingerprintNumber, + this.fingerprintType, + this.fingerprintId}); + + FingerprintItemData.fromJson(Map json) { + status = json['status']; + lockId = json['lockId']; + createDate = json['createDate']; + fingerprintName = json['fingerprintName']; + endDate = json['endDate']; + userId = json['userId']; + nickName = json['nickName']; + isCoerced = json['isCoerced']; + startDate = json['startDate']; + fingerprintNumber = json['fingerprintNumber']; + fingerprintType = json['fingerprintType']; + fingerprintId = json['fingerprintId']; + } + + Map toJson() { + final Map data = {}; + data['status'] = status; + data['lockId'] = lockId; + data['createDate'] = createDate; + data['fingerprintName'] = fingerprintName; + data['endDate'] = endDate; + data['userId'] = userId; + data['nickName'] = nickName; + data['isCoerced'] = isCoerced; + data['startDate'] = startDate; + data['fingerprintNumber'] = fingerprintNumber; + data['fingerprintType'] = fingerprintType; + data['fingerprintId'] = fingerprintId; + return data; + } +} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_logic.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_logic.dart index 6bbab42b..467d885c 100644 --- a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_logic.dart +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_logic.dart @@ -12,6 +12,7 @@ import '../../../../blue/io_tool/io_manager.dart'; import '../../../../blue/io_tool/io_tool.dart'; import '../../../../blue/io_tool/manager_event_bus.dart'; import '../../../../blue/sender_manage.dart'; +import '../../../../network/api_repository.dart'; import '../../../../tools/baseGetXController.dart'; import '../../../../tools/storage.dart'; import 'otherTypeKeyList_state.dart'; @@ -257,7 +258,20 @@ class OtherTypeKeyListLogic extends BaseGetXController{ privateKey:getPrivateKeyList, ); } - }); + }, isShowLoading: false); + } + + // 获取指纹列表 + void getFingerprintsListData() async{ + var entity = await ApiRepository.to.getFingerprintsListData( + lockId: state.lockId.value.toString(), + pageNo: '1', + pageSize: '20', + searchStr: '', + ); + if(entity.errorCode!.codeIsSuccessful){ + state.fingerprintItemListData.value = entity.data!.list!; + } } @override @@ -267,6 +281,8 @@ class OtherTypeKeyListLogic extends BaseGetXController{ print("onReady()"); _initReplySubscription(); + + getFingerprintsListData(); } @override diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart index 872f0df3..4308fd43 100644 --- a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_page.dart @@ -4,9 +4,12 @@ import 'package:get/get.dart'; import '../../../../appRouters.dart'; import '../../../../app_settings/app_colors.dart'; +import '../../../../tools/dateTool.dart'; +import '../../../../tools/noData.dart'; import '../../../../tools/submitBtn.dart'; import '../../../../tools/titleAppBar.dart'; import '../../../../translations/trans_lib.dart'; +import 'fingerprintListData_entity.dart'; import 'otherTypeKeyList_logic.dart'; class OtherTypeKeyListPage extends StatefulWidget { @@ -22,11 +25,10 @@ class _OtherTypeKeyListPageState extends State { @override Widget build(BuildContext context) { - var type = ModalRoute.of(context)?.settings.arguments as int; return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( - barTitle: getAppBarTitle(type), + barTitle: getAppBarTitle(state.fromType.value), haveBack: true, backgroundColor: AppColors.mainColor, actionsList: [ @@ -45,13 +47,18 @@ class _OtherTypeKeyListPageState extends State { SizedBox( height: 20.h, ), - Expanded(child: _buildMainUI(type)), + Expanded(child: _buildMainUI(state.fromType.value)), AddBottomWhiteBtn( btnName: - '${TranslationLoader.lanKeys!.add!.tr}${getAppBarTitle(type)}', - onClick: () { - Navigator.pushNamed(context, Routers.otherTypeKeyManagePage, - arguments: type); + '${TranslationLoader.lanKeys!.add!.tr}${getAppBarTitle(state.fromType.value)}', + onClick: () async { + var data = await Get.toNamed(Routers.otherTypeKeyManagePage, arguments: { + "lockId": state.lockId.value, + "fromType": state.fromType.value + }); + if(data != null) { + logic.getFingerprintsListData(); + } }, ), SizedBox( @@ -128,12 +135,12 @@ class _OtherTypeKeyListPageState extends State { typeImgName = 'images/icon_card.png'; } - return ListView.separated( - itemCount: 5, + return Obx(() => state.fingerprintItemListData.value.isNotEmpty ? ListView.separated( + itemCount: state.fingerprintItemListData.value.length, itemBuilder: (c, index) { - return _electronicKeyItem( - typeImgName, "张三", "2023.6.21 11.15", "2023.6.21 11.15", () { - Navigator.pushNamed(context, Routers.otherTypeKeyDetailPage, + FingerprintItemData fingerprintItemData = state.fingerprintItemListData.value[index]; + return _keyItem(typeImgName, fingerprintItemData.fingerprintName!, fingerprintItemData.fingerprintType! == 1 ? "永久" : "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}", () { + Get.toNamed(Routers.otherTypeKeyDetailPage, arguments: type); }); }, @@ -143,11 +150,10 @@ class _OtherTypeKeyListPageState extends State { color: AppColors.greyLineColor, ); }, - ); + ) :const NoData()); } - Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle, - String beginTime, String endTime, Function() action) { + Widget _keyItem(String lockTypeIcon, String lockTypeTitle, String showTime, Function() action) { return GestureDetector( onTap: action, child: Container( @@ -159,17 +165,9 @@ class _OtherTypeKeyListPageState extends State { ), child: Row( children: [ - SizedBox( - width: 30.w, - ), - Image.asset( - lockTypeIcon, - width: 60.w, - height: 60.w, - ), - SizedBox( - width: 20.w, - ), + SizedBox(width: 30.w), + Image.asset(lockTypeIcon, width: 60.w, height: 60.w), + SizedBox(width: 20.w), Expanded( child: Column( mainAxisAlignment: MainAxisAlignment.center, @@ -177,11 +175,7 @@ class _OtherTypeKeyListPageState extends State { Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Text( - lockTypeTitle, - style: TextStyle( - fontSize: 24.sp, color: AppColors.blackColor), - ), + Text(lockTypeTitle, style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)), ], ), SizedBox(height: 5.h), @@ -189,12 +183,7 @@ class _OtherTypeKeyListPageState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.start, children: [ - Text( - "2023.6.21 18:26 永久", - style: TextStyle( - fontSize: 18.sp, - color: AppColors.placeholderTextColor), - ), + Text(showTime, style: TextStyle(fontSize: 18.sp, color: AppColors.placeholderTextColor)), ], ), ), diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_state.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_state.dart index 39014a42..6bde10b8 100644 --- a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_state.dart +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyList/otherTypeKeyList_state.dart @@ -1,4 +1,17 @@ +import 'package:get/get.dart'; + +import 'fingerprintListData_entity.dart'; + class OtherTypeKeyListState{ + final lockId = 0.obs; + final fromType = 0.obs; + final fingerprintItemListData = [].obs; + + OtherTypeKeyListState() { + Map map = Get.arguments; + lockId.value = map["lockId"]; + fromType.value = map["fromType"]; + } } \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_page.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_page.dart index 63d3bd79..5b44f0a5 100644 --- a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_page.dart +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_page.dart @@ -1,5 +1,6 @@ import 'package:flutter/material.dart'; import 'package:get/get.dart'; +import 'package:star_lock/blue/io_tool/io_manager.dart'; import '../../../../app_settings/app_colors.dart'; import '../../../../tools/titleAppBar.dart'; @@ -19,7 +20,10 @@ class _OtherTypeKeyManagePageState extends State { @override Widget build(BuildContext context) { // 0卡 1指纹 2钥匙 - var lockType = ModalRoute.of(context)?.settings.arguments as int; + Map map = Get.arguments; + var lockId = map["lockId"]; + var lockType = map["fromType"]; + return Scaffold( backgroundColor: AppColors.mainBackgroundColor, appBar: TitleAppBar( @@ -29,7 +33,7 @@ class _OtherTypeKeyManagePageState extends State { backgroundColor: AppColors.mainColor), body: Column( children: [ - OtherTypeKeyManageTabbar(initialIndex: index, lockType: lockType), + OtherTypeKeyManageTabbar(initialIndex: index, lockType: lockType, lockId: lockId), ], ), ); diff --git a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_tabbar.dart b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_tabbar.dart index fafb9f8a..2ed18add 100644 --- a/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_tabbar.dart +++ b/star_lock/lib/main/lockDetail/otherTypeKey/otherTypeKeyManage/otherTypeKeyManage_tabbar.dart @@ -10,8 +10,9 @@ import '../otherTypeAddKey/otherTypeAddKey_page.dart'; class OtherTypeKeyManageTabbar extends StatefulWidget { var initialIndex = 1; var lockType = 0; + var lockId = 0; // 0卡 1指纹 2钥匙 OtherTypeKeyManageTabbar( - {Key? key, required this.initialIndex, required this.lockType}) + {Key? key, required this.initialIndex, required this.lockType, required this.lockId}) : super(key: key); @override @@ -89,6 +90,7 @@ class _OtherTypeKeyManageTabbarState extends State .map((ItemView item) => OtherTypeAddKeyPage( seletType: item.seletType, lockType: widget.lockType, + lockId: widget.lockId, )) .toList(), ), diff --git a/star_lock/lib/mine/addLock/saveLock/saveLock_logic.dart b/star_lock/lib/mine/addLock/saveLock/saveLock_logic.dart index 43bf6048..dc104426 100644 --- a/star_lock/lib/mine/addLock/saveLock/saveLock_logic.dart +++ b/star_lock/lib/mine/addLock/saveLock/saveLock_logic.dart @@ -286,7 +286,7 @@ class SaveLockLogic extends BaseGetXController { privateKey:getPrivateKeyList, ); } - }); + }, isShowLoading: false); } @override diff --git a/star_lock/lib/network/api.dart b/star_lock/lib/network/api.dart index 7738c5fc..fe2953ef 100644 --- a/star_lock/lib/network/api.dart +++ b/star_lock/lib/network/api.dart @@ -57,8 +57,24 @@ abstract class Api { final String setCheckInCreateCompanyURL = '/attendanceCompany/add'; // 设置考勤时创建公司 final String setLockPickingReminderDataURL = '/key/updateMonitorFlag'; // 设置开锁提醒 + final String getAttendanceRecordListByDateURL = '/attendanceRecord/listByDate'; // 获取考勤列表-早到榜日榜 + final String getAttendanceRecordListByMonthURL = '/attendanceRecord/earlyListByMonth'; // 获取考勤列表-早到榜月榜 + final String getAttendanceRecordListLateTimesByDateURL = '/attendanceRecord/lateListByDate'; // 获取考勤列表-迟到榜日榜 + final String getAttendanceRecordListLateTimesByMonthURL = '/attendanceRecord/lateEarlyListByMonth'; // 获取考勤列表-迟到榜月榜 + final String getAttendanceRecordHardworkingListURL = '/attendanceRecord/listForHardworking'; // 获取考勤列表- + final String getAttendanceRecordDtailURL = '/attendanceRecord/listByMonth'; // 获取考勤详情 final String getStaffListURL = '/staff/list'; // 获取员工列表 final String addStaffURL = '/staff/add'; // 添加员工 + final String editStaffURL = '/staff/update'; // 编辑员工 + final String addStaffSeletKeyURL = '/staff/attendanceList'; // 考勤设置添加员工-选择钥匙 + final String addHolidaysURL = '/vacation/add'; // 添加假期 + final String holidaysListURL = '/vacation/list'; // 假期列表 + final String holidaysDeleteURL = '/vacation/delete'; // 假期删除 + final String getCheckInSetInfoURL = '/attendanceCompany/query'; // 获取考勤设置信息 + final String editCheckInSetInfoURL = '/attendanceCompany/update'; // 修改考勤设置信息 + + final String getFingerprintListURL = '/fingerprint/list'; // 指纹列表 + final String addFingerprintURL = '/fingerprint/add'; // 添加指纹 final String getKeyDetailURL = '/key/get'; //获取单把钥匙详情信息 final String lockUserListURL = '/keyUser/listKeyUser'; //锁用户列表 diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index a6aa7b91..8d830a94 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -535,7 +535,7 @@ class ApiProvider extends BaseProvider { jsonEncode({ 'lockId': lockId, }), - isShowLoading: false + isUnShowLoading: true ); // 设置考勤时创建公司 @@ -594,6 +594,197 @@ class ApiProvider extends BaseProvider { 'usernameType': usernameType, })); + // 编辑员工 addHolidaysData + Future editStaffData( + String attendanceType, + String attendanceWay, + String staffId, + String have, + String staffName, + String countryCode, + String usernameType) => + post( + editStaffURL.toUrl, + jsonEncode({ + 'attendanceType': attendanceType, + 'attendanceWay': attendanceWay, + 'staffId': staffId, + 'have': have, + 'staffName': staffName, + 'countryCode': countryCode, + 'usernameType': usernameType, + })); + + // 添加员工选择钥匙 + Future addStaffSeletKeyData( + String companyId, + String type) => + post( + addStaffSeletKeyURL.toUrl, + jsonEncode({ + 'companyId': companyId, + 'type': type, + })); + + // 添加假期 + Future addHolidaysData( + String companyId, + String fillClassDate, + String vacationEndDate, + String vacationName, + String vacationStartDate) => + post( + addHolidaysURL.toUrl, + jsonEncode({ + 'companyId': companyId, + 'fillClassDate': fillClassDate, + 'vacationEndDate': vacationEndDate, + 'vacationName': vacationName, + 'vacationStartDate': vacationStartDate, + })); + + // 假期列表 + Future holidaysListData( + String companyId, + String vacationYear) => + post( + holidaysListURL.toUrl, + jsonEncode({ + 'companyId': companyId, + 'vacationYear': vacationYear, + })); + + // 删除假期 + Future deletHolidaysData( + String vacationId) => + post( + holidaysDeleteURL.toUrl, + jsonEncode({ + 'vacationId': vacationId, + })); + + // 获取考勤设置信息 + Future getCheckInSetInfoData( + String companyId) => + post( + getCheckInSetInfoURL.toUrl, + jsonEncode({ + 'companyId': companyId, + })); + + // 修改考勤设置信息 + Future editCheckInSetInfoData( + String attendanceType, + String companyId, + String type, + String companyName, + String workEndTime, + String workStartTime, + List workDay) => + post( + editCheckInSetInfoURL.toUrl, + jsonEncode({ + 'attendanceType': attendanceType, + 'companyId': companyId, + 'type': type, + 'companyName': companyName, + 'workEndTime': workEndTime, + 'workStartTime': workStartTime, + 'workDay': workDay, + })); + + // 获取考勤列表 -- 早到榜日榜 + Future getCheckInListEarlyArrivalWithDateData(String companyId, String attendanceDate) => + post( + getAttendanceRecordListByDateURL.toUrl, + jsonEncode({ + 'companyId': companyId, + 'attendanceDate': attendanceDate, + })); + + // 获取考勤列表 -- 早到榜月榜 + Future getCheckInListEarlyArrivalWithMonthData(String companyId, String attendanceDate) => + post( + getAttendanceRecordListByMonthURL.toUrl, + jsonEncode({ + 'companyId': companyId, + 'attendanceDate': attendanceDate, + })); + + // 获取考勤列表 -- 迟到榜日榜 + Future getCheckInListLateTimesWithDateData(String companyId, String attendanceDate) => + post( + getAttendanceRecordListLateTimesByDateURL.toUrl, + jsonEncode({ + 'companyId': companyId, + 'attendanceDate': attendanceDate, + })); + + // 获取考勤列表 -- 迟到榜月榜 + Future getCheckInListLateTimesWithMonthData(String companyId, String attendanceDate) => + post( + getAttendanceRecordListLateTimesByMonthURL.toUrl, + jsonEncode({ + 'companyId': companyId, + 'attendanceDate': attendanceDate, + })); + + // 获取考勤列表 -- 勤奋榜 + Future getCheckInListHardworkingData(String companyId, String attendanceDate, String type) => + post( + getAttendanceRecordHardworkingListURL.toUrl, + jsonEncode({ + 'companyId': companyId, + 'attendanceDate': attendanceDate, + 'type': type, + })); + + // 获取考勤详情 + Future getCheckInDetailData(String companyId, String attendanceDate, String staffId) => + post( + getAttendanceRecordDtailURL.toUrl, + jsonEncode({ + 'companyId': companyId, + 'attendanceDate': attendanceDate, + 'staffId': staffId, + })); + + // 获取指纹列表 + Future getFingerprintsListData(String lockId, String pageNo, String pageSize, String searchStr) => + post( + getFingerprintListURL.toUrl, + jsonEncode({ + 'lockId': lockId, + 'pageNo': pageNo, + 'pageSize': pageSize, + 'searchStr': searchStr, + })); + + // 添加指纹 + Future addFingerprintsData( + String lockId, + String endDate, + String addType, + String fingerprintName, + String fingerprintNumber, + String fingerprintType, + String isCoerced, + String startDate, + String cyclicConfig,) => + post( + addFingerprintURL.toUrl, + jsonEncode({ + 'lockId': lockId, + 'endDate': endDate, + 'addType': addType, + 'fingerprintName': fingerprintName, + 'fingerprintNumber': fingerprintNumber, + 'fingerprintType': fingerprintType, + 'isCoerced': isCoerced, + 'startDate': startDate, + 'cyclicConfig': cyclicConfig, + })); + Future listLockByGroup(String type, String keyGroupId) => post( listLockByGroupURL.toUrl, jsonEncode({'type': type, 'keyGroupId': keyGroupId})); diff --git a/star_lock/lib/network/api_provider_base.dart b/star_lock/lib/network/api_provider_base.dart index 13b7ad68..a81089fa 100644 --- a/star_lock/lib/network/api_provider_base.dart +++ b/star_lock/lib/network/api_provider_base.dart @@ -28,9 +28,9 @@ class BaseProvider extends GetConnect with Api { Map? query, Decoder? decoder, Progress? uploadProgress, - bool? isShowLoading}) async { + bool? isUnShowLoading = false}) async { // print("post: url:${url} body:${body} contentType:${contentType} headers:${headers} query:${query}"); - if(isShowLoading == true) EasyLoading.show(); + if(isUnShowLoading == false) EasyLoading.show(); print('哈喽请求body体为:${body}'); var res = await super.post(url, body, diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index 76b65986..0a8aebed 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -12,10 +12,18 @@ import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart'; import '../common/safetyVerification/entity/SafetyVerificationEntity.dart'; import '../login/login/entity/LoginEntity.dart'; import '../login/register/entity/SendValidationCodeEntity.dart'; +import '../main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_entity.dart'; +import '../main/lockDetail/checkingIn/checkingInHolidays/checkingInSetHolidays/checkingInSetHolidays_entity.dart'; +import '../main/lockDetail/checkingIn/checkingInList/checkingInListDay_entity.dart'; +import '../main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart'; +import '../main/lockDetail/checkingIn/checkingInSet/checkingInSet_entity.dart'; +import '../main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaffSeletKey_entity.dart'; +import '../main/lockDetail/checkingIn/checkingInStaff/checkingInSetStaffList/checkingInStaffList_entity.dart'; import '../main/lockDetail/lcokSet/configuringWifi/configuringWifiEntity.dart'; import '../main/lockDetail/lcokSet/lockSet/CheckingInInfoDataEntity.dart'; import '../main/lockDetail/lcokSet/lockTime/GetServerDatetimeEntity.dart'; import '../main/lockDetail/lcokSet/normallyOpenMode/GetPassageModeConfigEntity.dart'; +import '../main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart'; import '../main/lockMian/entity/lockInfoEntity.dart'; import '../mine/addLock/saveLock/entity/SaveLockEntity.dart'; import 'api_provider.dart'; @@ -587,15 +595,83 @@ class ApiRepository { return LoginEntity.fromJson(res.body); } - // 获取员工 - Future getStaffListData( + // 获取考勤列表 - 早到榜日榜 + Future getCheckInListEarlyArrivalWithDateData( + { + required String companyId, + required String attendanceDate, + }) async { + final res = + await apiProvider.getCheckInListEarlyArrivalWithDateData(companyId, attendanceDate); + return CheckingInListDayEntity.fromJson(res.body); + } + + // 获取考勤列表 - 早到榜月榜 + Future getCheckInListEarlyArrivalWithMonthData( + { + required String companyId, + required String attendanceDate, + }) async { + final res = + await apiProvider.getCheckInListEarlyArrivalWithMonthData(companyId, attendanceDate); + return CheckingInListMonthEntity.fromJson(res.body); + } + + // 获取考勤列表 - 迟到榜日榜 + Future getCheckInListLateTimesWithDateData( + { + required String companyId, + required String attendanceDate, + }) async { + final res = + await apiProvider.getCheckInListLateTimesWithDateData(companyId, attendanceDate); + return CheckingInListDayEntity.fromJson(res.body); + } + + // 获取考勤列表 - 迟到榜月榜 + Future getCheckInListLateTimesWithMonthData( + { + required String companyId, + required String attendanceDate, + }) async { + final res = + await apiProvider.getCheckInListLateTimesWithMonthData(companyId, attendanceDate); + return CheckingInListMonthEntity.fromJson(res.body); + } + + // 获取考勤列表 - 勤奋榜 + Future getCheckInListHardworkingData( + { + required String companyId, + required String attendanceDate, + required String type, + }) async { + final res = + await apiProvider.getCheckInListHardworkingData(companyId, attendanceDate, type); + return CheckingInListMonthEntity.fromJson(res.body); + } + + // 获取考勤详情 + Future getCheckInDetailData( + { + required String companyId, + required String attendanceDate, + required String staffId, + }) async { + final res = + await apiProvider.getCheckInDetailData(companyId, attendanceDate, staffId); + return CheckingInDetailEntity.fromJson(res.body); + } + + // 获取员工列表 + Future getStaffListData( { required String companyId, required String lockId, }) async { final res = await apiProvider.getStaffListData(companyId, lockId); - return LoginEntity.fromJson(res.body); + return CheckingInAddStaffListEntity.fromJson(res.body); } // 添加员工 @@ -614,4 +690,123 @@ class ApiRepository { return LoginEntity.fromJson(res.body); } + // 编辑员工 + Future editStaffData( + { + required String attendanceType, + required String attendanceWay, + required String staffId, + required String have, + required String staffName, + required String countryCode, + required String usernameType, + }) async { + final res = + await apiProvider.editStaffData(attendanceType, attendanceWay, staffId, have, staffName, countryCode, usernameType); + return LoginEntity.fromJson(res.body); + } + + // 添加员工选择钥匙 + Future addStaffSeletKeyData( + { + required String companyId, + required String type, + }) async { + final res = + await apiProvider.addStaffSeletKeyData(companyId, type); + return CheckingInAddStaffSeletKeyEntity.fromJson(res.body); + } + + // 添加假期 + Future addHolidaysData( + { + required String companyId, + required String fillClassDate, + required String vacationEndDate, + required String vacationName, + required String vacationStartDate, + }) async { + final res = + await apiProvider.addHolidaysData(companyId, fillClassDate, vacationEndDate, vacationName, vacationStartDate); + return LoginEntity.fromJson(res.body); + } + + // 假期列表 + Future holidaysListData( + { + required String companyId, + required String vacationYear, + }) async { + final res = + await apiProvider.holidaysListData(companyId, vacationYear); + return CheckingInSetHolidaysInfoDataEntity.fromJson(res.body); + } + + // 删除假期 + Future deletHolidaysData( + { + required String vacationId + }) async { + final res = + await apiProvider.deletHolidaysData(vacationId); + return LoginEntity.fromJson(res.body); + } + + // 获取考勤设置信息 + Future getCheckInSetInfoData( + { + required String companyId, + }) async { + final res = + await apiProvider.getCheckInSetInfoData(companyId); + return CheckingInSetEntity.fromJson(res.body); + } + + // 修改考勤设置信息 + Future editCheckInSetInfoData( + { + required String attendanceType, + required String companyId, + required String type, + required String companyName, + required String workEndTime, + required String workStartTime, + required List workDay, + }) async { + final res = + await apiProvider.editCheckInSetInfoData(attendanceType, companyId, type, companyName, workEndTime, workStartTime, workDay); + return CheckingInSetEntity.fromJson(res.body); + } + + // 获取指纹列表 + Future getFingerprintsListData( + { + required String lockId, + required String pageNo, + required String pageSize, + required String searchStr, + }) async { + final res = + await apiProvider.getFingerprintsListData(lockId, pageNo, pageSize, searchStr); + return FingerprintListDataEntity.fromJson(res.body); + } + + // 添加指纹 + Future addFingerprintsData( + { + required String lockId, + required String endDate, + required String addType, + required String fingerprintName, + required String fingerprintNumber, + required String fingerprintType, + required String isCoerced, + required String startDate, + required String cyclicConfig, + }) async { + final res = + await apiProvider.addFingerprintsData(lockId, endDate, addType, fingerprintName, fingerprintNumber, fingerprintType, isCoerced, startDate, cyclicConfig); + return CheckingInListMonthEntity.fromJson(res.body); + } + } diff --git a/star_lock/lib/network/request_interceptor.dart b/star_lock/lib/network/request_interceptor.dart index 8aa66a81..7fd95370 100644 --- a/star_lock/lib/network/request_interceptor.dart +++ b/star_lock/lib/network/request_interceptor.dart @@ -3,6 +3,7 @@ import 'dart:convert'; import 'package:get/get.dart'; import 'package:get/get_connect/http/src/request/request.dart'; +import '../login/login/entity/LoginData.dart'; import '../login/login/entity/LoginEntity.dart'; import '../tools/platform_info_services.dart'; import '../tools/storage.dart'; @@ -18,7 +19,7 @@ FutureOr requestInterceptor(Request request) async { String? xToken = ''; final data = await Storage.getString('userLoginData'); if (data != null && data.isNotEmpty) { - xToken = LoginEntity.fromJson(jsonDecode(data)).data!.accessToken; + xToken = LoginData.fromJson(jsonDecode(data)).accessToken; } request.headers['Authorization'] = "Bearer ${xToken ?? ''}"; return request; diff --git a/star_lock/lib/tools/commonItem.dart b/star_lock/lib/tools/commonItem.dart index 0c5b8d68..50eac58f 100644 --- a/star_lock/lib/tools/commonItem.dart +++ b/star_lock/lib/tools/commonItem.dart @@ -59,7 +59,7 @@ class CommonItem extends StatelessWidget { isHaveRightWidget! ? rightWidget! : Text( - rightTitle!, + rightTitle ?? "", textAlign: TextAlign.end, overflow: TextOverflow.ellipsis, maxLines: 1, diff --git a/star_lock/lib/tools/customNetworkImage.dart b/star_lock/lib/tools/customNetworkImage.dart new file mode 100644 index 00000000..a7827be7 --- /dev/null +++ b/star_lock/lib/tools/customNetworkImage.dart @@ -0,0 +1,34 @@ +import 'package:cached_network_image/cached_network_image.dart'; +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; + +/* +* 显示网络图片 并加缓存 +* */ + +class CustomNetworkImage extends StatelessWidget { + final String url; + final double width; + final double height; + final BoxFit boxFit; + const CustomNetworkImage({Key? key, required this.url, required this.width, required this.height, this.boxFit=BoxFit.cover}) : super(key: key); + + @override + Widget build(BuildContext context) { + return CachedNetworkImage( + width: width, + height: height, + fit: boxFit, + imageUrl: url, + imageBuilder: (context, imageProvider) => Container( + decoration: BoxDecoration( + image: DecorationImage( + image: imageProvider, + fit: boxFit, + colorFilter: const ColorFilter.mode(Colors.transparent, BlendMode.colorBurn)), + ), + ), + errorWidget: (context, url, error) => Icon(Icons.error,size: 40.sp) + ); + } +} diff --git a/star_lock/lib/tools/dateTool.dart b/star_lock/lib/tools/dateTool.dart index ae6dd6cb..be4f6473 100644 --- a/star_lock/lib/tools/dateTool.dart +++ b/star_lock/lib/tools/dateTool.dart @@ -24,7 +24,7 @@ class DateTool { return "$year.$month.$day $hour:$minute"; } - String dateToString(String timeDate){ + String dateToYMDHNSString(String timeDate){ int time = int.parse(timeDate); DateTime nowDate = DateTime.fromMillisecondsSinceEpoch(time); @@ -32,4 +32,27 @@ class DateTool { return appointmentDate; } + + String dateToYMDHNString(String timeDate){ + int time = int.parse(timeDate); + DateTime nowDate = DateTime.fromMillisecondsSinceEpoch(time); + + String appointmentDate = formatDate(nowDate, [yyyy,'.',mm,'.',dd,' ',HH,':',nn]); + + return appointmentDate; + } + + String dateToYMDString(String timeDate){ + int time = int.parse(timeDate); + DateTime nowDate = DateTime.fromMillisecondsSinceEpoch(time); + String appointmentDate = formatDate(nowDate, [yyyy,'.',mm,'.',dd]); + return appointmentDate; + } + + String dateToHNString(String timeDate){ + int time = int.parse(timeDate); + DateTime nowDate = DateTime.fromMillisecondsSinceEpoch(time); + String appointmentDate = formatDate(nowDate, [HH,':',nn]); + return appointmentDate; + } } \ No newline at end of file diff --git a/star_lock/lib/tools/eventBusEventManage.dart b/star_lock/lib/tools/eventBusEventManage.dart index b3981bfa..3ab53173 100644 --- a/star_lock/lib/tools/eventBusEventManage.dart +++ b/star_lock/lib/tools/eventBusEventManage.dart @@ -9,6 +9,11 @@ class RefreshLockListInfoDataEvent{ RefreshLockListInfoDataEvent(); } +/// 刷新考勤员工列表 +class RefreshCheckInStaffListDataEvent{ + RefreshCheckInStaffListDataEvent(); +} + /// 传递当前锁信息 class PassCurrentLockInformationEvent{ KeyInfos keyInfo; diff --git a/star_lock/lib/tools/noData.dart b/star_lock/lib/tools/noData.dart index cf4cf53a..11829f91 100644 --- a/star_lock/lib/tools/noData.dart +++ b/star_lock/lib/tools/noData.dart @@ -10,7 +10,7 @@ class NoData extends StatelessWidget { width: 1.sw, height: 1.sh - ScreenUtil().statusBarHeight, child: Center( - child: Image.asset('images/noData.png',width: 300.w,height: 240.w), + child: Image.asset('images/icon_unHaveData.png',width: 300.w,height: 240.w), ), ); } diff --git a/star_lock/lib/translations/lanKeyEntity.dart b/star_lock/lib/translations/lanKeyEntity.dart index b8bcbaf7..543a9043 100644 --- a/star_lock/lib/translations/lanKeyEntity.dart +++ b/star_lock/lib/translations/lanKeyEntity.dart @@ -185,7 +185,7 @@ class LanKeyEntity { this.workingHoursWereNotReleased, this.beLate, this.leaveEarly, - this.noCardPunched, + this.noCardPunched, this.holidayInfo, this.lanEnglish, this.lanChinese, this.multilingual, @@ -387,6 +387,8 @@ class LanKeyEntity { this.wifiPwd, this.pleaseEnterWifiPwd, this.wifiDistributionNetwork, + this.attendanceRecord, + this.edit }); LanKeyEntity.fromJson(dynamic json) { @@ -581,6 +583,7 @@ class LanKeyEntity { beLate = json['beLate']; leaveEarly = json['leaveEarly']; noCardPunched = json['noCardPunched']; + holidayInfo = json['holidayInfo']; lanEnglish = json['lanEnglish']; lanChinese = json['lanChinese']; @@ -806,6 +809,8 @@ class LanKeyEntity { wifiPwd = json['wifiPwd']; pleaseEnterWifiPwd = json['pleaseEnterWifiPwd']; wifiDistributionNetwork = json['wifiDistributionNetwork']; + attendanceRecord = json['attendanceRecord']; + edit = json['edit']; } String? starLock; String? clickUnlockAndHoldDownClose; @@ -957,6 +962,7 @@ class LanKeyEntity { String? beLate; String? leaveEarly; String? noCardPunched; + String? holidayInfo; String? basicInformation; String? wirelessKeyboard; @@ -1211,7 +1217,8 @@ class LanKeyEntity { String? wifiPwd; String? pleaseEnterWifiPwd; String? wifiDistributionNetwork; - + String? attendanceRecord; + String? edit; Map toJson() { final map = {}; map['starLock'] = starLock; @@ -1404,6 +1411,7 @@ class LanKeyEntity { map['beLate'] = beLate; map['leaveEarly'] = leaveEarly; map['noCardPunched'] = noCardPunched; + map['holidayInfo'] = holidayInfo; map['lanEnglish'] = lanEnglish; map['lanChinese'] = lanChinese; @@ -1627,6 +1635,8 @@ class LanKeyEntity { map['wifiPwd'] = wifiPwd; map['pleaseEnterWifiPwd'] = pleaseEnterWifiPwd; map['wifiDistributionNetwork'] = wifiDistributionNetwork; + map['attendanceRecord'] = attendanceRecord; + map['edit'] = edit; return map; } } diff --git a/star_lock/macos/Flutter/GeneratedPluginRegistrant.swift b/star_lock/macos/Flutter/GeneratedPluginRegistrant.swift index f3092101..127e12ed 100644 --- a/star_lock/macos/Flutter/GeneratedPluginRegistrant.swift +++ b/star_lock/macos/Flutter/GeneratedPluginRegistrant.swift @@ -12,6 +12,7 @@ import network_info_plus import package_info_plus import path_provider_foundation import shared_preferences_foundation +import sqflite import url_launcher_macos func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { @@ -22,5 +23,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) + SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) } diff --git a/star_lock/pubspec.yaml b/star_lock/pubspec.yaml index 467485ca..b294cf15 100644 --- a/star_lock/pubspec.yaml +++ b/star_lock/pubspec.yaml @@ -104,6 +104,9 @@ dependencies: # 允许App发现网络的相关信息并且进行相应的配置 network_info_plus: ^4.0.2 + + #网络图片缓存 + cached_network_image: ^3.2.0 dev_dependencies: flutter_test: sdk: flutter From d90c1c9f3d31f589dc1f0d6ab107b2fd394b4723 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Fri, 15 Sep 2023 16:07:35 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E7=A7=BB=E5=8A=A8?= =?UTF-8?q?=E6=96=87=E4=BB=B6=E5=A4=B9=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkingInAddHolidays_page.dart | 149 ------------------ .../checkingInStaffList_logic.dart | 44 ------ .../checkingInStaffList_page.dart | 116 -------------- .../checkingInStaffList_state.dart | 16 -- 4 files changed, 325 deletions(-) delete mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInAddHolidays/checkingInAddHolidays_page.dart delete mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_logic.dart delete mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_page.dart delete mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_state.dart diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInAddHolidays/checkingInAddHolidays_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInAddHolidays/checkingInAddHolidays_page.dart deleted file mode 100644 index dfc511e8..00000000 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInAddHolidays/checkingInAddHolidays_page.dart +++ /dev/null @@ -1,149 +0,0 @@ -import 'package:flutter/material.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/showCalendar.dart'; -import '../../../../tools/submitBtn.dart'; -import '../../../../tools/titleAppBar.dart'; -import '../../../../translations/trans_lib.dart'; - -class CheckingInAddHolidaysPage extends StatefulWidget { - const CheckingInAddHolidaysPage({Key? key}) : super(key: key); - - @override - State createState() => - _CheckingInAddHolidaysPageState(); -} - -class _CheckingInAddHolidaysPageState extends State { - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.addedHoliday!.tr, - haveBack: true, - backgroundColor: AppColors.mainColor), - body: Column( - children: [ - CommonItem( - leftTitel: TranslationLoader.lanKeys!.name!.tr, - rightTitle: "", - isHaveLine: true, - isHaveRightWidget: true, - rightWidget: getTFWidget( - "(${TranslationLoader.lanKeys!.mustFillIn!.tr})")), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.startDate!.tr, - rightTitle: "(${TranslationLoader.lanKeys!.mustFillIn!.tr})", - isHaveLine: true, - isHaveDirection: false, - action: () async { - await showDialog( - context: context, - builder: (context) { - return ShowCalendar( - datePickerMode: DatePickerMode.day, - seletAction: (dateTime) { - print("111111$dateTime"); - Navigator.of(context).pop(true); - }); - }); - }), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.endDate!.tr, - rightTitle: "(${TranslationLoader.lanKeys!.mustFillIn!.tr})", - isHaveLine: true, - isHaveDirection: false, - action: () async { - await showDialog( - context: context, - builder: (context) { - return ShowCalendar( - datePickerMode: DatePickerMode.day, - seletAction: (dateTime) { - Navigator.of(context).pop(true); - }); - }); - }), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.coverDate!.tr, - rightTitle: "", - isHaveLine: false, - isHaveDirection: false, - action: () async { - await showDialog( - context: context, - builder: (context) { - return ShowCalendar( - datePickerMode: DatePickerMode.day, - seletAction: (dateTime) { - Navigator.of(context).pop(true); - }); - }); - }), - SizedBox( - height: 50.w, - ), - SubmitBtn( - btnName: TranslationLoader.lanKeys!.sure!.tr, - borderRadius: 20.w, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), - padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: () {}), - ], - ), - ); - } - - Widget getTFWidget(String tfStr) { - return Container( - height: 50.h, - width: 300.w, - // color: Colors.red, - child: Row( - children: [ - Expanded( - child: TextField( - //输入框一行 - maxLines: 1, - // controller: _controller, - autofocus: false, - textAlign: TextAlign.end, - decoration: InputDecoration( - //输入里面输入文字内边距设置 - contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), - hintText: tfStr, - hintStyle: TextStyle( - fontSize: 22.sp, color: AppColors.darkGrayTextColor), - //不需要输入框下划线 - border: InputBorder.none, - ), - ), - ), - ], - ), - ); - } - - Widget whetherTheEmployeeHasAKeyWidget(String title, Function action) { - return GestureDetector( - onTap: () {}, - child: Row( - children: [ - Image.asset( - 'images/icon_round_unSelet.png', - width: 40.w, - height: 40.w, - ), - SizedBox( - width: 5.w, - ), - Text(title), - ], - ), - ); - } -} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_logic.dart deleted file mode 100644 index d4b4fcb5..00000000 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_logic.dart +++ /dev/null @@ -1,44 +0,0 @@ - - -import 'package:date_format/date_format.dart'; -import 'package:star_lock/tools/baseGetXController.dart'; -import '../../../../network/api_repository.dart'; -import 'checkingInStaffList_state.dart'; - -class CheckingInStaffManageLogic extends BaseGetXController{ - CheckingInStaffManageState state = CheckingInStaffManageState(); - - // 获取员工列表 - void getStaffList() async{ - var entity = await ApiRepository.to.getStaffListData( - companyId: state.companyId.value, - lockId:state.getKeyInfosData.value.lockId.toString(), - ); - if(entity.errorCode!.codeIsSuccessful){ - - } - } - - @override - void onReady() { - // TODO: implement onReady - super.onReady(); - print("onReady()"); - - getStaffList(); - } - - @override - void onInit() { - // TODO: implement onInit - super.onInit(); - print("onInit()"); - - } - - @override - void onClose() { - // TODO: implement onClose - - } -} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_page.dart deleted file mode 100644 index 4b5ff299..00000000 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_page.dart +++ /dev/null @@ -1,116 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; - -import '../../../../appRouters.dart'; -import '../../../../app_settings/app_colors.dart'; -import '../../../../tools/titleAppBar.dart'; -import '../../../../translations/trans_lib.dart'; -import 'checkingInStaffList_logic.dart'; - -class CheckingInStaffListPage extends StatefulWidget { - const CheckingInStaffListPage({Key? key}) : super(key: key); - - @override - State createState() => - _CheckingInStaffListPageState(); -} - -class _CheckingInStaffListPageState extends State { - final logic = Get.put(CheckingInStaffManageLogic()); - final state = Get.find().state; - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: AppColors.greyBackgroundColor, - appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.staff!.tr, - haveBack: true, - backgroundColor: AppColors.mainColor, - actionsList: [ - GestureDetector( - onTap: () { - Navigator.pushNamed(context, Routers.checkingInAddStaffPage, arguments: { - "getKeyInfosData": state.getKeyInfosData.value, - "companyId": state.companyId.value - }); - }, - child: Image.asset( - 'images/icon_add_white.png', - width: 36.w, - height: 36.w, - )), - SizedBox( - width: 30.w, - ), - ], - ), - body: Container( - color: Colors.white, - child: ListView.separated( - itemCount: 10, - itemBuilder: (c, index) { - return _checkingInStaffManageItem('images/icon_lock.png', "张三", - "2023.6.21 11.15", "2023.6.21 11.15", () { - // Navigator.pushNamed(context, Routers.electronicKeyDetailPage); - }); - }, - separatorBuilder: (context, index) { - return const Divider( - height: 1, indent: 20, color: AppColors.greyLineColor); - }, - ), - )); - } - - Widget _checkingInStaffManageItem(String lockTypeIcon, String lockTypeTitle, - String beginTime, String endTime, Function() action) { - return GestureDetector( - onTap: action, - child: Container( - height: 60.h, - margin: - EdgeInsets.only(left: 10.w, right: 10.w, top: 10.h, bottom: 10.h), - // decoration: BoxDecoration( - // color: Colors.white, - // borderRadius: BorderRadius.circular(10.w), - // ), - child: Row( - children: [ - SizedBox( - width: 30.w, - ), - Image.asset( - 'images/controls_user.png', - width: 40.w, - height: 40.w, - ), - // Container( - // width: 60.h, - // height: 60.h, - // decoration: BoxDecoration( - // color: AppColors.mainColor, - // border: Border.all(width: 1, color: AppColors.mainColor), - // borderRadius: BorderRadius.circular(30.h), - // ), - // padding: EdgeInsets.all(10.w), - // child: Image.asset( - // 'images/controls_user.png', - // width: 40.w, - // height: 40.w, - // color: Colors.white, - // )), - SizedBox( - width: 30.w, - ), - Text( - lockTypeTitle, - style: TextStyle(fontSize: 24.sp), - ), - ], - ), - ), - ); - } -} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_state.dart deleted file mode 100644 index 25fe8982..00000000 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_state.dart +++ /dev/null @@ -1,16 +0,0 @@ - -import 'package:get/get.dart'; - -import '../../../lockMian/entity/lockInfoEntity.dart'; - -class CheckingInStaffManageState{ - final getKeyInfosData = KeyInfos().obs; - final companyId = "".obs; - - CheckingInStaffManageState() { - Map map = Get.arguments; - getKeyInfosData.value = map["getKeyInfosData"]; - companyId.value = map["companyId"]; - } - -} \ No newline at end of file From 0c5e88bb08f3d5b635264abe6b6e08bf2b9ef172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Fri, 15 Sep 2023 16:07:43 +0800 Subject: [PATCH 3/5] no message --- .../checkingInAddStaff_logic.dart | 47 ----- .../checkingInAddStaff_page.dart | 178 ------------------ .../checkingInAddStaff_state.dart | 18 -- 3 files changed, 243 deletions(-) delete mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_logic.dart delete mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_page.dart delete mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_state.dart diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_logic.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_logic.dart deleted file mode 100644 index e9bde8f1..00000000 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_logic.dart +++ /dev/null @@ -1,47 +0,0 @@ - -import 'package:star_lock/tools/baseGetXController.dart'; -import '../../../../network/api_repository.dart'; -import 'checkingInAddStaff_state.dart'; - -class CheckingInAddStaffLogic extends BaseGetXController{ - CheckingInAddStaffState state = CheckingInAddStaffState(); - - // 添加员工 - void addStaffLoadData() async{ - var entity = await ApiRepository.to.addStaffData( - attendanceType: '', - attendanceWay: '', - companyId: state.companyId.value, - have: '', - staffName: '', - countryCode: '', - usernameType: '', - ); - if(entity.errorCode!.codeIsSuccessful){ - - } - } - - @override - void onReady() { - // TODO: implement onReady - super.onReady(); - print("onReady()"); - - } - - @override - void onInit() { - // TODO: implement onInit - super.onInit(); - print("onInit()"); - - } - - @override - void onClose() { - // TODO: implement onClose - - } - -} \ No newline at end of file diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_page.dart deleted file mode 100644 index 229b949b..00000000 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_page.dart +++ /dev/null @@ -1,178 +0,0 @@ -import 'package:flutter/material.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/showBottomSheetTool.dart'; -import '../../../../tools/submitBtn.dart'; -import '../../../../tools/titleAppBar.dart'; -import '../../../../translations/trans_lib.dart'; -import 'checkingInAddStaff_logic.dart'; - -class CheckingInAddStaffPage extends StatefulWidget { - const CheckingInAddStaffPage({Key? key}) : super(key: key); - - @override - State createState() => _CheckingInAddStaffPageState(); -} - -class _CheckingInAddStaffPageState extends State { - final logic = Get.put(CheckingInAddStaffLogic()); - final state = Get.find().state; - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: AppColors.mainBackgroundColor, - appBar: TitleAppBar( - barTitle: - "${TranslationLoader.lanKeys!.add!.tr}${TranslationLoader.lanKeys!.staff!.tr}", - haveBack: true, - backgroundColor: AppColors.mainColor), - body: Column( - children: [ - CommonItem( - leftTitel: TranslationLoader.lanKeys!.name!.tr, - rightTitle: "", - isHaveLine: true, - isHaveRightWidget: true, - rightWidget: - getTFWidget(TranslationLoader.lanKeys!.pleaseEnter!.tr)), - CommonItem( - leftTitel: TranslationLoader.lanKeys!.punchingMode!.tr, - rightTitle: "APP", - isHaveLine: false, - isHaveDirection: true, - action: () { - _showSeletClockInType(); - }), - SizedBox( - height: 10.h, - ), - CommonItem( - leftTitel: - TranslationLoader.lanKeys!.whetherTheEmployeeHasAKey!.tr, - rightTitle: "", - isHaveLine: true, - isHaveRightWidget: true, - rightWidget: Row( - children: [ - whetherTheEmployeeHasAKeyWidget("有", () {}), - SizedBox( - width: 30.w, - ), - whetherTheEmployeeHasAKeyWidget("无", () {}), - ], - )), - Visibility( - visible: true, - child: CommonItem( - leftTitel: TranslationLoader.lanKeys!.accountNumber!.tr, - rightTitle: "", - isHaveLine: true, - isHaveRightWidget: true, - rightWidget: - getTFWidget(TranslationLoader.lanKeys!.pleaseEnter!.tr)), - ), - Visibility( - visible: true, - child: CommonItem( - leftTitel: TranslationLoader.lanKeys!.selectKey!.tr, - rightTitle: "", - isHaveLine: false, - isHaveDirection: true, - action: () { - _showSeletClockInType(); - }), - ), - SizedBox( - height: 50.w, - ), - SubmitBtn( - btnName: TranslationLoader.lanKeys!.sure!.tr, - borderRadius: 20.w, - margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), - padding: EdgeInsets.only(top: 25.w, bottom: 25.w), - onClick: () {}), - ], - ), - ); - } - - Widget getTFWidget(String tfStr) { - return SizedBox( - height: 50.h, - width: 300.w, - // color: Colors.red, - child: Row( - children: [ - Expanded( - child: TextField( - //输入框一行 - maxLines: 1, - controller: state.staffNameController, - autofocus: false, - textAlign: TextAlign.end, - decoration: InputDecoration( - //输入里面输入文字内边距设置 - contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0), - hintText: tfStr, - hintStyle: TextStyle(fontSize: 22.sp), - //不需要输入框下划线 - border: InputBorder.none, - ), - ), - ), - ], - ), - ); - } - - void _showSeletClockInType() { - var list = [ - "APP", - "密码", - "卡", - "指纹", - ]; - ShowBottomSheetTool().showSingleRowPicker( - //上下文 - context, - //默认的索引 - normalIndex: 0, - title: "选择钥匙", - cancelTitle: TranslationLoader.lanKeys!.cancel!.tr, - sureTitle: TranslationLoader.lanKeys!.sure!.tr, - //要显示的列表 - //可自定义数据适配器 - //adapter: PickerAdapter(), - data: list, - //选择事件的回调 - clickCallBack: (int index, var str) {}); - } - - Widget whetherTheEmployeeHasAKeyWidget(String title, Function action) { - return GestureDetector( - onTap: () {}, - child: Row( - children: [ - Image.asset( - 'images/icon_round_unSelet.png', - width: 26.w, - height: 26.w, - ), - SizedBox( - width: 5.w, - ), - Text( - title, - style: TextStyle( - fontSize: 22.sp, - ), - ), - ], - ), - ); - } -} diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_state.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_state.dart deleted file mode 100644 index 4f4546f4..00000000 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_state.dart +++ /dev/null @@ -1,18 +0,0 @@ - -import 'package:flutter/material.dart'; -import 'package:get/get.dart'; - -import '../../../lockMian/entity/lockInfoEntity.dart'; - -class CheckingInAddStaffState{ - final getKeyInfosData = KeyInfos().obs; - final companyId = "".obs; - - final TextEditingController staffNameController = TextEditingController(); - - CheckingInAddStaffState() { - Map map = Get.arguments; - getKeyInfosData.value = map["getKeyInfosData"]; - companyId.value = map["companyId"]; - } -} \ No newline at end of file From a869a882868c22b155dc8485dc39b582514a17c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Mon, 18 Sep 2023 09:29:33 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=90=88=E5=B9=B6=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- star_lock/lib/appRouters.dart | 6 +---- .../lockDetail/lockDetail_page.dart | 2 +- star_lock/lib/network/api_provider.dart | 24 +++++++------------ star_lock/lib/network/api_repository.dart | 8 ------- 4 files changed, 10 insertions(+), 30 deletions(-) diff --git a/star_lock/lib/appRouters.dart b/star_lock/lib/appRouters.dart index 50f23081..230a3d0b 100644 --- a/star_lock/lib/appRouters.dart +++ b/star_lock/lib/appRouters.dart @@ -7,7 +7,6 @@ import 'package:get/get.dart'; import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart'; import 'package:star_lock/login/register/starLock_register_binding.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/lockUserList/lockUserList_page.dart'; -import 'package:star_lock/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_page.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendLockGroupList_page.dart'; import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_page.dart'; import 'package:star_lock/main/lockDetail/lockDetail/lockDetail_main_page.dart'; @@ -773,10 +772,7 @@ abstract class AppRouters { GetPage( name: Routers.checkInCreatCompanyPage, page: () => const CheckInCreatCompanyPage()), GetPage( - name: Routers.checkingInStaffDetailPage, page: () => const CheckingInStaffDetailPage()) - - name: Routers.checkInCreatCompanyPage, - page: () => const CheckInCreatCompanyPage()), + name: Routers.checkingInStaffDetailPage, page: () => const CheckingInStaffDetailPage()), GetPage( name: Routers.administratorDetailsPage, page: () => const AdministratorDetailsPage()), diff --git a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart index ddef9ed3..41d89e01 100644 --- a/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart +++ b/star_lock/lib/main/lockDetail/lockDetail/lockDetail_page.dart @@ -240,7 +240,7 @@ class _LockDetailPageState extends State with RouteAware { "lockId": widget.keyInfo.lockId, "fromType": 2 }); - + }), ]; showWidgetArr.addAll(defaultWidgetArr); diff --git a/star_lock/lib/network/api_provider.dart b/star_lock/lib/network/api_provider.dart index 1bec24cb..e84b3b6f 100644 --- a/star_lock/lib/network/api_provider.dart +++ b/star_lock/lib/network/api_provider.dart @@ -115,8 +115,7 @@ class ApiProvider extends BaseProvider { 'pageSize': pageSize, 'startDate': startDate, 'keyRight': keyRight - }), - isShowLoading: true); + })); Future sendElectronicKey( String createUser, @@ -253,8 +252,7 @@ class ApiProvider extends BaseProvider { 'keyboardPwdId': keyboardPwdId, 'cardId': cardId, 'fingerprintId': fingerprintId - }), - isShowLoading: true); + })); // 绑定蓝牙管理员 Future bindingBlueAdmin( @@ -346,8 +344,7 @@ class ApiProvider extends BaseProvider { 'operatorUid': operatorUid, 'startDate': startDate, 'timezoneRawOffSet': timezoneRawOffSet - }), - isShowLoading: true); + })); Future addKeyboardPwd( String lockId, @@ -403,8 +400,7 @@ class ApiProvider extends BaseProvider { jsonEncode({'lockId': lockId, 'groupId': groupId})); Future lockGroupList(String type) => - post(lockGroupListURL.toUrl, jsonEncode({'type': type}), - isShowLoading: true); + post(lockGroupListURL.toUrl, jsonEncode({'type': type})); Future deleteElectronicKey(String keyId) => post(deleteElectronicKeyURL.toUrl, jsonEncode({'keyId': keyId})); @@ -828,26 +824,22 @@ class ApiProvider extends BaseProvider { jsonEncode({'type': type, 'keyGroupId': keyGroupId})); Future getKeyDetail(String lockId) => - post(getKeyDetailURL.toUrl, jsonEncode({'lockId': lockId}), - isShowLoading: true); + post(getKeyDetailURL.toUrl, jsonEncode({'lockId': lockId})); Future lockUserList( String pageNo, String pageSize, String searchStr) => post( lockUserListURL.toUrl, jsonEncode( - {'pageNo': pageNo, 'pageSize': pageSize, 'searchStr': searchStr}), - isShowLoading: true); + {'pageNo': pageNo, 'pageSize': pageSize, 'searchStr': searchStr})); Future keyListByUser(String pageNo, String pageSize, String uid) => post(keyListByUserURL.toUrl, - jsonEncode({'pageNo': pageNo, 'pageSize': pageSize, 'uid': uid}), - isShowLoading: true); + jsonEncode({'pageNo': pageNo, 'pageSize': pageSize, 'uid': uid})); Future authorizedAdminList(String pageNo, String pageSize) => post( authorizedAdminListURL.toUrl, - jsonEncode({'pageNo': pageNo, 'pageSize': pageSize}), - isShowLoading: true); + jsonEncode({'pageNo': pageNo, 'pageSize': pageSize})); Future canSendKey( String endDate, List keyGroupIdList, List lockIdList) => diff --git a/star_lock/lib/network/api_repository.dart b/star_lock/lib/network/api_repository.dart index 1c6da3cd..2f3f776c 100644 --- a/star_lock/lib/network/api_repository.dart +++ b/star_lock/lib/network/api_repository.dart @@ -756,14 +756,6 @@ class ApiRepository { final res = await apiProvider.getStaffListData(companyId, lockId); return CheckingInAddStaffListEntity.fromJson(res.body); - - // 获取员工 - Future getStaffListData({ - required String companyId, - required String lockId, - }) async { - final res = await apiProvider.getStaffListData(companyId, lockId); - return LoginEntity.fromJson(res.body); } // 添加员工 From d680902ae073cd2cf1ae8d02de8aee9d9e23ce2e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=AD=8F=E5=B0=91=E9=98=B3?= <786612630@qq.com> Date: Mon, 18 Sep 2023 09:29:49 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../checkingInStaffList_page.dart | 117 ------------------ 1 file changed, 117 deletions(-) delete mode 100644 star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_page.dart diff --git a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_page.dart b/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_page.dart deleted file mode 100644 index dd1ada47..00000000 --- a/star_lock/lib/main/lockDetail/checkingIn/checkingInSetStaffList/checkingInStaffList_page.dart +++ /dev/null @@ -1,117 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:flutter_screenutil/flutter_screenutil.dart'; -import 'package:get/get.dart'; - -import '../../../../appRouters.dart'; -import '../../../../app_settings/app_colors.dart'; -import '../../../../tools/titleAppBar.dart'; -import '../../../../translations/trans_lib.dart'; -import 'checkingInStaffList_logic.dart'; - -class CheckingInStaffListPage extends StatefulWidget { - const CheckingInStaffListPage({Key? key}) : super(key: key); - - @override - State createState() => - _CheckingInStaffListPageState(); -} - -class _CheckingInStaffListPageState extends State { - final logic = Get.put(CheckingInStaffManageLogic()); - final state = Get.find().state; - - @override - Widget build(BuildContext context) { - return Scaffold( - backgroundColor: AppColors.greyBackgroundColor, - appBar: TitleAppBar( - barTitle: TranslationLoader.lanKeys!.staff!.tr, - haveBack: true, - backgroundColor: AppColors.mainColor, - actionsList: [ - GestureDetector( - onTap: () { - Navigator.pushNamed(context, Routers.checkingInAddStaffPage, - arguments: { - "getKeyInfosData": state.getKeyInfosData.value, - "companyId": state.companyId.value - }); - }, - child: Image.asset( - 'images/icon_add_white.png', - width: 36.w, - height: 36.w, - )), - SizedBox( - width: 30.w, - ), - ], - ), - body: Container( - color: Colors.white, - child: ListView.separated( - itemCount: 10, - itemBuilder: (c, index) { - return _checkingInStaffManageItem('images/icon_lock.png', "张三", - "2023.6.21 11.15", "2023.6.21 11.15", () { - // Navigator.pushNamed(context, Routers.electronicKeyDetailPage); - }); - }, - separatorBuilder: (context, index) { - return const Divider( - height: 1, indent: 20, color: AppColors.greyLineColor); - }, - ), - )); - } - - Widget _checkingInStaffManageItem(String lockTypeIcon, String lockTypeTitle, - String beginTime, String endTime, Function() action) { - return GestureDetector( - onTap: action, - child: Container( - height: 60.h, - margin: - EdgeInsets.only(left: 10.w, right: 10.w, top: 10.h, bottom: 10.h), - // decoration: BoxDecoration( - // color: Colors.white, - // borderRadius: BorderRadius.circular(10.w), - // ), - child: Row( - children: [ - SizedBox( - width: 30.w, - ), - Image.asset( - 'images/controls_user.png', - width: 40.w, - height: 40.w, - ), - // Container( - // width: 60.h, - // height: 60.h, - // decoration: BoxDecoration( - // color: AppColors.mainColor, - // border: Border.all(width: 1, color: AppColors.mainColor), - // borderRadius: BorderRadius.circular(30.h), - // ), - // padding: EdgeInsets.all(10.w), - // child: Image.asset( - // 'images/controls_user.png', - // width: 40.w, - // height: 40.w, - // color: Colors.white, - // )), - SizedBox( - width: 30.w, - ), - Text( - lockTypeTitle, - style: TextStyle(fontSize: 24.sp), - ), - ], - ), - ), - ); - } -}