This commit is contained in:
Daisy 2023-09-18 09:45:45 +08:00
commit 61621e7318
84 changed files with 3517 additions and 988 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View File

@ -110,11 +110,13 @@
"dailyCharts":"Daily Charts", "dailyCharts":"Daily Charts",
"monthlyLeaderboard":"Monthly Leader board", "monthlyLeaderboard":"Monthly Leader board",
"noAttendanceRecord":"No Attendance Record", "noAttendanceRecord":"No Attendance Record",
"attendanceRecord":"Attendance Record",
"everyoneIsVeryMotivated":"Everyone Is Very Motivated", "everyoneIsVeryMotivated":"Everyone Is Very Motivated",
"workingHoursWereNotReleased":"Working Hours Were Not Released", "workingHoursWereNotReleased":"Working Hours Were Not Released",
"beLate":"Be Late", "beLate":"Be Late",
"leaveEarly":"Leave Early", "leaveEarly":"Leave Early",
"noCardPunched":"No Card Punched", "noCardPunched":"No Card Punched",
"holidayInfo":"Holiday Info",
"basicInformation":"Basic Information", "basicInformation":"Basic Information",
"wirelessKeyboard":"Wireless Keyboard", "wirelessKeyboard":"Wireless Keyboard",
@ -400,5 +402,7 @@
"configuringWiFi":"Configuring WiFi", "configuringWiFi":"Configuring WiFi",
"pleaseEnterWifiName":"Please Enter Wifi Name", "pleaseEnterWifiName":"Please Enter Wifi Name",
"wifiPwd":"WiFi password", "wifiPwd":"WiFi password",
"pleaseEnterWifiPwd":"Please Enter WiFi Password" "pleaseEnterWifiPwd":"Please Enter WiFi Password",
"edit":"Edit",
"stressFingerprint":"Stress Fingerprint"
} }

View File

@ -110,11 +110,13 @@
"dailyCharts":"dailyCharts", "dailyCharts":"dailyCharts",
"monthlyLeaderboard":"monthlyLeaderboard", "monthlyLeaderboard":"monthlyLeaderboard",
"noAttendanceRecord":"noAttendanceRecord", "noAttendanceRecord":"noAttendanceRecord",
"attendanceRecord":"attendanceRecord",
"everyoneIsVeryMotivated":"everyoneIsVeryMotivated", "everyoneIsVeryMotivated":"everyoneIsVeryMotivated",
"workingHoursWereNotReleased":"workingHoursWereNotReleased", "workingHoursWereNotReleased":"workingHoursWereNotReleased",
"beLate":"beLate", "beLate":"beLate",
"leaveEarly":"leaveEarly", "leaveEarly":"leaveEarly",
"noCardPunched":"noCardPunched", "noCardPunched":"noCardPunched",
"holidayInfo":"holidayInfo",
"basicInformation":"basicInformation", "basicInformation":"basicInformation",
"wirelessKeyboard":"wirelessKeyboard", "wirelessKeyboard":"wirelessKeyboard",
@ -400,5 +402,8 @@
"configuringWiFi":"configuringWiFi", "configuringWiFi":"configuringWiFi",
"pleaseEnterWifiName":"pleaseEnterWifiName", "pleaseEnterWifiName":"pleaseEnterWifiName",
"wifiPwd":"wifiPwd", "wifiPwd":"wifiPwd",
"pleaseEnterWifiPwd":"pleaseEnterWifiPwd" "pleaseEnterWifiPwd":"pleaseEnterWifiPwd",
"edit":"edit",
"stressFingerprint":"stressFingerprint"
} }

View File

@ -110,11 +110,13 @@
"dailyCharts":"日榜", "dailyCharts":"日榜",
"monthlyLeaderboard":"月榜", "monthlyLeaderboard":"月榜",
"noAttendanceRecord":"无考勤记录", "noAttendanceRecord":"无考勤记录",
"attendanceRecord":"考勤记录",
"everyoneIsVeryMotivated":"大家干劲十足", "everyoneIsVeryMotivated":"大家干劲十足",
"workingHoursWereNotReleased":"工作时长未出炉", "workingHoursWereNotReleased":"工作时长未出炉",
"beLate":"迟到", "beLate":"迟到",
"leaveEarly":"早退", "leaveEarly":"早退",
"noCardPunched":"未打卡", "noCardPunched":"未打卡",
"holidayInfo":"假日信息",
"basicInformation":"基本信息", "basicInformation":"基本信息",
"wirelessKeyboard":"无线键盘", "wirelessKeyboard":"无线键盘",
@ -403,5 +405,7 @@
"configuringWiFi":"配置WiFi", "configuringWiFi":"配置WiFi",
"pleaseEnterWifiName":"请输入WiFi名字", "pleaseEnterWifiName":"请输入WiFi名字",
"wifiPwd":"WiFi名字", "wifiPwd":"WiFi名字",
"pleaseEnterWifiPwd":"请输入WiFi密码" "pleaseEnterWifiPwd":"请输入WiFi密码",
"edit":"编辑",
"stressFingerprint":"胁迫指纹"
} }

View File

@ -35,5 +35,63 @@ end
post_install do |installer| post_install do |installer|
installer.pods_project.targets.each do |target| installer.pods_project.targets.each do |target|
flutter_additional_ios_build_settings(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
end end

View File

@ -20,6 +20,9 @@ PODS:
- fluttertoast (0.0.2): - fluttertoast (0.0.2):
- Flutter - Flutter
- Toast - Toast
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- geocoding_ios (1.0.5): - geocoding_ios (1.0.5):
- Flutter - Flutter
- google_maps_flutter_ios (0.0.1): - google_maps_flutter_ios (0.0.1):
@ -49,6 +52,9 @@ PODS:
- shared_preferences_foundation (0.0.1): - shared_preferences_foundation (0.0.1):
- Flutter - Flutter
- FlutterMacOS - FlutterMacOS
- sqflite (0.0.3):
- Flutter
- FMDB (>= 2.7.5)
- SwiftProtobuf (1.22.0) - SwiftProtobuf (1.22.0)
- Toast (4.0.0) - Toast (4.0.0)
- url_launcher_ios (0.0.1): - url_launcher_ios (0.0.1):
@ -71,6 +77,7 @@ DEPENDENCIES:
- permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`) - permission_handler_apple (from `.symlinks/plugins/permission_handler_apple/ios`)
- reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`) - reactive_ble_mobile (from `.symlinks/plugins/reactive_ble_mobile/ios`)
- shared_preferences_foundation (from `.symlinks/plugins/shared_preferences_foundation/darwin`) - 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`) - url_launcher_ios (from `.symlinks/plugins/url_launcher_ios/ios`)
SPEC REPOS: SPEC REPOS:
@ -78,6 +85,7 @@ SPEC REPOS:
- AMap3DMap - AMap3DMap
- AMapFoundation - AMapFoundation
- AMapLocation - AMapLocation
- FMDB
- GoogleMaps - GoogleMaps
- Protobuf - Protobuf
- SwiftProtobuf - SwiftProtobuf
@ -116,6 +124,8 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/reactive_ble_mobile/ios" :path: ".symlinks/plugins/reactive_ble_mobile/ios"
shared_preferences_foundation: shared_preferences_foundation:
:path: ".symlinks/plugins/shared_preferences_foundation/darwin" :path: ".symlinks/plugins/shared_preferences_foundation/darwin"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
url_launcher_ios: url_launcher_ios:
:path: ".symlinks/plugins/url_launcher_ios/ios" :path: ".symlinks/plugins/url_launcher_ios/ios"
@ -130,6 +140,7 @@ SPEC CHECKSUMS:
Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854 Flutter: f04841e97a9d0b0a8025694d0796dd46242b2854
flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907 flutter_native_contact_picker: bd430ba0fbf82768bb50c2c52a69a65759a8f907
fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c fluttertoast: fafc4fa4d01a6a9e4f772ecd190ffa525e9e2d9c
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
geocoding_ios: a389ea40f6f548de6e63006a2e31bf66ff80769a geocoding_ios: a389ea40f6f548de6e63006a2e31bf66ff80769a
google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd google_maps_flutter_ios: abdac20d6ce8931f6ebc5f46616df241bfaa2cfd
GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693 GoogleMaps: 025272d5876d3b32604e5c080dc25eaf68764693
@ -141,10 +152,11 @@ SPEC CHECKSUMS:
Protobuf: c6bc59bbab3d38a71c67f62d7cb7ca8f8ea4eca1 Protobuf: c6bc59bbab3d38a71c67f62d7cb7ca8f8ea4eca1
reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c reactive_ble_mobile: 9ce6723d37ccf701dbffd202d487f23f5de03b4c
shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126 shared_preferences_foundation: 5b919d13b803cadd15ed2dc053125c68730e5126
sqflite: 31f7eba61e3074736dff8807a9b41581e4f7f15a
SwiftProtobuf: 40bd808372cb8706108f22d28f8ab4a6b9bc6989 SwiftProtobuf: 40bd808372cb8706108f22d28f8ab4a6b9bc6989
Toast: 91b396c56ee72a5790816f40d3a94dd357abc196 Toast: 91b396c56ee72a5790816f40d3a94dd357abc196
url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4 url_launcher_ios: 08a3dfac5fb39e8759aeb0abbd5d9480f30fc8b4
PODFILE CHECKSUM: 2f695eae20a86ca77f41095e9bd74ba52bd6304c PODFILE CHECKSUM: 99f32fc524867f7069762a97e548b5edf4ebf43f
COCOAPODS: 1.12.1 COCOAPODS: 1.12.1

View File

@ -375,14 +375,14 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = ZJ29NYHTV5; DEVELOPMENT_TEAM = 7NLFRKNVY3;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock"; PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock123";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
@ -506,14 +506,14 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = ZJ29NYHTV5; DEVELOPMENT_TEAM = 7NLFRKNVY3;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock"; PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock123";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";
@ -530,14 +530,14 @@
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)"; CURRENT_PROJECT_VERSION = "$(FLUTTER_BUILD_NUMBER)";
DEVELOPMENT_TEAM = ZJ29NYHTV5; DEVELOPMENT_TEAM = 7NLFRKNVY3;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
LD_RUNPATH_SEARCH_PATHS = ( LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock"; PRODUCT_BUNDLE_IDENTIFIER = "cn.star-lock.lock123";
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
VERSIONING_SYSTEM = "apple-generic"; VERSIONING_SYSTEM = "apple-generic";

View File

@ -24,13 +24,13 @@
<string>????</string> <string>????</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>$(FLUTTER_BUILD_NUMBER)</string> <string>$(FLUTTER_BUILD_NUMBER)</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSAppTransportSecurity</key> <key>NSAppTransportSecurity</key>
<dict> <dict>
<key>NSAllowsArbitraryLoads</key> <key>NSAllowsArbitraryLoads</key>
<true/> <true/>
</dict> </dict>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>NSBluetoothAlwaysUsageDescription</key> <key>NSBluetoothAlwaysUsageDescription</key>
<string>The app uses bluetooth to find, connect and transfer data between different devices</string> <string>The app uses bluetooth to find, connect and transfer data between different devices</string>
<key>NSBluetoothPeripheralUsageDescription</key> <key>NSBluetoothPeripheralUsageDescription</key>
@ -39,16 +39,16 @@
<string>这是你的自拍照</string> <string>这是你的自拍照</string>
<key>NSContactsUsageDescription</key> <key>NSContactsUsageDescription</key>
<string>Reason we need access to the contact list</string> <string>Reason we need access to the contact list</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>应用在后台的时候可以搜到更新的位置信息</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>应用在前台的时候可以搜到更新的位置信息</string>
<key>NSMicrophoneUsageDescription</key> <key>NSMicrophoneUsageDescription</key>
<string>用于音频插件</string> <string>用于音频插件</string>
<key>NSPhotoLibraryUsageDescription</key> <key>NSPhotoLibraryUsageDescription</key>
<string>用于相册</string> <string>用于相册</string>
<key>NSLocationWhenInUseUsageDescription</key>
<string>应用在前台的时候可以搜到更新的位置信息</string>
<key>NSLocationAlwaysUsageDescription</key>
<string>应用在后台的时候可以搜到更新的位置信息</string>
<key>NSLocationAlwaysAndWhenInUseUsageDescription</key>
<string>应用在前台和后台的时候可以搜到更新的位置信息</string>
<key>UIApplicationSupportsIndirectInputEvents</key> <key>UIApplicationSupportsIndirectInputEvents</key>
<true/> <true/>
<key>UIBackgroundModes</key> <key>UIBackgroundModes</key>

View File

@ -1,8 +1,12 @@
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:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart'; import 'package:star_lock/common/safetyVerification/safetyVerification_binding.dart';
import 'package:star_lock/login/register/starLock_register_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/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/massSendLockGroupList_page.dart';
import 'package:star_lock/main/lockDetail/electronicKey/massSendElectronicKey/massSendLockGroupList/massSendReceiver/massSendReceiver_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/lockDetail/lockDetail/lockDetail_main_page.dart';
@ -23,14 +27,17 @@ import 'login/forgetPassword/starLock_forgetPassword_page.dart';
import 'login/login/starLock_login_page.dart'; import 'login/login/starLock_login_page.dart';
import 'login/register/starLock_register_page.dart'; import 'login/register/starLock_register_page.dart';
import 'login/seletCountryRegion/seletCountryRegion_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/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/checkingInList/checkingInList_page.dart';
import 'main/lockDetail/checkingIn/checkingInSet/checkingInSet_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/checkingInSetWorkTime/checkingInSetWorkTime_page.dart';
import 'main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_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/electronicKey/electronicKeyDetail/keyOperationRecord_page.dart';
import 'main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart'; import 'main/lockDetail/lcokSet/automaticBlocking/automaticBlocking_page.dart';
import 'main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_page.dart'; import 'main/lockDetail/lcokSet/basicInformation/adminOpenLockPassword/adminOpenLockPassword_page.dart';
@ -203,6 +210,7 @@ abstract class Routers {
static const checkingInSetPage = '/CheckingInSetPage'; // static const checkingInSetPage = '/CheckingInSetPage'; //
static const checkingInStaffManagePage = '/CheckingInStaffManagePage'; // static const checkingInStaffManagePage = '/CheckingInStaffManagePage'; //
static const checkingInAddStaffPage = '/CheckingInAddStaffPage'; // static const checkingInAddStaffPage = '/CheckingInAddStaffPage'; //
static const checkingInStaffDetailPage = '/CheckingInStaffDetailPage'; //
static const checkingInSetWorkTimePage = static const checkingInSetWorkTimePage =
'/CheckingInSetWorkTimePage'; // '/CheckingInSetWorkTimePage'; //
static const checkingInSetWorkdaySet = '/CheckingInSetWorkdaySet'; // static const checkingInSetWorkdaySet = '/CheckingInSetWorkdaySet'; //
@ -210,6 +218,7 @@ abstract class Routers {
'/CheckingInSetHolidaysPage'; // '/CheckingInSetHolidaysPage'; //
static const checkingInAddHolidaysPage = '/CheckingInAddHolidaysPage'; // static const checkingInAddHolidaysPage = '/CheckingInAddHolidaysPage'; //
static const checkingInDetailPage = '/CheckingInDetailPage'; // static const checkingInDetailPage = '/CheckingInDetailPage'; //
static const checkingInDeletHolidaysPage = '/CheckingInDeletHolidaysPage'; //
static const mineSetPage = '/MineSetPage'; // static const mineSetPage = '/MineSetPage'; //
static const mineMultiLanguagePage = '/MineMultiLanguagePage'; // static const mineMultiLanguagePage = '/MineMultiLanguagePage'; //
@ -572,6 +581,10 @@ abstract class AppRouters {
name: Routers.checkingInAddHolidaysPage, name: Routers.checkingInAddHolidaysPage,
page: () => const CheckingInAddHolidaysPage(), page: () => const CheckingInAddHolidaysPage(),
), ),
GetPage(
name: Routers.checkingInDeletHolidaysPage,
page: () => const CheckingInDeletHolidaysPage(),
),
GetPage( GetPage(
name: Routers.checkingInDetailPage, name: Routers.checkingInDetailPage,
page: () => const CheckingInDetailPage(), page: () => const CheckingInDetailPage(),
@ -757,8 +770,9 @@ abstract class AppRouters {
GetPage( GetPage(
name: Routers.lockUserListPage, page: () => const LockUserListPage()), name: Routers.lockUserListPage, page: () => const LockUserListPage()),
GetPage( GetPage(
name: Routers.checkInCreatCompanyPage, name: Routers.checkInCreatCompanyPage, page: () => const CheckInCreatCompanyPage()),
page: () => const CheckInCreatCompanyPage()), GetPage(
name: Routers.checkingInStaffDetailPage, page: () => const CheckingInStaffDetailPage()),
GetPage( GetPage(
name: Routers.administratorDetailsPage, name: Routers.administratorDetailsPage,
page: () => const AdministratorDetailsPage()), page: () => const AdministratorDetailsPage()),

View File

@ -89,18 +89,20 @@ class BlueManage{
} }
/// ///
Future<void> connect(String deviceMAC, String deviceName, {ConnectStateCallBack? connectStateCallBack, bool? isFrist = false}) async { Future<void> connect(String deviceMAC, String deviceName, {ConnectStateCallBack? connectStateCallBack, bool? isFrist = false ,bool isShowLoading = true}) async {
connectDeviceMacAddress = deviceMAC; connectDeviceMacAddress = deviceMAC;
connectDeviceName = deviceName; connectDeviceName = deviceName;
print("connectDeviceId:$connectDeviceMacAddress connectDeviceName:$connectDeviceName"); print("connectDeviceId:$connectDeviceMacAddress connectDeviceName:$connectDeviceName");
EasyLoading.show(); if(isShowLoading){
Future.delayed(const Duration(seconds: 30), () { //asynchronous delay EasyLoading.show();
print("30s之后 菊花没有隐藏的话,强制隐藏菊花"); Future.delayed(const Duration(seconds: 10), () { //asynchronous delay
if(EasyLoading.isShow){ print("10s之后 菊花没有隐藏的话,强制隐藏菊花");
EasyLoading.dismiss(); if(EasyLoading.isShow){
} EasyLoading.dismiss();
}); }
});
}
_flutterReactiveBle!.connectToDevice(id: connectDeviceMacAddress, connectionTimeout: const Duration(seconds: 100000)).listen((connectionStateUpdate) async { _flutterReactiveBle!.connectToDevice(id: connectDeviceMacAddress, connectionTimeout: const Duration(seconds: 100000)).listen((connectionStateUpdate) async {
// //
deviceConnectionState = connectionStateUpdate.connectionState; deviceConnectionState = connectionStateUpdate.connectionState;
@ -177,18 +179,20 @@ class BlueManage{
} }
// //
Future<void> judgeReconnect(String deviceMAC, String deviceName, ConnectStateCallBack? connectStateCallBack) async { Future<void> judgeReconnect(String deviceMAC, String deviceName, ConnectStateCallBack? connectStateCallBack, {bool isShowLoading = true}) async {
if(deviceConnectionState == DeviceConnectionState.connected){ if(deviceConnectionState == DeviceConnectionState.connected){
EasyLoading.show(); if(isShowLoading){
Future.delayed(const Duration(seconds: 30), () { //asynchronous delay EasyLoading.show();
print("30s之后 菊花没有隐藏的话,强制隐藏菊花"); Future.delayed(const Duration(seconds: 10), () { //asynchronous delay
if(EasyLoading.isShow){ print("10s之后 菊花没有隐藏的话,强制隐藏菊花");
EasyLoading.dismiss(); if(EasyLoading.isShow){
} EasyLoading.dismiss();
}); }
});
}
connectStateCallBack!(deviceConnectionState!); connectStateCallBack!(deviceConnectionState!);
}else{ }else{
connect(deviceMAC, deviceName, connectStateCallBack: (state){ connect(deviceMAC, deviceName, isShowLoading: false, connectStateCallBack: (state){
connectStateCallBack!(deviceConnectionState!); connectStateCallBack!(deviceConnectionState!);
}); });
} }

View File

@ -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<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null ? Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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>? monthList;
Data({this.noPunchTimes, this.lateTimes, this.earlyTimes, this.monthList});
Data.fromJson(Map<String, dynamic> json) {
noPunchTimes = json['noPunchTimes'];
lateTimes = json['lateTimes'];
earlyTimes = json['earlyTimes'];
if (json['monthList'] != null) {
monthList = <MonthList>[];
json['monthList'].forEach((v) {
monthList!.add(MonthList.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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<String, dynamic> json) {
openingTimeStart = json['openingTimeStart'];
openingTimeEnd = json['openingTimeEnd'];
colorType = json['colorType'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['openingTimeStart'] = openingTimeStart;
data['openingTimeEnd'] = openingTimeEnd;
data['colorType'] = colorType;
return data;
}
}

View File

@ -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<void> 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
}
}

View File

@ -5,6 +5,7 @@ import 'package:get/get.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../app_settings/app_colors.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../translations/trans_lib.dart';
import 'checkingInDetail_logic.dart';
class CheckingInDetailPage extends StatefulWidget { class CheckingInDetailPage extends StatefulWidget {
const CheckingInDetailPage({Key? key}) : super(key: key); const CheckingInDetailPage({Key? key}) : super(key: key);
@ -14,6 +15,10 @@ class CheckingInDetailPage extends StatefulWidget {
} }
class _CheckingInDetailPageState extends State<CheckingInDetailPage> { class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
final logic = Get.put(CheckingInDetailLogic());
final state = Get.find<CheckingInDetailLogic>().state;
int _year = DateTime.now().year; int _year = DateTime.now().year;
int _month = DateTime.now().month; int _month = DateTime.now().month;
int _day = DateTime.now().day; int _day = DateTime.now().day;
@ -23,46 +28,40 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
super.initState();
// //
_setDatas(year: _year, month: _month); _setDatas(year: _year, month: _month);
// logic.getCheckInDetailData((){
_loadAttendanceMonthRecord("$_year-$_month"); //
// _loadAttendanceMonthRecord("$_year-$_month");
_loadAttendanceDayRecord("$_year-$_month-$_day"); });
super.initState(); //
// _loadAttendanceMonthRecord("$_year-$_month");
//
// _loadAttendanceDayRecord("$_year-$_month-$_day");
} }
// //
_loadAttendanceMonthRecord(String dateTime) async { _loadAttendanceMonthRecord(String dateTime) async {
CalendarModel bean1 = // print("_datas.length:${_datas.length} state.monthListData:${state.monthListData.length}");
CalendarModel(year: _year, month: _month, day: 1, workType: "2"); //
CalendarModel bean2 = var placeholderDays = _getPlaceholderDays(year: _year, month: _month);
CalendarModel(year: _year, month: _month, day: 2, workType: "1"); //
CalendarModel bean3 = var currentMonthDays = _getCurrentMonthDays(year: _year, month: _month);
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);
// var changeList = _datas.sublist(placeholderDays, placeholderDays + currentMonthDays);
// print("_datas.length:${_datas.length} placeholderDays:$placeholderDays currentMonthDays:$currentMonthDays");
setState(() { setState(() {
// _datas这个月上个月都包含的都有
for (int i = 0; i < _datas.length; i++) { for (int i = 0; i < _datas.length; i++) {
for (int j = 0; j < _listDatas.length; j++) { // i从0开始 i>=
if (_datas[i].year == _listDatas[j].year && if((i >= placeholderDays) && (i < (placeholderDays + currentMonthDays))){
_datas[i].month == _listDatas[j].month && // print("i:$i placeholderDays:$placeholderDays currentMonthDays:$currentMonthDays state.monthListData.length${state.monthListData.length}");
_datas[i].day == _listDatas[j].day) { _datas[i].workType = state.monthListData[i-placeholderDays].colorType.toString();
_datas[i].workType = _listDatas[j].workType; // print("_datas[i].workType:${_datas[i].workType} i:$i");
}
} }
} }
}); });
@ -72,6 +71,12 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
_loadAttendanceDayRecord(String dateTime) async { _loadAttendanceDayRecord(String dateTime) async {
// //
print("点击的是$dateTime"); print("点击的是$dateTime");
state.checkDate.value = DateTime.parse(dateTime).millisecondsSinceEpoch;
print("点击的是$dateTime state.checkDate.value:${state.checkDate.value}");
logic.getCheckInDetailData((){
//
_loadAttendanceMonthRecord("$_year-$_month");
});
} }
@override @override
@ -123,35 +128,18 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
}, },
child: Container( child: Container(
// margin: EdgeInsets.only(left: 20.w), // margin: EdgeInsets.only(left: 20.w),
child: Image( child: Image(width: 50.w, height: 30.w, image: const AssetImage("images/icon_left_black.png"),),
width: 30.w,
height: 30.w,
image: const AssetImage("images/icon_left_black.png"),
),
), ),
), ),
SizedBox( SizedBox(width: 60.w,),
width: 60.w, Text("$_year-$_month", style: TextStyle(fontSize: 28.sp, color: Colors.black, fontWeight: FontWeight.w500)),
), SizedBox(width: 60.w),
Text("$_year-$_month",
style: TextStyle(
fontSize: 28.sp,
color: Colors.black,
fontWeight: FontWeight.w500)),
SizedBox(
width: 60.w,
),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
_nextMonth(); _nextMonth();
}, },
child: Container( child: Container(
// margin: EdgeInsets.only(right: 20.sp), child: Image(width: 50.w, height: 30.w, image: const AssetImage("images/icon_right_black.png")),
child: Image(
width: 30.w,
height: 30.w,
image: const AssetImage("images/icon_right_black.png"),
),
), ),
), ),
], ],
@ -220,29 +208,42 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
// //
childAspectRatio: 1), childAspectRatio: 1),
itemBuilder: (context, index) { 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( return GestureDetector(
onTap: () { onTap: () {
setState(() { // setState(() {
if (_datas[index].month == _month) { // if (_datas[index].month == _month) {
// // //
for (int i = 0; i < _datas.length; i++) { // for (int i = 0; i < _datas.length; i++) {
if (i == index) { // if (i == index) {
// // //
_day = _datas[i].day!; // _day = _datas[i].day!;
_datas[i].isSelect = true; // _datas[i].isSelect = true;
//
// // //
_loadAttendanceDayRecord( // _loadAttendanceDayRecord(
"${_datas[i].year}-${_datas[i].month}-${_datas[i].day}"); // "${_datas[i].year}-${_datas[i].month}-${_datas[i].day}");
} else { // } else {
_datas[i].isSelect = false; // _datas[i].isSelect = false;
} // }
} // }
} else { // } else {
// // //
// _datas[index].is_select=false; // // _datas[index].is_select=false;
} // }
}); // });
}, },
child: Container( child: Container(
child: Column( child: Column(
@ -251,12 +252,10 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
width: 40.w, width: 40.w,
height: 40.w, height: 40.w,
// //
decoration: _datas[index].isSelect! decoration: BoxDecoration(
? const BoxDecoration( color: backColor,
color: Color(0xFF2C91F6), shape: BoxShape.circle,
shape: BoxShape.circle, ),
)
: const BoxDecoration(),
child: Center( child: Center(
child: Text( child: Text(
// //
@ -265,7 +264,7 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
: "", : "",
textAlign: TextAlign.center, textAlign: TextAlign.center,
// //
style: _datas[index].isSelect! style: (int.parse(_datas[index].workType!) > 0)
? TextStyle( ? TextStyle(
fontSize: 24.sp, color: const Color(0xFFFFFFFF)) fontSize: 24.sp, color: const Color(0xFFFFFFFF))
: (index % 7 == 5 || index % 7 == 6 : (index % 7 == 5 || index % 7 == 6
@ -280,19 +279,19 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
), ),
const SizedBox(height: 5), const SizedBox(height: 5),
// //
_datas[index].month == _month && // _datas[index].month == _month &&
_datas[index].workType != "" && // _datas[index].workType != "" &&
_datas[index].workType != "0" // _datas[index].workType != "0"
? Container( // ? Container(
height: 6.0, // height: 6.0,
width: 6.0, // width: 6.0,
decoration: BoxDecoration( // decoration: BoxDecoration(
shape: BoxShape.circle, // shape: BoxShape.circle,
color: _datas[index].workType == "1" // color: _datas[index].workType == "1"
? const Color(0xFFF48835) // ? const Color(0xFFF48835)
: const Color(0xFF2C91F6)), // : const Color(0xFF2C91F6)),
) // )
: Container(), // : Container(),
], ],
), ),
), ),
@ -322,9 +321,9 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
), ),
], ],
), ),
_bottomStatisticsItemWidget(Colors.red, "迟到", "0"), _bottomStatisticsItemWidget(const Color(0xFFE83523), "迟到", state.lateTimes.value),
_bottomStatisticsItemWidget(Colors.orange, "早退", "0"), _bottomStatisticsItemWidget(const Color(0xFFEDB459), "早退", state.earlyTimes.value),
_bottomStatisticsItemWidget(Colors.grey, "未打卡", "0"), _bottomStatisticsItemWidget(const Color(0xFF666666), "未打卡", state.noPunchTimes.value),
], ],
); );
} }
@ -374,9 +373,9 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
// //
int _getRowsForMonthYear({int? year, int? month}) { int _getRowsForMonthYear({int? year, int? month}) {
// //
var currentMonthDays = _getCurrentMonthDays(year: year, month: month); var currentMonthDays = _getCurrentMonthDays(year: year, month: month);
// // 1
var placeholderDays = _getPlaceholderDays(year: year, month: month); var placeholderDays = _getPlaceholderDays(year: year, month: month);
int rows = (currentMonthDays + placeholderDays) ~/ 7; int rows = (currentMonthDays + placeholderDays) ~/ 7;
@ -434,7 +433,7 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
month: lastMonth, month: lastMonth,
day: firstDay + i + 1, day: firstDay + i + 1,
isSelect: false, isSelect: false,
workType: "")); workType: "0"));
} }
/// ///
@ -446,14 +445,14 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
month: month, month: month,
day: i + 1, day: i + 1,
isSelect: true, isSelect: true,
workType: "")); workType: "0"));
} else { } else {
_datas.add(CalendarModel( _datas.add(CalendarModel(
year: year, year: year,
month: month, month: month,
day: i + 1, day: i + 1,
isSelect: false, isSelect: false,
workType: "")); workType: "0"));
} }
} }
@ -472,7 +471,7 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
month: nextMonth, month: nextMonth,
day: i + 1, day: i + 1,
isSelect: false, isSelect: false,
workType: "")); workType: "0"));
} }
} }
@ -489,9 +488,9 @@ class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
_datas.clear(); _datas.clear();
_setDatas(year: _year, month: _month); _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<CheckingInDetailPage> {
// //
_loadAttendanceMonthRecord("$_year-$_month"); _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? year;
int? month; int? month;
int? day; int? day;
String? workType = ""; //012 String? workType = ""; //012退3
bool? isSelect = false; bool? isSelect = false;
CalendarModel( CalendarModel(

View File

@ -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 = <MonthList>[].obs;
CheckingInDetailState() {
Map map = Get.arguments;
getKeyInfosData.value = map["getKeyInfosData"];
companyId.value = map["companyId"];
staffId.value = map["staffId"];
}
}

View File

@ -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
}
}

View File

@ -1,13 +1,15 @@
import 'package:date_format/date_format.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../../app_settings/app_colors.dart';
import '../../../../tools/commonItem.dart'; import '../../../../../tools/commonItem.dart';
import '../../../../tools/showCalendar.dart'; import '../../../../../tools/showCalendar.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../../translations/trans_lib.dart';
import 'checkingInAddHolidays_logic.dart';
class CheckingInAddHolidaysPage extends StatefulWidget { class CheckingInAddHolidaysPage extends StatefulWidget {
const CheckingInAddHolidaysPage({Key? key}) : super(key: key); const CheckingInAddHolidaysPage({Key? key}) : super(key: key);
@ -18,6 +20,9 @@ class CheckingInAddHolidaysPage extends StatefulWidget {
} }
class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> { class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
final logic = Get.put(CheckingInAddHolidaysLogic());
final state = Get.find<CheckingInAddHolidaysLogic>().state;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -35,9 +40,9 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: getTFWidget( rightWidget: getTFWidget(
"(${TranslationLoader.lanKeys!.mustFillIn!.tr})")), "(${TranslationLoader.lanKeys!.mustFillIn!.tr})")),
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.startDate!.tr, leftTitel: TranslationLoader.lanKeys!.startDate!.tr,
rightTitle: "(${TranslationLoader.lanKeys!.mustFillIn!.tr})", rightTitle: state.beginDate.value.isEmpty ? "(${TranslationLoader.lanKeys!.mustFillIn!.tr})" : state.beginDate.value,
isHaveLine: true, isHaveLine: true,
isHaveDirection: false, isHaveDirection: false,
action: () async { action: () async {
@ -47,14 +52,16 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
return ShowCalendar( return ShowCalendar(
datePickerMode: DatePickerMode.day, datePickerMode: DatePickerMode.day,
seletAction: (dateTime) { seletAction: (dateTime) {
print("111111$dateTime"); String beginDate = formatDate(dateTime, [yyyy,'-',mm,'-',dd]);
Navigator.of(context).pop(true); state.beginDate.value = beginDate;
Get.back();
// Navigator.of(context).pop(true);
}); });
}); });
}), })),
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.endDate!.tr, leftTitel: TranslationLoader.lanKeys!.endDate!.tr,
rightTitle: "(${TranslationLoader.lanKeys!.mustFillIn!.tr})", rightTitle: state.endDate.value.isEmpty ? "(${TranslationLoader.lanKeys!.mustFillIn!.tr})" : state.endDate.value,
isHaveLine: true, isHaveLine: true,
isHaveDirection: false, isHaveDirection: false,
action: () async { action: () async {
@ -64,13 +71,15 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
return ShowCalendar( return ShowCalendar(
datePickerMode: DatePickerMode.day, datePickerMode: DatePickerMode.day,
seletAction: (dateTime) { seletAction: (dateTime) {
Navigator.of(context).pop(true); String endDate = formatDate(dateTime, [yyyy,'-',mm,'-',dd]);
state.endDate.value = endDate;
Get.back();
}); });
}); });
}), })),
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.coverDate!.tr, leftTitel: TranslationLoader.lanKeys!.coverDate!.tr,
rightTitle: "", rightTitle: state.makeUpWorkDate.value,
isHaveLine: false, isHaveLine: false,
isHaveDirection: false, isHaveDirection: false,
action: () async { action: () async {
@ -80,10 +89,12 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
return ShowCalendar( return ShowCalendar(
datePickerMode: DatePickerMode.day, datePickerMode: DatePickerMode.day,
seletAction: (dateTime) { seletAction: (dateTime) {
Navigator.of(context).pop(true); String makeUpWorkDate = formatDate(dateTime, [yyyy,'-',mm,'-',dd]);
state.makeUpWorkDate.value = makeUpWorkDate;
Get.back();
}); });
}); });
}), })),
SizedBox( SizedBox(
height: 50.w, height: 50.w,
), ),
@ -92,7 +103,9 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
borderRadius: 20.w, borderRadius: 20.w,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {}), onClick: () {
logic.editStaffLoadData();
}),
], ],
), ),
); );
@ -109,7 +122,7 @@ class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
child: TextField( child: TextField(
// //
maxLines: 1, maxLines: 1,
// controller: _controller, controller: state.staffNameController,
autofocus: false, autofocus: false,
textAlign: TextAlign.end, textAlign: TextAlign.end,
decoration: InputDecoration( decoration: InputDecoration(

View File

@ -1,18 +1,19 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../lockMian/entity/lockInfoEntity.dart'; class CheckingInAddHolidaysState{
class CheckingInAddStaffState{
final getKeyInfosData = KeyInfos().obs;
final companyId = "".obs;
final TextEditingController staffNameController = TextEditingController(); final TextEditingController staffNameController = TextEditingController();
CheckingInAddStaffState() { final companyId = "".obs;
final beginDate = "".obs;
final endDate = "".obs;
final makeUpWorkDate = "".obs;
CheckingInAddHolidaysState() {
Map map = Get.arguments; Map map = Get.arguments;
getKeyInfosData.value = map["getKeyInfosData"];
companyId.value = map["companyId"]; companyId.value = map["companyId"];
} }
} }

View File

@ -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");
}
}
}

View File

@ -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<CheckingInDeletHolidaysPage> createState() => _CheckingInDeletHolidaysPageState();
}
class _CheckingInDeletHolidaysPageState extends State<CheckingInDeletHolidaysPage> {
final logic = Get.put(CheckingInDeletHolidaysLogic());
final state = Get.find<CheckingInDeletHolidaysLogic>().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),
],
)));
}
}

View File

@ -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"];
}
}

View File

@ -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<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null ? HolidaysListData.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['errorCode'] = errorCode;
data['description'] = description;
data['errorMsg'] = errorMsg;
if (this.data != null) {
data['data'] = this.data!.toJson();
}
return data;
}
}
class HolidaysListData {
List<HolidaysMonthListData>? holidayList;
HolidaysListData({this.holidayList});
HolidaysListData.fromJson(Map<String, dynamic> json) {
if (json['list'] != null) {
holidayList = <HolidaysMonthListData>[];
json['list'].forEach((v) {
holidayList!.add(HolidaysMonthListData.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
if (holidayList != null) {
data['list'] = holidayList!.map((v) => v.toJson()).toList();
}
return data;
}
}
class HolidaysMonthListData {
List<ListItem>? listItem;
HolidaysMonthListData({this.listItem});
HolidaysMonthListData.fromJson(List json) {
listItem = <ListItem>[];
for (var v in json) {
listItem!.add(ListItem.fromJson(v));
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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<String, dynamic> json) {
vacationEndDate = json['vacationEndDate'];
vacationName = json['vacationName'];
vacationStartDate = json['vacationStartDate'];
vacationYear = json['vacationYear'];
fillClassDate = json['fillClassDate'];
month = json['month'];
vacationId = json['vacationId'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['vacationEndDate'] = vacationEndDate;
data['vacationName'] = vacationName;
data['vacationStartDate'] = vacationStartDate;
data['vacationYear'] = vacationYear;
data['fillClassDate'] = fillClassDate;
data['month'] = month;
data['vacationId'] = vacationId;
return data;
}
}

View File

@ -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
}
}

View File

@ -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<CheckingInSetHolidaysPage> createState() =>
_CheckingInSetHolidaysPageState();
}
class _CheckingInSetHolidaysPageState extends State<CheckingInSetHolidaysPage> {
final logic = Get.put(CheckingInSetHolidaysLogic());
final state = Get.find<CheckingInSetHolidaysLogic>().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;
}
}

View File

@ -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 = <HolidaysMonthListData>[].obs;
CheckingInSetHolidaysState() {
Map map = Get.arguments;
companyId.value = map["companyId"];
}
}

View File

@ -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<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null ? Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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<AttendanceRecordDayList>? attendanceRecordList;
Data(
{this.noPunchTimes,
this.lateTimes,
this.earlyTimes,
this.attendanceRecordList});
Data.fromJson(Map<String, dynamic> json) {
noPunchTimes = json['noPunchTimes'];
lateTimes = json['lateTimes'];
earlyTimes = json['earlyTimes'];
if (json['attendanceRecordList'] != null) {
attendanceRecordList = <AttendanceRecordDayList>[];
json['attendanceRecordList'].forEach((v) {
attendanceRecordList!.add(AttendanceRecordDayList.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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<String, dynamic> 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<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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;
}
}

View File

@ -0,0 +1,81 @@
class CheckingInListMonthEntity {
int? errorCode;
String? description;
String? errorMsg;
List<AttendanceRecordMonthList>? data;
CheckingInListMonthEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
CheckingInListMonthEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
if (json['data'] != null) {
data = <AttendanceRecordMonthList>[];
json['data'].forEach((v) {
data!.add(AttendanceRecordMonthList.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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<String, dynamic> 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<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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;
}
}

View File

@ -1,5 +1,6 @@
import 'package:star_lock/main/lockDetail/checkingIn/checkingInList/checkingInListDay_entity.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../network/api_repository.dart'; import '../../../../network/api_repository.dart';
import 'checkingInList_state.dart'; import 'checkingInList_state.dart';
@ -14,6 +15,88 @@ class CheckingInListLogic extends BaseGetXController{
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
state.companyId.value = entity.data!.companyId.toString(); 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!;
} }
} }

View File

@ -1,13 +1,17 @@
import 'package:date_format/date_format.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/checkingIn/checkingInList/checkingInListMonth_entity.dart';
import '../../../../appRouters.dart'; import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../app_settings/app_colors.dart';
import '../../../../tools/noData.dart';
import '../../../../tools/showBottomSheetTool.dart'; import '../../../../tools/showBottomSheetTool.dart';
import '../../../../tools/showCalendar.dart'; import '../../../../tools/showCalendar.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../translations/trans_lib.dart';
import 'checkingInListDay_entity.dart';
import 'checkingInList_logic.dart'; import 'checkingInList_logic.dart';
class CheckingInListPage extends StatefulWidget { class CheckingInListPage extends StatefulWidget {
@ -35,27 +39,18 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
onTap: () { onTap: () {
Get.toNamed(Routers.checkingInSetPage, arguments: { Get.toNamed(Routers.checkingInSetPage, arguments: {
"getKeyInfosData": state.getKeyInfosData.value, "getKeyInfosData": state.getKeyInfosData.value,
"companyId": state.companyId.value
}); });
}, },
child: Image.asset( child: Image.asset('images/main/icon_lockDetail_checkIn_set.png', width: 36.w, height: 36.w,)),
'images/main/icon_lockDetail_checkIn_set.png', SizedBox(width: 30.w),
width: 36.w,
height: 36.w,
)),
SizedBox(
width: 30.w,
),
], ],
), ),
body: Column( body: Column(
children: [ children: [
topInfo(), topInfo(),
SizedBox( SizedBox(height: 10.h),
height: 10.h,
),
middleDayInfo(), middleDayInfo(),
Expanded(child: bottomList()) Expanded(child: getBottomList())
], ],
), ),
); );
@ -68,60 +63,74 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
color: Colors.white, color: Colors.white,
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(height: 30.h),
height: 30.h, Image.asset('images/main/icon_checkInRankingListTop.png', width: 120.w, height: 120.w),
), SizedBox(height: 10.h),
Image.asset('images/main/icon_checkInRankingListTop.png', Text(TranslationLoader.lanKeys!.noAttendanceRecord!.tr, style: TextStyle(fontSize: 24.sp)),
width: 120.w, height: 120.w), SizedBox(height: 30.h),
SizedBox(
height: 10.h,
),
Text(TranslationLoader.lanKeys!.noAttendanceRecord!.tr,
style: TextStyle(fontSize: 24.sp)),
SizedBox(
height: 30.h,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
// SizedBox(width: 30.w,), // SizedBox(width: 30.w,),
Row( Row(
children: [ children: [
SizedBox( SizedBox(width: 20.w,),
width: 40.w, GestureDetector(
), onTap: (){
Container( setState(() {
// width: 150.w, setState(() {
height: 70.h, state.isDay.value = true;
// color: Colors.red, DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(state.checkListDateTimestamp.value);
child: Column( String beginDate = formatDate(dateTime, [mm,'-',dd]);
mainAxisAlignment: MainAxisAlignment.spaceAround, state.checkListDate.value = beginDate;
children: [ logic.loadDataByType();
Text(TranslationLoader.lanKeys!.dailyCharts!.tr, });
style: TextStyle( });
color: AppColors.mainColor, fontSize: 22.sp)), },
Container( child: Container(
width: 20.w, width: 90.w,
height: 2.h, height: 70.h,
color: AppColors.mainColor) 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( // SizedBox(width: 20.w,),
width: 40.w, GestureDetector(
), onTap: (){
SizedBox( setState(() {
// width: 100.w, state.isDay.value = false;
height: 70.h, DateTime dateTime = DateTime.fromMillisecondsSinceEpoch(state.checkListDateTimestamp.value);
// color: Colors.red, String beginDate = formatDate(dateTime, [mm]);
child: Column( state.checkListDate.value = beginDate;
mainAxisAlignment: MainAxisAlignment.spaceAround, logic.loadDataByType();
children: [ });
Text(TranslationLoader.lanKeys!.monthlyLeaderboard!.tr, },
style: TextStyle( child: Container(
color: Colors.black, fontSize: 22.sp)), width: 90.w,
Container(width: 20.w, height: 2.h, color: Colors.black) 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<CheckingInListPage> {
return ShowCalendar( return ShowCalendar(
datePickerMode: DatePickerMode.day, datePickerMode: DatePickerMode.day,
seletAction: (dateTime) { 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( child: Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
Text( Text(state.checkListDate.value, style: TextStyle(color: Colors.black, fontSize: 22.sp),),
"07-12", Image.asset('images/icon_grayPullDown.png', width: 50.w, height: 30.w,),
style: TextStyle(color: Colors.black, fontSize: 22.sp), SizedBox(width: 10.w,),
),
Image.asset(
'images/icon_grayPullDown.png',
width: 50.w,
height: 30.w,
),
SizedBox(
width: 10.w,
),
], ],
), ),
) )
@ -165,8 +171,8 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
} }
Widget middleDayInfo() { Widget middleDayInfo() {
return Visibility( return Obx(() => Visibility(
visible: true, visible: state.isDay.value,
child: Container( child: Container(
height: 80.h, height: 80.h,
color: Colors.white, color: Colors.white,
@ -177,71 +183,83 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
Column( Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
SizedBox( SizedBox(height: 5.h),
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)),
Text("0", SizedBox(height: 5.h),
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( Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
SizedBox( SizedBox(height: 5.h),
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)),
Text("0", SizedBox(height: 5.h),
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( Column(
mainAxisAlignment: MainAxisAlignment.spaceAround, mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [ children: [
SizedBox( SizedBox(height: 5.h),
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)),
Text("0", SizedBox(height: 5.h),
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() { Widget getBottomList(){
return ListView.separated( if((state.isDay.value == true && (state.listType.value == "1")) || (state.isDay.value == true && (state.listType.value == "2"))){
itemCount: 10, return bottomDayList();
}else{
return bottomMonthList();
}
}
Widget bottomDayList() {
return Obx(() => state.checkingInDayListData.value.isNotEmpty ? ListView.separated(
itemCount: state.checkingInDayListData.value.length,
itemBuilder: (c, index) { itemBuilder: (c, index) {
return _checkingInListItem('images/controls_user.png', "张三", AttendanceRecordDayList attendanceRecordList= state.checkingInDayListData.value[index];
"2023.6.21 11.15", "2023.6.21 11.15", () { return _checkingInListItem(index, attendanceRecordList.headurl, attendanceRecordList.staffName,() {
Navigator.pushNamed(context, Routers.checkingInDetailPage); 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) { separatorBuilder: (context, index) {
return const Divider(height: 1, color: AppColors.greyLineColor); return const Divider(height: 1, color: AppColors.greyLineColor);
}, },
); ) :const NoData());
} }
Widget _checkingInListItem(String lockTypeIcon, String lockTypeTitle, Widget _checkingInListItem(int index, String? headUrl, String? name, Function() action) {
String beginTime, String endTime, Function() action) {
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
@ -253,21 +271,10 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
), ),
child: Row( child: Row(
children: [ children: [
SizedBox( SizedBox(width: 30.w,),
width: 30.w, Text("1", style: TextStyle(fontSize: 20.sp),),
), SizedBox(width: 20.w,),
Text( Image.asset('images/controls_user.png', width: 40.w, height: 40.w,),
"1",
style: TextStyle(fontSize: 20.sp),
),
SizedBox(
width: 20.w,
),
Image.asset(
'images/controls_user.png',
width: 40.w,
height: 40.w,
),
// Container( // Container(
// width: 60.h, // width: 60.h,
// height: 60.h, // height: 60.h,
@ -283,21 +290,12 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
// height: 30.w, // height: 30.w,
// color: Colors.white, // color: Colors.white,
// )), // )),
SizedBox( SizedBox(width: 20.w),
width: 20.w,
),
Expanded( Expanded(
child: Text( child: Text(name!, style: TextStyle(fontSize: 24.sp),),
lockTypeTitle,
style: TextStyle(fontSize: 24.sp),
),
), ),
SizedBox(width: 20.h), SizedBox(width: 20.h),
Image.asset( Image.asset("images/icon_right_grey.png", width: 21.w, height: 21.w,),
"images/icon_right_grey.png",
width: 21.w,
height: 21.w,
),
SizedBox(width: 20.h), SizedBox(width: 20.h),
], ],
), ),
@ -310,24 +308,19 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
onTap: () { onTap: () {
showListType(); showListType();
}, },
child: Row( child: Obx(() => Container(
mainAxisAlignment: MainAxisAlignment.center, width: 200.w,
children: [ height: 60.h,
Text( color: AppColors.mainColor,
TranslationLoader.lanKeys!.earlyArrivalList!.tr, child: Row(
style: TextStyle(color: Colors.white, fontSize: 26.sp), mainAxisAlignment: MainAxisAlignment.center,
), children: [
SizedBox( Text(state.listTypeStr.value, style: TextStyle(color: Colors.white, fontSize: 26.sp),),
width: 5.w, SizedBox(width: 5.w,),
), Image.asset('images/main/icon_lockDetail_checkIn_topTitle.png', width: 22.w, height: 16.w, fit: BoxFit.fill,)
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<CheckingInListPage> {
//adapter: PickerAdapter(), //adapter: PickerAdapter(),
data: list, 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();
});
});
} }
} }

View File

@ -1,14 +1,31 @@
import 'package:date_format/date_format.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../../translations/trans_lib.dart';
import '../../../lockMian/entity/lockInfoEntity.dart'; import '../../../lockMian/entity/lockInfoEntity.dart';
import 'checkingInListDay_entity.dart';
import 'checkingInListMonth_entity.dart';
class CheckingInListState{ class CheckingInListState{
final getKeyInfosData = KeyInfos().obs; final getKeyInfosData = KeyInfos().obs;
final companyId = "".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 = <AttendanceRecordDayList>[].obs;
final checkingInMonthListData = <AttendanceRecordMonthList>[].obs;
var lateTimes = "".obs;//
var earlyTimes = "".obs;// 退
var noPunchTimes = "".obs;//
CheckingInListState() { CheckingInListState() {
getKeyInfosData.value = Get.arguments as KeyInfos; getKeyInfosData.value = Get.arguments as KeyInfos;
} }
} }

View File

@ -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<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null ? CheckingInSetInfo.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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<int>? workDay;
CheckingInSetInfo(
{this.staffNum,
this.workEndTime,
this.attendanceType,
this.companyId,
this.companyName,
this.workStartTime,
this.workDay});
CheckingInSetInfo.fromJson(Map<String, dynamic> json) {
staffNum = json['staffNum'];
workEndTime = json['workEndTime'];
attendanceType = json['attendanceType'];
companyId = json['companyId'];
companyName = json['companyName'];
workStartTime = json['workStartTime'];
workDay = json['workDay'].cast<int>();
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['staffNum'] = staffNum;
data['workEndTime'] = workEndTime;
data['attendanceType'] = attendanceType;
data['companyId'] = companyId;
data['companyName'] = companyName;
data['workStartTime'] = workStartTime;
data['workDay'] = workDay;
return data;
}
}

View File

@ -1,9 +1,93 @@
import 'package:get/get.dart';
import '../../../../network/api_repository.dart';
import '../../../../tools/baseGetXController.dart'; import '../../../../tools/baseGetXController.dart';
import '../../../../tools/dateTool.dart';
import '../../../../tools/toast.dart';
import 'checkingInSet_state.dart'; import 'checkingInSet_state.dart';
class CheckingInSetLogic extends BaseGetXController{ class CheckingInSetLogic extends BaseGetXController{
CheckingInSetState state = CheckingInSetState(); 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<RefreshCheckInStaffListDataEvent>().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();
}
} }

View File

@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart'; import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/tools/toast.dart';
import '../../../../appRouters.dart'; import '../../../../appRouters.dart';
import '../../../../tools/commonItem.dart'; import '../../../../tools/commonItem.dart';
@ -22,8 +23,6 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
final logic = Get.put(CheckingInSetLogic()); final logic = Get.put(CheckingInSetLogic());
final state = Get.find<CheckingInSetLogic>().state; final state = Get.find<CheckingInSetLogic>().state;
final TextEditingController _changeNameController = TextEditingController();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
@ -35,18 +34,18 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Column( body: Column(
children: [ children: [
CommonItem( Obx(() => CommonItem(
leftTitel: leftTitel:
"${TranslationLoader.lanKeys!.company!.tr}${TranslationLoader.lanKeys!.name!.tr}", "${TranslationLoader.lanKeys!.company!.tr}${TranslationLoader.lanKeys!.name!.tr}",
rightTitle: "深圳市志超科技", rightTitle: state.companyName.value ?? "",
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
showCupertinoAlertDialog(context); showCupertinoAlertDialog(context);
}), })),
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.staff!.tr, leftTitel: TranslationLoader.lanKeys!.staff!.tr,
rightTitle: "0", rightTitle: state.staffNumber.value,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
@ -54,32 +53,61 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
"getKeyInfosData": state.getKeyInfosData.value, "getKeyInfosData": state.getKeyInfosData.value,
"companyId": state.companyId.value "companyId": state.companyId.value
}); });
}), })),
CommonItem( Obx(() => CommonItem(
leftTitel: leftTitel:
"${TranslationLoader.lanKeys!.work!.tr}${TranslationLoader.lanKeys!.time!.tr}", "${TranslationLoader.lanKeys!.work!.tr}${TranslationLoader.lanKeys!.time!.tr}",
rightTitle: "9:00 - 18:00", rightTitle: (state.beginTime.value.isNotEmpty) ? "${state.beginTime.value} - ${state.endTime.value}" : "",
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () async {
Navigator.pushNamed(context, Routers.checkingInSetWorkTimePage); var data = await Get.toNamed(Routers.checkingInSetWorkTimePage, arguments: {
}), "getKeyInfosData": state.getKeyInfosData.value,
CommonItem( "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: leftTitel:
"${TranslationLoader.lanKeys!.workday!.tr}${TranslationLoader.lanKeys!.set!.tr}", "${TranslationLoader.lanKeys!.workday!.tr}${TranslationLoader.lanKeys!.set!.tr}",
rightTitle: "1,2,3,4,5", rightTitle: state.weekDaysStr.value,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () async {
Navigator.pushNamed(context, Routers.checkingInSetWorkdaySet); 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( CommonItem(
leftTitel: TranslationLoader.lanKeys!.holidays!.tr, leftTitel: TranslationLoader.lanKeys!.holidays!.tr,
rightTitle: "", rightTitle: "",
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Routers.checkingInSetHolidaysPage); Get.toNamed(Routers.checkingInSetHolidaysPage, arguments: {
"companyId": state.companyId.value
});
}), }),
SizedBox( SizedBox(
height: 30.h, height: 30.h,
@ -103,14 +131,19 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return ShowTFView( return ShowTFView(
title: "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.name!.tr}", title: "${TranslationLoader.lanKeys!.amend!.tr}${TranslationLoader.lanKeys!.company!.tr}",
tipTitle: "", tipTitle: "",
controller: _changeNameController, controller: state.changeNameController,
sureClick: () { sureClick: () {
if(state.changeNameController.text.isEmpty){
Toast.show(msg: "请输入公司姓名");
return;
}
Get.back();
logic.editCheckInSetInfoData();
}, },
cancelClick: () { cancelClick: () {
Navigator.pop(context); Get.back();
},); },);
}); });
} }

View File

@ -1,15 +1,32 @@
import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../lockMian/entity/lockInfoEntity.dart'; import '../../../lockMian/entity/lockInfoEntity.dart';
import 'checkingInSet_entity.dart';
class CheckingInSetState{ class CheckingInSetState{
final getKeyInfosData = KeyInfos().obs; final getKeyInfosData = KeyInfos().obs;
final companyId = "".obs; final companyId = "".obs;
var isCustom = true.obs;
var weekDays = <int>[].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() { CheckingInSetState() {
Map map = Get.arguments; Map map = Get.arguments;
getKeyInfosData.value = map["getKeyInfosData"]; getKeyInfosData.value = map["getKeyInfosData"];
companyId.value = map["companyId"];
} }
} }

View File

@ -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
}
}

View File

@ -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<CheckingInSetHolidaysPage> createState() =>
_CheckingInSetHolidaysPageState();
}
class _CheckingInSetHolidaysPageState extends State<CheckingInSetHolidaysPage> {
@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) {
//
// }
// );
}
}

View File

@ -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<CheckingInStaffListPage> createState() =>
_CheckingInStaffListPageState();
}
class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
final logic = Get.put(CheckingInStaffManageLogic());
final state = Get.find<CheckingInStaffManageLogic>().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),
),
],
),
),
);
}
}

View File

@ -1,9 +1,29 @@
import 'package:get/get.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../network/api_repository.dart';
import '../../../../tools/toast.dart';
import 'checkingInSetWorkTime_state.dart'; import 'checkingInSetWorkTime_state.dart';
class CheckingInSetWorkTimeLogic extends BaseGetXController{ class CheckingInSetWorkTimeLogic extends BaseGetXController{
CheckingInSetWorkTimeState state = CheckingInSetWorkTimeState(); 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: "修改成功");
}
}
} }

View File

@ -64,16 +64,30 @@ class _CheckingInSetWorkTimePageState extends State<CheckingInSetWorkTimePage> {
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w), margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w),
padding: EdgeInsets.only(top: 20.w, bottom: 20.w), padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
onClick: () { 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)){ if(int.parse(state.beginTimeTimestamp.value) > int.parse(state.endTimeTimestamp.value)){
Toast.show(msg: "结束时间不能大于开始时间"); Toast.show(msg: "结束时间不能大于开始时间");
return; return;
} }
Get.back(result: { if(state.pushType.value == "2"){
"beginTime":state.beginTime.value, logic.editCheckInSetInfoData();
"beginTimeTimestamp":state.beginTimeTimestamp.value, }else{
"endTime":state.endTime.value, Get.back(result: {
"endTimeTimestamp":state.endTimeTimestamp.value, "beginTime":state.beginTime.value,
}); "beginTimeTimestamp":state.beginTimeTimestamp.value,
"endTime":state.endTime.value,
"endTimeTimestamp":state.endTimeTimestamp.value,
});
}
} }
), ),
], ],

View File

@ -1,10 +1,33 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../../tools/dateTool.dart';
import '../../../lockMian/entity/lockInfoEntity.dart';
import '../checkingInSet/checkingInSet_entity.dart';
class CheckingInSetWorkTimeState{ class CheckingInSetWorkTimeState{
final getKeyInfosData = KeyInfos().obs;
final checkingInSetInfo = CheckingInSetInfo().obs;
final companyId = "".obs;
var beginTime = "".obs;// var beginTime = "".obs;//
var endTime = "".obs;// var endTime = "".obs;//
var beginTimeTimestamp = "".obs;// var beginTimeTimestamp = "".obs;//
var endTimeTimestamp = "".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();
}
} }

View File

@ -1,9 +1,65 @@
import 'package:get/get.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../network/api_repository.dart';
import 'checkingInSetWorkdaySet_state.dart'; import 'checkingInSetWorkdaySet_state.dart';
class CheckingInSetWorkdaySetLogic extends BaseGetXController{ class CheckingInSetWorkdaySetLogic extends BaseGetXController{
CheckingInSetWorkdaySetState state = CheckingInSetWorkdaySetState(); 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();
}
} }

View File

@ -33,16 +33,21 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
body: ListView( body: ListView(
children: [ children: [
topBtnWidget(), 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())), Obx(() => Visibility(visible: !state.isCustom.value, child: bottomOddOrEvenDaysOffSeletBtn())),
SizedBox(height: 50.h,), SizedBox(height: 50.h,),
Container( Container(
margin: EdgeInsets.only(left: 20.w, right: 20.w), margin: EdgeInsets.only(left: 20.w, right: 20.w),
child: SubmitBtn(btnName: TranslationLoader.lanKeys!.sure!.tr, onClick: () { child: SubmitBtn(btnName: TranslationLoader.lanKeys!.sure!.tr, onClick: () {
Get.back(result: { if(state.pushType.value == "2"){
"attendanceType":state.isCustom.value, logic.editCheckInSetInfoData();
"weekDays":state.weekDays.value, }else{
}); Get.back(result: {
"attendanceType":state.isCustom.value,
"weekDays":state.weekDays.value,
});
}
}), }),
), ),
], ],
@ -127,7 +132,7 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
rightWidget: GestureDetector( rightWidget: GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
state.isSingledayWeekend.value = 0; state.isSingledayWeekend.value = 1;
state.weekDays.value = [1, 2 , 3, 4, 5, 6]; state.weekDays.value = [1, 2 , 3, 4, 5, 6];
}); });
}, },
@ -147,7 +152,7 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
rightWidget: GestureDetector( rightWidget: GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
state.isSingledayWeekend.value = 1; state.isSingledayWeekend.value = 2;
state.weekDays.value = [1, 2 , 3, 4, 5]; state.weekDays.value = [1, 2 , 3, 4, 5];
}); });
}, },
@ -206,22 +211,22 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
isHaveLine: true, isHaveLine: true,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: GestureDetector( rightWidget: GestureDetector(
onTap: () { onTap: () {
setState(() { setState(() {
state.isSingledayWeekend.value = 2; state.isSingledayWeekend.value = 2;
if(state.weekDays.value.contains(index)){ if(state.weekDays.value.contains(index)){
state.weekDays.value.remove(index); state.weekDays.value.remove(index);
}else{ }else{
state.weekDays.value.add(index); state.weekDays.value.add(index);
} }
state.weekDays.value.sort(); state.weekDays.value.sort();
}); });
}, },
child: Row( child: Obx(() => Row(
children: [ children: [
Image.asset(state.weekDays.value.contains(index) ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png', width: 30.w, height: 30.w,), Image.asset(state.weekDays.value.contains(index) ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png', width: 30.w, height: 30.w,),
], ],
)) )))
); );
} }
), ),

View File

@ -2,9 +2,37 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
class CheckingInSetWorkdaySetState{ import '../../../lockMian/entity/lockInfoEntity.dart';
var isCustom = true.obs; import '../checkingInSet/checkingInSet_entity.dart';
var isSingledayWeekend = 2.obs; // 0 1
var weekDays = [].obs;//
class CheckingInSetWorkdaySetState{
var isCustom = true.obs; //
var isSingledayWeekend = 2.obs; // 0 1
var weekDays = <int>[].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;
}
}
}
}
} }

View File

@ -0,0 +1,52 @@
class CheckingInAddStaffSeletKeyEntity {
int? errorCode;
String? description;
String? errorMsg;
List<CheckingInAddStaffKeyEntity>? data;
CheckingInAddStaffSeletKeyEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
CheckingInAddStaffSeletKeyEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
if (json['data'] != null) {
data = <CheckingInAddStaffKeyEntity>[];
json['data'].forEach((v) {
data!.add(CheckingInAddStaffKeyEntity.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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<String, dynamic> json) {
attendanceWay = json['attendanceWay'];
staffName = json['staffName'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['attendanceWay'] = attendanceWay;
data['staffName'] = staffName;
return data;
}
}

View File

@ -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<CheckingInAddStaffKeyEntity> 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
}
}

View File

@ -2,12 +2,13 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../../appRouters.dart';
import '../../../../tools/commonItem.dart'; import '../../../../../app_settings/app_colors.dart';
import '../../../../tools/showBottomSheetTool.dart'; import '../../../../../tools/commonItem.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../../tools/showBottomSheetTool.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../../tools/submitBtn.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../../tools/titleAppBar.dart';
import '../../../../../translations/trans_lib.dart';
import 'checkingInAddStaff_logic.dart'; import 'checkingInAddStaff_logic.dart';
class CheckingInAddStaffPage extends StatefulWidget { class CheckingInAddStaffPage extends StatefulWidget {
@ -38,15 +39,16 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
isHaveLine: true, isHaveLine: true,
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: rightWidget:
getTFWidget(TranslationLoader.lanKeys!.pleaseEnter!.tr)), getTFWidget(TranslationLoader.lanKeys!.pleaseEnter!.tr, state.staffNameController)),
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.punchingMode!.tr, leftTitel: TranslationLoader.lanKeys!.punchingMode!.tr,
rightTitle: "APP", rightTitle: state.seletPrintingMethodStr.value,
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
_showSeletClockInType(); var list = ["APP", "密码", "", "指纹"];
}), _showSeletClockInType(list, "1");
})),
SizedBox( SizedBox(
height: 10.h, height: 10.h,
), ),
@ -58,34 +60,72 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
isHaveRightWidget: true, isHaveRightWidget: true,
rightWidget: Row( rightWidget: Row(
children: [ children: [
whetherTheEmployeeHasAKeyWidget("", () {}), whetherTheEmployeeHasAKeyWidget("", state.appUnHaveAccount.value, () {
SizedBox( setState(() {
width: 30.w, state.appUnHaveAccount.value = true;
), });
whetherTheEmployeeHasAKeyWidget("", () {}), }),
SizedBox(width: 30.w,),
whetherTheEmployeeHasAKeyWidget("", !state.appUnHaveAccount.value, () {
setState(() {
state.appUnHaveAccount.value = false;
});
}),
], ],
)), )),
Visibility( Obx(() => Visibility(
visible: true, visible: state.appUnHaveAccount.value,
child: CommonItem( child: Column(
leftTitel: TranslationLoader.lanKeys!.accountNumber!.tr, children: [
rightTitle: "", CommonItem(
isHaveLine: true, leftTitel: TranslationLoader.lanKeys!.accountNumber!.tr,
isHaveRightWidget: true, rightTitle: "",
rightWidget: isHaveLine: true,
getTFWidget(TranslationLoader.lanKeys!.pleaseEnter!.tr)), isHaveRightWidget: true,
), rightWidget:
Visibility( getTFWidget(TranslationLoader.lanKeys!.pleaseEnter!.tr, state.staffAccountController)),
visible: true, 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<String, dynamic>;
state.countryCode.value = result['code'];
state.countryName.value = result['countryName'];
setState(() {});
},
),
],
),
)),
Obx(() => Visibility(
visible: !state.appUnHaveAccount.value,
child: CommonItem( child: CommonItem(
leftTitel: TranslationLoader.lanKeys!.selectKey!.tr, leftTitel: TranslationLoader.lanKeys!.selectKey!.tr,
rightTitle: "", rightTitle: state.seletKey.value,
isHaveLine: false, isHaveLine: false,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
_showSeletClockInType(); logic.addStaffSeletKey((v){
var list = [];
for (var element in v) {
list.add(element.attendanceWay);
}
_showSeletClockInType(list, "2");
});
}), }),
), )),
SizedBox( SizedBox(
height: 50.w, height: 50.w,
), ),
@ -94,13 +134,19 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
borderRadius: 20.w, borderRadius: 20.w,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {}), onClick: () {
if(state.isAdd.value == "2"){
logic.editStaffLoadData();
}else{
logic.addStaffLoadData();
}
}),
], ],
), ),
); );
} }
Widget getTFWidget(String tfStr) { Widget getTFWidget(String tfStr, TextEditingController tf) {
return SizedBox( return SizedBox(
height: 50.h, height: 50.h,
width: 300.w, width: 300.w,
@ -111,7 +157,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
child: TextField( child: TextField(
// //
maxLines: 1, maxLines: 1,
controller: state.staffNameController, controller: tf,
autofocus: false, autofocus: false,
textAlign: TextAlign.end, textAlign: TextAlign.end,
decoration: InputDecoration( decoration: InputDecoration(
@ -129,13 +175,8 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
); );
} }
void _showSeletClockInType() { // type 1 2
var list = [ void _showSeletClockInType(List list, String type) {
"APP",
"密码",
"",
"指纹",
];
ShowBottomSheetTool().showSingleRowPicker( ShowBottomSheetTool().showSingleRowPicker(
// //
context, context,
@ -149,16 +190,24 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
//adapter: PickerAdapter(), //adapter: PickerAdapter(),
data: list, data: list,
// //
clickCallBack: (int index, var str) {}); 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, Function action) { Widget whetherTheEmployeeHasAKeyWidget(String title, bool appUnHaveAccount, Function() action) {
return GestureDetector( return GestureDetector(
onTap: () {}, onTap: action,
child: Row( child: Row(
children: [ children: [
Image.asset( Image.asset(
'images/icon_round_unSelet.png', appUnHaveAccount ? 'images/icon_round_selet.png' : 'images/icon_round_unSelet.png',
width: 26.w, width: 26.w,
height: 26.w, height: 26.w,
), ),

View File

@ -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 = <CheckingInAddStaffKeyEntity>[].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;
}
}
}
}

View File

@ -0,0 +1,69 @@
class CheckingInAddStaffListEntity {
int? errorCode;
String? description;
String? errorMsg;
List<CheckingInAddStaffListItemEntity>? data;
CheckingInAddStaffListEntity(
{this.errorCode, this.description, this.errorMsg, this.data});
CheckingInAddStaffListEntity.fromJson(Map<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
if (json['data'] != null) {
data = <CheckingInAddStaffListItemEntity>[];
json['data'].forEach((v) {
data!.add(CheckingInAddStaffListItemEntity.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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<String, dynamic> json) {
headurl = json['headurl'];
staffName = json['staffName'];
staffId = json['staffId'];
attendanceType = json['attendanceType'];
countryCode = json['countryCode'];
attendanceWay = json['attendanceWay'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
data['headurl'] = headurl;
data['staffName'] = staffName;
data['staffId'] = staffId;
data['attendanceType'] = attendanceType;
data['countryCode'] = countryCode;
data['attendanceWay'] = attendanceWay;
return data;
}
}

View File

@ -1,8 +1,9 @@
import 'dart:async';
import 'package:date_format/date_format.dart';
import 'package:star_lock/tools/baseGetXController.dart'; import 'package:star_lock/tools/baseGetXController.dart';
import '../../../../network/api_repository.dart'; import '../../../../../network/api_repository.dart';
import '../../../../../tools/eventBusEventManage.dart';
import 'checkingInStaffList_state.dart'; import 'checkingInStaffList_state.dart';
class CheckingInStaffManageLogic extends BaseGetXController{ class CheckingInStaffManageLogic extends BaseGetXController{
@ -15,10 +16,17 @@ class CheckingInStaffManageLogic extends BaseGetXController{
lockId:state.getKeyInfosData.value.lockId.toString(), lockId:state.getKeyInfosData.value.lockId.toString(),
); );
if(entity.errorCode!.codeIsSuccessful){ if(entity.errorCode!.codeIsSuccessful){
state.staffListData.value = entity.data!;
} }
} }
late StreamSubscription _teamEvent;
void _initLoadDataAction() {
_teamEvent = eventBus.on<RefreshCheckInStaffListDataEvent>().listen((event) {
getStaffList();
});
}
@override @override
void onReady() { void onReady() {
// TODO: implement onReady // TODO: implement onReady
@ -26,6 +34,8 @@ class CheckingInStaffManageLogic extends BaseGetXController{
print("onReady()"); print("onReady()");
getStaffList(); getStaffList();
_initLoadDataAction();
} }
@override @override
@ -39,6 +49,6 @@ class CheckingInStaffManageLogic extends BaseGetXController{
@override @override
void onClose() { void onClose() {
// TODO: implement onClose // TODO: implement onClose
_teamEvent.cancel();
} }
} }

View File

@ -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<CheckingInStaffListPage> createState() =>
_CheckingInStaffListPageState();
}
class _CheckingInStaffListPageState extends State<CheckingInStaffListPage> {
final logic = Get.put(CheckingInStaffManageLogic());
final state = Get.find<CheckingInStaffManageLogic>().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)),
],
),
),
);
}
}

View File

@ -1,16 +1,20 @@
import 'package:get/get.dart'; import 'package:get/get.dart';
import '../../../lockMian/entity/lockInfoEntity.dart'; import '../../../../lockMian/entity/lockInfoEntity.dart';
import 'checkingInStaffList_entity.dart';
class CheckingInStaffManageState{ class CheckingInStaffManageState{
final getKeyInfosData = KeyInfos().obs; final getKeyInfosData = KeyInfos().obs;
final companyId = "".obs; final companyId = "".obs;
final staffListData = <CheckingInAddStaffListItemEntity>[].obs;
CheckingInStaffManageState() { CheckingInStaffManageState() {
Map map = Get.arguments; Map map = Get.arguments;
getKeyInfosData.value = map["getKeyInfosData"]; getKeyInfosData.value = map["getKeyInfosData"];
companyId.value = map["companyId"]; companyId.value = map["companyId"];
// print("companyId.value:${companyId.value}");
} }
} }

View File

@ -0,0 +1,9 @@
import 'package:star_lock/tools/baseGetXController.dart';
import 'checkingInStaffDetail_state.dart';
class CheckingInStaffDetailLogic extends BaseGetXController{
CheckingInStaffDetailState state = CheckingInStaffDetailState();
}

View File

@ -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<CheckingInStaffDetailPage> createState() => _CheckingInStaffDetailPageState();
}
class _CheckingInStaffDetailPageState extends State<CheckingInStaffDetailPage> {
final logic = Get.put(CheckingInStaffDetailLogic());
final state = Get.find<CheckingInStaffDetailLogic>().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),
],
),
);
}
}

View File

@ -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;
}
}
}

View File

@ -133,7 +133,7 @@ class AutomaticBlockingLogic extends BaseGetXController{
privateKey:getPrivateKeyList, privateKey:getPrivateKeyList,
); );
} }
}); }, isShowLoading: false);
} }
// //

View File

@ -66,7 +66,6 @@ class _CheckInCreatCompanyPageState extends State<CheckInCreatCompanyPage> {
setState(() { setState(() {
state.isCustom.value = data["attendanceType"]; state.isCustom.value = data["attendanceType"];
state.weekDays.value = data["weekDays"]; state.weekDays.value = data["weekDays"];
state.weekDaysStr.value = "";
state.weekDaysStr.value = state.weekDays.value.join(","); state.weekDaysStr.value = state.weekDays.value.join(",");
}); });
} }

View File

@ -53,7 +53,7 @@ class LockTimeLogic extends BaseGetXController{
(0xff & lockTime[2]) << 8 | (0xff & lockTime[2]) << 8 |
(0xFF & lockTime[3])); (0xFF & lockTime[3]));
String dataEime = DateTool().dateToString("${value}"); String dataEime = DateTool().dateToYMDHNSString("${value}");
state.dateTime.value = dataEime; state.dateTime.value = dataEime;
print("lockTime:$lockTime value:$value dataEime:$dataEime"); print("lockTime:$lockTime value:$value dataEime:$dataEime");
break; break;
@ -126,7 +126,7 @@ class LockTimeLogic extends BaseGetXController{
privateKey:getPrivateKeyList, privateKey:getPrivateKeyList,
); );
} }
}); }, isShowLoading: false);
} }
// //
@ -171,7 +171,7 @@ class LockTimeLogic extends BaseGetXController{
lockId: state.getKeyInfosData.value.lockId.toString(), lockId: state.getKeyInfosData.value.lockId.toString(),
); );
if(entity.errorCode!.codeIsSuccessful){ 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; state.dateTime.value = dataEime;
sendTiming(); sendTiming();
} }

View File

@ -407,7 +407,7 @@ class LockDetailLogic extends BaseGetXController{
privateKey:getPrivateKeyList, privateKey:getPrivateKeyList,
); );
} }
}); }, isShowLoading: false);
} }
@override @override
@ -417,9 +417,9 @@ class LockDetailLogic extends BaseGetXController{
print("onReady()"); print("onReady()");
_initReplySubscription(); _initReplySubscription();
BlueManage().startScan((v){ // BlueManage().startScan((v){
//
}); // });
} }
@override @override

View File

@ -261,10 +261,11 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware {
bottomItem('images/main/icon_main_electronicKey.png', bottomItem('images/main/icon_main_electronicKey.png',
TranslationLoader.lanKeys!.electronicKey!.tr, () { TranslationLoader.lanKeys!.electronicKey!.tr, () {
Get.toNamed(Routers.electronicKeyListPage, arguments: { Get.toNamed(Routers.electronicKeyListPage, arguments: {
"lockMainEntity": widget.lockMainEntity, "lockMainEntity": widget.lockMainEntity,
"keyInfo": widget.keyInfo "keyInfo": widget.keyInfo
}); });
}), }),
// //
bottomItem('images/main/icon_main_password.png', bottomItem('images/main/icon_main_password.png',
TranslationLoader.lanKeys!.password!.tr, () { TranslationLoader.lanKeys!.password!.tr, () {
@ -273,20 +274,29 @@ class _LockDetailPageState extends State<LockDetailPage> with RouteAware {
"keyInfo": widget.keyInfo "keyInfo": widget.keyInfo
}); });
}), }),
// ic卡 // ic卡
bottomItem('images/main/icon_main_icCard.png', bottomItem('images/main/icon_main_icCard.png', TranslationLoader.lanKeys!.card!.tr, () {
TranslationLoader.lanKeys!.card!.tr, () { Get.toNamed(Routers.otherTypeKeyListPage, arguments: {
Get.toNamed(Routers.otherTypeKeyListPage, arguments: 0); "lockId": widget.keyInfo.lockId,
}), "fromType": 0
});
}),
// //
bottomItem('images/main/icon_main_fingerprint.png', bottomItem('images/main/icon_main_fingerprint.png', TranslationLoader.lanKeys!.fingerprint!.tr, () {
TranslationLoader.lanKeys!.fingerprint!.tr, () { Get.toNamed(Routers.otherTypeKeyListPage, arguments: {
Get.toNamed(Routers.otherTypeKeyListPage, arguments: 1); "lockId": widget.keyInfo.lockId,
"fromType": 1
});
}), }),
// //
bottomItem('images/main/icon_main_remoteControl.png', bottomItem('images/main/icon_main_remoteControl.png', TranslationLoader.lanKeys!.remoteControl!.tr, () {
TranslationLoader.lanKeys!.remoteControl!.tr, () { Get.toNamed(Routers.otherTypeKeyListPage, arguments: {
Get.toNamed(Routers.otherTypeKeyListPage, arguments: 2); "lockId": widget.keyInfo.lockId,
"fromType": 2
});
}), }),
]; ];
showWidgetArr.addAll(defaultWidgetArr); showWidgetArr.addAll(defaultWidgetArr);

View File

@ -1,21 +1,33 @@
import 'dart:async'; import 'package:get/get.dart';
import 'package:flutter_reactive_ble/flutter_reactive_ble.dart'; import '../../../../network/api_repository.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 '../../../../tools/baseGetXController.dart'; import '../../../../tools/baseGetXController.dart';
import '../../../../tools/storage.dart'; import '../../../../tools/toast.dart';
import 'otherTypeAddKey_state.dart';
class OtherTypeAddKeyLogic extends BaseGetXController { 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 @override
void onReady() { void onReady() {

View File

@ -1,4 +1,7 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.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:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/appRouters.dart'; import 'package:star_lock/appRouters.dart';
@ -6,20 +9,24 @@ import 'package:star_lock/appRouters.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../app_settings/app_colors.dart';
import '../../../../tools/commonItem.dart'; import '../../../../tools/commonItem.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../tools/toast.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../translations/trans_lib.dart';
import 'otherTypeAddKey_logic.dart';
class OtherTypeAddKeyPage extends StatefulWidget { class OtherTypeAddKeyPage extends StatefulWidget {
final String seletType; final String seletType;
final int lockType; // 0 1 2 final int lockType; // 0 1 2
final int lockId; // 0 1 2
const OtherTypeAddKeyPage( 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 @override
State<OtherTypeAddKeyPage> createState() => _OtherTypeAddKeyPageState(); State<OtherTypeAddKeyPage> createState() => _OtherTypeAddKeyPageState();
} }
class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> { class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
final TextEditingController _controller = TextEditingController(); final logic = Get.put(OtherTypeAddKeyLogic());
final state = Get.find<OtherTypeAddKeyLogic>().state;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -35,10 +42,7 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
return Column( return Column(
children: [ children: [
perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr, perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr,
TranslationLoader.lanKeys!.pleaseEnter!.tr, _controller), TranslationLoader.lanKeys!.pleaseEnter!.tr, state.nameController),
SizedBox(
height: 30.h,
),
keyBottomWidget() keyBottomWidget()
], ],
); );
@ -49,11 +53,9 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
return Column( return Column(
children: [ children: [
perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr, perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr,
TranslationLoader.lanKeys!.pleaseEnter!.tr, _controller), TranslationLoader.lanKeys!.pleaseEnter!.tr, state.nameController),
keyTimeLimitWidget(), keyTimeLimitWidget(),
SizedBox( SizedBox(height: 10.h),
height: 30.h,
),
keyBottomWidget() keyBottomWidget()
], ],
); );
@ -64,17 +66,21 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
return Column( return Column(
children: [ children: [
perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr, perpetualKeyWidget(TranslationLoader.lanKeys!.name!.tr,
TranslationLoader.lanKeys!.pleaseEnter!.tr, _controller), TranslationLoader.lanKeys!.pleaseEnter!.tr, state.nameController),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
rightTitle: "", rightTitle: "",
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
// _showDatePicker(); // Map result = await Get.toNamed(Routers.electronicKeyPeriodValidityPage);
// // result as Map<String, dynamic>;
// weekdaysList = result['validityValue'];
// _effectiveDateTime = result['starDate'];
// _failureDateTime = result['endDate'];
// print(
// '得到的有效期数据:$weekdaysList $_effectiveDateTime $_failureDateTime');
}), }),
SizedBox( SizedBox(height: 10.h),
height: 30.h,
),
keyBottomWidget() keyBottomWidget()
], ],
); );
@ -104,20 +110,36 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
Widget keyTimeLimitWidget() { Widget keyTimeLimitWidget() {
return Column( return Column(
children: [ children: [
CommonItem( Obx(() => CommonItem(
leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr, leftTitel: TranslationLoader.lanKeys!.effectiveTime!.tr,
rightTitle: "2020.06.20 11:49", rightTitle: state.beginTime.value,
isHaveLine: true, isHaveLine: true,
isHaveDirection: true, isHaveDirection: true,
action: () { action: () async {
// _showDatePicker(); 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( CommonItem(
leftTitel: TranslationLoader.lanKeys!.failureTime!.tr, leftTitel: TranslationLoader.lanKeys!.failureTime!.tr,
rightTitle: "2020.06.20 11:49", rightTitle: "2020.06.20 11:49",
isHaveDirection: true, isHaveDirection: true,
action: () { 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), Container(height: 10.h),
], ],
@ -127,10 +149,24 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
Widget keyBottomWidget() { Widget keyBottomWidget() {
return Column( return Column(
children: [ 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: () { SubmitBtn(btnName: TranslationLoader.lanKeys!.next!.tr, onClick: () {
if(widget.lockType == 1){ if(state.nameController.text.isEmpty){
Get.toNamed(Routers.addFingerprintTipPage); Toast.show(msg: "请输入姓名");
return;
} }
// if(widget.lockType == 1){
Get.toNamed(Routers.addFingerprintTipPage);
// }
// logic.addFingerprintsData();
}), }),
], ],
); );
@ -236,7 +272,7 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
child: TextField( child: TextField(
// //
maxLines: 1, maxLines: 1,
// controller: _controller, controller: state.nameController,
autofocus: false, autofocus: false,
textAlign: TextAlign.end, textAlign: TextAlign.end,
decoration: InputDecoration( decoration: InputDecoration(
@ -256,4 +292,20 @@ class _OtherTypeAddKeyPageState extends State<OtherTypeAddKeyPage> {
), ),
); );
} }
//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;
});
},
);
}
} }

View File

@ -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"];
}
}

View File

@ -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();
}

View File

@ -9,6 +9,7 @@ import '../../../../tools/commonItem.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../translations/trans_lib.dart';
import 'otherTypeKeyDetail_logic.dart';
class OtherTypeKeyDetailPage extends StatefulWidget { class OtherTypeKeyDetailPage extends StatefulWidget {
const OtherTypeKeyDetailPage({Key? key}) : super(key: key); const OtherTypeKeyDetailPage({Key? key}) : super(key: key);
@ -18,6 +19,9 @@ class OtherTypeKeyDetailPage extends StatefulWidget {
} }
class _OtherTypeKeyDetailPageState extends State<OtherTypeKeyDetailPage> { class _OtherTypeKeyDetailPageState extends State<OtherTypeKeyDetailPage> {
final logic = Get.put(OtherTypeKeyDetailLogic());
final state = Get.find<OtherTypeKeyDetailLogic>().state;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var type = ModalRoute.of(context)?.settings.arguments as int; var type = ModalRoute.of(context)?.settings.arguments as int;
@ -25,25 +29,22 @@ class _OtherTypeKeyDetailPageState extends State<OtherTypeKeyDetailPage> {
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: barTitle: "${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}",
"${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}",
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
actionsList: [ actionsList: [
TextButton( TextButton(
child: Text( child: Text(TranslationLoader.lanKeys!.share!.tr, style: TextStyle(color: Colors.white, fontSize: 24.sp),),
TranslationLoader.lanKeys!.share!.tr, onPressed: () {
style: TextStyle(color: Colors.white, fontSize: 24.sp),
), },
onPressed: () {},
), ),
], ],
), ),
body: Column( body: Column(
children: [ children: [
CommonItem( CommonItem(
leftTitel: leftTitel: "${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}",
"${getAppBarTitle(type)}${TranslationLoader.lanKeys!.number!.tr}",
rightTitle: "98765432", rightTitle: "98765432",
isHaveDirection: true, isHaveDirection: true,
isHaveLine: true, isHaveLine: true,
@ -63,41 +64,41 @@ class _OtherTypeKeyDetailPageState extends State<OtherTypeKeyDetailPage> {
rightTitle: "永久", rightTitle: "永久",
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed( Navigator.pushNamed(context, Routers.electronicKeyDetailChangeDate);
context, Routers.electronicKeyDetailChangeDate);
}), }),
Container(height: 10.h), Container(height: 10.h),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.additive!.tr, leftTitel: TranslationLoader.lanKeys!.additive!.tr,
rightTitle: "15080825640", rightTitle: "15080825640",
action: () {}), action: () {
}),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.addTime!.tr, leftTitel: TranslationLoader.lanKeys!.addTime!.tr,
rightTitle: "2020.06.21 11:49", rightTitle: "2020.06.21 11:49",
action: () {}), action: () {
}),
Container(height: 10.h), Container(height: 10.h),
CommonItem( CommonItem(
leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr, leftTitel: TranslationLoader.lanKeys!.operatingRecord!.tr,
rightTitle: "", rightTitle: "",
isHaveDirection: true, isHaveDirection: true,
action: () { action: () {
Navigator.pushNamed(context, Routers.keyOperationRecordPage); Get.toNamed(Routers.keyOperationRecordPage);
}), }),
SizedBox( SizedBox(height: 40.h),
height: 40.h,
),
addControlsBtn(type), addControlsBtn(type),
SizedBox( SizedBox(height: 30.h),
height: 30.h,
),
SubmitBtn( SubmitBtn(
btnName: TranslationLoader.lanKeys!.delete!.tr, btnName: TranslationLoader.lanKeys!.delete!.tr,
isDelete: true, isDelete: true,
borderRadius: 20.w, borderRadius: 20.w,
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
left: 30.w, right: 30.w, top: 30.w, bottom: 30.w),
padding: EdgeInsets.only(top: 25.w, bottom: 25.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: () {}), onClick: () {
}),
], ],
), ),
); );

View File

@ -0,0 +1,4 @@
class OtherTypeKeyDetailState{
}

View File

@ -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<String, dynamic> json) {
errorCode = json['errorCode'];
description = json['description'];
errorMsg = json['errorMsg'];
data = json['data'] != null ? Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = Map<String, dynamic>();
data['errorCode'] = errorCode;
data['description'] = description;
data['errorMsg'] = errorMsg;
if (this.data != null) {
data['data'] = this.data!.toJson();
}
return data;
}
}
class Data {
List<FingerprintItemData>? list;
int? pageNo;
int? pageSize;
int? pages;
int? total;
Data({this.list, this.pageNo, this.pageSize, this.pages, this.total});
Data.fromJson(Map<String, dynamic> json) {
if (json['list'] != null) {
list = <FingerprintItemData>[];
json['list'].forEach((v) {
list!.add(FingerprintItemData.fromJson(v));
});
}
pageNo = json['pageNo'];
pageSize = json['pageSize'];
pages = json['pages'];
total = json['total'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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<String, dynamic> 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<String, dynamic> toJson() {
final Map<String, dynamic> data = <String, dynamic>{};
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;
}
}

View File

@ -12,6 +12,7 @@ import '../../../../blue/io_tool/io_manager.dart';
import '../../../../blue/io_tool/io_tool.dart'; import '../../../../blue/io_tool/io_tool.dart';
import '../../../../blue/io_tool/manager_event_bus.dart'; import '../../../../blue/io_tool/manager_event_bus.dart';
import '../../../../blue/sender_manage.dart'; import '../../../../blue/sender_manage.dart';
import '../../../../network/api_repository.dart';
import '../../../../tools/baseGetXController.dart'; import '../../../../tools/baseGetXController.dart';
import '../../../../tools/storage.dart'; import '../../../../tools/storage.dart';
import 'otherTypeKeyList_state.dart'; import 'otherTypeKeyList_state.dart';
@ -257,7 +258,20 @@ class OtherTypeKeyListLogic extends BaseGetXController{
privateKey:getPrivateKeyList, 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 @override
@ -267,6 +281,8 @@ class OtherTypeKeyListLogic extends BaseGetXController{
print("onReady()"); print("onReady()");
_initReplySubscription(); _initReplySubscription();
getFingerprintsListData();
} }
@override @override

View File

@ -4,9 +4,12 @@ import 'package:get/get.dart';
import '../../../../appRouters.dart'; import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../app_settings/app_colors.dart';
import '../../../../tools/dateTool.dart';
import '../../../../tools/noData.dart';
import '../../../../tools/submitBtn.dart'; import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart'; import '../../../../translations/trans_lib.dart';
import 'fingerprintListData_entity.dart';
import 'otherTypeKeyList_logic.dart'; import 'otherTypeKeyList_logic.dart';
class OtherTypeKeyListPage extends StatefulWidget { class OtherTypeKeyListPage extends StatefulWidget {
@ -22,11 +25,10 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var type = ModalRoute.of(context)?.settings.arguments as int;
return Scaffold( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
barTitle: getAppBarTitle(type), barTitle: getAppBarTitle(state.fromType.value),
haveBack: true, haveBack: true,
backgroundColor: AppColors.mainColor, backgroundColor: AppColors.mainColor,
actionsList: [ actionsList: [
@ -45,13 +47,18 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
SizedBox( SizedBox(
height: 20.h, height: 20.h,
), ),
Expanded(child: _buildMainUI(type)), Expanded(child: _buildMainUI(state.fromType.value)),
AddBottomWhiteBtn( AddBottomWhiteBtn(
btnName: btnName:
'${TranslationLoader.lanKeys!.add!.tr}${getAppBarTitle(type)}', '${TranslationLoader.lanKeys!.add!.tr}${getAppBarTitle(state.fromType.value)}',
onClick: () { onClick: () async {
Navigator.pushNamed(context, Routers.otherTypeKeyManagePage, var data = await Get.toNamed(Routers.otherTypeKeyManagePage, arguments: {
arguments: type); "lockId": state.lockId.value,
"fromType": state.fromType.value
});
if(data != null) {
logic.getFingerprintsListData();
}
}, },
), ),
SizedBox( SizedBox(
@ -128,12 +135,12 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
typeImgName = 'images/icon_card.png'; typeImgName = 'images/icon_card.png';
} }
return ListView.separated( return Obx(() => state.fingerprintItemListData.value.isNotEmpty ? ListView.separated(
itemCount: 5, itemCount: state.fingerprintItemListData.value.length,
itemBuilder: (c, index) { itemBuilder: (c, index) {
return _electronicKeyItem( FingerprintItemData fingerprintItemData = state.fingerprintItemListData.value[index];
typeImgName, "张三", "2023.6.21 11.15", "2023.6.21 11.15", () { return _keyItem(typeImgName, fingerprintItemData.fingerprintName!, fingerprintItemData.fingerprintType! == 1 ? "永久" : "${DateTool().dateToYMDHNString(fingerprintItemData.startDate.toString())} - ${DateTool().dateToYMDHNString(fingerprintItemData.endDate.toString())}", () {
Navigator.pushNamed(context, Routers.otherTypeKeyDetailPage, Get.toNamed(Routers.otherTypeKeyDetailPage,
arguments: type); arguments: type);
}); });
}, },
@ -143,11 +150,10 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
color: AppColors.greyLineColor, color: AppColors.greyLineColor,
); );
}, },
); ) :const NoData());
} }
Widget _electronicKeyItem(String lockTypeIcon, String lockTypeTitle, Widget _keyItem(String lockTypeIcon, String lockTypeTitle, String showTime, Function() action) {
String beginTime, String endTime, Function() action) {
return GestureDetector( return GestureDetector(
onTap: action, onTap: action,
child: Container( child: Container(
@ -159,17 +165,9 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
), ),
child: Row( child: Row(
children: [ children: [
SizedBox( SizedBox(width: 30.w),
width: 30.w, Image.asset(lockTypeIcon, width: 60.w, height: 60.w),
), SizedBox(width: 20.w),
Image.asset(
lockTypeIcon,
width: 60.w,
height: 60.w,
),
SizedBox(
width: 20.w,
),
Expanded( Expanded(
child: Column( child: Column(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -177,11 +175,7 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
Row( Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text( Text(lockTypeTitle, style: TextStyle(fontSize: 24.sp, color: AppColors.blackColor)),
lockTypeTitle,
style: TextStyle(
fontSize: 24.sp, color: AppColors.blackColor),
),
], ],
), ),
SizedBox(height: 5.h), SizedBox(height: 5.h),
@ -189,12 +183,7 @@ class _OtherTypeKeyListPageState extends State<OtherTypeKeyListPage> {
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
Text( Text(showTime, style: TextStyle(fontSize: 18.sp, color: AppColors.placeholderTextColor)),
"2023.6.21 18:26 永久",
style: TextStyle(
fontSize: 18.sp,
color: AppColors.placeholderTextColor),
),
], ],
), ),
), ),

View File

@ -1,4 +1,17 @@
import 'package:get/get.dart';
import 'fingerprintListData_entity.dart';
class OtherTypeKeyListState{ class OtherTypeKeyListState{
final lockId = 0.obs;
final fromType = 0.obs;
final fingerprintItemListData = <FingerprintItemData>[].obs;
OtherTypeKeyListState() {
Map map = Get.arguments;
lockId.value = map["lockId"];
fromType.value = map["fromType"];
}
} }

View File

@ -1,5 +1,6 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:get/get.dart'; import 'package:get/get.dart';
import 'package:star_lock/blue/io_tool/io_manager.dart';
import '../../../../app_settings/app_colors.dart'; import '../../../../app_settings/app_colors.dart';
import '../../../../tools/titleAppBar.dart'; import '../../../../tools/titleAppBar.dart';
@ -19,7 +20,10 @@ class _OtherTypeKeyManagePageState extends State<OtherTypeKeyManagePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
// 0 1 2 // 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( return Scaffold(
backgroundColor: AppColors.mainBackgroundColor, backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar( appBar: TitleAppBar(
@ -29,7 +33,7 @@ class _OtherTypeKeyManagePageState extends State<OtherTypeKeyManagePage> {
backgroundColor: AppColors.mainColor), backgroundColor: AppColors.mainColor),
body: Column( body: Column(
children: [ children: [
OtherTypeKeyManageTabbar(initialIndex: index, lockType: lockType), OtherTypeKeyManageTabbar(initialIndex: index, lockType: lockType, lockId: lockId),
], ],
), ),
); );

View File

@ -10,8 +10,9 @@ import '../otherTypeAddKey/otherTypeAddKey_page.dart';
class OtherTypeKeyManageTabbar extends StatefulWidget { class OtherTypeKeyManageTabbar extends StatefulWidget {
var initialIndex = 1; var initialIndex = 1;
var lockType = 0; var lockType = 0;
var lockId = 0; // 0 1 2
OtherTypeKeyManageTabbar( OtherTypeKeyManageTabbar(
{Key? key, required this.initialIndex, required this.lockType}) {Key? key, required this.initialIndex, required this.lockType, required this.lockId})
: super(key: key); : super(key: key);
@override @override
@ -89,6 +90,7 @@ class _OtherTypeKeyManageTabbarState extends State<OtherTypeKeyManageTabbar>
.map((ItemView item) => OtherTypeAddKeyPage( .map((ItemView item) => OtherTypeAddKeyPage(
seletType: item.seletType, seletType: item.seletType,
lockType: widget.lockType, lockType: widget.lockType,
lockId: widget.lockId,
)) ))
.toList(), .toList(),
), ),

View File

@ -286,7 +286,7 @@ class SaveLockLogic extends BaseGetXController {
privateKey:getPrivateKeyList, privateKey:getPrivateKeyList,
); );
} }
}); }, isShowLoading: false);
} }
@override @override

View File

@ -61,8 +61,24 @@ abstract class Api {
final String setLockPickingReminderDataURL = final String setLockPickingReminderDataURL =
'/key/updateMonitorFlag'; // '/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 getStaffListURL = '/staff/list'; //
final String addStaffURL = '/staff/add'; // 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 getKeyDetailURL = '/key/get'; //
final String lockUserListURL = '/keyUser/listKeyUser'; // final String lockUserListURL = '/keyUser/listKeyUser'; //

View File

@ -115,8 +115,7 @@ class ApiProvider extends BaseProvider {
'pageSize': pageSize, 'pageSize': pageSize,
'startDate': startDate, 'startDate': startDate,
'keyRight': keyRight 'keyRight': keyRight
}), }));
isShowLoading: true);
Future<Response> sendElectronicKey( Future<Response> sendElectronicKey(
String createUser, String createUser,
@ -253,8 +252,7 @@ class ApiProvider extends BaseProvider {
'keyboardPwdId': keyboardPwdId, 'keyboardPwdId': keyboardPwdId,
'cardId': cardId, 'cardId': cardId,
'fingerprintId': fingerprintId 'fingerprintId': fingerprintId
}), }));
isShowLoading: true);
// //
Future<Response> bindingBlueAdmin( Future<Response> bindingBlueAdmin(
@ -346,8 +344,7 @@ class ApiProvider extends BaseProvider {
'operatorUid': operatorUid, 'operatorUid': operatorUid,
'startDate': startDate, 'startDate': startDate,
'timezoneRawOffSet': timezoneRawOffSet 'timezoneRawOffSet': timezoneRawOffSet
}), }));
isShowLoading: true);
Future<Response> addKeyboardPwd( Future<Response> addKeyboardPwd(
String lockId, String lockId,
@ -403,8 +400,7 @@ class ApiProvider extends BaseProvider {
jsonEncode({'lockId': lockId, 'groupId': groupId})); jsonEncode({'lockId': lockId, 'groupId': groupId}));
Future<Response> lockGroupList(String type) => Future<Response> lockGroupList(String type) =>
post(lockGroupListURL.toUrl, jsonEncode({'type': type}), post(lockGroupListURL.toUrl, jsonEncode({'type': type}));
isShowLoading: true);
Future<Response> deleteElectronicKey(String keyId) => Future<Response> deleteElectronicKey(String keyId) =>
post(deleteElectronicKeyURL.toUrl, jsonEncode({'keyId': keyId})); post(deleteElectronicKeyURL.toUrl, jsonEncode({'keyId': keyId}));
@ -570,7 +566,8 @@ class ApiProvider extends BaseProvider {
jsonEncode({ jsonEncode({
'lockId': lockId, 'lockId': lockId,
}), }),
isShowLoading: false); isUnShowLoading: true
);
// //
Future<Response> setCheckInCreateCompanyData( Future<Response> setCheckInCreateCompanyData(
@ -631,31 +628,218 @@ class ApiProvider extends BaseProvider {
'usernameType': usernameType, 'usernameType': usernameType,
})); }));
// addHolidaysData
Future<Response> 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<Response> addStaffSeletKeyData(
String companyId,
String type) =>
post(
addStaffSeletKeyURL.toUrl,
jsonEncode({
'companyId': companyId,
'type': type,
}));
//
Future<Response> 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<Response> holidaysListData(
String companyId,
String vacationYear) =>
post(
holidaysListURL.toUrl,
jsonEncode({
'companyId': companyId,
'vacationYear': vacationYear,
}));
//
Future<Response> deletHolidaysData(
String vacationId) =>
post(
holidaysDeleteURL.toUrl,
jsonEncode({
'vacationId': vacationId,
}));
//
Future<Response> getCheckInSetInfoData(
String companyId) =>
post(
getCheckInSetInfoURL.toUrl,
jsonEncode({
'companyId': companyId,
}));
//
Future<Response> editCheckInSetInfoData(
String attendanceType,
String companyId,
String type,
String companyName,
String workEndTime,
String workStartTime,
List<int> workDay) =>
post(
editCheckInSetInfoURL.toUrl,
jsonEncode({
'attendanceType': attendanceType,
'companyId': companyId,
'type': type,
'companyName': companyName,
'workEndTime': workEndTime,
'workStartTime': workStartTime,
'workDay': workDay,
}));
// --
Future<Response> getCheckInListEarlyArrivalWithDateData(String companyId, String attendanceDate) =>
post(
getAttendanceRecordListByDateURL.toUrl,
jsonEncode({
'companyId': companyId,
'attendanceDate': attendanceDate,
}));
// --
Future<Response> getCheckInListEarlyArrivalWithMonthData(String companyId, String attendanceDate) =>
post(
getAttendanceRecordListByMonthURL.toUrl,
jsonEncode({
'companyId': companyId,
'attendanceDate': attendanceDate,
}));
// --
Future<Response> getCheckInListLateTimesWithDateData(String companyId, String attendanceDate) =>
post(
getAttendanceRecordListLateTimesByDateURL.toUrl,
jsonEncode({
'companyId': companyId,
'attendanceDate': attendanceDate,
}));
// --
Future<Response> getCheckInListLateTimesWithMonthData(String companyId, String attendanceDate) =>
post(
getAttendanceRecordListLateTimesByMonthURL.toUrl,
jsonEncode({
'companyId': companyId,
'attendanceDate': attendanceDate,
}));
// --
Future<Response> getCheckInListHardworkingData(String companyId, String attendanceDate, String type) =>
post(
getAttendanceRecordHardworkingListURL.toUrl,
jsonEncode({
'companyId': companyId,
'attendanceDate': attendanceDate,
'type': type,
}));
//
Future<Response> getCheckInDetailData(String companyId, String attendanceDate, String staffId) =>
post(
getAttendanceRecordDtailURL.toUrl,
jsonEncode({
'companyId': companyId,
'attendanceDate': attendanceDate,
'staffId': staffId,
}));
//
Future<Response> getFingerprintsListData(String lockId, String pageNo, String pageSize, String searchStr) =>
post(
getFingerprintListURL.toUrl,
jsonEncode({
'lockId': lockId,
'pageNo': pageNo,
'pageSize': pageSize,
'searchStr': searchStr,
}));
//
Future<Response> 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<Response> listLockByGroup(String type, String keyGroupId) => post( Future<Response> listLockByGroup(String type, String keyGroupId) => post(
listLockByGroupURL.toUrl, listLockByGroupURL.toUrl,
jsonEncode({'type': type, 'keyGroupId': keyGroupId})); jsonEncode({'type': type, 'keyGroupId': keyGroupId}));
Future<Response> getKeyDetail(String lockId) => Future<Response> getKeyDetail(String lockId) =>
post(getKeyDetailURL.toUrl, jsonEncode({'lockId': lockId}), post(getKeyDetailURL.toUrl, jsonEncode({'lockId': lockId}));
isShowLoading: true);
Future<Response> lockUserList( Future<Response> lockUserList(
String pageNo, String pageSize, String searchStr) => String pageNo, String pageSize, String searchStr) =>
post( post(
lockUserListURL.toUrl, lockUserListURL.toUrl,
jsonEncode( jsonEncode(
{'pageNo': pageNo, 'pageSize': pageSize, 'searchStr': searchStr}), {'pageNo': pageNo, 'pageSize': pageSize, 'searchStr': searchStr}));
isShowLoading: true);
Future<Response> keyListByUser(String pageNo, String pageSize, String uid) => Future<Response> keyListByUser(String pageNo, String pageSize, String uid) =>
post(keyListByUserURL.toUrl, post(keyListByUserURL.toUrl,
jsonEncode({'pageNo': pageNo, 'pageSize': pageSize, 'uid': uid}), jsonEncode({'pageNo': pageNo, 'pageSize': pageSize, 'uid': uid}));
isShowLoading: true);
Future<Response> authorizedAdminList(String pageNo, String pageSize) => post( Future<Response> authorizedAdminList(String pageNo, String pageSize) => post(
authorizedAdminListURL.toUrl, authorizedAdminListURL.toUrl,
jsonEncode({'pageNo': pageNo, 'pageSize': pageSize}), jsonEncode({'pageNo': pageNo, 'pageSize': pageSize}));
isShowLoading: true);
Future<Response> canSendKey( Future<Response> canSendKey(
String endDate, List keyGroupIdList, List lockIdList) => String endDate, List keyGroupIdList, List lockIdList) =>

View File

@ -28,9 +28,9 @@ class BaseProvider extends GetConnect with Api {
Map<String, dynamic>? query, Map<String, dynamic>? query,
Decoder<T>? decoder, Decoder<T>? decoder,
Progress? uploadProgress, Progress? uploadProgress,
bool? isShowLoading}) async { bool? isUnShowLoading = false}) async {
// print("post: url:${url} body:${body} contentType:${contentType} headers:${headers} query:${query}"); // 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}'); print('哈喽请求body体为${body}');
var res = await super.post(url, body, var res = await super.post(url, body,

View File

@ -14,10 +14,18 @@ import '../common/safetyVerification/entity/CheckSafetyVerificationEntity.dart';
import '../common/safetyVerification/entity/SafetyVerificationEntity.dart'; import '../common/safetyVerification/entity/SafetyVerificationEntity.dart';
import '../login/login/entity/LoginEntity.dart'; import '../login/login/entity/LoginEntity.dart';
import '../login/register/entity/SendValidationCodeEntity.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/configuringWifi/configuringWifiEntity.dart';
import '../main/lockDetail/lcokSet/lockSet/CheckingInInfoDataEntity.dart'; import '../main/lockDetail/lcokSet/lockSet/CheckingInInfoDataEntity.dart';
import '../main/lockDetail/lcokSet/lockTime/GetServerDatetimeEntity.dart'; import '../main/lockDetail/lcokSet/lockTime/GetServerDatetimeEntity.dart';
import '../main/lockDetail/lcokSet/normallyOpenMode/GetPassageModeConfigEntity.dart'; import '../main/lockDetail/lcokSet/normallyOpenMode/GetPassageModeConfigEntity.dart';
import '../main/lockDetail/otherTypeKey/otherTypeKeyList/fingerprintListData_entity.dart';
import '../main/lockMian/entity/lockInfoEntity.dart'; import '../main/lockMian/entity/lockInfoEntity.dart';
import '../mine/addLock/saveLock/entity/SaveLockEntity.dart'; import '../mine/addLock/saveLock/entity/SaveLockEntity.dart';
import 'api_provider.dart'; import 'api_provider.dart';
@ -671,13 +679,83 @@ class ApiRepository {
return LoginEntity.fromJson(res.body); return LoginEntity.fromJson(res.body);
} }
// // -
Future<LoginEntity> getStaffListData({ Future<CheckingInListDayEntity> getCheckInListEarlyArrivalWithDateData(
required String companyId, {
required String lockId, required String companyId,
}) async { required String attendanceDate,
final res = await apiProvider.getStaffListData(companyId, lockId); }) async {
return LoginEntity.fromJson(res.body); final res =
await apiProvider.getCheckInListEarlyArrivalWithDateData(companyId, attendanceDate);
return CheckingInListDayEntity.fromJson(res.body);
}
// -
Future<CheckingInListMonthEntity> getCheckInListEarlyArrivalWithMonthData(
{
required String companyId,
required String attendanceDate,
}) async {
final res =
await apiProvider.getCheckInListEarlyArrivalWithMonthData(companyId, attendanceDate);
return CheckingInListMonthEntity.fromJson(res.body);
}
// -
Future<CheckingInListDayEntity> getCheckInListLateTimesWithDateData(
{
required String companyId,
required String attendanceDate,
}) async {
final res =
await apiProvider.getCheckInListLateTimesWithDateData(companyId, attendanceDate);
return CheckingInListDayEntity.fromJson(res.body);
}
// -
Future<CheckingInListMonthEntity> getCheckInListLateTimesWithMonthData(
{
required String companyId,
required String attendanceDate,
}) async {
final res =
await apiProvider.getCheckInListLateTimesWithMonthData(companyId, attendanceDate);
return CheckingInListMonthEntity.fromJson(res.body);
}
// -
Future<CheckingInListMonthEntity> 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<CheckingInDetailEntity> 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<CheckingInAddStaffListEntity> getStaffListData(
{
required String companyId,
required String lockId,
}) async {
final res =
await apiProvider.getStaffListData(companyId, lockId);
return CheckingInAddStaffListEntity.fromJson(res.body);
} }
// //
@ -694,4 +772,123 @@ class ApiRepository {
companyId, have, staffName, countryCode, usernameType); companyId, have, staffName, countryCode, usernameType);
return LoginEntity.fromJson(res.body); return LoginEntity.fromJson(res.body);
} }
//
Future<LoginEntity> 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<CheckingInAddStaffSeletKeyEntity> addStaffSeletKeyData(
{
required String companyId,
required String type,
}) async {
final res =
await apiProvider.addStaffSeletKeyData(companyId, type);
return CheckingInAddStaffSeletKeyEntity.fromJson(res.body);
}
//
Future<LoginEntity> 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<CheckingInSetHolidaysInfoDataEntity> holidaysListData(
{
required String companyId,
required String vacationYear,
}) async {
final res =
await apiProvider.holidaysListData(companyId, vacationYear);
return CheckingInSetHolidaysInfoDataEntity.fromJson(res.body);
}
//
Future<LoginEntity> deletHolidaysData(
{
required String vacationId
}) async {
final res =
await apiProvider.deletHolidaysData(vacationId);
return LoginEntity.fromJson(res.body);
}
//
Future<CheckingInSetEntity> getCheckInSetInfoData(
{
required String companyId,
}) async {
final res =
await apiProvider.getCheckInSetInfoData(companyId);
return CheckingInSetEntity.fromJson(res.body);
}
//
Future<CheckingInSetEntity> editCheckInSetInfoData(
{
required String attendanceType,
required String companyId,
required String type,
required String companyName,
required String workEndTime,
required String workStartTime,
required List<int> workDay,
}) async {
final res =
await apiProvider.editCheckInSetInfoData(attendanceType, companyId, type, companyName, workEndTime, workStartTime, workDay);
return CheckingInSetEntity.fromJson(res.body);
}
//
Future<FingerprintListDataEntity> 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<CheckingInListMonthEntity> 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);
}
} }

View File

@ -4,6 +4,7 @@ import 'package:get/get.dart';
import 'package:get/get_connect/http/src/request/request.dart'; import 'package:get/get_connect/http/src/request/request.dart';
import 'package:star_lock/login/login/entity/LoginData.dart'; import 'package:star_lock/login/login/entity/LoginData.dart';
import '../login/login/entity/LoginData.dart';
import '../login/login/entity/LoginEntity.dart'; import '../login/login/entity/LoginEntity.dart';
import '../tools/platform_info_services.dart'; import '../tools/platform_info_services.dart';
import '../tools/storage.dart'; import '../tools/storage.dart';
@ -19,10 +20,7 @@ FutureOr<Request> requestInterceptor(Request request) async {
String? xToken = ''; String? xToken = '';
final data = await Storage.getString('userLoginData'); final data = await Storage.getString('userLoginData');
if (data != null && data.isNotEmpty) { if (data != null && data.isNotEmpty) {
LoginData loginData = LoginData.fromJson(jsonDecode(data)); xToken = LoginData.fromJson(jsonDecode(data)).accessToken;
xToken = loginData.accessToken;
// xToken = LoginEntity.fromJson(jsonDecode(data)).data!.accessToken;
} }
request.headers['Authorization'] = "Bearer ${xToken ?? ''}"; request.headers['Authorization'] = "Bearer ${xToken ?? ''}";
return request; return request;

View File

@ -59,7 +59,7 @@ class CommonItem extends StatelessWidget {
isHaveRightWidget! isHaveRightWidget!
? rightWidget! ? rightWidget!
: Text( : Text(
rightTitle!, rightTitle ?? "",
textAlign: TextAlign.end, textAlign: TextAlign.end,
overflow: TextOverflow.ellipsis, overflow: TextOverflow.ellipsis,
maxLines: 1, maxLines: 1,

View File

@ -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)
);
}
}

View File

@ -24,7 +24,7 @@ class DateTool {
return "$year.$month.$day $hour:$minute"; return "$year.$month.$day $hour:$minute";
} }
String dateToString(String timeDate){ String dateToYMDHNSString(String timeDate){
int time = int.parse(timeDate); int time = int.parse(timeDate);
DateTime nowDate = DateTime.fromMillisecondsSinceEpoch(time); DateTime nowDate = DateTime.fromMillisecondsSinceEpoch(time);
@ -32,4 +32,27 @@ class DateTool {
return appointmentDate; 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;
}
} }

View File

@ -9,6 +9,11 @@ class RefreshLockListInfoDataEvent{
RefreshLockListInfoDataEvent(); RefreshLockListInfoDataEvent();
} }
///
class RefreshCheckInStaffListDataEvent{
RefreshCheckInStaffListDataEvent();
}
/// ///
class PassCurrentLockInformationEvent{ class PassCurrentLockInformationEvent{
KeyInfos keyInfo; KeyInfos keyInfo;

View File

@ -10,7 +10,7 @@ class NoData extends StatelessWidget {
width: 1.sw, width: 1.sw,
height: 1.sh - ScreenUtil().statusBarHeight, height: 1.sh - ScreenUtil().statusBarHeight,
child: Center( 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),
), ),
); );
} }

View File

@ -185,7 +185,7 @@ class LanKeyEntity {
this.workingHoursWereNotReleased, this.workingHoursWereNotReleased,
this.beLate, this.beLate,
this.leaveEarly, this.leaveEarly,
this.noCardPunched, this.noCardPunched, this.holidayInfo,
this.lanEnglish, this.lanEnglish,
this.lanChinese, this.lanChinese,
this.multilingual, this.multilingual,
@ -387,6 +387,8 @@ class LanKeyEntity {
this.wifiPwd, this.wifiPwd,
this.pleaseEnterWifiPwd, this.pleaseEnterWifiPwd,
this.wifiDistributionNetwork, this.wifiDistributionNetwork,
this.attendanceRecord,
this.edit
}); });
LanKeyEntity.fromJson(dynamic json) { LanKeyEntity.fromJson(dynamic json) {
@ -581,6 +583,7 @@ class LanKeyEntity {
beLate = json['beLate']; beLate = json['beLate'];
leaveEarly = json['leaveEarly']; leaveEarly = json['leaveEarly'];
noCardPunched = json['noCardPunched']; noCardPunched = json['noCardPunched'];
holidayInfo = json['holidayInfo'];
lanEnglish = json['lanEnglish']; lanEnglish = json['lanEnglish'];
lanChinese = json['lanChinese']; lanChinese = json['lanChinese'];
@ -806,6 +809,8 @@ class LanKeyEntity {
wifiPwd = json['wifiPwd']; wifiPwd = json['wifiPwd'];
pleaseEnterWifiPwd = json['pleaseEnterWifiPwd']; pleaseEnterWifiPwd = json['pleaseEnterWifiPwd'];
wifiDistributionNetwork = json['wifiDistributionNetwork']; wifiDistributionNetwork = json['wifiDistributionNetwork'];
attendanceRecord = json['attendanceRecord'];
edit = json['edit'];
} }
String? starLock; String? starLock;
String? clickUnlockAndHoldDownClose; String? clickUnlockAndHoldDownClose;
@ -957,6 +962,7 @@ class LanKeyEntity {
String? beLate; String? beLate;
String? leaveEarly; String? leaveEarly;
String? noCardPunched; String? noCardPunched;
String? holidayInfo;
String? basicInformation; String? basicInformation;
String? wirelessKeyboard; String? wirelessKeyboard;
@ -1211,7 +1217,8 @@ class LanKeyEntity {
String? wifiPwd; String? wifiPwd;
String? pleaseEnterWifiPwd; String? pleaseEnterWifiPwd;
String? wifiDistributionNetwork; String? wifiDistributionNetwork;
String? attendanceRecord;
String? edit;
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final map = <String, dynamic>{}; final map = <String, dynamic>{};
map['starLock'] = starLock; map['starLock'] = starLock;
@ -1404,6 +1411,7 @@ class LanKeyEntity {
map['beLate'] = beLate; map['beLate'] = beLate;
map['leaveEarly'] = leaveEarly; map['leaveEarly'] = leaveEarly;
map['noCardPunched'] = noCardPunched; map['noCardPunched'] = noCardPunched;
map['holidayInfo'] = holidayInfo;
map['lanEnglish'] = lanEnglish; map['lanEnglish'] = lanEnglish;
map['lanChinese'] = lanChinese; map['lanChinese'] = lanChinese;
@ -1627,6 +1635,8 @@ class LanKeyEntity {
map['wifiPwd'] = wifiPwd; map['wifiPwd'] = wifiPwd;
map['pleaseEnterWifiPwd'] = pleaseEnterWifiPwd; map['pleaseEnterWifiPwd'] = pleaseEnterWifiPwd;
map['wifiDistributionNetwork'] = wifiDistributionNetwork; map['wifiDistributionNetwork'] = wifiDistributionNetwork;
map['attendanceRecord'] = attendanceRecord;
map['edit'] = edit;
return map; return map;
} }
} }

View File

@ -12,6 +12,7 @@ import network_info_plus
import package_info_plus import package_info_plus
import path_provider_foundation import path_provider_foundation
import shared_preferences_foundation import shared_preferences_foundation
import sqflite
import url_launcher_macos import url_launcher_macos
func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) { func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
@ -22,5 +23,6 @@ func RegisterGeneratedPlugins(registry: FlutterPluginRegistry) {
FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin")) FLTPackageInfoPlusPlugin.register(with: registry.registrar(forPlugin: "FLTPackageInfoPlusPlugin"))
PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin")) PathProviderPlugin.register(with: registry.registrar(forPlugin: "PathProviderPlugin"))
SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin")) SharedPreferencesPlugin.register(with: registry.registrar(forPlugin: "SharedPreferencesPlugin"))
SqflitePlugin.register(with: registry.registrar(forPlugin: "SqflitePlugin"))
UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin")) UrlLauncherPlugin.register(with: registry.registrar(forPlugin: "UrlLauncherPlugin"))
} }

View File

@ -104,6 +104,9 @@ dependencies:
# 允许App发现网络的相关信息并且进行相应的配置 # 允许App发现网络的相关信息并且进行相应的配置
network_info_plus: ^4.0.2 network_info_plus: ^4.0.2
#网络图片缓存
cached_network_image: ^3.2.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test:
sdk: flutter sdk: flutter