fix:修复 开锁页-考勤-设置 公司名称 长位的显示不全,通通锁显示2栏。另修改未做长度限制,应限制6-30位,和创建一样

This commit is contained in:
anfe 2024-05-20 11:59:34 +08:00
parent b3d0c04ddc
commit a394c339a2
9 changed files with 195 additions and 182 deletions

View File

@ -855,5 +855,6 @@
"门铃事件":"Doorbell event",
"视频事件":"Video event",
"请开启蓝牙":"Please turn on Bluetooth",
"请选择有效日":"Please select the effective day"
"请选择有效日":"Please select the effective day",
"公司名字长度不能小于 6 ": "The length of the company name cannot be less than 6"
}

View File

@ -884,5 +884,6 @@
"门铃事件":"门铃事件",
"视频事件":"视频事件",
"请开启蓝牙":"请开启蓝牙",
"请选择有效日":"请选择有效日"
"请选择有效日":"请选择有效日",
"公司名字长度不能小于 6 ": "公司名字长度不能小于 6 "
}

View File

@ -815,7 +815,7 @@
"身份证号": "身份证号",
"请输入真实姓名": "请输入真实姓名",
"请输入身份证号": "请输入身份证号",
"请输入身份证号和真实姓名":"请输入身份证号和真实姓名",
"请输入身份证号和真实姓名": "请输入身份证号和真实姓名",
"点击返回设备配对": "点击返回设备配对",
"无法连接?尝试升级": "无法连接?尝试升级",
"固件升级提示": "固件升级提示",
@ -845,14 +845,15 @@
"操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。": "操作失败,请确认锁是否在附近,或重启手机蓝牙后再试。",
"如果是全自动锁,请使屏幕变亮": "如果是全自动锁,请使屏幕变亮",
"正在尝试闭锁……": "正在尝试闭锁……",
"清空记录":"清空记录",
"是否要删除操作记录?":"是否要删除操作记录?",
"被删除的记录不能恢复":"被删除的记录不能恢复",
"全部事件":"全部事件",
"开锁事件":"开锁事件",
"异常事件":"异常事件",
"门铃事件":"门铃事件",
"视频事件":"视频事件",
"请开启蓝牙":"请开启蓝牙",
"请选择有效日":"请选择有效日"
"清空记录": "清空记录",
"是否要删除操作记录?": "是否要删除操作记录?",
"被删除的记录不能恢复": "被删除的记录不能恢复",
"全部事件": "全部事件",
"开锁事件": "开锁事件",
"异常事件": "异常事件",
"门铃事件": "门铃事件",
"视频事件": "视频事件",
"请开启蓝牙": "请开启蓝牙",
"请选择有效日": "请选择有效日",
"公司名字长度不能小于 6 ": "公司名字长度不能小于 6 "
}

View File

@ -4,6 +4,7 @@ import 'package:flutter/services.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/app_settings/app_colors.dart';
import 'package:star_lock/main/lockDetail/checkingIn/checkingInSet/checkingInSet_state.dart';
import '../../../../appRouters.dart';
import '../../../../tools/commonItem.dart';
@ -22,8 +23,8 @@ class CheckingInSetPage extends StatefulWidget {
}
class _CheckingInSetPageState extends State<CheckingInSetPage> {
final logic = Get.put(CheckingInSetLogic());
final state = Get.find<CheckingInSetLogic>().state;
final CheckingInSetLogic logic = Get.put(CheckingInSetLogic());
final CheckingInSetState state = Get.find<CheckingInSetLogic>().state;
@override
Widget build(BuildContext context) {
@ -31,17 +32,17 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
backgroundColor: AppColors.mainBackgroundColor,
appBar: TitleAppBar(
barTitle:
"${TranslationLoader.lanKeys!.checkingIn!.tr}${TranslationLoader.lanKeys!.set!.tr}",
'${TranslationLoader.lanKeys!.checkingIn!.tr}${TranslationLoader.lanKeys!.set!.tr}',
haveBack: true,
backgroundColor: AppColors.mainColor),
body: Column(
children: [
children: <Widget>[
Obx(() => CommonItem(
leftTitel:
"公司名称".tr,
// rightTitle: state.companyName.value ?? "",
isHaveRightWidget: true,
rightWidget: getTFWidget(),
'公司名称'.tr,
rightTitle: state.companyName.value ?? '',
// isHaveRightWidget: true,
// rightWidget: getTFWidget(),
isHaveLine: true,
isHaveDirection: true,
action: () {
@ -53,23 +54,23 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
isHaveLine: true,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.checkingInStaffManagePage, arguments: {
"getKeyInfosData": state.getKeyInfosData.value,
"companyId": state.companyId.value
Get.toNamed(Routers.checkingInStaffManagePage, arguments: <String, Object>{
'getKeyInfosData': state.getKeyInfosData.value,
'companyId': state.companyId.value
});
})),
Obx(() => CommonItem(
leftTitel:
"${TranslationLoader.lanKeys!.work!.tr}${TranslationLoader.lanKeys!.time!.tr}",
rightTitle: (state.beginTime.value.isNotEmpty) ? "${state.beginTime.value} - ${state.endTime.value}" : "",
rightTitle: (state.beginTime.value.isNotEmpty) ? '${state.beginTime.value} - ${state.endTime.value}' : '',
isHaveLine: true,
isHaveDirection: true,
action: () async {
var data = await Get.toNamed(Routers.checkingInSetWorkTimePage, arguments: {
var data = await Get.toNamed(Routers.checkingInSetWorkTimePage, arguments: <String, Object>{
// "getKeyInfosData": state.getKeyInfosData.value,
"companyId": state.companyId.value,
"pushType": "2",
"checkingInSetInfo": state.checkingInSetInfo.value,
'companyId': state.companyId.value,
'pushType': '2',
'checkingInSetInfo': state.checkingInSetInfo.value,
});
if(data != null) {
setState(() {
@ -84,30 +85,30 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
Obx(() => CommonItem(
leftTitel:
"${TranslationLoader.lanKeys!.workday!.tr}${TranslationLoader.lanKeys!.set!.tr}",
rightTitle: state.isCustom.value == true ? state.weekDaysStr.value : (state.weekDaysStr.value.length == 5 ? "单休" : "双休"),
rightTitle: state.isCustom.value == true ? state.weekDaysStr.value : (state.weekDaysStr.value.length == 5 ? '单休' : '双休'),
isHaveLine: true,
isHaveDirection: true,
action: () async {
var data = await Get.toNamed(Routers.checkingInSetWorkdaySet, arguments: {
"getKeyInfosData": state.getKeyInfosData.value,
"companyId": state.companyId.value,
"pushType": "2",
"checkingInSetInfo": state.checkingInSetInfo.value,
var data = await Get.toNamed(Routers.checkingInSetWorkdaySet, arguments: <String, Object>{
'getKeyInfosData': state.getKeyInfosData.value,
'companyId': state.companyId.value,
'pushType': '2',
'checkingInSetInfo': state.checkingInSetInfo.value,
});
if(data != null) {
state.isCustom.value = data["attendanceType"];
state.weekDays.value = data["weekDays"];
state.weekDaysStr.value = state.weekDays.value.join(",");
state.isCustom.value = data['attendanceType'];
state.weekDays.value = data['weekDays'];
state.weekDaysStr.value = state.weekDays.value.join(',');
}
})),
CommonItem(
leftTitel: TranslationLoader.lanKeys!.holidays!.tr,
rightTitle: "",
rightTitle: '',
isHaveLine: false,
isHaveDirection: true,
action: () {
Get.toNamed(Routers.checkingInSetHolidaysPage, arguments: {
"companyId": state.companyId.value
Get.toNamed(Routers.checkingInSetHolidaysPage, arguments: <String, String>{
'companyId': state.companyId.value
});
}),
SizedBox(
@ -117,14 +118,14 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
visible: state.getKeyInfosData.value.isLockOwner == 1,
child: SubmitBtn(
btnName:
"${TranslationLoader.lanKeys!.delete!.tr} ${TranslationLoader.lanKeys!.company!.tr}",
'${TranslationLoader.lanKeys!.delete!.tr} ${TranslationLoader.lanKeys!.company!.tr}',
borderRadius: 20.w,
fontSize: 32.sp,
isDelete: true,
margin: EdgeInsets.only(left: 30.w, right: 30.w, top: 20.w),
padding: EdgeInsets.only(top: 20.w, bottom: 20.w),
onClick: () {
ShowTipView().showIosTipWithContentDialog("是否删除?".tr, () {
ShowTipView().showIosTipWithContentDialog('是否删除?'.tr, () {
logic.deletCompanyData();
});
// showDeletCompanyAlertDialog(context);
@ -140,12 +141,19 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
context: context,
builder: (BuildContext context) {
return ShowTFView(
title: "修改公司名字".tr,
tipTitle: "",
title: '修改公司名字'.tr,
tipTitle: '',
controller: state.changeNameController,
inputFormatters: <TextInputFormatter>[
LengthLimitingTextInputFormatter(30),
],
sureClick: () {
if(state.changeNameController.text.isEmpty){
logic.showToast("请输入公司名字".tr);
logic.showToast('请输入公司名字'.tr);
return;
}
if(state.changeNameController.text.length <6){
logic.showToast('公司名字长度不能小于 6 '.tr);
return;
}
Get.back();
@ -159,7 +167,7 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
//
Widget getTFWidget() {
state.nameController.text = state.companyName.value ?? "";
state.nameController.text = state.companyName.value ?? '';
return Container(
// color: Colors.red,
height: 65.h,
@ -168,7 +176,7 @@ class _CheckingInSetPageState extends State<CheckingInSetPage> {
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
children: <Widget>[
Expanded(
child: TextField(
//

View File

@ -6,28 +6,28 @@ import '../../../lockMian/entity/lockListInfo_entity.dart';
import 'checkingInSet_entity.dart';
class CheckingInSetState{
final getKeyInfosData = LockListInfoItemEntity().obs;
final companyId = "".obs;
CheckingInSetState() {
Map map = Get.arguments;
getKeyInfosData.value = map['getKeyInfosData'];
}
final Rx<LockListInfoItemEntity> getKeyInfosData = LockListInfoItemEntity().obs;
final RxString companyId = ''.obs;
var isCustom = false.obs;
RxBool isCustom = false.obs;
var weekDays = <int>[].obs;//
var weekDaysStr = "".obs;//
RxList<int> weekDays = <int>[].obs;//
RxString weekDaysStr = ''.obs;//
var beginTime = "".obs;//
var endTime = "".obs;//
var beginTimeTimestamp = "".obs;//
var endTimeTimestamp = "".obs;//
RxString beginTime = ''.obs;//
RxString endTime = ''.obs;//
RxString beginTimeTimestamp = ''.obs;//
RxString endTimeTimestamp = ''.obs;//
var staffNumber = "".obs;//
var companyName = "".obs;//
RxString staffNumber = ''.obs;//
RxString companyName = ''.obs;//
final TextEditingController changeNameController = TextEditingController();
final TextEditingController nameController = TextEditingController();
final checkingInSetInfo = CheckingInSetInfo().obs;
CheckingInSetState() {
Map map = Get.arguments;
getKeyInfosData.value = map["getKeyInfosData"];
}
final Rx<CheckingInSetInfo> checkingInSetInfo = CheckingInSetInfo().obs;
}

View File

@ -5,6 +5,7 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:get/get.dart';
import 'package:star_lock/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaffSelectKey_entity.dart';
import 'package:star_lock/main/lockDetail/checkingIn/checkingInStaff/checkingInSetAddStaff/checkingInAddStaff_state.dart';
import 'package:star_lock/tools/commonDataManage.dart';
import '../../../../../appRouters.dart';
import '../../../../../app_settings/app_colors.dart';
@ -45,7 +46,7 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
isHaveLine: true,
isHaveRightWidget: true,
rightWidget: getTFWidget(
"${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.name!.tr}",
'${TranslationLoader.lanKeys!.pleaseEnter!.tr}${TranslationLoader.lanKeys!.name!.tr}',
state.staffNameController)),
//
Obx(() => CommonItem(
@ -60,7 +61,10 @@ class _CheckingInAddStaffPageState extends State<CheckingInAddStaffPage> {
''.tr,
'指纹'.tr
];
if (state.getKeyInfosData.value.lockName!.contains('T9A')) {
// if (state.getKeyInfosData.value.lockName!.contains('T9A')) {
if (CommonDataManage().currentKeyInfo.lockFeature?.d3Face ==
1) {
list.add('人脸'.tr);
}
_showSelectClockInType(list, list, list, '1', '选择钥匙'.tr);

View File

@ -6,38 +6,9 @@ import '../checkingInSetStaffList/checkingInStaffList_entity.dart';
import 'checkingInAddStaffSelectKey_entity.dart';
class CheckingInAddStaffState {
final Rx<LockListInfoItemEntity> getKeyInfosData = LockListInfoItemEntity().obs;
final RxString companyId = ''.obs;
final Rx<CheckingInAddStaffListItemEntity> staffListItemData = CheckingInAddStaffListItemEntity().obs;
final TextEditingController staffNameController = TextEditingController();
final TextEditingController staffAccountController = TextEditingController();
final RxString selectPrintingMethodType = '1'.obs; // 1APP 2 3 4 5
final RxString selectPrintingMethodStr = 'APP'.obs; //
final RxString countryName = '中国'.tr.obs;
final RxString countryCode = '86'.obs;
final RxBool appUnHaveAccount = true.obs; //
final RxList<CheckingInAddStaffKeyEntity> keyEntity = <CheckingInAddStaffKeyEntity>[].obs; //
final RxString isAdd = '1'.obs; // 1 2
final RxString attendanceWayName = ''.obs;
final RxString attendanceWayNumber = ''.obs;
final RxBool isCanClick = false.obs;
RxString staffName = ''.obs;
RxString staffAccount = ''.obs;
bool get staffNameIsNotEmpty => staffName.value.isNotEmpty;
bool get staffAccountIsNotEmpty => staffAccount.value.isNotEmpty;
bool get attendanceWayNumberIsNotEmpty =>
attendanceWayNumber.value.isNotEmpty;
CheckingInAddStaffState() {
Map map = Get.arguments;
final Map<dynamic, dynamic> map = Get.arguments;
getKeyInfosData.value = map['getKeyInfosData'];
companyId.value = map['companyId'];
@ -61,6 +32,9 @@ class CheckingInAddStaffState {
case 4:
selectPrintingMethodStr.value = '指纹'.tr;
break;
case 5:
selectPrintingMethodStr.value = '人脸'.tr;
break;
}
if (staffListItemData.value.attendanceWay!.isNotEmpty) {
@ -71,4 +45,37 @@ class CheckingInAddStaffState {
}
}
}
final Rx<LockListInfoItemEntity> getKeyInfosData =
LockListInfoItemEntity().obs;
final RxString companyId = ''.obs;
final Rx<CheckingInAddStaffListItemEntity> staffListItemData =
CheckingInAddStaffListItemEntity().obs;
final TextEditingController staffNameController = TextEditingController();
final TextEditingController staffAccountController = TextEditingController();
final RxString selectPrintingMethodType =
'1'.obs; // 1APP 2 3 4 5
final RxString selectPrintingMethodStr = 'APP'.obs; //
final RxString countryName = '中国'.tr.obs;
final RxString countryCode = '86'.obs;
final RxBool appUnHaveAccount = true.obs; //
final RxList<CheckingInAddStaffKeyEntity> keyEntity =
<CheckingInAddStaffKeyEntity>[].obs; //
final RxString isAdd = '1'.obs; // 1 2
final RxString attendanceWayName = ''.obs;
final RxString attendanceWayNumber = ''.obs;
final RxBool isCanClick = false.obs;
RxString staffName = ''.obs;
RxString staffAccount = ''.obs;
bool get staffNameIsNotEmpty => staffName.value.isNotEmpty;
bool get staffAccountIsNotEmpty => staffAccount.value.isNotEmpty;
bool get attendanceWayNumberIsNotEmpty =>
attendanceWayNumber.value.isNotEmpty;
}

View File

@ -3,6 +3,20 @@ import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:star_lock/app_settings/app_colors.dart';
class CommonItem extends StatelessWidget {
CommonItem(
{required this.leftTitel,
Key? key,
this.rightTitle,
this.allHeight,
this.isHaveDirection = false,
this.isHaveLine = false,
this.isHaveRightWidget = false,
this.isPadding = true,
this.rightWidget,
this.isTipsImg,
this.action,
this.tipsImgAction})
: super(key: key);
String? leftTitel;
String? rightTitle;
bool? isHaveDirection;
@ -15,97 +29,73 @@ class CommonItem extends StatelessWidget {
bool? isTipsImg;
bool? isPadding;
CommonItem(
{Key? key,
required this.leftTitel,
this.rightTitle,
this.allHeight,
this.isHaveDirection = false,
this.isHaveLine = false,
this.isHaveRightWidget = false,
this.isPadding = true,
this.rightWidget,
this.isTipsImg,
this.action,
this.tipsImgAction})
: super(key: key);
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: action,
child: Column(
// mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
height: allHeight ?? 65.h,
color: Colors.white,
padding: isPadding == true ? EdgeInsets.only(left: 20.w, right: 10.w) : EdgeInsets.zero, // , top: 20.w, bottom: 20.w
child: Row(
children: [
// SizedBox(width: 20.w),
SizedBox(
// width: isHaveRightWidget! ? 100.w : 300.w,
child: Text(leftTitel!, style: TextStyle(fontSize: 22.sp))),
SizedBox(width: 6.w),
isTipsImg == true
? GestureDetector(
onTap: tipsImgAction,
child: Container(
width: 50.h,
height: 50.h,
padding: EdgeInsets.only(right:10.h, top: 15.h, bottom: 10.h),
child: Image.asset(
'images/icon_tips_Q.png',
width: 20.w,
height: 20.w,
),
),
)
: Container(),
Expanded(child: SizedBox(width: 10.w)),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
isHaveRightWidget!
? rightWidget!
: SizedBox(
// width: rightTitle!.isNotEmpty ? 260.w : 0.1.w,
child: Text(
rightTitle ?? "",
textAlign: TextAlign.right,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 22.sp,
color: AppColors.darkGrayTextColor),
),
),
],
),
isHaveDirection! ? SizedBox(width: 15.w) : Container(),
isHaveDirection!
? Image.asset(
'images/icon_right_grey.png',
width: 12.w,
height: 21.w,
)
: SizedBox(width: 10.w),
isHaveDirection! ? SizedBox(width: 5.w) : Container(),
],
),
),
// isHaveLine!?Container(height: 0.5.h, color: Colors.grey,):Container()
//by DaisyWu
isHaveLine!
? Divider(
color: AppColors.greyLineColor,
indent: isPadding == true ? 20.w : 0,
endIndent: isPadding == true ? 20.w : 0,
height: 1,
child: Container(
height: allHeight ?? 65.h,
padding: isPadding == true
? EdgeInsets.only(left: 20.w, right: 10.w)
: EdgeInsets.zero,
decoration: BoxDecoration(
color: Colors.white,
border: isHaveLine!
? Border(
bottom: BorderSide(
color: AppColors.greyLineColor, //
width: 2.0.h, //
),
)
: Container()
],
: null,
),
child: Row(
children: <Widget>[
Text(leftTitel!, style: TextStyle(fontSize: 22.sp)),
SizedBox(width: 6.w),
if (isTipsImg == true)
GestureDetector(
onTap: tipsImgAction,
child: Container(
width: 50.h,
height: 50.h,
padding:
EdgeInsets.only(right: 10.h, top: 15.h, bottom: 10.h),
child: Image.asset(
'images/icon_tips_Q.png',
width: 20.w,
height: 20.w,
),
),
)
else
Container(),
if (isHaveRightWidget!) ...<Widget>[
const Spacer(),
rightWidget!
] else
Expanded(
child: Text(
rightTitle ?? '',
textAlign: TextAlign.right,
overflow: TextOverflow.ellipsis,
maxLines: 2,
style: TextStyle(
fontSize: 22.sp, color: AppColors.darkGrayTextColor),
),
),
if (isHaveDirection!) SizedBox(width: 15.w) else Container(),
if (isHaveDirection!)
Image.asset(
'images/icon_right_grey.png',
width: 12.w,
height: 21.w,
)
else
SizedBox(width: 10.w),
if (isHaveDirection!) SizedBox(width: 5.w) else Container(),
],
),
),
);
}

View File

@ -65,6 +65,7 @@ class ShowTFView extends StatelessWidget {
//线
border: InputBorder.none,
),
),
)
],