Merge remote-tracking branch 'origin/main'

# Conflicts:
#	lib/pages/home/SafetyCommitment/company_safety_commitment_apply.dart
main
hs 2025-09-05 09:29:22 +08:00
commit 019fff8329
24 changed files with 464 additions and 231 deletions

View File

@ -24,7 +24,7 @@ class ApiService {
"http://192.168.20.240:8500/whb_stu_face/"; "http://192.168.20.240:8500/whb_stu_face/";
/// ///
// static const String basePath = "https://qaaqwh.qhdsafety.com/integrated_whb"; // static const String basePath = "https://qaaqwh.qhdsafety.com/integrated_whb";
static const String basePath = "http://192.168.20.240:8500/integrated_whb/"; static const String basePath = "http://192.168.20.240:8500/integrated_whb";
// static const String basePath = "http://192.168.0.37:8099/api"; // static const String basePath = "http://192.168.0.37:8099/api";

View File

@ -7,6 +7,7 @@ import 'package:qhd_prevention/customWidget/toast_util.dart';
import 'package:qhd_prevention/http/ApiService.dart'; import 'package:qhd_prevention/http/ApiService.dart';
import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart'; import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart';
import 'package:qhd_prevention/pages/my_appbar.dart'; import 'package:qhd_prevention/pages/my_appbar.dart';
import 'package:qhd_prevention/tools/tools.dart';
class PhotoItem { class PhotoItem {
final String id; final String id;
@ -40,38 +41,38 @@ class _DangerImageUpdataPageState extends State<DangerImageUpdataPage> {
// TODO: implement initState // TODO: implement initState
super.initState(); super.initState();
_imgList = widget.imgList; _imgList = widget.imgList;
_getAlreadyUpImages(); // _getAlreadyUpImages();
} }
Future<void> _getAlreadyUpImages() async { // Future<void> _getAlreadyUpImages() async {
try { // try {
final result = await ApiService.getAlreadyUpImages(widget.id); // final result = await ApiService.getAlreadyUpImages(widget.id);
if (result['result'] == 'success') { // if (result['result'] == 'success') {
final List<dynamic> newList = result['imgs'] ?? []; // final List<dynamic> newList = result['imgs'] ?? [];
setState(() { // setState(() {
for (Map item in newList) { // for (Map item in newList) {
String id = item['IMGFILES_ID'] ?? ''; // String id = item['IMGFILES_ID'] ?? '';
String filePath = item['FILEPATH'] ?? ''; // String filePath = item['FILEPATH'] ?? '';
_imgList.add( // _imgList.add(
PhotoItem( // PhotoItem(
id: id, // ID // id: id, // ID
filePath: ApiService.baseImgPath+filePath, // filePath: ApiService.baseImgPath+filePath,
type: "1", // type: "1",
), // ),
); // );
//
} // }
//
}); // });
} else { // } else {
ToastUtil.showNormal(context, "加载数据失败"); // ToastUtil.showNormal(context, "加载数据失败");
// _showMessage('加载数据失败'); // // _showMessage('加载数据失败');
} // }
} catch (e) { // } catch (e) {
// Toast // // Toast
print('加载数据失败:$e'); // print('加载数据失败:$e');
} // }
} // }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -151,6 +152,7 @@ class _DangerImageUpdataPageState extends State<DangerImageUpdataPage> {
); );
} }
Future<void> _submitAll() async { Future<void> _submitAll() async {
LoadingDialogHelper.show(message: "上传中...");
int i = 0; int i = 0;
for (PhotoItem item in _imgList) { for (PhotoItem item in _imgList) {
if (item.type == '2') { if (item.type == '2') {
@ -163,7 +165,7 @@ class _DangerImageUpdataPageState extends State<DangerImageUpdataPage> {
} }
i++; i++;
} }
LoadingDialogHelper.hide();
ToastUtil.showNormal(context, "提交成功"); ToastUtil.showNormal(context, "提交成功");
Navigator.of(context).pop(); Navigator.of(context).pop();
} }

View File

@ -560,6 +560,8 @@ class _QuickReportPageState extends State<QuickReportPage> {
}); });
}else{ }else{
LoadingDialogHelper.hide(); LoadingDialogHelper.hide();
ToastUtil.showNormal(context, "提交失败");
} }
} catch (e) { } catch (e) {
LoadingDialogHelper.hide(); LoadingDialogHelper.hide();

View File

@ -99,9 +99,9 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
listDates.addAll(newList);//"HIDDENDESCR" -> "3111111" listDates.addAll(newList);//"HIDDENDESCR" -> "3111111"
for(int i=0;i<listDates.length;i++){ for(int i=0;i<listDates.length;i++){
try{ try{
otherHidden.add(DepartmentEntry(department: listDates[i]["HIDDENDESCR"], responsible: '请选择',index:'',departmentId:listDates[i]['HIDDEN_ID'] ,responsibleId:'')); otherHidden.add(DepartmentEntry(department: listDates[i]["HIDDENDESCR"], responsible: '点击填写',index:'',departmentId:listDates[i]['HIDDEN_ID'] ,responsibleId:''));
}catch(e){ }catch(e){
otherHidden.add(DepartmentEntry(department: "", responsible: '请选择',index:'',departmentId:listDates[i]['HIDDEN_ID'],responsibleId:'')); otherHidden.add(DepartmentEntry(department: "", responsible: '点击填写',index:'',departmentId:listDates[i]['HIDDEN_ID'],responsibleId:''));
} }
} }
@ -130,9 +130,9 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
listDates.addAll(newList);//"HIDDENDESCR" -> "3111111" listDates.addAll(newList);//"HIDDENDESCR" -> "3111111"
for(int i=0;i<listDates.length;i++){ for(int i=0;i<listDates.length;i++){
try{ try{
otherHidden.add(DepartmentEntry(department: listDates[i]["HIDDENDESCR"], responsible: '请选择',index:'',departmentId:listDates[i]['HIDDEN_ID'] ,responsibleId:'')); otherHidden.add(DepartmentEntry(department: listDates[i]["HIDDENDESCR"], responsible: '点击填写',index:'',departmentId:listDates[i]['HIDDEN_ID'] ,responsibleId:''));
}catch(e){ }catch(e){
otherHidden.add(DepartmentEntry(department: "", responsible: '请选择',index:'',departmentId:listDates[i]['HIDDEN_ID'],responsibleId:'')); otherHidden.add(DepartmentEntry(department: "", responsible: '点击填写',index:'',departmentId:listDates[i]['HIDDEN_ID'],responsibleId:''));
} }
} }
@ -158,11 +158,22 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
Container( Container(
color: Colors.white, color: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 15), padding: EdgeInsets.symmetric(horizontal: 15),
child: GestureDetector(
child: ListItemFactory.createRowSpaceBetweenItem( child: ListItemFactory.createRowSpaceBetweenItem(
leftText: "日期选择", leftText: "日期选择",
rightText: dataTime.isEmpty?"请选择":dataTime, rightText: dataTime.isEmpty?"请选择":dataTime,
isRight: true, isRight: true,
), ),
onTap: () async {
DateTime? picked = await BottomDateTimePicker.showDate(context);
if (picked != null) {
setState(() {
dataTime = DateFormat('yyyy-MM-dd').format(picked);
stringTime = DateFormat('HH:mm').format(picked);
});
}
},
),
), ),
Divider(height: 1,), Divider(height: 1,),
@ -176,6 +187,7 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
DateTime? picked = await BottomDateTimePicker.showDate(context); DateTime? picked = await BottomDateTimePicker.showDate(context);
if (picked != null) { if (picked != null) {
setState(() { setState(() {
dataTime = DateFormat('yyyy-MM-dd').format(picked);
stringTime = DateFormat('HH:mm').format(picked); stringTime = DateFormat('HH:mm').format(picked);
}); });
} }
@ -559,7 +571,7 @@ class _CheckingInformationOnePageState extends State<CheckingInformationOnePage>
} }
void _addOtherHidden() { void _addOtherHidden() {
setState(() { setState(() {
otherHidden.add(DepartmentEntry(department: '请选择', responsible: '请选择',index:'',departmentId: '',responsibleId:'')); otherHidden.add(DepartmentEntry(department: '点击填写', responsible: '点击填写',index:'',departmentId: '',responsibleId:''));
}); });
} }

View File

@ -460,9 +460,9 @@ class _DangerWaitListPageState extends State<DangerWaitListPage> {
if("1"==type){ if("1"==type){
return "隐患来源:隐患快报"; return "隐患来源:隐患快报";
}else if("2"==type){ }else if("2"==type){
return "隐患来源:隐患排查清单检查"; return "隐患来源:隐患排查";
}else if("3"==type){ }else if("3"==type){
return "隐患来源:标准排查清单检查"; return "隐患来源:标准排查";
}else if("4"==type){ }else if("4"==type){
return "隐患来源:专项检查"; return "隐患来源:专项检查";
}else{ }else{

View File

@ -300,7 +300,8 @@ class DannerRepairState extends State<DannerRepair> {
Widget _acceptPrepare() { Widget _acceptPrepare() {
final fields = [ final fields = [
_buildReadOnlyRow("排查日期", widget.pd["CREATTIME"]), _buildReadOnlyRow("排查日期", widget.pd["CREATTIME"]),
_buildReadOnlyRow("隐患清单", ""), if(FormUtils.hasValue(widget.pd, "LIST_NAME"))
_buildReadOnlyRow("隐患清单", widget.pd["LIST_NAME"]),
ListItemFactory.createBuildMultilineInput("治理标准", "请输入治理标准", standardController), ListItemFactory.createBuildMultilineInput("治理标准", "请输入治理标准", standardController),
ListItemFactory.createBuildMultilineInput("治理方法", "请输入治理方法", methodController), ListItemFactory.createBuildMultilineInput("治理方法", "请输入治理方法", methodController),
ListItemFactory.createBuildMultilineInput("经费落实", "请输入经费落实", fundController), ListItemFactory.createBuildMultilineInput("经费落实", "请输入经费落实", fundController),

View File

@ -157,7 +157,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
Widget _buildInfoItem(String title, String value) { Widget _buildInfoItem(String title, String value) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 10),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -188,12 +188,17 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
minHeight: constraints.maxHeight, minHeight: constraints.maxHeight,
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
_buildInfoItem('隐患描述', pd['HIDDENDESCR'] ?? ''),
Card(
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
_buildInfoItem('隐患描述', pd['HIDDENDESCR'] ?? ''),
Divider(height: 1), Divider(height: 1),
// //
_buildInfoItem('隐患来源', _getSourceText(pd['SOURCE'])), _buildInfoItem('隐患来源', _getSourceText(pd['SOURCE'])),
@ -240,6 +245,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
ListItemFactory.createTextImageItem( ListItemFactory.createTextImageItem(
text: "隐患照片", text: "隐患照片",
imageUrls: files, imageUrls: files,
horizontalPadding:10,
onImageTapped: (index) { onImageTapped: (index) {
presentOpaque( presentOpaque(
SingleImageViewer(imageUrl:ApiService.baseImgPath + files[index]), SingleImageViewer(imageUrl:ApiService.baseImgPath + files[index]),
@ -249,10 +255,14 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
), ),
// //
if (videoList.isNotEmpty) ...[ if (videoList.isNotEmpty) ...[
const SizedBox(height: 16), SizedBox(height: 10),
const Text('隐患视频', style: TextStyle(fontWeight: FontWeight.bold)), Padding(
padding: EdgeInsets.only(left: 10,right: 10),
child: Text('隐患视频', style: TextStyle(fontWeight: FontWeight.bold)),
),
GestureDetector( GestureDetector(
onTap: () { onTap: () {
showDialog( showDialog(
@ -274,13 +284,27 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
height: 120, height: 120,
), ),
), ),
], ],
],
),
),
SizedBox(height: 10,),
// //
if (pd['STATE'] != null && int.parse(pd['STATE']) >= 2 && int.parse(pd['STATE']) <= 4) ...[ if (pd['STATE'] != null && int.parse(pd['STATE']) >= 2 && int.parse(pd['STATE']) <= 4) ...[
// const Divider(height: 10,color: Colors.grey,), // const Divider(height: 10,color: Colors.grey,),
Row( SizedBox(height: 10,),
Card(
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(top: 10,left: 10,right: 10),
child:
Row(
children: [ children: [
Container(width: 3, height: 15, color: Colors.blue), Container(width: 3, height: 15, color: Colors.blue),
const SizedBox(width: 8), const SizedBox(width: 8),
@ -290,7 +314,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
), ),
], ],
), ),
),
// const Text('整改信息', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), // const Text('整改信息', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
Divider(height: 1), Divider(height: 1),
@ -307,6 +331,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
ListItemFactory.createTextImageItem( ListItemFactory.createTextImageItem(
text: "整改后图片", text: "整改后图片",
imageUrls: files2, imageUrls: files2,
horizontalPadding: 10,
onImageTapped: (index) { onImageTapped: (index) {
presentOpaque( presentOpaque(
SingleImageViewer(imageUrl: ApiService.baseImgPath +files2[index]), SingleImageViewer(imageUrl: ApiService.baseImgPath +files2[index]),
@ -346,6 +371,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
ListItemFactory.createTextImageItem( ListItemFactory.createTextImageItem(
text: "方案图片", text: "方案图片",
imageUrls: files4, imageUrls: files4,
horizontalPadding: 10,
onImageTapped: (index) { onImageTapped: (index) {
presentOpaque( presentOpaque(
SingleImageViewer(imageUrl: ApiService.baseImgPath +files2[index]), SingleImageViewer(imageUrl: ApiService.baseImgPath +files2[index]),
@ -360,11 +386,13 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
Divider(height: 1), Divider(height: 1),
_buildInfoItem('整改计划', pd['HAVEPLAN']=="0" ? '':''), _buildInfoItem('整改计划', pd['HAVEPLAN']=="0" ? '':''),
if(pd['HAVEPLAN']=="1")
Divider(height: 1), Divider(height: 1),
if(pd['HAVEPLAN']=="1") if(pd['HAVEPLAN']=="1")
ListItemFactory.createTextImageItem( ListItemFactory.createTextImageItem(
text: "计划图片", text: "计划图片",
imageUrls: files2, imageUrls: files2,
horizontalPadding: 10,
onImageTapped: (index) { onImageTapped: (index) {
presentOpaque( presentOpaque(
SingleImageViewer(imageUrl: ApiService.baseImgPath +files2[index]), SingleImageViewer(imageUrl: ApiService.baseImgPath +files2[index]),
@ -373,7 +401,9 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
}, },
), ),
],
),
),
// //
_danner_type_wait(), _danner_type_wait(),
@ -399,7 +429,11 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
return SizedBox( return SizedBox(
child: Column( child: Column(
children: [ children: [
_getRepairState(), Card(
color:Colors.white,
child: _getRepairState(),
),
// //
// _accepted ? _getRepairState() : _noAccepet_repair(_accepted), // _accepted ? _getRepairState() : _noAccepet_repair(_accepted),
@ -427,11 +461,12 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
children: [ children: [
ListItemFactory.createBuildSimpleSection("隐患验收",horPadding:0), ListItemFactory.createBuildSimpleSection("隐患验收",horPadding:10),
Divider(height: 1), Divider(height: 1),
ListItemFactory.createYesNoSection( ListItemFactory.createYesNoSection(
horizontalPadding: 0, horizontalPadding: 0,
verticalPadding:0,
title: '是否合格', title: '是否合格',
yesLabel: '', yesLabel: '',
noLabel: '', noLabel: '',
@ -448,7 +483,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
Column(children: [ Column(children: [
Divider(), Divider(),
Container( Container(
padding: EdgeInsets.only(top: 15,bottom: 15), padding: EdgeInsets.only(top: 10,bottom: 10,left: 10,right: 10),
child: Column( child: Column(
children: [ children: [
Row( Row(
@ -481,7 +516,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
}, },
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 0), padding: EdgeInsets.symmetric(horizontal: 10),
child: ListItemFactory.createRowSpaceBetweenItem( child: ListItemFactory.createRowSpaceBetweenItem(
leftText: "验收日期", leftText: "验收日期",
rightText: dataTime.isEmpty?"请选择":dataTime, rightText: dataTime.isEmpty?"请选择":dataTime,
@ -494,6 +529,7 @@ class _HiddenDangerAcceptancePageState extends State<HiddenDangerAcceptancePage>
title: "验收照片", title: "验收照片",
maxCount: 4, maxCount: 4,
mediaType: MediaType.image, mediaType: MediaType.image,
horizontalPadding: 10,
onChanged: (files) { onChanged: (files) {
// files // files
gaiHouImages.clear(); gaiHouImages.clear();

View File

@ -98,7 +98,9 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> {
} }
} }
}); });
} }else{
getDataTwo();
}
} catch (e) { } catch (e) {
print('Error fetching data: $e'); print('Error fetching data: $e');
@ -156,7 +158,7 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> {
Widget _buildInfoItem(String title, String value) { Widget _buildInfoItem(String title, String value) {
return Padding( return Padding(
padding: const EdgeInsets.symmetric(vertical: 8), padding: const EdgeInsets.symmetric(vertical: 8,horizontal: 10),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
@ -187,105 +189,133 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> {
minHeight: constraints.maxHeight, minHeight: constraints.maxHeight,
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.all(16), padding: const EdgeInsets.all(10),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
_buildInfoItem('隐患描述', pd['HIDDENDESCR'] ?? ''),
Divider(height: 1), Card(
// color: Colors.white,
_buildInfoItem('隐患来源', _getSourceText(pd['SOURCE'])), child: Column(
Divider(height: 1), crossAxisAlignment: CrossAxisAlignment.start,
// children: [
if (pd['SOURCE'] == '2') ...[ _buildInfoItem('隐患描述', pd['HIDDENDESCR'] ?? ''),
_buildInfoItem('风险点(单元)', pd['RISK_UNIT'] ?? ''), Divider(height: 1),
Divider(height: 1), //
_buildInfoItem('辨识部位', pd['IDENTIFICATION'] ?? ''), _buildInfoItem('隐患来源', _getSourceText(pd['SOURCE'])),
Divider(height: 1), Divider(height: 1),
_buildInfoItem('存在风险', pd['RISK_DESCR'] ?? ''), //
Divider(height: 1), if (pd['SOURCE'] == '2') ...[
_buildInfoItem('风险分级', pd['LEVEL'] ?? ''), _buildInfoItem('风险点(单元)', pd['RISK_UNIT'] ?? ''),
Divider(height: 1), Divider(height: 1),
_buildInfoItem('检查内容', pd['CHECK_CONTENT'] ?? ''), _buildInfoItem('辨识部位', pd['IDENTIFICATION'] ?? ''),
Divider(height: 1), Divider(height: 1),
], _buildInfoItem('存在风险', pd['RISK_DESCR'] ?? ''),
Divider(height: 1),
_buildInfoItem('风险分级', pd['LEVEL'] ?? ''),
Divider(height: 1),
_buildInfoItem('检查内容', pd['CHECK_CONTENT'] ?? ''),
Divider(height: 1),
],
_buildInfoItem('隐患部位', pd['HIDDENPART'] ?? ''), _buildInfoItem('隐患部位', pd['HIDDENPART'] ?? ''),
Divider(height: 1), Divider(height: 1),
_buildInfoItem('发现人', pd['CREATORNAME'] ?? ''), _buildInfoItem('发现人', pd['CREATORNAME'] ?? ''),
Divider(height: 1), Divider(height: 1),
_buildInfoItem('发现时间', pd['CREATTIME'] ?? ''), _buildInfoItem('发现时间', pd['CREATTIME'] ?? ''),
Divider(height: 1), Divider(height: 1),
if (pd['HIDDEN_CATEGORY']?.isNotEmpty == true) if (pd['HIDDEN_CATEGORY']?.isNotEmpty == true)
_buildInfoItem('隐患类别', pd['HIDDEN_CATEGORY_NAME'] ?? ''), _buildInfoItem('隐患类别', pd['HIDDEN_CATEGORY_NAME'] ?? ''),
_buildInfoItem('隐患类型', pd['HIDDENTYPE_NAME'] ?? ''), _buildInfoItem('隐患类型', pd['HIDDENTYPE_NAME'] ?? ''),
Divider(height: 1), Divider(height: 1),
_buildInfoItem('整改类型', _getRectificationType(pd['RECTIFICATIONTYPE'])), _buildInfoItem('整改类型', _getRectificationType(pd['RECTIFICATIONTYPE'])),
if (pd['RECTIFICATIONTYPE'] == '2') if (pd['RECTIFICATIONTYPE'] == '2')
_buildInfoItem('整改期限', pd['RECTIFICATIONDEADLINE'] ?? ''), _buildInfoItem('整改期限', pd['RECTIFICATIONDEADLINE'] ?? ''),
Divider(height: 1), Divider(height: 1),
// //
// const Text('隐患照片', style: TextStyle(fontWeight: FontWeight.bold)), // const Text('隐患照片', style: TextStyle(fontWeight: FontWeight.bold)),
// _buildImageGrid(files, onTap: (index) => _showImageGallery(files, index)), // _buildImageGrid(files, onTap: (index) => _showImageGallery(files, index)),
ListItemFactory.createTextImageItem( ListItemFactory.createTextImageItem(
text: "隐患照片", text: "隐患照片",
imageUrls: files, imageUrls: files,
onImageTapped: (index) { horizontalPadding:10,
presentOpaque( onImageTapped: (index) {
SingleImageViewer(imageUrl:ApiService.baseImgPath + files[index]), presentOpaque(
context, SingleImageViewer(imageUrl:ApiService.baseImgPath + files[index]),
); context,
}, );
},
),
//
if (videoList.isNotEmpty) ...[
SizedBox(height: 10),
Padding(
padding: EdgeInsets.only(left: 10,right: 10),
child: Text('隐患视频', style: TextStyle(fontWeight: FontWeight.bold)),
),
GestureDetector(
onTap: () {
showDialog(
context: context,
barrierColor: Colors.black54,
builder: (_) => VideoPlayerPopup(videoUrl: ApiService.baseImgPath + videoList[0]['FILEPATH']),
);
// present(
// BigVideoViewer(videoUrl:ApiService.baseImgPath + videoList[0]['FILEPATH']),
// context,
// );
},
// => _playVideo(ApiService.baseImgPath + videoList[0]['FILEPATH']),
child: Image.asset(
'assets/image/videostart.png', //
color: Colors.blue,
width: 120,
height: 120,
),
),
],
],
),
), ),
//
if (videoList.isNotEmpty) ...[
const SizedBox(height: 16),
const Text('隐患视频', style: TextStyle(fontWeight: FontWeight.bold)),
GestureDetector(
onTap: () {
showDialog(
context: context,
barrierColor: Colors.black54,
builder: (_) => VideoPlayerPopup(videoUrl: ApiService.baseImgPath + videoList[0]['FILEPATH']),
);
// present(
// BigVideoViewer(videoUrl:ApiService.baseImgPath + videoList[0]['FILEPATH']),
// context,
// );
},
// => _playVideo(ApiService.baseImgPath + videoList[0]['FILEPATH']),
child: Image.asset(
'assets/image/videostart.png', //
color: Colors.blue,
width: 120,
height: 120,
),
),
],
SizedBox(height: 10,),
// //
if (pd['STATE'] != null && int.parse(pd['STATE']) >= 2 && int.parse(pd['STATE']) <= 4) ...[ if (pd['STATE'] != null && int.parse(pd['STATE']) >= 2 && int.parse(pd['STATE']) <= 4) ...[
SizedBox(height: 10,),
// const Divider(height: 10,color: Colors.grey,), // const Divider(height: 10,color: Colors.grey,),
Row( Card(
children: [ color: Colors.white,
Container(width: 3, height: 15, color: Colors.blue), child: Column(
const SizedBox(width: 8), crossAxisAlignment: CrossAxisAlignment.start,
Text( children: [
Padding(
padding: EdgeInsets.only(top: 10,left: 10,right: 10),
child: Row(
children: [
Container(width: 3, height: 15, color: Colors.blue),
const SizedBox(width: 8),
Text(
"整改信息", "整改信息",
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold), style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
), ),
], ],
),
), ),
// const Text('整改信息', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), // const Text('整改信息', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
Divider(height: 1), Divider(height: 1),
_buildInfoItem('整改描述', pd['RECTIFYDESCR'] ?? ''), _buildInfoItem('整改描述', pd['RECTIFYDESCR'] ?? ''),
@ -301,6 +331,7 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> {
ListItemFactory.createTextImageItem( ListItemFactory.createTextImageItem(
text: "整改后图片", text: "整改后图片",
imageUrls: files2, imageUrls: files2,
horizontalPadding: 10,
onImageTapped: (index) { onImageTapped: (index) {
presentOpaque( presentOpaque(
SingleImageViewer(imageUrl: ApiService.baseImgPath +files2[index]), SingleImageViewer(imageUrl: ApiService.baseImgPath +files2[index]),
@ -340,6 +371,7 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> {
ListItemFactory.createTextImageItem( ListItemFactory.createTextImageItem(
text: "方案图片", text: "方案图片",
imageUrls: files4, imageUrls: files4,
horizontalPadding: 10,
onImageTapped: (index) { onImageTapped: (index) {
presentOpaque( presentOpaque(
SingleImageViewer(imageUrl: ApiService.baseImgPath +files2[index]), SingleImageViewer(imageUrl: ApiService.baseImgPath +files2[index]),
@ -359,6 +391,7 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> {
ListItemFactory.createTextImageItem( ListItemFactory.createTextImageItem(
text: "计划图片", text: "计划图片",
imageUrls: files2, imageUrls: files2,
horizontalPadding: 10,
onImageTapped: (index) { onImageTapped: (index) {
presentOpaque( presentOpaque(
SingleImageViewer(imageUrl: ApiService.baseImgPath +files2[index]), SingleImageViewer(imageUrl: ApiService.baseImgPath +files2[index]),
@ -366,7 +399,9 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> {
); );
}, },
), ),
],
),
),
// ... // ...
], ],
@ -376,16 +411,26 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> {
if ((6==widget.dangerType.index||1==widget.dangerType.index||0==widget.dangerType.index)&&checkList.isNotEmpty) ...[ if ((6==widget.dangerType.index||1==widget.dangerType.index||0==widget.dangerType.index)&&checkList.isNotEmpty) ...[
// const Divider(height: 10,color: Colors.grey,), // const Divider(height: 10,color: Colors.grey,),
SizedBox(height: 10,), SizedBox(height: 10,),
Row( Card(
color: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container(width: 3, height: 15, color: Colors.blue),
const SizedBox(width: 8), Padding(
Text( padding: EdgeInsets.only(top: 10,left: 10,right: 10),
"验收信息", child:
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold), Row(
), children: [
], Container(width: 3, height: 15, color: Colors.blue),
), const SizedBox(width: 8),
Text(
"验收信息",
style: const TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
),
],
),
),
// const Text('整改信息', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)), // const Text('整改信息', style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold)),
@ -405,6 +450,7 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> {
ListItemFactory.createTextImageItem( ListItemFactory.createTextImageItem(
text: "验收图片", text: "验收图片",
imageUrls: files7, imageUrls: files7,
horizontalPadding: 10,
onImageTapped: (index) { onImageTapped: (index) {
presentOpaque( presentOpaque(
SingleImageViewer(imageUrl: ApiService.baseImgPath +files5[index]), SingleImageViewer(imageUrl: ApiService.baseImgPath +files5[index]),
@ -412,6 +458,9 @@ class _HiddenRecordDetailPageState extends State<HiddenRecordDetailPage> {
); );
}, },
), ),
],
),
),
], ],

View File

@ -159,7 +159,7 @@ class _EquipmentInspectionListPageState
return ListView.builder( return ListView.builder(
controller: _scrollController, controller: _scrollController,
itemCount: _equipList.length, itemCount: _periodList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
final period = _periodList[index]; final period = _periodList[index];
final items = groupedItems[period] ?? []; final items = groupedItems[period] ?? [];

View File

@ -86,7 +86,8 @@ class _HomeNfcDetailPageState extends State<HomeNfcDetailPage> {
); );
if (result == null) { if (result == null) {
_showMessage('请求失败:结果为 null'); ToastUtil.showNormal(context, '请求失败:结果为 null');
// _showMessage('请求失败:结果为 null');
return; return;
} }
printLongString(jsonEncode(result)); printLongString(jsonEncode(result));

View File

@ -168,12 +168,14 @@ class _NfcQuestionFecebookState extends State<NfcQuestionFecebook> {
final text = _descriptionController.text.trim(); final text = _descriptionController.text.trim();
if (text.isEmpty) { if (text.isEmpty) {
_showMessage('请填写问题'); ToastUtil.showNormal(context, '请填写问题');
// _showMessage('请填写问题');
return; return;
} }
if (_images.isEmpty) { if (_images.isEmpty) {
_showMessage('请上传图片'); ToastUtil.showNormal(context, '请上传图片');
// _showMessage('请上传图片');
return; return;
} }
Map data = { Map data = {
@ -225,9 +227,11 @@ class _NfcQuestionFecebookState extends State<NfcQuestionFecebook> {
final raw = await ApiService.nfcFeedBack(data); final raw = await ApiService.nfcFeedBack(data);
if (raw['result'] == 'success') { if (raw['result'] == 'success') {
_showMessage('提交成功'); ToastUtil.showNormal(context, '提交成功');
// _showMessage('提交成功');
} else { } else {
_showMessage('提交失败'); ToastUtil.showNormal(context, '提交失败');
// _showMessage('提交失败');
} }
} catch (e) { } catch (e) {
// Toast // Toast

View File

@ -175,7 +175,7 @@ class _RiskControlPageState extends State<RiskControlPage> {
); );
}, },
child: Container( child: Container(
height: 100,
color: Colors.white, color: Colors.white,
padding: EdgeInsets.symmetric(horizontal: 16), // padding: EdgeInsets.symmetric(horizontal: 16), //
child: Row( child: Row(
@ -197,6 +197,8 @@ class _RiskControlPageState extends State<RiskControlPage> {
Text( Text(
'风险点(单元):${item['RISKUNITNAME'] ?? ''}', '风险点(单元):${item['RISKUNITNAME'] ?? ''}',
style: TextStyle(fontSize: 14, color: Colors.grey), style: TextStyle(fontSize: 14, color: Colors.grey),
maxLines: 2,
overflow: TextOverflow.ellipsis,
), ),
SizedBox(height: 4), SizedBox(height: 4),
Text( Text(
@ -209,8 +211,10 @@ class _RiskControlPageState extends State<RiskControlPage> {
// //
Padding( Padding(
padding: EdgeInsets.only(top: 15), padding: EdgeInsets.only(top: 5,bottom: 5),
child: Column( child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
// //
Row( Row(
@ -235,7 +239,7 @@ class _RiskControlPageState extends State<RiskControlPage> {
SizedBox(height: 12), // SizedBox(height: 12), //
Row( Row(
children: [ children: [
SizedBox(width: 110),
Icon(Icons.arrow_forward_ios_rounded, size: 16), Icon(Icons.arrow_forward_ios_rounded, size: 16),
], ],
), ),

View File

@ -1,4 +1,5 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:qhd_prevention/customWidget/toast_util.dart';
import 'package:qhd_prevention/pages/my_appbar.dart'; import 'package:qhd_prevention/pages/my_appbar.dart';
import 'package:qhd_prevention/tools/coord_convert.dart'; import 'package:qhd_prevention/tools/coord_convert.dart';
import 'package:qhd_prevention/tools/tools.dart'; import 'package:qhd_prevention/tools/tools.dart';
@ -65,7 +66,7 @@ class _RiskDetailPageState extends State<RiskDetailPage> {
Future<void> _addCoordinate() async { Future<void> _addCoordinate() async {
try { try {
LoadingDialogHelper.show(message: "提交中...");
// //
await fetchAndSaveBd09(context); await fetchAndSaveBd09(context);
final prefs = await SharedPreferences.getInstance(); final prefs = await SharedPreferences.getInstance();
@ -73,16 +74,20 @@ class _RiskDetailPageState extends State<RiskDetailPage> {
String longitude = prefs.getString('bd_lon') ?? ''; String longitude = prefs.getString('bd_lon') ?? '';
final result = await ApiService.addCoordinate( widget.itemData["IDENTIFICATIONPARTS_ID"], final result = await ApiService.addCoordinate( widget.itemData["IDENTIFICATIONPARTS_ID"],
longitude,latitude); longitude,latitude);
LoadingDialogHelper.hide();
if (result['result'] == 'success') { if (result['result'] == 'success') {
setState(() { setState(() {
_showMessage('提交成功'); ToastUtil.showNormal(context, "提交成功");
// _showMessage('提交成功');
Navigator.pop(context); Navigator.pop(context);
}); });
}else{ }else{
ToastUtil.showNormal(context, "提交失败");
_showMessage('加载数据失败'); _showMessage('加载数据失败');
} }
} catch (e) { } catch (e) {
LoadingDialogHelper.hide();
// Toast // Toast
print('加载数据失败:$e'); print('加载数据失败:$e');
} }
@ -99,13 +104,13 @@ class _RiskDetailPageState extends State<RiskDetailPage> {
// //
const double bottomAreaHeight = 100; const double bottomAreaHeight = 100;
final double maxCardHeight = final double maxCardHeight =
constraints.maxHeight - bottomAreaHeight; constraints.maxHeight - bottomAreaHeight-10;
return Column( return Column(
children: [ children: [
// //
Padding( Padding(
padding: const EdgeInsets.all(15), padding: EdgeInsets.all(15),
child: ConstrainedBox( child: ConstrainedBox(
constraints: BoxConstraints(maxHeight: maxCardHeight), constraints: BoxConstraints(maxHeight: maxCardHeight),
child: Container( child: Container(
@ -118,12 +123,6 @@ class _RiskDetailPageState extends State<RiskDetailPage> {
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.stretch, crossAxisAlignment: CrossAxisAlignment.stretch,
children: [ children: [
_buildHeader(),
const Divider(
height: .5,
thickness: .5,
color: Colors.grey,
),
// Flexible SingleChildScrollView // Flexible SingleChildScrollView
Flexible( Flexible(
@ -134,6 +133,14 @@ class _RiskDetailPageState extends State<RiskDetailPage> {
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
_buildHeader(),
const Divider(
height: .5,
thickness: .5,
color: Colors.grey,
),
_itemCell("存在风险",0), _itemCell("存在风险",0),
_itemCell("主要管控措施",1), _itemCell("主要管控措施",1),
_itemCell("管控部门",2), _itemCell("管控部门",2),
@ -171,17 +178,23 @@ class _RiskDetailPageState extends State<RiskDetailPage> {
// //
Widget _buildHeader() { Widget _buildHeader() {
return Padding( return Padding(
padding: const EdgeInsets.all(15), padding: EdgeInsets.only(top:5,left: 15,right: 15,bottom: 15),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Text( Expanded(
widget.itemData['RISKUNITNAME']?? "", child: Text(
style: TextStyle(fontSize: 16, color: Colors.black54), widget.itemData['RISKUNITNAME']?? "",
style: TextStyle(fontSize: 16, color: Colors.black54),
),
), ),
Text( SizedBox(width: 15,),
widget.itemData['PARTSNAME'] ?? "未知地区", Expanded(
style: const TextStyle(fontSize: 16, color: Colors.black54), child: Text(
widget.itemData['PARTSNAME'] ?? "未知地区",
style: const TextStyle(fontSize: 16, color: Colors.black54),
),
), ),
], ],
), ),

View File

@ -82,18 +82,19 @@ class _ScanPageState extends State<ScanPage> {
} }
} else { } else {
// STUDENT_ID id // STUDENT_ID id
bool found = false; Navigator.pop(context, result);
final listId = result; // bool found = false;
for (final item in widget.totalList) { // final listId = result;
if (item['LISTMANAGER_ID'] == listId) { // for (final item in widget.totalList) {
found = true; // if (item['LISTMANAGER_ID'] == listId) {
goToList(listId: item['LISTMANAGER_ID'], listName: item['NAME']); // found = true;
break; // goToList(listId: item['LISTMANAGER_ID'], listName: item['NAME']);
} // break;
} // }
if (!found) { // }
ToastUtil.showError(context, '无法检查该清单'); // if (!found) {
} // ToastUtil.showError(context, '无法检查该清单');
// }
} }
} catch (e, st) { } catch (e, st) {
// //

View File

@ -44,7 +44,7 @@ class _DangerPageState extends State<DangerPage>
List<dynamic> allList = [];
List<dynamic> listOne = []; List<dynamic> listOne = [];
List<dynamic> listTwo = []; List<dynamic> listTwo = [];
@ -97,11 +97,11 @@ class _DangerPageState extends State<DangerPage>
listTwo.clear(); listTwo.clear();
switch(widget.type ){ switch(widget.type ){
case 1:// case 1://
appBarTitle="隐患排查清单"; appBarTitle="隐患排查";
_getHazardInvestigationList(); _getHazardInvestigationList();
break; break;
case 2:// case 2://
appBarTitle="标准排查清单"; appBarTitle="标准排查";
_getStandardInvestigationList(); _getStandardInvestigationList();
break; break;
// case 3://- // case 3://-
@ -117,6 +117,7 @@ class _DangerPageState extends State<DangerPage>
final result = await ApiService.getHazardInvestigationList(id,searchKey); final result = await ApiService.getHazardInvestigationList(id,searchKey);
if (result['result'] == 'success') { if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? []; final List<dynamic> newList = result['varList'] ?? [];
allList.addAll(newList);
setState(() { setState(() {
for(int i=0;i<newList.length;i++){ for(int i=0;i<newList.length;i++){
@ -149,6 +150,7 @@ class _DangerPageState extends State<DangerPage>
final result = await ApiService.getStandardInvestigationList(id,searchKey); final result = await ApiService.getStandardInvestigationList(id,searchKey);
if (result['result'] == 'success') { if (result['result'] == 'success') {
final List<dynamic> newList = result['varList'] ?? []; final List<dynamic> newList = result['varList'] ?? [];
allList.addAll(newList);
setState(() { setState(() {
for(int i=0;i<newList.length;i++){ for(int i=0;i<newList.length;i++){
@ -230,7 +232,7 @@ class _DangerPageState extends State<DangerPage>
Widget build(BuildContext context) { Widget build(BuildContext context) {
return Scaffold( return Scaffold(
appBar: MyAppbar( appBar: MyAppbar(
title: "隐患排查", title: appBarTitle,
actions: [ actions: [
TextButton( TextButton(
onPressed: () { onPressed: () {
@ -427,12 +429,12 @@ class _DangerPageState extends State<DangerPage>
Future<void> _goScan() async { Future<void> _goScan() async {
final result = await Navigator.push( final result = await Navigator.push(
context, context,
MaterialPageRoute(builder: (_) => ScanPage(totalList: [])), MaterialPageRoute(builder: (_) => ScanPage(totalList: allList)),
); );
dynamic item; dynamic item;
for(int i=0;i<listDates.length;i++){ for(int i=0;i<allList.length;i++){
final listItem= listDates[i]; final listItem= allList[i];
String code=""; String code="";
switch(widget.type ){ switch(widget.type ){
case 1:// case 1://
@ -446,8 +448,11 @@ class _DangerPageState extends State<DangerPage>
item=listItem; item=listItem;
} }
} }
if(item!=null) {
_handleItemTap(item,0); _handleItemTap(item, 0);
}else{
ToastUtil.showNormal(context, "无法检查该清单");
}
} }

View File

@ -1,9 +1,13 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:open_file/open_file.dart';
import 'dart:convert'; import 'dart:convert';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:qhd_prevention/customWidget/toast_util.dart';
import 'package:qhd_prevention/pages/home/work/read_file_page.dart'; import 'package:qhd_prevention/pages/home/work/read_file_page.dart';
import 'package:qhd_prevention/pages/home/work/risk_list_picker.dart'; import 'package:qhd_prevention/pages/home/work/risk_list_picker.dart';
import 'package:qhd_prevention/pages/my_appbar.dart'; import 'package:qhd_prevention/pages/my_appbar.dart';
@ -78,6 +82,34 @@ class _LawsRegulationsPage extends State<LawsRegulationsPage> {
); );
} }
Future<void> _downloadAndLoad(String url) async {
try {
final filename = url.split('/').last;
final dir = await getTemporaryDirectory();
final filePath = '${dir.path}/$filename';
final dio = Dio();
final response = await dio.get<List<int>>(
url,
options: Options(responseType: ResponseType.bytes),
);
final file = File(filePath);
await file.writeAsBytes(response.data!);
final result = await OpenFile.open(filePath);
if (result.type != ResultType.done) {
ToastUtil.showNormal(context, "文件加载失败");
}
} catch (e) {
//
ToastUtil.showNormal(context, "文件加载失败");
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text('文件加载失败: \$e')),
// );
}
}
Future<void> _downloadFile(String filePath) async { Future<void> _downloadFile(String filePath) async {
// //
try { try {
@ -94,13 +126,13 @@ class _LawsRegulationsPage extends State<LawsRegulationsPage> {
// //
try { try {
final url =ApiService.baseImgPath + file["FILEPATH"]; final url =ApiService.baseImgPath + file["FILEPATH"];
_downloadAndLoad(url);
pushPage( // pushPage(
ReadFilePage( // ReadFilePage(
fileUrl: url, // fileUrl: url,
), // ),
context, // context,
); // );
} catch (e) { } catch (e) {
print(e.toString()); print(e.toString());
} }

View File

@ -1,9 +1,13 @@
import 'dart:io';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:open_file/open_file.dart';
import 'dart:convert'; import 'dart:convert';
import 'package:path_provider/path_provider.dart'; import 'package:path_provider/path_provider.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:dio/dio.dart'; import 'package:dio/dio.dart';
import 'package:qhd_prevention/customWidget/toast_util.dart';
import 'package:qhd_prevention/pages/home/work/read_file_page.dart'; import 'package:qhd_prevention/pages/home/work/read_file_page.dart';
import 'package:qhd_prevention/pages/home/work/risk_list_picker.dart'; import 'package:qhd_prevention/pages/home/work/risk_list_picker.dart';
import 'package:qhd_prevention/pages/my_appbar.dart'; import 'package:qhd_prevention/pages/my_appbar.dart';
@ -57,7 +61,33 @@ class _LawsRegulationsTwoPage extends State<LawsRegulationsTwoPage> {
} }
} }
Future<void> _downloadAndLoad(String url) async {
try {
final filename = url.split('/').last;
final dir = await getTemporaryDirectory();
final filePath = '${dir.path}/$filename';
final dio = Dio();
final response = await dio.get<List<int>>(
url,
options: Options(responseType: ResponseType.bytes),
);
final file = File(filePath);
await file.writeAsBytes(response.data!);
final result = await OpenFile.open(filePath);
if (result.type != ResultType.done) {
ToastUtil.showNormal(context, "文件加载失败");
}
} catch (e) {
//
ToastUtil.showNormal(context, "文件加载失败");
// ScaffoldMessenger.of(context).showSnackBar(
// SnackBar(content: Text('文件加载失败: \$e')),
// );
}
}
@ -78,12 +108,13 @@ class _LawsRegulationsTwoPage extends State<LawsRegulationsTwoPage> {
try { try {
final url =ApiService.baseImgPath + file["FILEPATH"]; final url =ApiService.baseImgPath + file["FILEPATH"];
pushPage( _downloadAndLoad(url);
ReadFilePage( // pushPage(
fileUrl: url, // ReadFilePage(
), // fileUrl: url,
context, // ),
); // context,
// );
} catch (e) { } catch (e) {
print(e.toString()); print(e.toString());
} }

View File

@ -1,6 +1,7 @@
import 'dart:math'; import 'dart:math';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:qhd_prevention/customWidget/toast_util.dart';
import 'package:qhd_prevention/pages/home/work_alert.dart'; import 'package:qhd_prevention/pages/home/work_alert.dart';
import 'package:qhd_prevention/pages/my_appbar.dart'; import 'package:qhd_prevention/pages/my_appbar.dart';
import 'package:qhd_prevention/tools/tools.dart'; import 'package:qhd_prevention/tools/tools.dart';
@ -103,7 +104,8 @@ class _WorkSetPageState extends State<WorkSetPage> {
final result = await ApiService.addRiCheng(data,title,content,id,urlPath); final result = await ApiService.addRiCheng(data,title,content,id,urlPath);
if (result['result'] == 'success') { if (result['result'] == 'success') {
setState(() { setState(() {
_showMessage('保存成功'); ToastUtil.showNormal(context, '保存成功');
// _showMessage('保存成功');
String data= DateFormat('yyyy-MM-dd').format(_selectedDay); String data= DateFormat('yyyy-MM-dd').format(_selectedDay);
_getRiCheng(data,false); _getRiCheng(data,false);
}); });

View File

@ -39,6 +39,8 @@ class _MineDutyApplicationPage extends State<MineDutyApplicationPage> {
ToastUtil.showSuccess(context, '提交成功'); ToastUtil.showSuccess(context, '提交成功');
widget.onClose('关闭提交'); // widget.onClose('关闭提交'); //
Navigator.pop(context); // Navigator.pop(context); //
}else{
ToastUtil.showSuccess(context, '提交失败');
} }
} catch (e) { } catch (e) {
print('加载出错: $e'); print('加载出错: $e');

View File

@ -1,6 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:image_picker/image_picker.dart'; import 'package:image_picker/image_picker.dart';
import 'package:qhd_prevention/customWidget/toast_util.dart';
import 'dart:io'; import 'dart:io';
import '../../../../../customWidget/photo_picker_row.dart'; import '../../../../../customWidget/photo_picker_row.dart';
import 'package:qhd_prevention/pages/my_appbar.dart'; import 'package:qhd_prevention/pages/my_appbar.dart';
@ -296,17 +297,20 @@ class _FeedbackPageState extends State<FeedbackPage> {
final text = _descriptionController.text.trim(); final text = _descriptionController.text.trim();
if (title.isEmpty ) { if (title.isEmpty ) {
_showMessage('请填写标题'); ToastUtil.showNormal(context, '请填写标题');
// _showMessage('请填写标题');
return; return;
} }
if (text.isEmpty ) { if (text.isEmpty ) {
_showMessage('请填写问题和意见'); ToastUtil.showNormal(context, '请填写问题和意见');
// _showMessage('请填写问题和意见');
return; return;
} }
if (_images.isEmpty) { if (_images.isEmpty) {
_showMessage('请上传隐患图片'); ToastUtil.showNormal(context, '请上传相关图片');
// _showMessage('请上传隐患图片');
return; return;
} }
@ -373,11 +377,13 @@ class _FeedbackPageState extends State<FeedbackPage> {
final raw = await ApiService.setFeedBack(title,text,num,imagePaths); final raw = await ApiService.setFeedBack(title,text,num,imagePaths);
if (raw['result'] == 'success') { if (raw['result'] == 'success') {
ToastUtil.showNormal(context, '反馈提交成功');
Navigator.pop(context); // Navigator.pop(context); //
_showMessage('反馈提交成功'); // _showMessage('反馈提交成功');
}else{ }else{
_showMessage('反馈提交失败'); ToastUtil.showNormal(context, '反馈提交失败');
// _showMessage('反馈提交失败');
} }
} catch (e) { } catch (e) {

View File

@ -120,8 +120,9 @@ class _MinePageState extends State<MinePage> {
GestureDetector( GestureDetector(
child: _setItemWidget("离岗"), child: _setItemWidget("离岗"),
onTap: () async { onTap: () async {
LoadingDialogHelper.show();
bool isRest= await _getIsRest(); bool isRest= await _getIsRest();
LoadingDialogHelper.hide();
if(isRest){ if(isRest){
ToastUtil.showNormal(context, "您已经处于离岗状态中"); ToastUtil.showNormal(context, "您已经处于离岗状态中");
return; return;

View File

@ -2,6 +2,7 @@ import 'dart:convert';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:qhd_prevention/customWidget/custom_button.dart'; import 'package:qhd_prevention/customWidget/custom_button.dart';
import 'package:qhd_prevention/customWidget/toast_util.dart';
import 'package:qhd_prevention/pages/my_appbar.dart'; import 'package:qhd_prevention/pages/my_appbar.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -36,25 +37,47 @@ class _MineSetPwdPageState extends State<MineSetPwdPage> {
final newPwd = _newPwdController.text.trim(); final newPwd = _newPwdController.text.trim();
final confirmPwd = _confirmPwdController.text.trim(); final confirmPwd = _confirmPwdController.text.trim();
if (oldPwd.isEmpty || newPwd.isEmpty || confirmPwd.isEmpty) { if (oldPwd.isEmpty) {
_showMessage('请填写完整所有字段'); ToastUtil.showNormal(context, '请填写旧密码');
// _showMessage('请填写旧密码');
return; return;
} }
if (newPwd.isEmpty) {
ToastUtil.showNormal(context, '请填写新密码');
// _showMessage('请填写新密码');
return;
}
if (confirmPwd.isEmpty) {
ToastUtil.showNormal(context, '请填写确认新密码');
// _showMessage('请填写确认新密码');
return;
}
// if (oldPwd.isEmpty || newPwd.isEmpty || confirmPwd.isEmpty) {
// _showMessage('请填写完整所有字段');
// return;
// }
if (newPwd != confirmPwd) { if (newPwd != confirmPwd) {
_showMessage('新密码与确认密码不一致'); ToastUtil.showNormal(context, '新密码与确认密码不一致');
// _showMessage('新密码与确认密码不一致');
return; return;
} }
final RegExp regex = RegExp(r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,18}$'); final RegExp regex = RegExp(r'^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)[a-zA-Z\d]{6,18}$');
if (regex.hasMatch(newPwd)) { if (regex.hasMatch(newPwd)) {
_showMessage('密码长度为6-18位必须包含大小字母小写字母数字和特殊符号。'); ToastUtil.showNormal(context, '密码长度为6-18位必须包含大小字母小写字母数字和特殊符号。');
// _showMessage('密码长度为6-18位必须包含大小字母小写字母数字和特殊符号。');
return; return;
} }
// //
if (newPwd.length < 8 || newPwd.length > 18) { if (newPwd.length < 8 || newPwd.length > 18) {
_showMessage('密码长度需在8-18位之间'); ToastUtil.showNormal(context, '密码长度需在8-18位之间');
// _showMessage('密码长度需在8-18位之间');
return; return;
} }
@ -138,7 +161,8 @@ class _MineSetPwdPageState extends State<MineSetPwdPage> {
// final hidCount = raw['hidCount'] as Map<String, dynamic>; // final hidCount = raw['hidCount'] as Map<String, dynamic>;
// print(hidCount); // print(hidCount);
if (raw['result'] == 'success') { if (raw['result'] == 'success') {
_showMessage('密码修改成功'); // ToastUtil.showNormal(context, '密码修改成功');
// _showMessage('密码修改成功'); //
Navigator.pop(context,true); Navigator.pop(context,true);
// //
@ -151,13 +175,15 @@ class _MineSetPwdPageState extends State<MineSetPwdPage> {
); );
}else{ }else{
_showMessage('密码修改失败'); ToastUtil.showNormal(context, '密码修改失败');
// _showMessage('密码修改失败');
} }
} catch (e) { } catch (e) {
// Toast // Toast
print('加载首页数据失败:$e'); print('加载首页数据失败:$e');
_showMessage('密码修改失败'); ToastUtil.showNormal(context, '密码修改失败');
// _showMessage('密码修改失败');
} }
} }

View File

@ -22,6 +22,7 @@ class _NotifPageState extends State<NotifPage>
late TabController _tabController; late TabController _tabController;
int _selectedTab = 0; int _selectedTab = 0;
int pageNum = 1; int pageNum = 1;
String keyWord="";
// //
final List<Map<String, dynamic>> _notifications = List.generate(10, (i) { final List<Map<String, dynamic>> _notifications = List.generate(10, (i) {
@ -45,25 +46,26 @@ class _NotifPageState extends State<NotifPage>
if (_tabController.indexIsChanging) { if (_tabController.indexIsChanging) {
setState(() => _selectedTab = _tabController.index); setState(() => _selectedTab = _tabController.index);
print('切换到标签:${_tabController.index}'); print('切换到标签:${_tabController.index}');
searchController.text = "";
keyWord="";
reRefreshData(); reRefreshData();
} }
}); });
_getNotifList(""); _getNotifList();
} }
void reRefreshData() { void reRefreshData() {
pageNum = 1; pageNum = 1;
_list.clear(); _list.clear();
searchController.text = "";
if (0 == _selectedTab) { if (0 == _selectedTab) {
_getNotifList(""); _getNotifList();
} else { } else {
_getNotifEnterprise(""); _getNotifEnterprise();
} }
} }
Future<void> _getNotifList(String keyWord) async { Future<void> _getNotifList() async {
LoadingDialogHelper.show(); LoadingDialogHelper.show();
try { try {
final result = await ApiService.getNotifList( final result = await ApiService.getNotifList(
@ -87,7 +89,7 @@ class _NotifPageState extends State<NotifPage>
} }
} }
Future<void> _getNotifEnterprise(String keyWord) async { Future<void> _getNotifEnterprise() async {
// LoadingDialogHelper.show(); // LoadingDialogHelper.show();
try { try {
final result = await ApiService.getNotifEnterprise( final result = await ApiService.getNotifEnterprise(
@ -166,10 +168,11 @@ class _NotifPageState extends State<NotifPage>
// String word="整改"; // String word="整改";
pageNum = 1; pageNum = 1;
_list.clear(); _list.clear();
keyWord=keyword;
if (0 == _selectedTab) { if (0 == _selectedTab) {
_getNotifList(keyword); _getNotifList();
} else { } else {
_getNotifEnterprise(keyword); _getNotifEnterprise();
} }
}, },
), ),

View File

@ -114,7 +114,7 @@ dependencies:
video_compress: ^3.1.4 video_compress: ^3.1.4
#息屏处理 #息屏处理
wakelock_plus: ^1.3.2 wakelock_plus: ^1.3.2
open_file: ^3.2.1
dev_dependencies: dev_dependencies: