完成考勤模块UI

This commit is contained in:
魏少阳 2023-07-13 14:13:44 +08:00
parent 5900cfc672
commit f73c7984a5
21 changed files with 1361 additions and 124 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

@ -26,13 +26,20 @@
"failureTime":"Failure Time",
"effectiveDate":"Effective Date",
"failureDate":"Failure Date",
"Monday":"M",
"Tuesday":"T",
"Wednesday":"W",
"Thursday":"T",
"Friday":"F",
"Saturday":"S",
"Sunday":"S",
"monday":"Monday",
"tuesday":"Tuesday",
"wednesday":"Wednesday",
"thursday":"Thursday",
"friday":"Friday",
"saturday":"Saturday",
"sunday":"Sunday",
"mondayShort":"M",
"tuesdayShort":"T",
"wednesdayShort":"W",
"thursdayShort":"T",
"fridayShort":"F",
"saturdayShort":"S",
"sundayShort":"S",
"realNameAuthentication":"RealNameAuthentication",
"sendKeyBottomTip":"The recipient can use it unlimited times during the validity period",
@ -82,6 +89,32 @@
"work":"Work",
"workday":"Workday",
"holidays":"Holidays",
"punchingMode":"Punching Mode",
"whetherTheEmployeeHasAKey":"If The Employee Has A Key",
"selectKey":"Select Key",
"officeHours":"Office Hours",
"closingTime":"Closing Time",
"thisWeek":"This Week",
"singleDayWeekend":"Single Day Weekend",
"twoDaysOff":"Two Days Off",
"oddOrEvenDaysOff":"Odd Or Even Days Off",
"year":"Year",
"month":"Month",
"libertyDay":"Liberty Day",
"coverDate":"Cover Date",
"addedHoliday":"Added Holiday",
"startDate":"Start Date",
"accessDate":"Access Date",
"mustFillIn":"Must Fill In",
"endDate":"End Date",
"dailyCharts":"Daily Charts",
"monthlyLeaderboard":"Monthly Leader board",
"noAttendanceRecord":"No Attendance Record",
"everyoneIsVeryMotivated":"Everyone Is Very Motivated",
"workingHoursWereNotReleased":"Working Hours Were Not Released",
"beLate":"Be Late",
"leaveEarly":"Leave Early",
"noCardPunched":"No Card Punched",
"basicInformation":"Basic Information",
"wirelessKeyboard":"Wireless Keyboard",

View File

@ -26,13 +26,20 @@
"failureTime":"failureTime",
"effectiveDate":"effectiveDate",
"failureDate":"failureDate",
"Monday":"Monday",
"Tuesday":"Tuesday",
"Wednesday":"Wednesday",
"Thursday":"Thursday",
"Friday":"Friday",
"Saturday":"Saturday",
"Sunday":"Sunday",
"monday":"monday",
"tuesday":"tuesday",
"wednesday":"wednesday",
"thursday":"thursday",
"friday":"friday",
"saturday":"saturday",
"sunday":"sunday",
"mondayShort":"mondayShort",
"tuesdayShort":"tuesdayShort",
"wednesdayShort":"wednesdayShort",
"thursdayShort":"thursdayShort",
"fridayShort":"fridayShort",
"saturdayShort":"saturdayShort",
"sundayShort":"sundayShort",
"realNameAuthentication":"realNameAuthentication",
"sendKeyBottomTip":"sendKeyBottomTip",
@ -82,6 +89,32 @@
"work":"work",
"workday":"workday",
"holidays":"holidays",
"punchingMode":"punchingMode",
"whetherTheEmployeeHasAKey":"whetherTheEmployeeHasAKey",
"selectKey":"selectKey",
"officeHours":"officeHours",
"closingTime":"closingTime",
"thisWeek":"thisWeek",
"singleDayWeekend":"singleDayWeekend",
"twoDaysOff":"twoDaysOff",
"oddOrEvenDaysOff":"oddOrEvenDaysOff",
"year":"year",
"month":"month",
"libertyDay":"libertyDay",
"coverDate":"coverDate",
"addedHoliday":"addedHoliday",
"startDate":"startDate",
"accessDate":"accessDate",
"mustFillIn":"mustFillIn",
"endDate":"endDate",
"dailyCharts":"dailyCharts",
"monthlyLeaderboard":"monthlyLeaderboard",
"noAttendanceRecord":"noAttendanceRecord",
"everyoneIsVeryMotivated":"everyoneIsVeryMotivated",
"workingHoursWereNotReleased":"workingHoursWereNotReleased",
"beLate":"beLate",
"leaveEarly":"leaveEarly",
"noCardPunched":"noCardPunched",
"basicInformation":"basicInformation",
"wirelessKeyboard":"wirelessKeyboard",

View File

@ -26,13 +26,20 @@
"failureTime":"失效时间",
"effectiveDate":"生效日期",
"failureDate":"失效日期",
"Monday":"一",
"Tuesday":"二",
"Wednesday":"三",
"Thursday":"四",
"Friday":"五",
"Saturday":"六",
"Sunday":"日",
"monday":"星期一",
"tuesday":"星期二",
"wednesday":"星期三",
"thursday":"星期四",
"friday":"星期五",
"saturday":"星期六",
"sunday":"星期日",
"mondayShort":"一",
"tuesdayShort":"二",
"wednesdayShort":"三",
"thursdayShort":"四",
"fridayShort":"五",
"saturdayShort":"六",
"sundayShort":"日",
"realNameAuthentication":"实名认证",
"sendKeyBottomTip":"接收者在有效期内可以不限次数使用",
@ -82,6 +89,32 @@
"work":"工作",
"workday":"工作日",
"holidays":"节假日",
"punchingMode":"打卡方式",
"whetherTheEmployeeHasAKey":"员工是否有钥匙",
"selectKey":"选择钥匙",
"officeHours":"上班时间",
"closingTime":"下班时间",
"thisWeek":"本周",
"singleDayWeekend":"单休",
"twoDaysOff":"双休",
"oddOrEvenDaysOff":"单双休",
"year":"年",
"month":"月",
"libertyDay":"放假日期",
"coverDate":"补班日期",
"addedHoliday":"添加假日",
"startDate":"开始日期",
"accessDate":"接入日期",
"mustFillIn":"必填",
"endDate":"结束日期",
"dailyCharts":"日榜",
"monthlyLeaderboard":"月榜",
"noAttendanceRecord":"无考勤记录",
"everyoneIsVeryMotivated":"大家干劲十足",
"workingHoursWereNotReleased":"工作时长未出炉",
"beLate":"迟到",
"leaveEarly":"早退",
"noCardPunched":"未打卡",
"basicInformation":"基本信息",
"wirelessKeyboard":"无线键盘",

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

View File

@ -6,9 +6,12 @@ import 'login/forgetPassword/starLock_forgetPassword_page.dart';
import 'login/login/starLock_login_page.dart';
import 'login/register/starLock_register_page.dart';
import 'login/seletCountryRegion/seletCountryRegion_page.dart';
import 'main/lockDetail/checkingIn/checkingInAddHolidays/checkingInAddHolidays_page.dart';
import 'main/lockDetail/checkingIn/checkingInDetail/checkingInDetail_page.dart';
import 'main/lockDetail/checkingIn/checkingInList/checkingInList_page.dart';
import 'main/lockDetail/checkingIn/checkingInSet/checkingInSet_page.dart';
import 'main/lockDetail/checkingIn/checkingInSetAddStaff/checkingInAddStaff_page.dart';
import 'main/lockDetail/checkingIn/checkingInSetHolidays/checkingInSetHolidays_page.dart';
import 'main/lockDetail/checkingIn/checkingInSetStaffManage/checkingInStaffManage_page.dart';
import 'main/lockDetail/checkingIn/checkingInSetWorkTime/checkingInSetWorkTime_page.dart';
import 'main/lockDetail/checkingIn/checkingInSetWorkdaySet/checkingInSetWorkdaySet_page.dart';
@ -127,6 +130,9 @@ abstract class Routers {
static const checkingInAddStaffPage = '/CheckingInAddStaffPage';//
static const checkingInSetWorkTimePage = '/CheckingInSetWorkTimePage';//
static const checkingInSetWorkdaySet = '/CheckingInSetWorkdaySet';//
static const checkingInSetHolidaysPage = '/CheckingInSetHolidaysPage';//
static const checkingInAddHolidaysPage = '/CheckingInAddHolidaysPage';//
static const checkingInDetailPage = '/CheckingInDetailPage';//
static const mineSetPage = '/MineSetPage';//
static const mineMultiLanguagePage = '/MineMultiLanguagePage';//
@ -399,5 +405,17 @@ abstract class AppRouters {
name: Routers.checkingInSetWorkdaySet,
page: () => const CheckingInSetWorkdaySet(),
),
GetPage(
name: Routers.checkingInSetHolidaysPage,
page: () => const CheckingInSetHolidaysPage(),
),
GetPage(
name: Routers.checkingInAddHolidaysPage,
page: () => const CheckingInAddHolidaysPage(),
),
GetPage(
name: Routers.checkingInDetailPage,
page: () => CheckingInDetailPage(),
),
];
}

View File

@ -0,0 +1,109 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/commonItem.dart';
import '../../../../tools/showCalendar.dart';
import '../../../../tools/submitBtn.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
class CheckingInAddHolidaysPage extends StatefulWidget {
const CheckingInAddHolidaysPage({Key key}) : super(key: key);
@override
State<CheckingInAddHolidaysPage> createState() => _CheckingInAddHolidaysPageState();
}
class _CheckingInAddHolidaysPageState extends State<CheckingInAddHolidaysPage> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(barTitle:TranslationLoader.lanKeys.addedHoliday.tr, haveBack:true, backgroundColor: AppColors.mainColor),
body: Column(
children: [
CommonItem(leftTitel:TranslationLoader.lanKeys.name.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: getTFWidget("(${TranslationLoader.lanKeys.mustFillIn.tr})")),
CommonItem(leftTitel:TranslationLoader.lanKeys.startDate.tr, rightTitle:"(${TranslationLoader.lanKeys.mustFillIn.tr})", isHaveLine: true, isHaveDirection: false, action: () async {
await showDialog(context: context,
builder: (context) {
return ShowCalendar(datePickerMode: DatePickerMode.day, seletAction: (dateTime){
print("111111$dateTime");
Navigator.of(context).pop(true);
});
});
}),
CommonItem(leftTitel:TranslationLoader.lanKeys.endDate.tr, rightTitle:"(${TranslationLoader.lanKeys.mustFillIn.tr})", isHaveLine: true, isHaveDirection: false, action: () async {
await showDialog(context: context,
builder: (context) {
return ShowCalendar(datePickerMode: DatePickerMode.day, seletAction: (dateTime){
Navigator.of(context).pop(true);
});
});
}),
CommonItem(leftTitel:TranslationLoader.lanKeys.coverDate.tr, rightTitle:"", isHaveLine: false, isHaveDirection: false, action: () async {
await showDialog(context: context,
builder: (context) {
return ShowCalendar(datePickerMode: DatePickerMode.day, seletAction: (dateTime){
Navigator.of(context).pop(true);
});
});
}),
SizedBox(height: 50.w,),
SubmitBtn(btnName: TranslationLoader.lanKeys.sure.tr, borderRadius: 20.w, margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 30.w), padding: EdgeInsets.only(top: 25.w, bottom: 25.w),
onClick: (){
}
),
],
),
);
}
Widget getTFWidget(String tfStr){
return Container(
height: 50.h,
width: 300.w,
// color: Colors.red,
child: Row(
children: [
Expanded(
child: TextField(
//
maxLines: 1,
// controller: _controller,
autofocus: false,
textAlign:TextAlign.end,
decoration: InputDecoration(
//
contentPadding: const EdgeInsets.only(top: 12.0, bottom: 8.0),
hintText: tfStr,
//线
border: InputBorder.none,
),
),
),
SizedBox(width: 10.w,),
],
),
);
}
Widget whetherTheEmployeeHasAKeyWidget(String title, Function action){
return GestureDetector(
onTap: (){
},
child: Row(
children: [
Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),
SizedBox(width: 5.w,),
Text(title),
],
),
);
}
}

View File

@ -0,0 +1,500 @@
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/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
class CheckingInDetailPage extends StatefulWidget {
const CheckingInDetailPage({Key key}) : super(key: key);
@override
_CheckingInDetailPageState createState() => _CheckingInDetailPageState();
}
class _CheckingInDetailPageState extends State<CheckingInDetailPage> {
int _year = DateTime.now().year;
int _month = DateTime.now().month;
int _day = DateTime.now().day;
final List<CalendarModel> _datas = [];
final List<CalendarModel> _listDatas = [];
@override
void initState() {
// TODO: implement initState
//
_setDatas(year: _year, month: _month);
//
_loadAttendanceMonthRecord( "$_year-$_month");
//
_loadAttendanceDayRecord("$_year-$_month-$_day");
super.initState();
}
//
_loadAttendanceMonthRecord(String dateTime) async {
CalendarModel bean1 = CalendarModel(year: _year,month: _month,day: 1,workType: "2");
CalendarModel bean2 = CalendarModel(year: _year,month: _month,day: 2,workType: "1");
CalendarModel bean3 = CalendarModel(year: _year,month: _month,day: 3,workType: "2");
CalendarModel bean4 = CalendarModel(year: _year,month: _month,day: 4,workType: "0");
CalendarModel bean5 = CalendarModel(year: _year,month: _month,day: 5,workType: "0");
CalendarModel bean6 = CalendarModel(year: _year,month: _month,day: 6,workType: "1");
_listDatas.add(bean1);
_listDatas.add(bean2);
_listDatas.add(bean3);
_listDatas.add(bean4);
_listDatas.add(bean5);
_listDatas.add(bean6);
setState(() {
for (int i = 0; i < _datas.length; i++) {
for (int j = 0; j < _listDatas.length; j++) {
if (_datas[i].year== _listDatas[j].year &&
_datas[i].month == _listDatas[j].month &&
_datas[i].day == _listDatas[j].day) {
_datas[i].workType = _listDatas[j].workType;
}
}
}
});
}
//
_loadAttendanceDayRecord(String dateTime) async{
//
print("点击的是$dateTime");
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: TitleAppBar(barTitle:"张三", haveBack:true, backgroundColor: AppColors.mainColor),
body: SingleChildScrollView(
child: Column(
children: [
Container(
// margin: EdgeInsets.all(20.sp),
decoration: BoxDecoration(
//
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(12.r)),
//
),
child: Column(
children: [
_yearHeader(),
SizedBox(height: 10.h),
_weekHeader(),
_everyDay(),
_bottomStatisticsWidget()
],
),
),
//
Container(),
],
)));
}
//
Widget _yearHeader() {
return Container(
height: 30,
margin: const EdgeInsets.only(top: 10),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
GestureDetector(
onTap: () {
_lastMonth();
},
child: Container(
// margin: EdgeInsets.only(left: 20.w),
child: Image(
width: 30.w,
height: 30.w,
image: const AssetImage("images/icon_left_black.png"),
),
),
),
SizedBox(width: 60.w,),
Text("$_year-$_month", style: TextStyle(fontSize: 34.sp, color: Colors.black, fontWeight: FontWeight.w500)),
SizedBox(width: 60.w,),
GestureDetector(
onTap: () {
_nextMonth();
},
child: Container(
// margin: EdgeInsets.only(right: 20.sp),
child: Image(
width: 30.w,
height: 30.h,
image: const AssetImage("images/icon_right_black.png"),
),
),
),
],
),
);
}
//
Widget _weekHeader() {
var array = ["", "", "", "", "", "", ""];
return Container(
height: 50.h,
child: GridView.builder(
padding: const EdgeInsets.only(left: 10, right: 10),
itemCount: array.length,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
//
crossAxisCount: 7,
//
// mainAxisSpacing: ScreenUtil().setHeight(10),
//
// crossAxisSpacing: ScreenUtil().setWidth(15),
//
childAspectRatio: 2),
itemBuilder: (context, index) {
return Container(
alignment: Alignment.center,
child: Text(
array[index],
style: TextStyle(
color: index == 5 || index == 6
? const Color(0xFFC4C8D0)
: const Color(0xFF3C3E43),
fontSize: 30.sp),
));
},
),
);
}
//
Widget _everyDay() {
return Container(
child: GridView.builder(
padding: EdgeInsets.only(left: 10.sp, top: 10.sp, right: 10.sp),
itemCount: _getRowsForMonthYear(year: _year, month: _month) * 7,
shrinkWrap: true,
physics: const NeverScrollableScrollPhysics(),
gridDelegate: const SliverGridDelegateWithFixedCrossAxisCount(
//
crossAxisCount: 7,
// //
// mainAxisSpacing: ScreenUtil().setHeight(10),
// //
// crossAxisSpacing: ScreenUtil().setWidth(10),
//
childAspectRatio: 1),
itemBuilder: (context, index) {
return GestureDetector(
onTap: () {
setState(() {
if (_datas[index].month == _month) {
//
for (int i = 0; i < _datas.length; i++) {
if (i == index) {
//
_day = _datas[i].day;
_datas[i].isSelect = true;
//
_loadAttendanceDayRecord( "${_datas[i].year}-${_datas[i].month}-${_datas[i].day}");
} else {
_datas[i].isSelect = false;
}
}
} else {
//
// _datas[index].is_select=false;
}
});
},
child: Container(
child: Column(
children: [
Container(
width: 40.w,
height: 40.w,
//
decoration: _datas[index].isSelect
? const BoxDecoration(
color: Color(0xFF2C91F6),
shape: BoxShape.circle,
)
: const BoxDecoration(),
child: Center(
child: Text(
//
_datas[index].month == _month
? _datas[index].day.toString()
: "",
textAlign: TextAlign.center,
//
style: _datas[index].isSelect
? TextStyle(
fontSize: 32.sp, color: const Color(0xFFFFFFFF))
: (index % 7 == 5 || index % 7 == 6
? TextStyle(
fontSize: 32.sp, color: const Color(0xFFC4C8D0))
: TextStyle(
fontSize: 32.sp, color: const Color(0xFF3C3E43))),
),
),
),
const SizedBox(height: 5),
//
_datas[index].month == _month &&
_datas[index].workType != "" &&
_datas[index].workType != "0"
? Container(
height: 6.0,
width: 6.0,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: _datas[index].workType == "1"
? const Color(0xFFF48835)
: const Color(0xFF2C91F6)),
)
: Container(),
],
),
),
);
},
),
);
}
Widget _bottomStatisticsWidget(){
return Column(
children: [
Row(
children: [
Container(
width: 1.sw,
// height: 40.h,
padding: EdgeInsets.only(left: 50.w,top: 5.h, bottom: 5.h),
color: Colors.grey,
child: Text("月统计", style: TextStyle(color: Colors.white, fontSize: 32.sp, fontWeight: FontWeight.w500),),
),
],
),
_bottomStatisticsItemWidget(Colors.red ,"迟到", "0"),
_bottomStatisticsItemWidget(Colors.orange ,"早退", "0"),
_bottomStatisticsItemWidget(Colors.grey ,"未打卡", "0"),
],
);
}
Widget _bottomStatisticsItemWidget(Color color,String leftTitel, String rightTitle,){
return Column(
children: [
Container(
height: 70.h,
padding: EdgeInsets.only(left:20.w, right: 10.w, top: 20.w, bottom: 20.w),
child: Row(
children: [
SizedBox(width:20.w),
Container(
width: 35.w,
height: 35.w,
decoration: BoxDecoration(
color: color,
borderRadius:BorderRadius.all(Radius.circular(35.h))
),
),
SizedBox(width:20.w),
Expanded(child: Text(leftTitel, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500))),
SizedBox(width:20.w),
Text(rightTitle, textAlign: TextAlign.end, style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500)),
SizedBox(width:10.w),
],
),
),
Container(height: 0.5.h, color: Colors.grey,)
],
);
}
//
int _getRowsForMonthYear({int year, int month}) {
//
var currentMonthDays = _getCurrentMonthDays(year: year, month: month);
//
var placeholderDays = _getPlaceholderDays(year: year, month: month);
int rows = (currentMonthDays + placeholderDays) ~/ 7;
int remainder = (currentMonthDays + placeholderDays) % 7;
if (remainder > 0) {
rows = rows + 1;
}
return rows;
}
//
int _getPlaceholderDays({int year, int month}) {
return DateTime(year, month).weekday - 1 % 7;
}
//
int _getCurrentMonthDays({int year, int month}) {
if (month == 2) {
//2
if (((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0)) {
return 29;
} else {
return 28;
}
} else if (month == 1 ||
month == 3 ||
month == 5 ||
month == 7 ||
month == 8 ||
month == 10 ||
month == 12) {
return 31;
} else {
return 30;
}
}
///
_setDatas({int year, int month}) {
///
var lastYear = year;
var lastMonth = month - 1;
if (month == 1) {
lastYear = year - 1;
lastMonth = 12;
}
var placeholderDays = _getPlaceholderDays(year: year, month: month);
var lastMonthDays = _getCurrentMonthDays(year: lastYear, month: lastMonth);
var firstDay = lastMonthDays - placeholderDays;
for (var i = 0; i < placeholderDays; i++) {
_datas.add(CalendarModel(
year: lastYear,
month: lastMonth,
day: firstDay + i + 1,
isSelect: false,
workType: ""));
}
///
var currentMonthDays = _getCurrentMonthDays(year: year, month: month);
for (var i = 0; i < currentMonthDays; i++) {
if (i == _day - 1) {
_datas.add(CalendarModel(
year: year,
month: month,
day: i + 1,
isSelect: true,
workType: ""));
} else {
_datas.add(CalendarModel(
year: year,
month: month,
day: i + 1,
isSelect: false,
workType: ""));
}
}
///
var nextYear = year;
var nextMonth = month + 1;
if (month == 12) {
nextYear = year + 1;
nextMonth = 1;
}
var nextPlaceholderDays =
_getPlaceholderDays(year: nextYear, month: nextMonth);
for (var i = 0; i < 7 - nextPlaceholderDays; i++) {
_datas.add(CalendarModel(
year: nextYear,
month: nextMonth,
day: i + 1,
isSelect: false,
workType: ""));
}
}
//
_lastMonth() {
setState(() {
if (_month == 1) {
_year = _year - 1;
_month = 12;
} else {
_month = _month - 1;
}
_day = 1; //
_datas.clear();
_setDatas(year: _year, month: _month);
//
_loadAttendanceMonthRecord( "$_year-$_month");
//
_loadAttendanceDayRecord("$_year-$_month-$_day");
});
}
//
_nextMonth() {
if(_month==12){//12
if(DateTime.now().year>=_year+1){//
_setNextMonthData();
}
}else{//12
if(DateTime.now().month>=_month+1){
//
_setNextMonthData();
}
}
}
//
_setNextMonthData(){
setState(() {
if (_month == 12) {
_year = _year + 1;
_month = 1;
} else {
_month = _month + 1;
}
if (_month == DateTime.now().month) {
//
_day = DateTime.now().day;
} else {
//
_day = 1;
}
_datas.clear();
_setDatas(year: _year, month: _month);
//
_loadAttendanceMonthRecord( "$_year-$_month");
//
_loadAttendanceDayRecord("$_year-$_month-$_day");
});
}
}
//bean
class CalendarModel {
int year;
int month;
int day;
String workType = "";//012
bool isSelect = false;
CalendarModel(
{this.year, this.month, this.day, this.isSelect, this.workType});
}

View File

@ -6,6 +6,7 @@ import 'package:get/get.dart';
import '../../../../appRouters.dart';
import '../../../../app_settings/app_colors.dart';
import '../../../../tools/showBottomSheetTool.dart';
import '../../../../tools/showCalendar.dart';
import '../../../../tools/titleAppBar.dart';
import '../../../../translations/trans_lib.dart';
@ -31,14 +32,157 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
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);
});
}
)
body: Column(
children: [
topInfo(),
SizedBox(height: 10.h,),
middleDayInfo(),
Expanded(child: bottomList())
],
),
);
}
Widget topInfo(){
return Container(
width: 1.sw,
// height: 370.h,
color: Colors.white,
child: Column(
children: [
SizedBox(height: 30.h,),
Image.asset('images/main/icon_checkInRankingListTop.png', width: 145.w, height: 145.w),
SizedBox(height: 10.h,),
Text(TranslationLoader.lanKeys.noAttendanceRecord.tr, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500)),
SizedBox(height: 30.h,),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
// SizedBox(width: 30.w,),
Row(
children: [
SizedBox(width: 40.w,),
Container(
// width: 150.w,
height: 70.h,
// color: Colors.red,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(TranslationLoader.lanKeys.dailyCharts.tr, style: TextStyle(color: AppColors.mainColor)),
Container(width: 20.w, height: 2.h, color: AppColors.mainColor)
],
),
),
SizedBox(width: 40.w,),
Container(
// width: 100.w,
height: 70.h,
// color: Colors.red,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Text(TranslationLoader.lanKeys.monthlyLeaderboard.tr, style: TextStyle(color: Colors.black)),
Container(width: 20.w, height: 2.h, color: Colors.black)
],
),
),
],
),
GestureDetector(
onTap: () async {
await showDialog(context: context,
builder: (context) {
return ShowCalendar(datePickerMode: DatePickerMode.day, seletAction: (dateTime){
Navigator.of(context).pop(true);
});
});
},
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("07-12", style: const TextStyle(color: Colors.black),),
Image.asset('images/icon_grayPullDown.png', width: 50.w, height: 30.w,),
SizedBox(width: 10.w,),
],
),
)
],
),
// Container(height: 10.h, color: AppColors.mainBackgroundColor,),
],
),
);
}
Widget middleDayInfo(){
return Visibility(
visible: true,
child: Container(
height: 80.h,
color: Colors.white,
margin: EdgeInsets.only(left:15.h, right: 15.h, bottom: 10.h),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Container(
// width: 100.w,
// height: 80.h,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
SizedBox(height: 5.h,),
Text("0", style: TextStyle(color: Colors.black)),
Text(TranslationLoader.lanKeys.beLate.tr, style: TextStyle(color: Colors.black)),
SizedBox(height: 5.h,),
],
),
),
Container(
// width: 100.w,
// height: 80.h,
// color: Colors.red,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
SizedBox(height: 5.h,),
Text("0", style: TextStyle(color: Colors.black)),
Text(TranslationLoader.lanKeys.leaveEarly.tr, style: TextStyle(color: Colors.black)),
SizedBox(height: 5.h,),
],
),
),
Container(
// width: 100.w,
// height: 80.h,
// color: Colors.red,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
SizedBox(height: 5.h,),
Text("0", style: TextStyle(color: Colors.black)),
Text(TranslationLoader.lanKeys.noCardPunched.tr, style: TextStyle(color: Colors.black)),
SizedBox(height: 5.h,),
],
),
),
],
),
),
);
}
Widget bottomList(){
return ListView.separated(
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.checkingInDetailPage);
});
},
separatorBuilder: (context, index) {
return const Divider(height:1, color: Colors.grey);
},
);
}
@ -46,8 +190,8 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
return GestureDetector(
onTap: action,
child: Container(
height: 100.h,
margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
height: 80.h,
// margin: EdgeInsets.only(left: 20.w, right: 20.w, top: 20.w),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(10.w),
@ -55,36 +199,24 @@ class _CheckingInListPageState extends State<CheckingInListPage> {
child: Row(
children: [
SizedBox(width: 30.w,),
Image.asset(lockTypeIcon, width: 50.w, height: 50.w,),
SizedBox(width: 30.w,),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
// color: Colors.red,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ),
SizedBox(width:20.w),
Text("待接收", style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500), ),
],
),
),
SizedBox(width:20.w),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text("2023.6.21 11.15-2023.6.21 11.15", style: TextStyle(fontSize: 28.sp, fontWeight: FontWeight.w500), ),
],
),
),
SizedBox(width:20.h),
],
),
Text("1", style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ),
SizedBox(width: 20.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/mine/icon_mine_main_defaultAvatar.png', width: 40.w, height: 40.w, color: Colors.white,)
),
SizedBox(width: 20.w,),
Expanded(
child: Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w500), ),
),
SizedBox(width:20.h),
Image.asset("images/icon_right.png", width: 50.w, height: 50.w,),
SizedBox(width:20.h),
],
),

View File

@ -41,7 +41,7 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
Navigator.pushNamed(context, Routers.checkingInSetWorkdaySet);
}),
CommonItem(leftTitel:TranslationLoader.lanKeys.holidays.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){
// Navigator.pushNamed(context, Routers.lockEscalationPage);
Navigator.pushNamed(context, Routers.checkingInSetHolidaysPage);
}),
SizedBox(height: 30.h,),
SubmitBtn(btnName: "${TranslationLoader.lanKeys.delete.tr} ${TranslationLoader.lanKeys.company.tr}",

View File

@ -26,11 +26,11 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
body: Column(
children: [
CommonItem(leftTitel:TranslationLoader.lanKeys.name.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: getTFWidget(TranslationLoader.lanKeys.pleaseEnter.tr)),
CommonItem(leftTitel:"打卡方式", rightTitle:"APP", isHaveLine: false, isHaveDirection: true, action: (){
CommonItem(leftTitel:TranslationLoader.lanKeys.punchingMode.tr, rightTitle:"APP", isHaveLine: false, isHaveDirection: true, action: (){
_showSeletClockInType();
}),
SizedBox(height: 10.h,),
CommonItem(leftTitel:"员工是否有钥匙", rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: Row(
CommonItem(leftTitel:TranslationLoader.lanKeys.whetherTheEmployeeHasAKey.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: Row(
children: [
whetherTheEmployeeHasAKeyWidget("", (){
@ -43,11 +43,11 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
)),
Visibility(
visible:true,
child: CommonItem(leftTitel:"账号", rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: getTFWidget("请输入员工账号")),
child: CommonItem(leftTitel:TranslationLoader.lanKeys.accountNumber.tr, rightTitle:"", isHaveLine: true, isHaveRightWidget: true, rightWidget: getTFWidget(TranslationLoader.lanKeys.pleaseEnter.tr)),
),
Visibility(
visible:true,
child: CommonItem(leftTitel:"选择钥匙", rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){
child: CommonItem(leftTitel:TranslationLoader.lanKeys.selectKey.tr, rightTitle:"", isHaveLine: false, isHaveDirection: true, action: (){
_showSeletClockInType();
}),
),
@ -65,7 +65,8 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
Widget getTFWidget(String tfStr){
return Container(
height: 50.h,
width: 500.w,
width: 300.w,
// color: Colors.red,
child: Row(
children: [
Expanded(

View File

@ -0,0 +1,187 @@
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: 50.w, height: 50.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: 32.sp, color: Colors.white),))
),
SizedBox(width: 30.w,),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
// color: Colors.red,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(lockTypeTitle, style: TextStyle(fontSize: 32.sp, fontWeight: FontWeight.w600), ),
],
),
),
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: 24.sp, fontWeight: FontWeight.w500), ),
],
),
),
SizedBox(height:5.h),
Container(
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Text("${TranslationLoader.lanKeys.coverDate.tr}:2023.6.21 11.15", style: TextStyle(fontSize: 24.sp, fontWeight: FontWeight.w500), ),
],
),
),
],
),
),
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: const TextStyle(color: Colors.white),),
SizedBox(width: 5.w,),
Image.asset('images/main/icon_lockDetail_checkIn_topTitle.png', width: 30.w, height: 16.w,)
],
),
);
}
Widget 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

@ -29,12 +29,12 @@ class _CheckingInSetWorkTimePageState extends State<CheckingInSetWorkTimePage> {
Widget buildMainUI(){
return Column(
children: [
CommonItem(leftTitel:"上班时间", rightTitle:"11:49", isHaveDirection: true, isHaveLine: true, action:(){
CommonItem(leftTitel:TranslationLoader.lanKeys.officeHours.tr, rightTitle:"11:49", isHaveDirection: true, isHaveLine: true, action:(){
// ShowSeletDateTime().showDatePicker(context, '2100-01-01 00:00', '1900-01-01 00:00', getNowDate(),'yyyy-MMMM-dd HH:mm', (dateTime, List<int> index) {
//
// });
}),
CommonItem(leftTitel:"下班时间", rightTitle:"11:49", isHaveDirection: true, action:(){
CommonItem(leftTitel:TranslationLoader.lanKeys.closingTime.tr, rightTitle:"11:49", isHaveDirection: true, action:(){
// ShowSeletDateTime().showDatePicker(context, '00:00', '00:00', getNowDate(),'HH:mm', (dateTime, List<int> index) {
//
// });

View File

@ -63,7 +63,7 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(child: Text("自定义", style: TextStyle(fontSize: 32.sp, color: Colors.white))),
Center(child: Text(TranslationLoader.lanKeys.custom.tr, style: TextStyle(fontSize: 32.sp, color: Colors.white))),
],
),
),
@ -72,10 +72,11 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
width: (1.sw - 10*3)/2,
height: 120.h,
color: Colors.grey,
padding: EdgeInsets.all(10.w),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Center(child: Text("单双休", style: TextStyle(fontSize: 32.sp, color: Colors.white))),
Expanded(child: Center(child: Text(TranslationLoader.lanKeys.oddOrEvenDaysOff.tr, style: TextStyle(fontSize: 32.sp, color: Colors.white), textAlign: TextAlign.center,))),
],
),
),
@ -89,15 +90,15 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
padding: EdgeInsets.only(left:10.w, right: 10.w),
child: Column(
children: [
CommonItem(leftTitel:"本周", rightTitle:"", allHeight:70.h, isHaveLine: true),
CommonItem(leftTitel:"单休", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
CommonItem(leftTitel:TranslationLoader.lanKeys.thisWeek.tr, rightTitle:"", allHeight:70.h, isHaveLine: true),
CommonItem(leftTitel:TranslationLoader.lanKeys.singleDayWeekend.tr, rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
rightWidget: GestureDetector(
onTap: (){
},
child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),)
),
CommonItem(leftTitel:"双休", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
CommonItem(leftTitel:TranslationLoader.lanKeys.twoDaysOff.tr, rightTitle:"", allHeight:70.h, isHaveLine: false, isHaveRightWidget: true,
rightWidget: GestureDetector(
onTap: (){
@ -115,49 +116,49 @@ class _CheckingInSetWorkdaySetState extends State<CheckingInSetWorkdaySet> {
padding: EdgeInsets.only(left:10.w, right: 10.w),
child: Column(
children: [
CommonItem(leftTitel:"星期一", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
CommonItem(leftTitel:TranslationLoader.lanKeys.monday.tr, rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
rightWidget: GestureDetector(
onTap: (){
},
child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),)
),
CommonItem(leftTitel:"星期二", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
CommonItem(leftTitel:TranslationLoader.lanKeys.tuesday.tr, rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
rightWidget: GestureDetector(
onTap: (){
},
child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),)
),
CommonItem(leftTitel:"星期三", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
CommonItem(leftTitel:TranslationLoader.lanKeys.wednesday.tr, rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
rightWidget: GestureDetector(
onTap: (){
},
child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),)
),
CommonItem(leftTitel:"星期四", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
CommonItem(leftTitel:TranslationLoader.lanKeys.thursday.tr, rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
rightWidget: GestureDetector(
onTap: (){
},
child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),)
),
CommonItem(leftTitel:"星期五", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
CommonItem(leftTitel:TranslationLoader.lanKeys.friday.tr, rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
rightWidget: GestureDetector(
onTap: (){
},
child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),)
),
CommonItem(leftTitel:"星期六", rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
CommonItem(leftTitel:TranslationLoader.lanKeys.saturday.tr, rightTitle:"", allHeight:70.h, isHaveLine: true, isHaveRightWidget: true,
rightWidget: GestureDetector(
onTap: (){
},
child: Row(children: [Image.asset('images/icon_round_unSelet.png', width: 40.w, height: 40.w,),],),)
),
CommonItem(leftTitel:"星期日", rightTitle:"", allHeight:70.h, isHaveLine: false, isHaveRightWidget: true,
CommonItem(leftTitel:TranslationLoader.lanKeys.sunday.tr, rightTitle:"", allHeight:70.h, isHaveLine: false, isHaveRightWidget: true,
rightWidget: GestureDetector(
onTap: (){

View File

@ -67,25 +67,25 @@ class _ElectronicKeyPeriodValidityPageState extends State<ElectronicKeyPeriodVal
String dateStr;
switch (index) {
case 0:
dateStr = TranslationLoader.lanKeys.Sunday.tr;
dateStr = TranslationLoader.lanKeys.sundayShort.tr;
break;
case 1:
dateStr = TranslationLoader.lanKeys.Monday.tr;
dateStr = TranslationLoader.lanKeys.mondayShort.tr;
break;
case 2:
dateStr = TranslationLoader.lanKeys.Tuesday.tr;
dateStr = TranslationLoader.lanKeys.tuesdayShort.tr;
break;
case 3:
dateStr = TranslationLoader.lanKeys.Wednesday.tr;
dateStr = TranslationLoader.lanKeys.wednesdayShort.tr;
break;
case 4:
dateStr = TranslationLoader.lanKeys.Thursday.tr;
dateStr = TranslationLoader.lanKeys.thursdayShort.tr;
break;
case 5:
dateStr = TranslationLoader.lanKeys.Friday.tr;
dateStr = TranslationLoader.lanKeys.fridayShort.tr;
break;
case 6:
dateStr = TranslationLoader.lanKeys.Saturday.tr;
dateStr = TranslationLoader.lanKeys.saturdayShort.tr;
break;
default:
break;

View File

@ -102,25 +102,25 @@ class _NormallyOpenModePageState extends State<NormallyOpenModePage> {
String dateStr;
switch (index) {
case 0:
dateStr = TranslationLoader.lanKeys.Sunday.tr;
dateStr = TranslationLoader.lanKeys.sundayShort.tr;
break;
case 1:
dateStr = TranslationLoader.lanKeys.Monday.tr;
dateStr = TranslationLoader.lanKeys.mondayShort.tr;
break;
case 2:
dateStr = TranslationLoader.lanKeys.Tuesday.tr;
dateStr = TranslationLoader.lanKeys.tuesdayShort.tr;
break;
case 3:
dateStr = TranslationLoader.lanKeys.Wednesday.tr;
dateStr = TranslationLoader.lanKeys.wednesdayShort.tr;
break;
case 4:
dateStr = TranslationLoader.lanKeys.Thursday.tr;
dateStr = TranslationLoader.lanKeys.thursdayShort.tr;
break;
case 5:
dateStr = TranslationLoader.lanKeys.Friday.tr;
dateStr = TranslationLoader.lanKeys.fridayShort.tr;
break;
case 6:
dateStr = TranslationLoader.lanKeys.Saturday.tr;
dateStr = TranslationLoader.lanKeys.saturdayShort.tr;
break;
default:
break;

View File

@ -0,0 +1,54 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
typedef SeletDateCallback(DateTime dateTime);
class ShowCalendar extends StatelessWidget {
SeletDateCallback seletAction;
DatePickerMode datePickerMode;
ShowCalendar({Key key, this.seletAction, this.datePickerMode}) : super(key: key);
@override
Widget build(BuildContext context) {
return Dialog(
// insetPadding: EdgeInsets.all(10), //
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(20))), //
backgroundColor: Colors.white,
clipBehavior: Clip.antiAlias, //
elevation: 10,
child: SizedBox(
//
height: 350,
width: 1.sw - 40.w,
child: _calendarDatePicker(datePickerMode),
),
);
}
CalendarDatePicker _calendarDatePicker(DatePickerMode mode){
return CalendarDatePicker(
initialDate: DateTime.now(), //
// currentDate: DateTime(2020, 10, 18),
firstDate: DateTime(2000, 1, 1), //
lastDate: DateTime(2100, 1, 1), //
initialCalendarMode: mode, //
//
onDateChanged:seletAction,
//
onDisplayedMonthChanged: (dateTime){
print("onDisplayedMonthChanged $dateTime");
},
//
selectableDayPredicate: (dayTime){
if(dayTime == DateTime(2020, 10, 15) || dayTime == DateTime(2020, 10, 16) || dayTime == DateTime(2020, 10, 17)) {
return false;
}
return true;
}
);
}
}

View File

@ -27,13 +27,20 @@ class LanKeyEntity {
this.failureTime,
this.effectiveDate,
this.failureDate,
this.Monday,
this.Tuesday,
this.Wednesday,
this.Thursday,
this.Friday,
this.Saturday,
this.Sunday,
this.monday,
this.tuesday,
this.wednesday,
this.thursday,
this.friday,
this.saturday,
this.sunday,
this.mondayShort,
this.tuesdayShort,
this.wednesdayShort,
this.thursdayShort,
this.fridayShort,
this.saturdayShort,
this.sundayShort,
this.realNameAuthentication,
this.sendKeyBottomTip,
@ -151,6 +158,32 @@ class LanKeyEntity {
this.work,
this.workday,
this.holidays,
this.punchingMode,
this.whetherTheEmployeeHasAKey,
this.selectKey,
this.officeHours,
this.closingTime,
this.thisWeek,
this.singleDayWeekend,
this.twoDaysOff,
this.oddOrEvenDaysOff,
this.year,
this.month,
this.libertyDay,
this.coverDate,
this.addedHoliday,
this.startDate,
this.accessDate,
this.mustFillIn,
this.endDate,
this.dailyCharts,
this.monthlyLeaderboard,
this.noAttendanceRecord,
this.everyoneIsVeryMotivated,
this.workingHoursWereNotReleased,
this.beLate,
this.leaveEarly,
this.noCardPunched,
this.lanEnglish,
this.lanChinese,
@ -244,13 +277,20 @@ class LanKeyEntity {
failureTime = json['failureTime'];
effectiveDate = json['effectiveDate'];
failureDate = json['failureDate'];
Monday = json['Monday'];
Tuesday = json['Tuesday'];
Wednesday = json['Wednesday'];
Thursday = json['Thursday'];
Friday = json['Friday'];
Saturday = json['Saturday'];
Sunday = json['Sunday'];
monday = json['monday'];
tuesday = json['tuesday'];
wednesday = json['wednesday'];
thursday = json['thursday'];
friday = json['friday'];
saturday = json['saturday'];
sunday = json['sunday'];
mondayShort = json['mondayShort'];
tuesdayShort = json['tuesdayShort'];
wednesdayShort = json['wednesdayShort'];
thursdayShort = json['thursdayShort'];
fridayShort = json['fridayShort'];
saturdayShort = json['saturdayShort'];
sundayShort = json['sundayShort'];
realNameAuthentication = json['realNameAuthentication'];
sendKeyBottomTip = json['sendKeyBottomTip'];
@ -368,6 +408,32 @@ class LanKeyEntity {
work = json['work'];
workday = json['workday'];
holidays = json['holidays'];
punchingMode = json['punchingMode'];
whetherTheEmployeeHasAKey = json['whetherTheEmployeeHasAKey'];
selectKey = json['selectKey'];
officeHours = json['officeHours'];
closingTime = json['closingTime'];
thisWeek = json['thisWeek'];
singleDayWeekend = json['singleDayWeekend'];
twoDaysOff = json['twoDaysOff'];
oddOrEvenDaysOff = json['oddOrEvenDaysOff'];
year = json['year'];
month = json['month'];
libertyDay = json['libertyDay'];
coverDate = json['coverDate'];
addedHoliday = json['addedHoliday'];
startDate = json['startDate'];
accessDate = json['accessDate'];
mustFillIn = json['mustFillIn'];
endDate = json['endDate'];
dailyCharts = json['dailyCharts'];
monthlyLeaderboard = json['monthlyLeaderboard'];
noAttendanceRecord = json['noAttendanceRecord'];
everyoneIsVeryMotivated = json['everyoneIsVeryMotivated'];
workingHoursWereNotReleased = json['workingHoursWereNotReleased'];
beLate = json['beLate'];
leaveEarly = json['leaveEarly'];
noCardPunched = json['noCardPunched'];
lanEnglish = json['lanEnglish'];
lanChinese = json['lanChinese'];
@ -459,13 +525,20 @@ class LanKeyEntity {
String failureTime;
String effectiveDate;
String failureDate;
String Monday;
String Tuesday;
String Wednesday;
String Thursday;
String Friday;
String Saturday;
String Sunday;
String monday;
String tuesday;
String wednesday;
String thursday;
String friday;
String saturday;
String sunday;
String mondayShort;
String tuesdayShort;
String wednesdayShort;
String thursdayShort;
String fridayShort;
String saturdayShort;
String sundayShort;
String realNameAuthentication;
String sendKeyBottomTip;
@ -548,6 +621,33 @@ class LanKeyEntity {
String work;
String workday;
String holidays;
String punchingMode;
String whetherTheEmployeeHasAKey;
String selectKey;
String officeHours;
String closingTime;
String thisWeek;
String singleDayWeekend;
String twoDaysOff;
String oddOrEvenDaysOff;
String year;
String month;
String libertyDay;
String coverDate;
String addedHoliday;
String startDate;
String accessDate;
String mustFillIn;
String endDate;
String dailyCharts;
String monthlyLeaderboard;
String noAttendanceRecord;
String everyoneIsVeryMotivated;
String workingHoursWereNotReleased;
String beLate;
String leaveEarly;
String noCardPunched;
String basicInformation;
String wirelessKeyboard;
@ -676,13 +776,20 @@ class LanKeyEntity {
map['failureTime'] = failureTime;
map['effectiveDate'] = effectiveDate;
map['failureDate'] = failureDate;
map['Monday'] = Monday;
map['Tuesday'] = Tuesday;
map['Wednesday'] = Wednesday;
map['Thursday'] = Thursday;
map['Friday'] = Friday;
map['Saturday'] = Saturday;
map['Sunday'] = Sunday;
map['monday'] = monday;
map['tuesday'] = tuesday;
map['wednesday'] = wednesday;
map['thursday'] = thursday;
map['friday'] = friday;
map['saturday'] = saturday;
map['sunday'] = sunday;
map['mondayShort'] = mondayShort;
map['tuesdayShort'] = tuesdayShort;
map['wednesdayShort'] = wednesdayShort;
map['thursdayShort'] = thursdayShort;
map['fridayShort'] = fridayShort;
map['saturdayShort'] = saturdayShort;
map['sundayShort'] = sundayShort;
map['realNameAuthentication'] = realNameAuthentication;
map['sendKeyBottomTip'] = sendKeyBottomTip;
@ -801,7 +908,33 @@ class LanKeyEntity {
map['work'] = work;
map['workday'] = workday;
map['holidays'] = holidays;
map['punchingMode'] = punchingMode;
map['whetherTheEmployeeHasAKey'] = whetherTheEmployeeHasAKey;
map['selectKey'] = selectKey;
map['officeHours'] = officeHours;
map['closingTime'] = closingTime;
map['thisWeek'] = thisWeek;
map['singleDayWeekend'] = singleDayWeekend;
map['twoDaysOff'] = twoDaysOff;
map['oddOrEvenDaysOff'] = oddOrEvenDaysOff;
map['year'] = year;
map['month'] = month;
map['libertyDay'] = libertyDay;
map['coverDate'] = coverDate;
map['addedHoliday'] = addedHoliday;
map['startDate'] = startDate;
map['accessDate'] = accessDate;
map['mustFillIn'] = mustFillIn;
map['endDate'] = endDate;
map['dailyCharts'] = dailyCharts;
map['monthlyLeaderboard'] = monthlyLeaderboard;
map['noAttendanceRecord'] = noAttendanceRecord;
map['everyoneIsVeryMotivated'] = everyoneIsVeryMotivated;
map['workingHoursWereNotReleased'] = workingHoursWereNotReleased;
map['beLate'] = beLate;
map['leaveEarly'] = leaveEarly;
map['noCardPunched'] = noCardPunched;
map['lanEnglish'] = lanEnglish;
map['lanChinese'] = lanChinese;
map['multilingual'] = multilingual;

View File

@ -58,7 +58,10 @@ dependencies:
flutter_picker: ^2.1.0
#生成二维码
qr_flutter: ^4.0.0
#底部选择
flutter_pickers: ^2.1.9
#万年历
syncfusion_flutter_datepicker: ^18.4.48
dev_dependencies:
flutter_test:
sdk: flutter