2025.9.8 修改bug

main
xufei 2025-09-08 15:11:24 +08:00
parent 8c5ea8e660
commit 41c514cdc4
7 changed files with 42 additions and 17 deletions

View File

@ -48,7 +48,7 @@ class _ImmediatelyInspectionState extends State<ImmediatelyInspection> {
ItemListWidget.singleLineTitleText(
label: '巡检人:',
isEditable: true,
isRequired: false,
isRequired: true,
controller: _xunController,
hintText: '请输入巡检人',
text: '',
@ -61,7 +61,7 @@ class _ImmediatelyInspectionState extends State<ImmediatelyInspection> {
label: '巡检日期',
text: dataTime.isEmpty ? '请选择' : dataTime ?? '',
isEditable: true,
isRequired: false,
isRequired: true,
horizontalnum: 0,
),
onTap: () async {
@ -100,7 +100,7 @@ class _ImmediatelyInspectionState extends State<ImmediatelyInspection> {
child: ItemListWidget.multiLineTitleTextField(
label: '巡检内容:',
isEditable: true,
isRequired: false,
isRequired: true,
controller: _neiRongController,
hintText: "(必填)",
text: '',
@ -123,6 +123,7 @@ class _ImmediatelyInspectionState extends State<ImmediatelyInspection> {
// SizedBox(height: 15,),
if (_isFault)
RepairedPhotoSection(
isRequired: true,
horizontalPadding: 15,
title: "故障照片",
maxCount: 4,
@ -140,6 +141,7 @@ class _ImmediatelyInspectionState extends State<ImmediatelyInspection> {
SizedBox(height: _isFault ? 15 : 0),
if (_isFault)
RepairedPhotoSection(
isRequired: true,
horizontalPadding: 15,
title: "故障处理后照片",
maxCount: 4,
@ -156,6 +158,7 @@ class _ImmediatelyInspectionState extends State<ImmediatelyInspection> {
SizedBox(height: _isFault ? 15 : 0),
RepairedPhotoSection(
isRequired: true,
horizontalPadding: 15,
title: "巡检照片",
maxCount: 4,

View File

@ -419,7 +419,7 @@ class _SafecheckSignListPageState extends State<SafecheckSignListPage> {
flex: 2,
child: SearchBarWidget(
showResetButton: false,
hintText: "输入关键字",
hintText: "输入被检查单位部门关键字",
// isClickableOnly: true,
onSearch: (text) {
_search();

View File

@ -418,7 +418,7 @@ class _CheckPersonListPageState extends State<CheckPersonListPage> {
flex: 2,
child: SearchBarWidget(
showResetButton: false,
hintText: "输入关键字",
hintText: "输入被检查单位部门关键字",
// isClickableOnly: true,
onSearch: (text) {
_search();

View File

@ -452,7 +452,7 @@ class _SafecheckDangerListPageState extends State<SafecheckDangerListPage> {
flex: 2,
child: SearchBarWidget(
showResetButton: false,
hintText: "输入关键字",
hintText: "输入被检查单位部门关键字",
// isClickableOnly: true,
onSearch: (text) {
_search();

View File

@ -426,7 +426,7 @@ class _DefendRecordListPageState extends State<DefendRecordListPage> {
flex: 2,
child: SearchBarWidget(
showResetButton: false,
hintText: "输入关键字",
hintText: "输入被检查单位部门关键字",
// isClickableOnly: true,
onSearch: (text) {
_search();

View File

@ -75,7 +75,7 @@ class _SafecheckStartDetailState extends State<SafecheckStartDetail> {
{'name': 'INSPECTED_DEPARTMENT_ID', 'message': '请选择被检查单位'},
{'name': 'INSPECTED_SITEUSER_ID', 'message': '请选择被检查单位现场负责人'},
{'name': 'INSPECTION_PLACE', 'message': '请输入检查场所'},
{'name': 'INSPECTION_TYPE', 'message': '请选择检查类型不能为空'},
{'name': 'INSPECTION_TYPE', 'message': '请选择检查类型'},
{'name': 'INSPECTION_TIME_START', 'message': '请选择检查开始时间'},
{'name': 'INSPECTION_TIME_END', 'message': '请选择作业结束时间'},
];
@ -335,6 +335,7 @@ class _SafecheckStartDetailState extends State<SafecheckStartDetail> {
}
// rules
bool isRulesTrue=true;
for (final r in rules) {
final name = r['name'] ?? '';
final message = r['message'] ?? '请完善表单';
@ -342,9 +343,15 @@ class _SafecheckStartDetailState extends State<SafecheckStartDetail> {
if (v == null || v.toString().isEmpty || v.toString() == '请选择') {
LoadingDialogHelper.hide();
ToastUtil.showNormal(context, message);
isRulesTrue=false;
break;
}
}
if(!isRulesTrue){
return;
}
// situationList SITUATION
final situations = (form['situationList'] as List<dynamic>?) ?? [];
for (var i = 0; i < situations.length; i++) {

View File

@ -67,27 +67,39 @@ class _MineSetPwdPageState extends State<MineSetPwdPage> {
return;
}
final RegExp regex = RegExp(r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,18}$');
if (regex.hasMatch(newPwd)) {
ToastUtil.showNormal(context, '密码长度为6-18位必须包含大小字母小写字母数字和特殊符号。');
// _showMessage('密码长度为6-18位必须包含大小字母小写字母数字和特殊符号。');
return;
}
//
if (newPwd.length < 8 || newPwd.length > 18) {
ToastUtil.showNormal(context, '密码长度需在8-18位之间');
ToastUtil.showNormal(context, '新密码长度需在8-18位之间');
// _showMessage('密码长度需在8-18位之间');
return;
}
// final RegExp regex = RegExp(r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,18}$');
if (!isPasswordValid(newPwd)) {
ToastUtil.showNormal(context, '必须包含大小字母,小写字母数字和特殊符号。');
// _showMessage('密码长度为6-18位必须包含大小字母小写字母数字和特殊符号。');
return;
}
_changePass(oldPwd,newPwd);
}
bool isPasswordValid(String password) {
//
final hasUpperCase = RegExp(r'[A-Z]');
final hasLowerCase = RegExp(r'[a-z]');
final hasNumber = RegExp(r'[0-9]');
final hasSpecialChar = RegExp(r'[!@#$%^&*(),.?":{}|<>]'); //
//
return hasUpperCase.hasMatch(password) &&
hasLowerCase.hasMatch(password) &&
hasNumber.hasMatch(password) &&
hasSpecialChar.hasMatch(password);
}
void _showMessage(String msg) {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text(msg)));
}
@ -174,6 +186,9 @@ class _MineSetPwdPageState extends State<MineSetPwdPage> {
(Route<dynamic> route) => false, //
);
}else if (raw['result'] == 'usererror'){
ToastUtil.showNormal(context, '旧密码输入错误');
// _showMessage('密码修改失败');
}else{
ToastUtil.showNormal(context, '密码修改失败');
// _showMessage('密码修改失败');