diff --git a/lib/customWidget/ItemWidgetFactory.dart b/lib/customWidget/ItemWidgetFactory.dart index 72fb021..7cf4881 100644 --- a/lib/customWidget/ItemWidgetFactory.dart +++ b/lib/customWidget/ItemWidgetFactory.dart @@ -23,8 +23,10 @@ class ListItemFactory { ), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisSize: MainAxisSize.max, children: [ Row( + mainAxisSize: MainAxisSize.min, children: [ if (isRequired) Text('* ', style: TextStyle(color: Colors.red)), Text( @@ -39,16 +41,18 @@ class ListItemFactory { ), if (isRight) Row( - mainAxisAlignment: MainAxisAlignment.center, + mainAxisSize: MainAxisSize.min, children: [ - Expanded(child: Text( - rightText, - // rightText, - style: TextStyle(fontSize: 15, color: Colors.grey), - maxLines: 1, - overflow: TextOverflow.ellipsis, - ),), - SizedBox(width: 2), + Flexible( + fit: FlexFit.loose, + child: Text( + rightText, + style: TextStyle(fontSize: 15, color: Colors.grey), + maxLines: 1, + overflow: TextOverflow.ellipsis, + ), + ), + SizedBox(width: 6), Icon( Icons.arrow_forward_ios_rounded, color: Colors.black45, @@ -57,8 +61,16 @@ class ListItemFactory { ], ) else - Expanded(child: Text(rightText, style: TextStyle(fontSize: 15, color: Colors.grey,),maxLines: 1, - overflow: TextOverflow.ellipsis, textAlign: TextAlign.right,)), + Flexible( + fit: FlexFit.loose, + child: Text( + rightText, + style: TextStyle(fontSize: 15, color: Colors.grey), + maxLines: 1, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.right, + ), + ), ], ), ); @@ -196,25 +208,26 @@ class ListItemFactory { ), ), const SizedBox(height: 10), - videoUrl.isNotEmpty ? - GestureDetector( - onTap: onVideoTapped, - child: Container( - height: videoHeight, - width: videoHeight * 3 / 2, - decoration: BoxDecoration( - color: Colors.grey[300], - borderRadius: BorderRadius.circular(4), - ), - child: const Center( - child: Icon( - Icons.play_circle_outline, - size: 40, - color: Colors.white, + videoUrl.isNotEmpty + ? GestureDetector( + onTap: onVideoTapped, + child: Container( + height: videoHeight, + width: videoHeight * 3 / 2, + decoration: BoxDecoration( + color: Colors.grey[300], + borderRadius: BorderRadius.circular(4), + ), + child: const Center( + child: Icon( + Icons.play_circle_outline, + size: 40, + color: Colors.white, + ), + ), ), - ), - ), - ) : SizedBox(height: 10,) + ) + : SizedBox(height: 10), ], ), ); @@ -258,7 +271,6 @@ class ListItemFactory { bool isEdit = true, String text = '', bool isRequired = false, - }) { return Padding( padding: EdgeInsets.only( @@ -278,15 +290,18 @@ class ListItemFactory { Expanded( child: Row( children: [ - if (isRequired && isEdit) Text('* ', style: TextStyle(color: Colors.red)), - Text( - title, - style: TextStyle( - fontSize: 15, - fontWeight: FontWeight.bold, - color: Colors.black, + if (isRequired && isEdit) + Text('* ', style: TextStyle(color: Colors.red)), + Expanded( + child: Text( + title, + style: TextStyle( + fontSize: 15, + fontWeight: FontWeight.bold, + color: Colors.black, + ), ), - ) + ), ], ), ), @@ -318,8 +333,7 @@ class ListItemFactory { ), ], ), - if (!isEdit) - Text(text, style: TextStyle(),) + if (!isEdit) Text(text, style: TextStyle()), ], ), ), @@ -330,10 +344,11 @@ class ListItemFactory { static Widget createBuildSimpleSection( String title, { double horPadding = 10, + Color color = Colors.white, }) { return Container( decoration: BoxDecoration( - color: Colors.white, + color: color, borderRadius: BorderRadius.circular(8), ), child: Padding( @@ -352,6 +367,45 @@ class ListItemFactory { ); } + /// 列表标题头(蓝色圆点+文字) + static Widget createBlueDotSection( + String title, + {double horPadding = 10, + int color=0xFFf1f1f1}) { + return Container( + decoration: BoxDecoration( + color: Color(color), + borderRadius: BorderRadius.circular(8), + ), + child: Padding( + padding: EdgeInsets.symmetric(horizontal: horPadding, vertical: 10), + child: Row( + children: [ + Container( + width: 7, + height: 7, + decoration: BoxDecoration( + color: Colors.blue, + borderRadius: BorderRadius.circular(180), + ), + ), + const SizedBox(width: 8), + Expanded( + // 添加 Expanded + child: Text( + title, + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + ), + ), + ), + ], + ), + ), + ); + } + /// 单纯标题 static Widget headerTitle(String title, {bool isRequired = false}) { return Container( @@ -403,7 +457,9 @@ class ListItemFactory { children: [ if (isRequired) Text('* ', style: TextStyle(color: Colors.red)), // 标题 - HhTextStyleUtils.mainTitle(label, fontSize: 15), + Expanded( + child:HhTextStyleUtils.mainTitle(label, fontSize: 15), + ), ], ), diff --git a/lib/http/ApiService.dart b/lib/http/ApiService.dart index 45cdd41..356d607 100644 --- a/lib/http/ApiService.dart +++ b/lib/http/ApiService.dart @@ -54,6 +54,7 @@ class ApiService { // static const String projectManagerUrl = // 'https://pm.qhdsafety.com/zy-projectManage'; + /// RSA 公钥 static const publicKey = ''' -----BEGIN PUBLIC KEY----- @@ -64,6 +65,9 @@ U6Hzm1ninpWeE+awIDAQAB -----END PUBLIC KEY----- '''; + + + /// 登录验证接口 static Future> loginCheck(String keydataVal) { return HttpManager().request( @@ -105,7 +109,6 @@ U6Hzm1ninpWeE+awIDAQAB data: {'USER_ID': SessionService.instance.loginUserId}, ); } - /// 通知红点数量 static Future> getNotifRedPoint() { return HttpManager().request( @@ -135,7 +138,6 @@ U6Hzm1ninpWeE+awIDAQAB }, ); } - /// 排查数据(部门) static Future> getDeptData() { return HttpManager().request( @@ -152,7 +154,6 @@ U6Hzm1ninpWeE+awIDAQAB }, ); } - /// 排查数据(监管) static Future> getSuperviseDeptData() { return HttpManager().request( @@ -169,7 +170,6 @@ U6Hzm1ninpWeE+awIDAQAB }, ); } - /// 安全检查 static Future> getSafetyEnvironmentalInspectionCount() { return HttpManager().request( @@ -233,7 +233,6 @@ U6Hzm1ninpWeE+awIDAQAB }, ); } - /// 获取清单数量 static Future> getListData() { return HttpManager().request( @@ -250,7 +249,6 @@ U6Hzm1ninpWeE+awIDAQAB }, ); } - /// 获取滚动隐患 static Future> getHiddenRoll() { return HttpManager().request( @@ -275,8 +273,7 @@ U6Hzm1ninpWeE+awIDAQAB }, ); } - - /// TODO -------------–-------------------- 首页学习园地 -------------–-------------------- +/// TODO -------------–-------------------- 首页学习园地 -------------–-------------------- /// 我的任务列表 static Future> getStudyList(int page) { return HttpManager().request( @@ -286,17 +283,13 @@ U6Hzm1ninpWeE+awIDAQAB data: { 'CORPINFO_ID': SessionService.instance.corpinfoId, 'USER_ID': SessionService.instance.loginUserId, - 'showCount': 10, - 'currentPage': page, + 'showCount':10, + 'currentPage':page }, ); } - /// 课程列表 - static Future> getClassList( - String classId, - String POST_ID, - ) { + static Future> getClassList(String classId, String POST_ID) { return HttpManager().request( basePath, '/app/edu/stagestudentrelation/getClassCurriculum', @@ -304,49 +297,33 @@ U6Hzm1ninpWeE+awIDAQAB data: { 'CORPINFO_ID': SessionService.instance.corpinfoId, 'USER_ID': SessionService.instance.loginUserId, - 'showCount': 9999, - 'currentPage': 1, - 'CLASS_ID': classId, - 'POST_ID': POST_ID, + 'showCount':9999, + 'currentPage':1, + 'CLASS_ID' : classId, + 'POST_ID' : POST_ID }, ); } - /// 学习详情视频列表 - static Future> getStudyDetailList( - String CLASS_ID, - String CLASSCURRICULUM_ID, - String STUDENT_ID, - ) { - print( - CLASS_ID + - '---' + - CLASSCURRICULUM_ID + - '---' + - STUDENT_ID + - '---' + - SessionService.instance.corpinfoId! + - '---' + - SessionService.instance.loginUserId!, - ); + static Future> getStudyDetailList(String CLASS_ID, String CLASSCURRICULUM_ID, String STUDENT_ID) { + print(CLASS_ID + '---' + CLASSCURRICULUM_ID + '---' + STUDENT_ID+ '---' + SessionService.instance.corpinfoId! + '---' + SessionService.instance.loginUserId!); return HttpManager().request( basePath, '/app/edu/stagestudentrelation/getMyTask', method: Method.post, data: { 'CLASSCURRICULUM_ID': CLASSCURRICULUM_ID, - 'CLASS_ID': CLASS_ID, - 'STUDENT_ID': STUDENT_ID, + 'CLASS_ID' : CLASS_ID, + 'STUDENT_ID':STUDENT_ID, 'CORPINFO_ID': SessionService.instance.corpinfoId, 'USER_ID': SessionService.instance.loginUserId, + }, ); } /// 获取视频信息 - static Future> fnGetVideoPlayInfo( - String VIDEOCOURSEWARE_ID, - ) { + static Future> fnGetVideoPlayInfo(String VIDEOCOURSEWARE_ID) { return HttpManager().request( basePath, '/app/edu/audioOrVideo/getVideoPlayInfoApp', @@ -355,38 +332,38 @@ U6Hzm1ninpWeE+awIDAQAB 'VIDEOCOURSEWARE_ID': VIDEOCOURSEWARE_ID, 'CORPINFO_ID': SessionService.instance.corpinfoId, 'USER_ID': SessionService.instance.loginUserId, + }, ); } - static Future> fnSetUserFaceTime(int FACE_TIME) { return HttpManager().request( baseFacePath, '/app/user/setUserFaceTime', method: Method.post, data: { - 'loading': false, + 'loading':false, 'FACE_TIME': FACE_TIME, 'CORPINFO_ID': SessionService.instance.corpinfoId, 'USER_ID': SessionService.instance.loginUserId, + }, ); } - static Future> fnGetUserFaceTime(int FACE_TIME) { return HttpManager().request( baseFacePath, '/app/user/getUserFaceTime', method: Method.post, data: { - 'loading': false, + 'loading':false, 'FACE_TIME': FACE_TIME, 'CORPINFO_ID': SessionService.instance.corpinfoId, 'USER_ID': SessionService.instance.loginUserId, + }, ); } - /// 清除人脸时间 static Future> fnClearUserFaceTime() { return HttpManager().request( @@ -394,45 +371,31 @@ U6Hzm1ninpWeE+awIDAQAB '/app/user/clearUserFaceTime', method: Method.post, data: { - 'loading': false, + 'loading':false, 'CORPINFO_ID': SessionService.instance.corpinfoId, 'USER_ID': SessionService.instance.loginUserId, }, ); } - static Future> fnGetVideoPlayProgress( - String VIDEOCOURSEWARE_ID, - String CURRICULUM_ID, - String CLASS_ID, - String STUDENT_ID, - ) { + static Future> fnGetVideoPlayProgress(String VIDEOCOURSEWARE_ID, String CURRICULUM_ID, String CLASS_ID, String STUDENT_ID) { return HttpManager().request( basePath, '/app/edu/coursestudyvideorecord/getVideoProgress', method: Method.post, data: { 'VIDEOCOURSEWARE_ID': VIDEOCOURSEWARE_ID, - 'CURRICULUM_ID': CURRICULUM_ID, - 'CLASS_ID': CLASS_ID, - 'STUDENT_ID': STUDENT_ID, + 'CURRICULUM_ID' : CURRICULUM_ID, + 'CLASS_ID':CLASS_ID, + 'STUDENT_ID':STUDENT_ID, 'CORPINFO_ID': SessionService.instance.corpinfoId, 'USER_ID': SessionService.instance.loginUserId, + }, ); } - /// 上报播放进度或结束 - static Future> fnSubmitPlayTime( - String VIDEOCOURSEWARE_ID, - String CURRICULUM_ID, - String IS_END, - int RESOURCETIME, - String CHAPTER_ID, - String STUDENT_ID, - String CLASSCURRICULUM_ID, - String CLASS_ID, - ) { + static Future> fnSubmitPlayTime(String VIDEOCOURSEWARE_ID, String CURRICULUM_ID,String IS_END,int RESOURCETIME,String CHAPTER_ID,String STUDENT_ID,String CLASSCURRICULUM_ID, String CLASS_ID) { return HttpManager().request( basePath, '/app/edu/coursestudyvideorecord/save', @@ -442,7 +405,7 @@ U6Hzm1ninpWeE+awIDAQAB 'CURRICULUM_ID': CURRICULUM_ID, 'CHAPTER_ID': CHAPTER_ID, 'RESOURCETIME': RESOURCETIME, - 'IS_END': IS_END, + 'IS_END':IS_END, 'CLASS_ID': CLASS_ID, 'CLASSCURRICULUM_ID': CLASSCURRICULUM_ID, 'STUDENT_ID': STUDENT_ID, @@ -450,18 +413,15 @@ U6Hzm1ninpWeE+awIDAQAB 'USER_NAME': SessionService.instance.username, 'CORPINFO_ID': SessionService.instance.corpinfoId, 'USER_ID': SessionService.instance.loginUserId, + }, ); } - /// 人脸比对上传接口 /// /// [imagePath] 本地图片文件路径 /// 返回后端完整 JSON - static Future> getUserFace( - String imagePath, - String studentId, - ) async { + static Future> getUserFace(String imagePath, String studentId) async { final file = File(imagePath); if (!await file.exists()) { throw ApiException('file_not_found', '图片不存在:$imagePath'); @@ -472,28 +432,27 @@ U6Hzm1ninpWeE+awIDAQAB baseUrl: baseFacePath, path: '/app/user/compareFaceForH5V2', fromData: { - 'USER_ID': SessionService.instance.loginUserId, - 'STUDENT_ID': studentId, - 'CORPINFO_ID': SessionService.instance.corpinfoId, - 'FFILE': await MultipartFile.fromFile(file.path, filename: fileName), + 'USER_ID' : SessionService.instance.loginUserId, + 'STUDENT_ID' : studentId, + 'CORPINFO_ID' : SessionService.instance.corpinfoId, + 'FFILE' : await MultipartFile.fromFile( + file.path, + filename: fileName + ) }, + ); } - /// 签名上传 - static Future> signUpdate( - String signBase64, - String CLASS_ID, - String STAGESTUDENTRELATION_ID, - ) { + static Future> signUpdate(String signBase64, String CLASS_ID, String STAGESTUDENTRELATION_ID) { return HttpManager().request( basePath, '/app/edu/stagestudentrelation/sign', method: Method.post, data: { - 'FFILE': signBase64, - 'STUDYSTATE': 1, - 'CLASS_ID': CLASS_ID, + 'FFILE':signBase64, + 'STUDYSTATE':1, + 'CLASS_ID' : CLASS_ID, 'STAGESTUDENTRELATION_ID': STAGESTUDENTRELATION_ID, 'OPERATOR': SessionService.instance.username, 'USER_ID': SessionService.instance.loginUserId, @@ -502,78 +461,77 @@ U6Hzm1ninpWeE+awIDAQAB } /// 视频练习 - static Future> questionListByVideo( - String VIDEOCOURSEWARE_ID, - ) { + static Future> questionListByVideo(String VIDEOCOURSEWARE_ID) { return HttpManager().request( basePath, '/app/edu/question/listAllByVideo', method: Method.post, - data: {'VIDEOCOURSEWARE_ID': VIDEOCOURSEWARE_ID}, + data: { + 'VIDEOCOURSEWARE_ID':VIDEOCOURSEWARE_ID, + }, ); } /// 成绩查询 - static Future> pageTaskScoreByUser( - int showCount, - int currentPage, - ) { + static Future> pageTaskScoreByUser(int showCount, int currentPage) { return HttpManager().request( basePath, '/app/edu/stagestudentrelation/pageTaskScoreByUser', method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, "showCount": showCount, - "currentPage": currentPage, + "currentPage": currentPage }, ); } /// 考试详情 - static Future> getExamRecordByStuId( - String STUDENT_ID, - String CLASS_ID, - ) { + static Future> getExamRecordByStuId(String STUDENT_ID, String CLASS_ID) { return HttpManager().request( basePath, '/app/edu/stageexam/getExamRecordByStuId', method: Method.post, - data: {"STUDENT_ID": STUDENT_ID, "CLASS_ID": CLASS_ID}, + data: { + "STUDENT_ID":STUDENT_ID, + "CLASS_ID": CLASS_ID, + }, ); } - /// 开始考试 static Future> getStartExam(Map data) { return HttpManager().request( basePath, '/app/edu/stageexam/getExam', method: Method.post, - data: {...data}, + data: { + ...data + }, ); } - /// 开始加强考试 static Future> getStartStrengthenExam(Map data) { return HttpManager().request( basePath, '/app/edu/stageexam/getStrengthenExam', method: Method.post, - data: {...data}, + data: { + ...data + }, ); } - /// 加强学习视频 static Future> getListStrengthenVideo(Map data) { return HttpManager().request( basePath, '/app/edu/stagestudentrelation/listStrengthenVideo', method: Method.post, - data: {...data}, + data: { + ...data + }, ); } - /// 考试提交 static Future> submitExam(Map data) { return HttpManager().request( @@ -581,9 +539,9 @@ U6Hzm1ninpWeE+awIDAQAB '/app/edu/stageexam/submit', method: Method.post, data: { - "USERNAME": SessionService.instance.loginUser?["USERNAME"] ?? "", - "USER_ID": SessionService.instance.loginUserId, - ...data, + "USERNAME": SessionService.instance.loginUser?["USERNAME"]??"", + "USER_ID":SessionService.instance.loginUserId, + ...data }, ); } @@ -595,10 +553,11 @@ U6Hzm1ninpWeE+awIDAQAB basePath, '/app/eightwork/checkWork', method: Method.post, - data: {"USER_ID": SessionService.instance.loginUserId}, + data: { + "USER_ID":SessionService.instance.loginUserId, + }, ); } - /// 特殊作业分类二级 static Future> specialcheckWorkCount(String path) { return HttpManager().request( @@ -607,39 +566,35 @@ U6Hzm1ninpWeE+awIDAQAB method: Method.post, data: { "tm": DateTime.now().millisecondsSinceEpoch, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } - /// 筛选数据 static Future> searchGetTaskSetps(int task_id) { return HttpManager().request( basePath, '/app/eightwork/getTaskSetps', method: Method.post, - data: {"TASK_ID": task_id}, + data: { + "TASK_ID": task_id, + }, ); } - /// 特殊作业筛选列表 - static Future> specialCheckListWorkCount( - Map data, - String url, - ) { + static Future> specialCheckListWorkCount(Map data, String url) { return HttpManager().request( basePath, url, method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, - ...data, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, + ...data }, ); } - /// 动火删除 static Future> hotworkDelete(String hotworkId) { return HttpManager().request( @@ -647,33 +602,28 @@ U6Hzm1ninpWeE+awIDAQAB '/app/hotwork/delete', method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, - "HOTWORK_ID": hotworkId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, + "HOTWORK_ID":hotworkId }, ); } - /// 八项作业流程图 - static Future> workGetFlowList( - String workType, - String hotworkId, - ) { + static Future> workGetFlowList(String workType,String hotworkId) { // 根据 workType 生成对应的字段名,比如 'hotwork' -> 'HOTWORK_ID' final idKey = '${workType.toUpperCase()}_ID'; return HttpManager().request( basePath, '/app/${workType}/getFlowList', method: Method.post, - data: {idKey: hotworkId}, + data: { + idKey :hotworkId + }, ); } /// 作业详情 - static Future> getHomeworkFindById( - String workType, - String hotworkId, - ) { + static Future> getHomeworkFindById(String workType, String hotworkId) { // 根据 workType 生成对应的字段名,比如 'hotwork' -> 'HOTWORK_ID' final idKey = '${workType.toUpperCase()}_ID'; return HttpManager().request( @@ -681,28 +631,25 @@ U6Hzm1ninpWeE+awIDAQAB '/app/${workType}/findById', method: Method.post, data: { - idKey: hotworkId, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + idKey:hotworkId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } - /// 提交作业 static Future> submitHomework(String url, Map data) { return HttpManager().request( basePath, url, method: Method.post, - data: {...data}, + data: { + ...data + }, ); } - /// 气体分析详情列表 - static Future> workGasList( - String workType, - String workId, - ) { + static Future> workGasList(String workType,String workId) { // 根据 workType 生成对应的字段名,比如 'hotwork' -> 'HOTWORK_ID' final idKey = '${workType.toUpperCase()}_ID'; return HttpManager().request( @@ -710,19 +657,15 @@ U6Hzm1ninpWeE+awIDAQAB '/app/${workType}/gas/list', method: Method.post, data: { - idKey: workId, + idKey:workId, "tm": DateTime.now().millisecondsSinceEpoch, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } - /// 气体分析详情列表删除 - static Future> workGasDelete( - String workType, - String workGasId, - ) { + static Future> workGasDelete(String workType,String workGasId) { // 根据 workType 生成对应的字段名,比如 'hotwork' -> 'HOTWORK_ID' final idKey = '${workType.toUpperCase()}GAS_ID'; return HttpManager().request( @@ -730,64 +673,55 @@ U6Hzm1ninpWeE+awIDAQAB '/app/$workType/gas/delete', method: Method.post, data: { - idKey: workGasId, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + idKey:workGasId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } - /// 所有签名列表 - static Future> listSignFinished( - String workType, - String hotworkId, - ) { + static Future> listSignFinished(String workType,String hotworkId) { // 根据 workType 生成对应的字段名,比如 'hotwork' -> 'HOTWORK_ID' final idKey = '${workType.toUpperCase()}_ID'; return HttpManager().request( basePath, '/app/${workType}/listSignFinished', method: Method.post, - data: {idKey: hotworkId}, + data: { + idKey :hotworkId, + }, ); } - /// 安全防护措施 - static Future> listSignFinishMeasures( - String workType, - String workId, - ) { + static Future> listSignFinishMeasures(String workType,String workId, + ) { // 根据 workType 生成对应的字段名,比如 'hotwork' -> 'HOTWORK_ID' final idKey = '${workType.toUpperCase()}_ID'; return HttpManager().request( basePath, '/app/$workType/listSignFinishMeasures', method: Method.post, - data: {idKey: workId}, + data: { + idKey: workId, + }, ); } /// 所有安全防护措施 - static Future> listSignFinishAllMeasures( - String workType, - ) { + static Future> listSignFinishAllMeasures(String workType) { final String tm = DateTime.now().millisecondsSinceEpoch.toString(); return HttpManager().request( basePath, '/app/$workType/listAllMeasures?tm=$tm', method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } - /// 安全措施确认 - static Future> listSignSureAllMeasures( - String workType, - String homeWorkId, - ) { + static Future> listSignSureAllMeasures(String workType,String homeWorkId) { final String tm = DateTime.now().millisecondsSinceEpoch.toString(); // 根据 workType 生成对应的字段名,比如 'hotwork' -> 'HOTWORK_ID' final idKey = '${workType.toUpperCase()}_ID'; @@ -796,9 +730,9 @@ U6Hzm1ninpWeE+awIDAQAB '/app/$workType/listAllMeasuresForSign?tm=$tm', method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, + "CORPINFO_ID":SessionService.instance.corpinfoId, idKey: homeWorkId, - "CONFIRM_ID": SessionService.instance.loginUserId, + "CONFIRM_ID":SessionService.instance.loginUserId, }, ); } @@ -809,20 +743,22 @@ U6Hzm1ninpWeE+awIDAQAB basePath, '/app/eightwork/startingList', method: Method.post, - data: {...data}, + data: { + ...data + }, ); } - /// 风险辨识结果 风险列表 static Future> getEightWorkInfo(Map data) { return HttpManager().request( basePath, '/app/eightwork/getInfo', method: Method.post, - data: {...data}, + data: { + ...data + }, ); } - /// 动火人及证书编号 static Future> getHotWorkNameList() { return HttpManager().request( @@ -831,18 +767,18 @@ U6Hzm1ninpWeE+awIDAQAB method: Method.post, data: { "tm": DateTime.now().millisecondsSinceEpoch, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } + /// 保存或作废气体检测 - static Future> saveGasTest( - String workType, - Map formData, - List filePaths, - ) async { + static Future> saveGasTest(String workType, + Map formData, + List filePaths, + ) async { // 复制一份 formData final data = Map.from(formData); @@ -860,13 +796,12 @@ U6Hzm1ninpWeE+awIDAQAB fromData: data, ); } - /// 保存安全措施确认 - static Future> saveSafeFunctionSure( - String workType, - Map formData, - List filePaths, - ) async { + static Future> saveSafeFunctionSure ( + String workType, + Map formData, + List filePaths, + ) async { // 复制一份 formData final data = Map.from(formData); @@ -886,9 +821,11 @@ U6Hzm1ninpWeE+awIDAQAB } /// 上传图片或视频 - static Future> uploadSaveFile(String filePath) async { + static Future> uploadSaveFile ( + String filePath, + ) async { final Map data = { - "CORPINFO_ID": SessionService.instance.corpinfoId, + "CORPINFO_ID":SessionService.instance.corpinfoId, }; // 把文件路径填成 MultipartFile final path = filePath; @@ -902,24 +839,24 @@ U6Hzm1ninpWeE+awIDAQAB fromData: data, ); } - ///删除图片 static Future> deleteSaveFile(String FILE_PATH) { return HttpManager().request( basePath, '/app/eightwork/deleteFile', method: Method.post, - data: {"FILE_PATH": FILE_PATH}, + data: { + "FILE_PATH": FILE_PATH, + }, ); } - /// 安全措施个项保存 - static Future> saveDangerousOptionsFile( - List filePaths, - ) async { + static Future> saveDangerousOptionsFile ( + List filePaths, + ) async { // 复制一份 formData final Map data = { - "CORPINFO_ID": SessionService.instance.corpinfoId, + "CORPINFO_ID":SessionService.instance.corpinfoId, }; // 把文件路径填成 MultipartFile for (var i = 0; i < filePaths.length; i++) { @@ -940,21 +877,18 @@ U6Hzm1ninpWeE+awIDAQAB } /// 受限空间台账信息 - static Future> getLimitspaceMsssage( - String LIMITSPACE_ID, - ) { + static Future> getLimitspaceMsssage(String LIMITSPACE_ID) { return HttpManager().request( basePath, '/app/limitspace/goEdit', method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, - 'LIMITSPACE_ID': LIMITSPACE_ID, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, + 'LIMITSPACE_ID' : LIMITSPACE_ID, }, ); } - /// 受限空间名称列表 static Future> getLimitspaceNameList() { final String tm = DateTime.now().millisecondsSinceEpoch.toString(); @@ -963,28 +897,24 @@ U6Hzm1ninpWeE+awIDAQAB '/app/limitspace/listAllSpace?tm=${tm}', method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } - /// 受限空间气体分析详情 - static Future> getConfinedspacegaswh( - String CONFINEDSPACE_ID, - ) { + static Future> getConfinedspacegaswh(String CONFINEDSPACE_ID) { return HttpManager().request( basePath, '/app/confinedspacegaswh/goEdit', method: Method.post, data: { - "CONFINEDSPACE_ID": CONFINEDSPACE_ID, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "CONFINEDSPACE_ID" : CONFINEDSPACE_ID, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } - /// 受限空间气体提交 static Future> submitSpaceGas(String url, Map data) { return HttpManager().request( @@ -992,9 +922,9 @@ U6Hzm1ninpWeE+awIDAQAB url, method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, - ...data, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, + ...data }, ); } @@ -1006,12 +936,11 @@ U6Hzm1ninpWeE+awIDAQAB '/app/keyprojectcheck/keyProjectCount', method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "loginUserId": SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "loginUserId":SessionService.instance.loginUserId, }, ); } - /// 重点工程筛选列表 static Future> getKeyProjectList(Map data, String url) { return HttpManager().request( @@ -1019,38 +948,34 @@ U6Hzm1ninpWeE+awIDAQAB url, method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "UserId": SessionService.instance.loginUserId, - ...data, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "UserId":SessionService.instance.loginUserId, + ...data }, ); } - /// 重点工程详情 - static Future> getKeyProjectDeatail( - String OUTSOURCED_ID, - ) { + static Future> getKeyProjectDeatail(String OUTSOURCED_ID) { return HttpManager().request( basePath, '/app/keyProjects/getOutsourced', method: Method.post, - data: {"OUTSOURCED_ID": OUTSOURCED_ID}, + data: { + "OUTSOURCED_ID":OUTSOURCED_ID, + + }, ); } - /// 工程开始结束 - static Future> sureKeyProjectState( - String OUTSOURCED_ID, - String State, - ) { + static Future> sureKeyProjectState(String OUTSOURCED_ID, String State) { return HttpManager().request( basePath, '/app/keyProjects/updateState', method: Method.post, data: { - "OUTSOURCED_ID": OUTSOURCED_ID, - 'OPERATOR': SessionService.instance.loginUserId, - 'STATE': State, + "OUTSOURCED_ID":OUTSOURCED_ID, + 'OPERATOR' : SessionService.instance.loginUserId, + 'STATE':State }, ); } @@ -1062,30 +987,25 @@ U6Hzm1ninpWeE+awIDAQAB url, method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "UserId": SessionService.instance.loginUserId, - ...data, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "UserId":SessionService.instance.loginUserId, + ...data }, ); } - /// 安全检查记录 - static Future> getSafeCheckReciordList( - Map data, - String url, - ) { + static Future> getSafeCheckReciordList(Map data, String url) { return HttpManager().request( basePath, url, method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "UserId": SessionService.instance.loginUserId, - ...data, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "UserId":SessionService.instance.loginUserId, + ...data }, ); } - /// 安全检查发起 static Future> addSafeCheckRecord(String OUTSOURCED_ID) { return HttpManager().request( @@ -1093,41 +1013,35 @@ U6Hzm1ninpWeE+awIDAQAB '/app/keyProjects/goEdit', method: Method.post, data: { - "OUTSOURCED_ID": OUTSOURCED_ID, - "tm": DateTime.now().millisecondsSinceEpoch.toString(), + "OUTSOURCED_ID":OUTSOURCED_ID, + "tm":DateTime.now().millisecondsSinceEpoch.toString(), }, ); } - /// 安全检查 - static Future> getSafeCheckGoEdit( - String KEYPROJECTCHECK_ID, - ) { + static Future> getSafeCheckGoEdit(String KEYPROJECTCHECK_ID) { return HttpManager().request( basePath, '/app/keyprojectcheck/goEdit', method: Method.post, - data: {"KEYPROJECTCHECK_ID": KEYPROJECTCHECK_ID}, + data: { + "KEYPROJECTCHECK_ID":KEYPROJECTCHECK_ID, + }, ); } - /// 安全检查单位现场负责人列表 - static Future> getSafeCheckPersonList( - String UNITS_ID, - String NOMAIN, - ) { + static Future> getSafeCheckPersonList(String UNITS_ID, String NOMAIN) { return HttpManager().request( basePath, '/app/keyProjects/listAllPersonnel', method: Method.post, data: { - "UNITS_ID": UNITS_ID, - 'NOMAIN': NOMAIN, - "tm": DateTime.now().millisecondsSinceEpoch.toString(), + "UNITS_ID":UNITS_ID, + 'NOMAIN':NOMAIN, + "tm":DateTime.now().millisecondsSinceEpoch.toString(), }, ); } - /// 安全检查检查类型 static Future> getSafeCheckTypeList() { return HttpManager().request( @@ -1135,112 +1049,103 @@ U6Hzm1ninpWeE+awIDAQAB '/dictionaries/listSelectTreeByTkiTree?tm=${DateTime.now().millisecondsSinceEpoch.toString()}', method: Method.post, data: { - "DICTIONARIES_ID": '60e6481d96e44a5390ff5c347c4d1ffe', - "tm": DateTime.now().millisecondsSinceEpoch.toString(), + "DICTIONARIES_ID":'60e6481d96e44a5390ff5c347c4d1ffe', + "tm":DateTime.now().millisecondsSinceEpoch.toString(), }, ); } - /// 安全检查被检查单位 - static Future> getSafeCheckToUnitList( - String OUTSOURCED_ID, - ) { + static Future> getSafeCheckToUnitList(String OUTSOURCED_ID) { return HttpManager().request( basePath, '/app/keyProjects/listAllUnits', method: Method.post, data: { "CORPINFO_ID": SessionService.instance.corpinfoId, - "OUTSOURCED_ID": OUTSOURCED_ID, + "OUTSOURCED_ID":OUTSOURCED_ID, }, ); } - /// 安全检查发起提交 static Future> safeCheckPunishSubmit(Map data) { return HttpManager().request( basePath, '/app/keyprojectpunish/add', method: Method.post, - data: {...data}, + data: { + ...data + }, ); } - /// 安全检查发起提交 static Future> safeKeyprojectCheckSubmit(Map data) { return HttpManager().request( basePath, '/app/keyprojectcheck/add', method: Method.post, - data: {...data}, + data: { + ...data + }, ); } - /// 重点工程隐患管理列表 - static Future> getKeyprojectDangerList( - String url, - Map data, - ) { + static Future> getKeyprojectDangerList(String url, Map data) { return HttpManager().request( basePath, url, method: Method.post, - data: {...data}, + data: { + ...data + }, ); } - /// 重点工程隐患详情 - static Future> getKeyprojectDangerFindHidden( - String HIDDEN_ID, - String OUTSOURCED_ID, - ) { + static Future> getKeyprojectDangerFindHidden(String HIDDEN_ID, String OUTSOURCED_ID) { return HttpManager().request( basePath, '/app/keyprojectcheck/findHidden', method: Method.post, - data: {'HIDDEN_ID': HIDDEN_ID, 'OUTSOURCED_ID': OUTSOURCED_ID}, + data: { + 'HIDDEN_ID':HIDDEN_ID, + 'OUTSOURCED_ID':OUTSOURCED_ID + }, ); } - /// 重点工程隐患验收 - static Future> checkKeyprojectDanger( - String HIDDEN_ID, - Map data, - ) { + static Future> checkKeyprojectDanger(String HIDDEN_ID, Map data) { return HttpManager().request( basePath, '/app/keyprojectcheck/check', method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "CREATOR": SessionService.instance.loginUserId, - "OPERATOR": SessionService.instance.loginUserId, - 'HIDDEN_ID': HIDDEN_ID, - ...data, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "CREATOR":SessionService.instance.loginUserId, + "OPERATOR":SessionService.instance.loginUserId, + 'HIDDEN_ID':HIDDEN_ID, + ...data }, ); } /// 上传图片 - static Future> addNormalImgFiles( - String imagePath, - Map data, - ) async { + static Future> addNormalImgFiles(String imagePath, Map data) async { final file = File(imagePath); if (!await file.exists()) { throw ApiException('file_not_found', '图片不存在:$imagePath'); } final fileName = file.path.split(Platform.pathSeparator).last; return HttpManager().uploadFaceImage( - baseUrl: basePath, - path: '/app/imgfiles/add', - fromData: { - ...data, - 'FFILE': await MultipartFile.fromFile(file.path, filename: fileName), - }, + baseUrl: basePath, + path: '/app/imgfiles/add', + fromData: { + ...data, + 'FFILE': await MultipartFile.fromFile( + file.path, + filename: fileName + ), + } ); } - /// 重点工程处罚 static Future> keyprojectpunishAdd(Map data) { return HttpManager().request( @@ -1248,27 +1153,23 @@ U6Hzm1ninpWeE+awIDAQAB '/app/keyprojectpunish/add', method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "CREATOR": SessionService.instance.loginUserId, - "OPERATOR": SessionService.instance.loginUserId, - ...data, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "CREATOR":SessionService.instance.loginUserId, + "OPERATOR":SessionService.instance.loginUserId, + ...data }, ); } - /// 重点工程处罚修改隐患 - static Future> keyprojectPunishEdit( - Map data, - String ISPUNISH, - ) { + static Future> keyprojectPunishEdit(Map data, String ISPUNISH) { return HttpManager().request( basePath, '/app/keyprojectcheck/editHiddenIspunish', method: Method.post, data: { - "ISPUNISH": ISPUNISH, - "PUNISH_PERSON": SessionService.instance.loginUserId, - ...data, + "ISPUNISH":ISPUNISH, + "PUNISH_PERSON":SessionService.instance.loginUserId, + ...data }, ); } @@ -1280,7 +1181,7 @@ U6Hzm1ninpWeE+awIDAQAB '/app/safetyenvironmental/countCheck', method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, + "CORPINFO_ID":SessionService.instance.corpinfoId, 'INSPECTION_USER_ID': SessionService.instance.loginUserId, 'INSPECTED_SITEUSER_ID': SessionService.instance.loginUserId, 'INSPECTION_ORIGINATOR_ID': SessionService.instance.loginUserId, @@ -1288,105 +1189,65 @@ U6Hzm1ninpWeE+awIDAQAB }, ); } - /// 安全检查流程图 static Future> safeCheckFlowList(String ID) { return HttpManager().request( basePath, '/app/safetyenvironmental/showFlowChart', method: Method.post, - data: {'ID': ID}, + data: { + 'ID' :ID + }, ); } - /// 安全检查列表 - static Future> getSafeCheckSearchList( - Map data, - String url, - ) { + static Future> getSafeCheckSearchList(Map data, String url) { return HttpManager().request( basePath, url, method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "loginUserId": SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "loginUserId":SessionService.instance.loginUserId, 'tm': DateTime.now().millisecondsSinceEpoch.toString(), - 'roleLevel': SessionService.instance.loginUser?['roleLevel'] ?? '', - 'supDeparIds': SessionService.instance.loginUser?['supDeparIds'] ?? '', + 'roleLevel' : SessionService.instance.loginUser?['roleLevel'] ?? '', + 'supDeparIds' : SessionService.instance.loginUser?['supDeparIds'] ?? '', - ...data, + ...data }, ); } - // 安全检查列表详情 - static Future> getSafeCheckStartGoEdit( - String INSPECTION_ID, - ) { + static Future> getSafeCheckStartGoEdit(String INSPECTION_ID) { return HttpManager().request( basePath, '/app/safetyenvironmental/goEdit', method: Method.post, - data: {"INSPECTION_ID": INSPECTION_ID}, + data: { + "INSPECTION_ID":INSPECTION_ID, + }, ); } - // 安全检查操作 - static Future> SafeCheckStartGoEditMsg( - String imagePath, - String msg, - Map data - ) async { - Map formData = { - ...data, - }; - if (imagePath.isNotEmpty) { - final file = File(imagePath); - if (!await file.exists()) { - throw ApiException('file_not_found', '图片不存在:$imagePath'); - } - final fileName = file.path.split(Platform.pathSeparator).last; - formData['FFILE'] = - await MultipartFile.fromFile(file.path, filename: fileName); - return HttpManager().uploadFaceImage( - baseUrl: basePath, - path: '/app/safetyenvironmental/$msg', - fromData: formData, - ); - }else { - return HttpManager().request( - basePath, - '/app/safetyenvironmental/$msg', - data: formData, - ); - } - - } ///TODO -------------–-------------------- 我的 -------------–-------------------- /// 问题反馈 - static Future> setFeedBack( - String backTitle, - String backContent, - String backType, - String imgPaths, - ) { + static Future> setFeedBack(String backTitle,String backContent,String backType,String imgPaths) { return HttpManager().request( basePath, '/app/feedback/add', method: Method.post, data: { - "FEEDBACK_TITLE": backTitle, - "FEEDBACK_CONTENT": backContent, - "FEEDBACK_TYPE": backType, - "FEEDBACK_IMG": imgPaths, - "loginUserId": SessionService.instance.loginUserId, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "FEEDBACK_TITLE":backTitle, + "FEEDBACK_CONTENT":backContent, + "FEEDBACK_TYPE":backType, + "FEEDBACK_IMG" :imgPaths, + "loginUserId":SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } @@ -1400,39 +1261,41 @@ U6Hzm1ninpWeE+awIDAQAB final fileName = file.path.split(Platform.pathSeparator).last; return HttpManager().uploadFaceImage( - baseUrl: basePath, - path: '/app/feedback/upload', - fromData: { - "corpUserId": "", - 'CORPINFO_ID': SessionService.instance.corpinfoId, - 'USER_ID': SessionService.instance.loginUserId, - 'FFILE': await MultipartFile.fromFile(file.path, filename: fileName), - }, + baseUrl: basePath, + path: '/app/feedback/upload', + fromData: { + "corpUserId":"", + 'CORPINFO_ID': SessionService.instance.corpinfoId, + 'USER_ID': SessionService.instance.loginUserId, + 'FFILE': await MultipartFile.fromFile( + file.path, + filename: fileName + ), + } ); } /// 隐患整改图片上传 - static Future> addImgFiles( - String imagePath, - String type, - String id, - ) async { + static Future> addImgFiles(String imagePath,String type,String id) async { final file = File(imagePath); if (!await file.exists()) { throw ApiException('file_not_found', '图片不存在:$imagePath'); } final fileName = file.path.split(Platform.pathSeparator).last; return HttpManager().uploadFaceImage( - baseUrl: basePath, - path: '/app/imgfiles/add', - fromData: { - 'FOREIGN_KEY': id, - 'TYPE': type, - "corpUserId": "", - 'CORPINFO_ID': SessionService.instance.corpinfoId, - 'USER_ID': SessionService.instance.loginUserId, - 'FFILE': await MultipartFile.fromFile(file.path, filename: fileName), - }, + baseUrl: basePath, + path: '/app/imgfiles/add', + fromData: { + 'FOREIGN_KEY': id, + 'TYPE': type, + "corpUserId":"", + 'CORPINFO_ID': SessionService.instance.corpinfoId, + 'USER_ID': SessionService.instance.loginUserId, + 'FFILE': await MultipartFile.fromFile( + file.path, + filename: fileName + ), + } ); } @@ -1444,97 +1307,88 @@ U6Hzm1ninpWeE+awIDAQAB } final fileName = file.path.split(Platform.pathSeparator).last; return HttpManager().uploadFaceImage( - baseUrl: basePath, - path: '/app/hidden/identifyImg', - fromData: { - 'CORPINFO_ID': SessionService.instance.corpinfoId, - 'USER_ID': SessionService.instance.loginUserId, - 'FFILE': await MultipartFile.fromFile(file.path, filename: fileName), - }, + baseUrl: basePath, + path: '/app/hidden/identifyImg', + fromData: { + 'CORPINFO_ID': SessionService.instance.corpinfoId, + 'USER_ID': SessionService.instance.loginUserId, + 'FFILE': await MultipartFile.fromFile( + file.path, + filename: fileName + ), + } ); } + /// 修改密码 - static Future> changePassWord( - String oldPwd, - String confirmPwd, - ) { + static Future> changePassWord(String oldPwd,String confirmPwd) { return HttpManager().request( basePath, '/app/user/editUserPwd', method: Method.post, data: { - "USERNAME": SessionService.instance.loginUser?["USERNAME"] ?? "", + "USERNAME": SessionService.instance.loginUser?["USERNAME"]??"", "PASSWORD": oldPwd, "NOWPASSWORD": confirmPwd, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } /// 获取离岗管理列表 - static Future> getDutyManagement( - int showCount, - int currentPage, - ) { + static Future> getDutyManagement(int showCount, int currentPage) { return HttpManager().request( basePath, '/app/offduty/list?showCount=$showCount¤tPage=$currentPage', method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, // ISMAIN:loginUser.ISMAIN, // ISSUPERVISE:loginUser.ISSUPERVISE, - "DEPARTMENT_ID": SessionService.instance.deptId, - "TYPE": 'edit', + "DEPARTMENT_ID":SessionService.instance.deptId, + "TYPE": 'edit' }, ); } /// 通知列表 - static Future> getNotifList( - String showCount, - String currentPage, - String keyWord, - ) { + static Future> getNotifList(String showCount, String currentPage,String keyWord) { return HttpManager().request( basePath, '/app/notice/list', method: Method.post, data: { - "showCount": showCount, - "currentPage": currentPage, - "KEYWORDS": keyWord, - "corpinfoId": SessionService.instance.corpinfoId, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "showCount" : showCount, + "currentPage" : currentPage, + "KEYWORDS":keyWord, + "corpinfoId" :SessionService.instance.corpinfoId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } /// 通知列表-企业 - static Future> getNotifEnterprise( - String showCount, - String currentPage, - String keyWord, - ) { + static Future> getNotifEnterprise(String showCount, String currentPage,String keyWord) { return HttpManager().request( basePath, '/app/notice/listForCp', method: Method.post, data: { - "showCount": showCount, - "currentPage": currentPage, - "KEYWORDS": keyWord, - "loginUserId": SessionService.instance.loginUserId, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "showCount" : showCount, + "currentPage" : currentPage, + "KEYWORDS":keyWord, + "loginUserId" :SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } + /// 通知详情 static Future> getNotifDetail(String id) { return HttpManager().request( @@ -1542,12 +1396,12 @@ U6Hzm1ninpWeE+awIDAQAB '/app/notice/goEdit', method: Method.post, data: { - "NOTICECORPUSERID_ID": id, - "loginUserId": SessionService.instance.loginUserId, - "corpinfoId": SessionService.instance.corpinfoId, - "ISMAIN": "0", - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "NOTICECORPUSERID_ID":id, + "loginUserId":SessionService.instance.loginUserId, + "corpinfoId":SessionService.instance.corpinfoId, + "ISMAIN":"0", + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } @@ -1559,21 +1413,17 @@ U6Hzm1ninpWeE+awIDAQAB '/app/notice/goEditForPc', method: Method.post, data: { - "NOTICECORPUSERID_ID": id, - "loginUserId": SessionService.instance.loginUserId, - "corpinfoId": SessionService.instance.corpinfoId, - "ISMAIN": "0", - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "NOTICECORPUSERID_ID":id, + "loginUserId":SessionService.instance.loginUserId, + "corpinfoId":SessionService.instance.corpinfoId, + "ISMAIN":"0", + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } - /// 更新人脸信息 - static Future> reloadMyFace( - String imagePath, - String studentId, - ) async { + static Future> reloadMyFace(String imagePath, String studentId) async { final file = File(imagePath); if (!await file.exists()) { throw ApiException('file_not_found', '图片不存在:$imagePath'); @@ -1581,13 +1431,16 @@ U6Hzm1ninpWeE+awIDAQAB final fileName = file.path.split(Platform.pathSeparator).last; return HttpManager().uploadFaceImage( - baseUrl: basePath, - path: '/app/user/editUserFaceV2', - fromData: { - 'CORPINFO_ID': SessionService.instance.corpinfoId, - 'USER_ID': SessionService.instance.loginUserId, - 'FFILE': await MultipartFile.fromFile(file.path, filename: fileName), - }, + baseUrl: basePath, + path: '/app/user/editUserFaceV2', + fromData: { + 'CORPINFO_ID': SessionService.instance.corpinfoId, + 'USER_ID': SessionService.instance.loginUserId, + 'FFILE': await MultipartFile.fromFile( + file.path, + filename: fileName + ), + } ); } @@ -1597,16 +1450,15 @@ U6Hzm1ninpWeE+awIDAQAB basePath, '/app/notice/delete', method: Method.post, - data: {"NOTICECORPUSERID_ID": id}, + data: { + "NOTICECORPUSERID_ID":id, + }, ); } /// 获取AI预警列表 - static Future> getAiAlarmList( - String showCount, - String currentPage, - String keyWord, - ) { + static Future> getAiAlarmList(String showCount, String currentPage,String keyWord) { + return HttpManager().request( basePath, '/app/aiwarning/list?showCount=$showCount¤tPage=$currentPage', @@ -1614,24 +1466,21 @@ U6Hzm1ninpWeE+awIDAQAB data: { "tm": DateTime.now().millisecondsSinceEpoch, "KEYWORDS": keyWord, //关键字模糊查询 - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } + /// 离岗申请 - static Future> submitApplicationLeaving( - String startTime, - String endTime, - String text, - ) { + static Future> submitApplicationLeaving(String startTime, String endTime,String text) { return HttpManager().request( basePath, '/app/offduty/add', method: Method.post, data: { - "OFFDUTY_ID": "", + "OFFDUTY_ID":"", "STARTTIME": startTime, "ENDTIME": endTime, "DESCR": text, @@ -1645,82 +1494,66 @@ U6Hzm1ninpWeE+awIDAQAB } /// 离岗审批 - static Future> dutyApproval( - String type, - String text, - String itemNum, - ) { + static Future> dutyApproval(String type, String text,String itemNum) { return HttpManager().request( basePath, '/app/offduty/review', method: Method.post, data: { - "OFFDUTY_ID": itemNum, - "REVIEW_STATUS": type, - "REVIEW_DESC": text, - "OPERATOR": SessionService.instance.loginUserId, + "OFFDUTY_ID":itemNum, + "REVIEW_STATUS":type, + "REVIEW_DESC":text, + "OPERATOR":SessionService.instance.loginUserId }, ); } /// 离岗取消 - static Future> dutyReturned( - String type, - String text, - String itemNum, - ) { + static Future> dutyReturned(String type, String text,String itemNum) { return HttpManager().request( basePath, '/app/offduty/cancel', method: Method.post, data: { - "OFFDUTY_ID": itemNum, - "REVIEW_STATUS": type, - "REVIEW_DESC": text, - "OPERATOR": SessionService.instance.loginUserId, + "OFFDUTY_ID":itemNum, + "REVIEW_STATUS":type, + "REVIEW_DESC":text, + "OPERATOR":SessionService.instance.loginUserId }, ); } + /// 获取离岗记录列表 - static Future> getDepartureRecordList( - int showCount, - int currentPage, - ) { + static Future> getDepartureRecordList(int showCount, int currentPage) { + return HttpManager().request( basePath, '/app/offduty/list?showCount=$showCount¤tPage=$currentPage', method: Method.post, data: { "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, - "ISMAIN": 0, - "ISSUPERVISE": 0, + "USER_ID":SessionService.instance.loginUserId, + "ISMAIN":0, + "ISSUPERVISE":0, "DEPARTMENT_ID": SessionService.instance.corpinfoId, - "TYPE": 'show', + "TYPE": 'show' }, ); } + + /// 获取隐患治理列表 - static Future> getHiddenTreatmentList( - int type, - int currentPage, - String startDate, - String endDate, - String level, - String riskStandard, - String state, - String departmentId, - String correctiveDepartment, - String isIndex, - String keyWord, - ) { + static Future> getHiddenTreatmentList(int type, int currentPage, + String startDate,String endDate,String level,String riskStandard,String state, + String departmentId,String correctiveDepartment,String isIndex,String keyWord) { return HttpManager().request( basePath, '/app/hidden/listRiskStandard', method: Method.post, data: { + //隐患记录 "STARTTIME": startDate, "ENDTIME": endDate, @@ -1792,15 +1625,13 @@ U6Hzm1ninpWeE+awIDAQAB } /// 获取部门负责人列表 - static Future> getListTreePersonList( - String DEPARTMENT_ID, - ) { + static Future> getListTreePersonList(String DEPARTMENT_ID) { return HttpManager().request( basePath, '/app/sys/listUser', method: Method.post, data: { - "tm": DateTime.now().millisecondsSinceEpoch.toString(), + "tm":DateTime.now().millisecondsSinceEpoch.toString(), "DEPARTMENT_ID": DEPARTMENT_ID, "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, @@ -1808,6 +1639,7 @@ U6Hzm1ninpWeE+awIDAQAB ); } + /// 获取隐患记录详情 static Future> getDangerDetail(String id) { return HttpManager().request( @@ -1849,6 +1681,7 @@ U6Hzm1ninpWeE+awIDAQAB ); } + /// 获取本日工作提醒 static Future> getAnPai() { return HttpManager().request( @@ -1856,10 +1689,10 @@ U6Hzm1ninpWeE+awIDAQAB '/app/listmanager/checkListIndex', method: Method.post, data: { - "tm": DateTime.now().millisecondsSinceEpoch.toString(), - "DEPARTMENT_ID": SessionService.instance.corpinfoId, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "tm":DateTime.now().millisecondsSinceEpoch.toString(), + "DEPARTMENT_ID":SessionService.instance.corpinfoId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } @@ -1872,45 +1705,35 @@ U6Hzm1ninpWeE+awIDAQAB method: Method.post, data: { "CDATA": data, - "USERNAME": SessionService.instance.loginUser?["USERNAME"] ?? "", - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USERNAME": SessionService.instance.loginUser?["USERNAME"]??"", + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } /// 增加本日日程安排 - static Future> addRiCheng( - String data, - String title, - String content, - String id, - String urlPath, - ) { + static Future> addRiCheng(String data,String title, String content,String id,String urlPath) { return HttpManager().request( basePath, '/app/schedule/$urlPath', method: Method.post, data: { "CDATA": data, - "USERNAME": SessionService.instance.loginUser?["USERNAME"] ?? "", - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USERNAME":SessionService.instance.loginUser?["USERNAME"]??"", + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, "SCHEDULE_ID": id, "TITLE": title, - "FHDESC": content, + "FHDESC":content, }, ); } + /// 获取风险分布列表 - static Future> getRiskRecordList( - int currentPage, - String riskId, - String dept, - String level, - String keyWord, - ) { + static Future> getRiskRecordList(int currentPage, + String riskId,String dept,String level,String keyWord) { return HttpManager().request( basePath, '/app/riskpoint/list?showCount=-1¤tPage=$currentPage', @@ -1935,28 +1758,25 @@ U6Hzm1ninpWeE+awIDAQAB method: Method.post, data: { "CHECK_IDENTIFICATION_ID": id, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } /// 获取风险分布详情提交坐标 - static Future> addCoordinate( - String id, - String longitude, - String latitude, - ) { + static Future> addCoordinate(String id,String longitude,String latitude) { return HttpManager().request( basePath, '/app/riskpoint/editLonAndLat', method: Method.post, data: { "IDENTIFICATIONPARTS_ID": id, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, - "LONGITUDE": longitude, - "LATITUDE": latitude, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, + "LONGITUDE" : longitude, + "LATITUDE" : latitude, + }, ); } @@ -1981,9 +1801,9 @@ U6Hzm1ninpWeE+awIDAQAB '/app/mfolderStipulate/appListTree', method: Method.post, data: { - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, - "KEYWORDS": keyWord, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, + "KEYWORDS":keyWord, "SHARE": "yes", }, ); @@ -1996,53 +1816,55 @@ U6Hzm1ninpWeE+awIDAQAB '/app/mfolderStipulate/listByParentId', method: Method.post, data: { - "PARENT_ID": id, - "TYPE": 2, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "PARENT_ID":id, + "TYPE":2, + "CORPINFO_ID":SessionService.instance.corpinfoId, + "USER_ID":SessionService.instance.loginUserId, }, ); } + /// 提交隐患整改 - static Future> rectificationSubmission( - String id, - String buMenId, - String renYuanId, - ) { + static Future> rectificationSubmission(String id,String buMenId,String renYuanId) { return HttpManager().request( basePath, '/app/hidden/editRec', method: Method.post, data: { + "HIDDEN_ID": id, "RECTIFICATIONDEPT": buMenId, "RECTIFICATIONOR": renYuanId, - "HIDDEN_ID": id, "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, }, ); } + /// 提交隐患整改 + static Future> rectificationSubmissionTwo(String id,String buMenId,String renYuanId) { + return HttpManager().request( + basePath, + '/app/customHidden/editRec', + method: Method.post, + data: { + "HIDDEN_ID": id, + "RECTIFICATIONDEPT": buMenId, + "RECTIFICATIONOR": renYuanId, + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + /// 提交隐患整改 static Future> normalRectificationSubmission( - String dataTime, - String miaoShu, - String acceptedPrepareType, - String acceptedPlanType, - String id, - String caertTime, - String listName, - String standard, - String method, - String fund, - String person, - String workTime, - String time, - String work, - String other, - String json, - ) { + String dataTime,String miaoShu,String acceptedPrepareType,String acceptedPlanType, + String id,String caertTime,String listName, + String standard,String method,String fund,String person, + String workTime,String time,String work,String other,String json) { + // print("============>"+ dataTime+ miaoShu+ acceptedPrepareType+ acceptedPlanType+ // id+ caertTime+ listName+ standard+ method+ fund+ person+ // workTime+ time+ work+ other+ json); @@ -2052,6 +1874,7 @@ U6Hzm1ninpWeE+awIDAQAB '/app/hidden/rectify', method: Method.post, data: { + "RECTIFICATIONTIME": dataTime, "RECTIFYDESCR": miaoShu, "HAVESCHEME": acceptedPrepareType, @@ -2076,6 +1899,48 @@ U6Hzm1ninpWeE+awIDAQAB ); } + /// 提交隐患整改 + static Future> normalRectificationSubmissionTwo( + String dataTime,String miaoShu,String acceptedPrepareType,String acceptedPlanType, + String id,String caertTime,String listName, + String standard,String method,String fund,String person, + String workTime,String time,String work,String other,String json) { + + // print("============>"+ dataTime+ miaoShu+ acceptedPrepareType+ acceptedPlanType+ + // id+ caertTime+ listName+ standard+ method+ fund+ person+ + // workTime+ time+ work+ other+ json); + + return HttpManager().request( + basePath, + '/app/customHidden/rectify', + method: Method.post, + data: { + + "RECTIFICATIONTIME": dataTime, + "RECTIFYDESCR": miaoShu, + "HAVESCHEME": acceptedPrepareType, + "HAVEPLAN": acceptedPlanType, + "HIDDEN_ID": id, + + "SCREENINGDATE": caertTime.isNotEmpty ? caertTime : '', + "LISTNAME": listName.isNotEmpty ? caertTime : '', + "GOVERNSTANDARDS": standard, + "GOVERNMETHOD": method, + "EXPENDITURE": fund, + "PRINCIPAL": person, + "PROGRAMMING": workTime, + "TIMELIMITFOR": time, + "JOBREQUIREMENT": work, + "OTHERBUSINESS": other, + "OTHER": json, + + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + /// 获取隐患级别 static Future> getHazardLevel() { return HttpManager().request( @@ -2092,23 +1957,10 @@ U6Hzm1ninpWeE+awIDAQAB /// 上传隐患快报 static Future> addRiskListCheckApp( - String hazardDescription, - String partDescription, - String latitude, - String longitude, - String dangerDetail, - String dataTime, - String type, - String responsibleId, - String yinHuanTypeIds, - String hazardLeve, - String buMenId, - String buMenPDId, - String yinHuanTypeNames, - String hiddenType1, - String hiddenType2, - String hiddenType3, - ) { + String hazardDescription,String partDescription,String latitude,String longitude, + String dangerDetail,String dataTime,String type,String responsibleId, + String yinHuanTypeIds,String hazardLeve,String buMenId,String buMenPDId, + String yinHuanTypeNames,String hiddenType1,String hiddenType2,String hiddenType3,) { return HttpManager().request( basePath, '/app/hidden/riskListCheckAppAdd', @@ -2127,15 +1979,15 @@ U6Hzm1ninpWeE+awIDAQAB "RECTIFICATIONOR": responsibleId, "HIDDENTYPE": yinHuanTypeIds, - "HIDDENLEVEL": hazardLeve, + "HIDDENLEVEL":hazardLeve, "RECTIFICATIONDEPT": buMenId, - "HIDDENFINDDEPT": buMenPDId.isNotEmpty ? buMenPDId : buMenId, + "HIDDENFINDDEPT": buMenPDId.isNotEmpty?buMenPDId:buMenId, "CREATOR": SessionService.instance.loginUserId, "HIDDENTYPE_NAME": yinHuanTypeNames, - "HIDDENTYPE1": hiddenType1, - "HIDDENTYPE2": hiddenType2, - "HIDDENTYPE3": hiddenType3, + "HIDDENTYPE1": hiddenType1 , + "HIDDENTYPE2": hiddenType2 , + "HIDDENTYPE3": hiddenType3 , "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, }, @@ -2143,40 +1995,27 @@ U6Hzm1ninpWeE+awIDAQAB } /// 提交隐患验收接口 - static Future> addHazardAcceptance( - String type, - String miaoshu, - String dataTime, - String id, - ) { + static Future> addHazardAcceptance(String type,String miaoshu,String dataTime,String id) { return HttpManager().request( basePath, '/app/hidden/riskListCheckInspection', method: Method.post, - data: { - "ISQUALIFIED": type, - "CHECKDESCR": miaoshu, - "CHECK_TIME": dataTime, - "HIDDEN_ID": id, - "CHECKOR": SessionService.instance.loginUserId, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, - }, + data: { + "ISQUALIFIED": type, + "CHECKDESCR": miaoshu, + "CHECK_TIME": dataTime, + "HIDDEN_ID": id, + "CHECKOR": SessionService.instance.loginUserId, + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, ); } /// 隐患检查列表 static Future> getHazardInspectionRecordList( - int currentPage, - String keyWord, - String id, - String dept, - String starDate, - String endDate, - String periodId, - String userName, - String typeId, - ) { + int currentPage,String keyWord,String id,String dept, + String starDate,String endDate,String periodId,String userName,String typeId,) { return HttpManager().request( basePath, '/app/listmanager/recordList?showCount=-1¤tPage=$currentPage', @@ -2189,7 +2028,7 @@ U6Hzm1ninpWeE+awIDAQAB "PERIOD": periodId, "USERNAME": userName, "TYPE": typeId, - "tm": DateTime.now().millisecondsSinceEpoch.toString(), + "tm": DateTime.now().millisecondsSinceEpoch.toString(), "KEYWORDS": keyWord, //关键字模糊查询 "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, @@ -2199,16 +2038,8 @@ U6Hzm1ninpWeE+awIDAQAB /// 标准排查列表 static Future> getStandardInvestigationRecordList( - int currentPage, - String keyWord, - String id, - String dept, - String starDate, - String endDate, - String periodId, - String userName, - String typeId, - ) { + int currentPage,String keyWord,String id,String dept, + String starDate,String endDate,String periodId,String userName,String typeId,) { return HttpManager().request( basePath, '/app/hiddenDangerCheckStandardCustom/recordList?showCount=-1¤tPage=$currentPage', @@ -2221,7 +2052,7 @@ U6Hzm1ninpWeE+awIDAQAB "PERIOD": periodId, "USERNAME": userName, "TYPE": typeId, - "tm": DateTime.now().millisecondsSinceEpoch.toString(), + "tm": DateTime.now().millisecondsSinceEpoch.toString(), "KEYWORDS": keyWord, //关键字模糊查询 "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, @@ -2238,7 +2069,7 @@ U6Hzm1ninpWeE+awIDAQAB data: { "DICTIONARIES_ID": '4a3d0d99b0ea4e268c11dd0b18866917', "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID": SessionService.instance.loginUserId, }, ); } @@ -2252,16 +2083,13 @@ U6Hzm1ninpWeE+awIDAQAB data: { "DICTIONARIES_ID": 'f60cf0e8315b4993b6d6049dd29f2ba5', "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID": SessionService.instance.loginUserId, }, ); } /// 获取检查记录列表 - static Future> getCheckRecordListOne( - String id, - String keyword, - ) { + static Future> getCheckRecordListOne(String id,String keyword) { return HttpManager().request( basePath, '/app/checkrecord/list', @@ -2270,16 +2098,13 @@ U6Hzm1ninpWeE+awIDAQAB "LISTMANAGER_ID": id, "KEYWORDS": keyword, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID": SessionService.instance.loginUserId, }, ); } /// 获取检查记录列表 - static Future> getCheckRecordList( - String id, - String keyword, - ) { + static Future> getCheckRecordList(String id,String keyword) { return HttpManager().request( basePath, '/app/customCheckRecord/list', @@ -2288,11 +2113,40 @@ U6Hzm1ninpWeE+awIDAQAB "CUSTOM_ID": id, "KEYWORDS": keyword, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID": SessionService.instance.loginUserId, }, ); } + /// 获取检查记录详情-隐患 + static Future> getInspectRecordsDetailYin(String id) { + return HttpManager().request( + basePath, + '/app/checkrecord/goEdit', + method: Method.post, + data: { + "CHECKRECORD_ID": id, + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + /// 获取检查记录详情2-隐患 + static Future> getInspectRecordsDetailTwoYin(String id) { + return HttpManager().request( + basePath, + '/app/hidden/getChcenkHidden', + method: Method.post, + data: { + "CHECKRECORD_ID": id, + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + /// 获取检查记录详情 static Future> getInspectRecordsDetail(String id) { return HttpManager().request( @@ -2302,7 +2156,7 @@ U6Hzm1ninpWeE+awIDAQAB data: { "CHECKRECORD_ID": id, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID": SessionService.instance.loginUserId, }, ); } @@ -2316,7 +2170,7 @@ U6Hzm1ninpWeE+awIDAQAB data: { "CHECKRECORD_ID": id, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID": SessionService.instance.loginUserId, }, ); } @@ -2331,16 +2185,15 @@ U6Hzm1ninpWeE+awIDAQAB "FOREIGN_KEY": id, "TYPE": 14, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID": SessionService.instance.loginUserId, }, ); } + + /// 获取标准排查列表 - static Future> getStandardInvestigationList( - String id, - String keyWord, - ) { + static Future> getStandardInvestigationList(String id,String keyWord) { return HttpManager().request( basePath, '/app/hiddenDangerCheckStandardCustom/checkList', @@ -2348,20 +2201,17 @@ U6Hzm1ninpWeE+awIDAQAB data: { "USER_NAME": SessionService.instance.username, "CHECK_DEPARTMENT_ID": id, - "SUB_DEPARTMENT_IDS": keyWord, //选择的部门 - "IS_MAIN": SessionService.instance.loginUser?["ISMAIN"] ?? "0", + "SUB_DEPARTMENT_IDS": keyWord, //选择的部门 + "IS_MAIN":SessionService.instance. loginUser?["ISMAIN"]??"0", "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, - "ISSUPERVISE": SessionService.instance.loginUser?["ISSUPERVISE"] ?? "0", + "ISSUPERVISE": SessionService.instance. loginUser?["ISSUPERVISE"]??"0", }, ); } /// 获取隐患排查列表 - static Future> getHazardInvestigationList( - String id, - String keyWord, - ) { + static Future> getHazardInvestigationList(String id,String keyWord) { return HttpManager().request( basePath, '/app/listmanager/checkListV2', @@ -2369,11 +2219,11 @@ U6Hzm1ninpWeE+awIDAQAB data: { "USER_NAME": SessionService.instance.username, "CHECK_DEPARTMENT_ID": id, - "SUB_DEPARTMENT_IDS": keyWord, //选择的部门 - "IS_MAIN": SessionService.instance.loginUser?["ISMAIN"] ?? "0", + "SUB_DEPARTMENT_IDS": keyWord, //选择的部门 + "IS_MAIN":SessionService.instance. loginUser?["ISMAIN"]??"0", "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, - "ISSUPERVISE": SessionService.instance.loginUser?["ISSUPERVISE"] ?? "0", + "ISSUPERVISE": SessionService.instance. loginUser?["ISSUPERVISE"]??"0", }, ); } @@ -2388,7 +2238,7 @@ U6Hzm1ninpWeE+awIDAQAB "CUSTOM_ID": id, "USER_NAME": SessionService.instance.username, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID":SessionService.instance.loginUserId, }, ); } @@ -2403,7 +2253,7 @@ U6Hzm1ninpWeE+awIDAQAB "LISTMANAGER_ID": id, "USER_NAME": SessionService.instance.username, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID":SessionService.instance.loginUserId, }, ); } @@ -2417,9 +2267,9 @@ U6Hzm1ninpWeE+awIDAQAB data: { "ELECTRONIC_FENCE_ID": id, "USER_NAME": SessionService.instance.username, - "PLS_ID": "", + "PLS_ID":"", "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID":SessionService.instance.loginUserId, }, ); } @@ -2435,11 +2285,12 @@ U6Hzm1ninpWeE+awIDAQAB "CHECK_ITEM": item["CHECK_ITEM"], "USER_NAME": SessionService.instance.username, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID":SessionService.instance.loginUserId, }, ); } + /// 获取已上传图片 static Future> getAlreadyUpImages(String id) { return HttpManager().request( @@ -2450,7 +2301,7 @@ U6Hzm1ninpWeE+awIDAQAB "FOREIGN_KEY": id, "TYPE": 14, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID":SessionService.instance.loginUserId, }, ); } @@ -2464,51 +2315,38 @@ U6Hzm1ninpWeE+awIDAQAB data: { "IMGFILES_ID": id, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID":SessionService.instance.loginUserId, }, ); } + /// 暂存隐患记录 static Future> temporaryStorageOfHidden( - String msg, - item, - unqualifiedInspectionItemID, - String hazardDescription, - String partDescription, - String latitude, - String longitude, - String dangerDetail, - String dataTime, - String type, - String responsibleId, - String yinHuanTypeIds, - String hazardLeve, - String buMenId, - String buMenPDId, - String yinHuanTypeNames, - String hiddenType1, - String hiddenType2, - String hiddenType3, - ) { + String msg,item,unqualifiedInspectionItemID, + String hazardDescription,String partDescription,String latitude,String longitude, + String dangerDetail,String dataTime,String type,String responsibleId, + String yinHuanTypeIds,String hazardLeve,String buMenId,String buMenPDId, + String yinHuanTypeNames,String hiddenType1,String hiddenType2,String hiddenType3,) { print("======>$type"); return HttpManager().request( basePath, '/app/customHidden/$msg', method: Method.post, data: { - "HIDDEN_ID": unqualifiedInspectionItemID, + "HIDDEN_ID":unqualifiedInspectionItemID, - "CUSTOM_ID": item["CUSTOM_ID"] ?? "", - "CUSTOM_ITEM_ID": item["CUSTOM_ITEM_ID"] ?? "", - "RECORDITEM_ID": item["RECORDITEM_ID"] ?? "", - "CHECK_CATEGORY": item["CHECK_CATEGORY"] ?? "", - "CHECK_CATEGORY_NAME": item["CHECK_CATEGORY_NAME"] ?? "", - "CHECK_ITEM": item["CHECK_ITEM"] ?? "", - "CHECK_ITEM_NAME": item["CHECK_ITEM_NAME"] ?? "", - "CHECK_CONTENT": item["CHECK_CONTENT"] ?? "", - "CHECK_STANDARD": item["CHECK_STANDARD"] ?? "", - "REFERENCE_BASIS": item["REFERENCE_BASIS"] ?? "", + + "CUSTOM_ID": item["CUSTOM_ID"]??"", + "CUSTOM_ITEM_ID": item["CUSTOM_ITEM_ID"]??"", + "RECORDITEM_ID": item["RECORDITEM_ID"]??"", + "CHECK_CATEGORY": item["CHECK_CATEGORY"]??"", + "CHECK_CATEGORY_NAME": item["CHECK_CATEGORY_NAME"]??"", + "CHECK_ITEM": item["CHECK_ITEM"]??"", + "CHECK_ITEM_NAME":item["CHECK_ITEM_NAME"]??"", + "CHECK_CONTENT": item["CHECK_CONTENT"]??"", + "CHECK_STANDARD": item["CHECK_STANDARD"]??"", + "REFERENCE_BASIS":item["REFERENCE_BASIS"] ??"", "SOURCE": '2', "STATE": '0', "CLEARIMG": '1', @@ -2524,21 +2362,22 @@ U6Hzm1ninpWeE+awIDAQAB "RECTIFICATIONOR": responsibleId, "HIDDENTYPE": yinHuanTypeIds, - "HIDDENLEVEL": hazardLeve, + "HIDDENLEVEL":hazardLeve, "RECTIFICATIONDEPT": buMenId, - "HIDDENFINDDEPT": buMenPDId.isNotEmpty ? buMenPDId : buMenId, + "HIDDENFINDDEPT": buMenPDId.isNotEmpty?buMenPDId:buMenId, "CREATOR": SessionService.instance.loginUserId, "HIDDENTYPE_NAME": yinHuanTypeNames, - "HIDDENTYPE1": hiddenType1, - "HIDDENTYPE2": hiddenType2, - "HIDDENTYPE3": hiddenType3, + "HIDDENTYPE1": hiddenType1 , + "HIDDENTYPE2": hiddenType2 , + "HIDDENTYPE3": hiddenType3 , "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, }, ); } + /// 获取暂存隐患记录 static Future> getTemporaryStorageOfHidden(String id) { return HttpManager().request( @@ -2548,40 +2387,36 @@ U6Hzm1ninpWeE+awIDAQAB data: { "HIDDEN_ID": id, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID":SessionService.instance.loginUserId, }, ); } /// 提交排查项 static Future> submitInvestigationItems( - item, - String longitude, - String latitude, - String itemsString, - String idsString, - String checkrecordId, - ) { + item,String longitude,String latitude, + String itemsString,String idsString,String checkrecordId,) { return HttpManager().request( basePath, '/app/customCheckRecord/add', method: Method.post, - data: { - "CUSTOM_ID": item["CUSTOM_ID"], - "LIST_NAME": SessionService.instance.listItemNameJson, - "CREATOR": SessionService.instance.username, - "LATITUDE": latitude, - "LONGITUDE": longitude, - "ITEMS": itemsString, - "IDS": idsString, - "CHECKRECORD_ID": checkrecordId, - "tm": DateTime.now().millisecondsSinceEpoch.toString(), - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, - }, + data: { + "CUSTOM_ID": item["CUSTOM_ID"], + "LIST_NAME": SessionService.instance.listItemNameJson, + "CREATOR": SessionService.instance.username, + "LATITUDE": latitude, + "LONGITUDE": longitude, + "ITEMS": itemsString, + "IDS": idsString, + "CHECKRECORD_ID": checkrecordId, + "tm": DateTime.now().millisecondsSinceEpoch.toString(), + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, ); } + /// 获取排查项 static Future> getCheckInformationList(String id) { return HttpManager().request( @@ -2589,6 +2424,7 @@ U6Hzm1ninpWeE+awIDAQAB '/app/customHidden/getOtherHidden', method: Method.post, data: { + "CUSTOM_ID": id, "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, @@ -2596,35 +2432,23 @@ U6Hzm1ninpWeE+awIDAQAB ); } + + /// 暂存其他隐患记录 static Future> checkInformationOneItemData( - String msg, - String id, - unqualifiedInspectionItemID, - String hazardDescription, - String partDescription, - String latitude, - String longitude, - String dangerDetail, - String dataTime, - String type, - String responsibleId, - String yinHuanTypeIds, - String hazardLeve, - String buMenId, - String buMenPDId, - String yinHuanTypeNames, - String hiddenType1, - String hiddenType2, - String hiddenType3, - ) { + String msg,String id,unqualifiedInspectionItemID, + String hazardDescription,String partDescription,String latitude,String longitude, + String dangerDetail,String dataTime,String type,String responsibleId, + String yinHuanTypeIds,String hazardLeve,String buMenId,String buMenPDId, + String yinHuanTypeNames,String hiddenType1,String hiddenType2,String hiddenType3,) { print("======>$type"); return HttpManager().request( basePath, '/app/customHidden/$msg', method: Method.post, data: { - "HIDDEN_ID": unqualifiedInspectionItemID, + + "HIDDEN_ID":unqualifiedInspectionItemID, "SOURCE": '3', "STATE": '0', @@ -2639,46 +2463,47 @@ U6Hzm1ninpWeE+awIDAQAB "RECTIFICATIONOR": responsibleId, "HIDDENTYPE": yinHuanTypeIds, - "HIDDENLEVEL": hazardLeve, + "HIDDENLEVEL":hazardLeve, "RECTIFICATIONDEPT": buMenId, - "HIDDENFINDDEPT": buMenPDId.isNotEmpty ? buMenPDId : buMenId, + "HIDDENFINDDEPT": buMenPDId.isNotEmpty?buMenPDId:buMenId, "CREATOR": SessionService.instance.loginUserId, "LISTMANAGER_ID": id, "HIDDENTYPE_NAME": yinHuanTypeNames, - "HIDDENTYPE1": hiddenType1, - "HIDDENTYPE2": hiddenType2, - "HIDDENTYPE3": hiddenType3, + "HIDDENTYPE1": hiddenType1 , + "HIDDENTYPE2": hiddenType2 , + "HIDDENTYPE3": hiddenType3 , "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, }, ); } + + /// 提交排查项 - static Future> customCheckRecordFinish( - String time, - String text, - String CHECKRECORD_ID, - String id, - String json, - ) { + static Future> customCheckRecordFinish(String time,String text, + String CHECKRECORD_ID,String id,String json) { return HttpManager().request( basePath, '/app/customCheckRecord/finish', method: Method.post, data: { - "CHECK_TIME": time, - "DESCR": text, - "CHECKRECORD_ID": CHECKRECORD_ID, - "CUSTOM_ID": id, - "OTHER": json, - "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "CHECK_TIME": time, + "DESCR": text, + "CHECKRECORD_ID": CHECKRECORD_ID, + "CUSTOM_ID": id, + "OTHER": json, + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + + }, ); } + + /// 获取隐患排查排查项 static Future> getInvestigationItemsYinHuan(final item) { return HttpManager().request( @@ -2690,15 +2515,13 @@ U6Hzm1ninpWeE+awIDAQAB "IDENTIFICATIONPARTS_ID": item["IDENTIFICATIONPARTS_ID"], "USER_NAME": SessionService.instance.username, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID":SessionService.instance.loginUserId, }, ); } /// 获取隐患排查暂存隐患记录 - static Future> getYinHuanTemporaryStorageOfHidden( - String id, - ) { + static Future> getYinHuanTemporaryStorageOfHidden(String id) { return HttpManager().request( basePath, '/app/hidden/goRiskListCheckEdit', @@ -2706,49 +2529,34 @@ U6Hzm1ninpWeE+awIDAQAB data: { "HIDDEN_ID": id, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID":SessionService.instance.loginUserId, }, ); } + /// 暂存隐患排查隐患记录 static Future> temporaryStorageOfHiddenYinHuan( - String msg, - item, - unqualifiedInspectionItemID, - String hazardDescription, - String partDescription, - String latitude, - String longitude, - String dangerDetail, - String dataTime, - String type, - String responsibleId, - String yinHuanTypeIds, - String hazardLeve, - String buMenId, - String buMenPDId, - String yinHuanTypeNames, - String hiddenType1, - String hiddenType2, - String hiddenType3, - result, - ) { + String msg,item,unqualifiedInspectionItemID, + String hazardDescription,String partDescription,String latitude,String longitude, + String dangerDetail,String dataTime,String type,String responsibleId, + String yinHuanTypeIds,String hazardLeve,String buMenId,String buMenPDId, + String yinHuanTypeNames,String hiddenType1,String hiddenType2,String hiddenType3,result) { print("======>$type"); return HttpManager().request( basePath, '/app/hidden/$msg', method: Method.post, data: { - "HIDDEN_ID": unqualifiedInspectionItemID, + "HIDDEN_ID":unqualifiedInspectionItemID, "SOURCE": '2', "STATE": '0', "HIDDEN_CATEGORY": result["HIDDEN_CATEGORY"] ?? '', "LISTMANAGER_ID": item["LISTMANAGER_ID"], "RISKITEM_ID": result["LISTCHECKITEM_ID"], - "CHECK_CONTENT": item["CHECK_CONTENT"] ?? "", - "RECORDITEM_ID": item["RECORDITEM_ID"] ?? "", + "CHECK_CONTENT": item["CHECK_CONTENT"]??"", + "RECORDITEM_ID": item["RECORDITEM_ID"]??"", "HIDDENDESCR": hazardDescription, "HIDDENPART": partDescription, @@ -2761,31 +2569,27 @@ U6Hzm1ninpWeE+awIDAQAB "RECTIFICATIONOR": responsibleId, "HIDDENTYPE": yinHuanTypeIds, - "HIDDENLEVEL": hazardLeve, + "HIDDENLEVEL":hazardLeve, "RECTIFICATIONDEPT": buMenId, - "HIDDENFINDDEPT": buMenPDId.isNotEmpty ? buMenPDId : buMenId, + "HIDDENFINDDEPT": buMenPDId.isNotEmpty?buMenPDId:buMenId, "CREATOR": SessionService.instance.loginUserId, "CLEARIMG": '1', "HIDDENTYPE_NAME": yinHuanTypeNames, - "HIDDENTYPE1": hiddenType1, - "HIDDENTYPE2": hiddenType2, - "HIDDENTYPE3": hiddenType3, + "HIDDENTYPE1": hiddenType1 , + "HIDDENTYPE2": hiddenType2 , + "HIDDENTYPE3": hiddenType3 , "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, }, ); } + /// 提交隐患排查排查项 static Future> submitInvestigationItemsYinHuan( - item, - String longitude, - String latitude, - String itemsString, - String idsString, - String checkrecordId, - ) { + item,String longitude,String latitude, + String itemsString,String idsString,String checkrecordId,) { return HttpManager().request( basePath, '/app/checkrecord/add', @@ -2793,7 +2597,7 @@ U6Hzm1ninpWeE+awIDAQAB data: { // "CUSTOM_ID": item["CUSTOM_ID"], "LISTMANAGER_ID": item["LISTMANAGER_ID"], - "LIST_NAME": SessionService.instance.listItemNameJson, + "LIST_NAME": SessionService.instance.listItemNameJson, "CREATOR": SessionService.instance.username, "LATITUDE": latitude, "LONGITUDE": longitude, @@ -2807,10 +2611,10 @@ U6Hzm1ninpWeE+awIDAQAB ); } + + /// 获取隐患排查项 - static Future> getCheckInformationListYinHuan( - String id, - ) { + static Future> getCheckInformationListYinHuan(String id) { return HttpManager().request( basePath, '/app/hidden/getOtherHidden', @@ -2823,14 +2627,10 @@ U6Hzm1ninpWeE+awIDAQAB ); } + /// 提交隐患排查项 - static Future> customCheckRecordFinishYinHuan( - String time, - String text, - String CHECKRECORD_ID, - String id, - String json, - ) { + static Future> customCheckRecordFinishYinHuan(String time,String text, + String CHECKRECORD_ID,String id,String json) { return HttpManager().request( basePath, '/app/checkrecord/finish', @@ -2843,14 +2643,16 @@ U6Hzm1ninpWeE+awIDAQAB "OTHER": json, "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, + + }, ); } + + /// 获取暂存隐患记录 - static Future> getTemporaryStorageOfHiddenYinHuan( - String id, - ) { + static Future> getTemporaryStorageOfHiddenYinHuan(String id) { return HttpManager().request( basePath, '/app/hidden/goEdit', @@ -2858,40 +2660,27 @@ U6Hzm1ninpWeE+awIDAQAB data: { "HIDDEN_ID": id, "CORPINFO_ID": SessionService.instance.corpinfoId, - "USER_ID": SessionService.instance.loginUserId, + "USER_ID":SessionService.instance.loginUserId, }, ); } + /// 暂存其他隐患记录 static Future> checkInformationOneItemDataYinHuan( - String msg, - String id, - unqualifiedInspectionItemID, - String hazardDescription, - String partDescription, - String latitude, - String longitude, - String dangerDetail, - String dataTime, - String type, - String responsibleId, - String yinHuanTypeIds, - String hazardLeve, - String buMenId, - String buMenPDId, - String yinHuanTypeNames, - String hiddenType1, - String hiddenType2, - String hiddenType3, - ) { + String msg,String id,unqualifiedInspectionItemID, + String hazardDescription,String partDescription,String latitude,String longitude, + String dangerDetail,String dataTime,String type,String responsibleId, + String yinHuanTypeIds,String hazardLeve,String buMenId,String buMenPDId, + String yinHuanTypeNames,String hiddenType1,String hiddenType2,String hiddenType3,) { print("======>$type"); return HttpManager().request( basePath, '/app/hidden/$msg', method: Method.post, data: { - "HIDDEN_ID": unqualifiedInspectionItemID, + + "HIDDEN_ID":unqualifiedInspectionItemID, "SOURCE": '3', "STATE": '0', @@ -2906,30 +2695,29 @@ U6Hzm1ninpWeE+awIDAQAB "RECTIFICATIONOR": responsibleId, "HIDDENTYPE": yinHuanTypeIds, - "HIDDENLEVEL": hazardLeve, + "HIDDENLEVEL":hazardLeve, "RECTIFICATIONDEPT": buMenId, - "HIDDENFINDDEPT": buMenPDId.isNotEmpty ? buMenPDId : buMenId, + "HIDDENFINDDEPT": buMenPDId.isNotEmpty?buMenPDId:buMenId, "CREATOR": SessionService.instance.loginUserId, "LISTMANAGER_ID": id, "HIDDENTYPE_NAME": yinHuanTypeNames, - "HIDDENTYPE1": hiddenType1, - "HIDDENTYPE2": hiddenType2, - "HIDDENTYPE3": hiddenType3, + "HIDDENTYPE1": hiddenType1 , + "HIDDENTYPE2": hiddenType2 , + "HIDDENTYPE3": hiddenType3 , "CORPINFO_ID": SessionService.instance.corpinfoId, "USER_ID": SessionService.instance.loginUserId, }, ); } + + /// 获取安全例会列表 - static Future> getSafetyMeetingList( - int page, - int selectedTab, - ) { + static Future> getSafetyMeetingList(int page,int selectedTab) { return HttpManager().request( basePath, - '/app/safetyMeeting/list?selectType=$selectedTab &showCount=10¤tPage=$page', + '/app/safetyMeeting/list?selectType=$selectedTab&showCount=10¤tPage=$page', method: Method.post, data: { "CORPINFO_ID": SessionService.instance.corpinfoId, @@ -2937,4 +2725,375 @@ U6Hzm1ninpWeE+awIDAQAB }, ); } + + + + /// 获取安全例会详情 + static Future> getSafetyMeetDetail(String id) { + return HttpManager().request( + basePath, + '/app/safetyMeeting/goEdit', + method: Method.post, + data: { + "SAFETY_MEETING_ID": id, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + + /// 提交安全例会详情 + static Future> setSafetyMeetDetailFeedback(String id,String text) { + return HttpManager().request( + basePath, + '/app/safetyMeeting/confirm', + method: Method.post, + data: { + "SAFETY_MEETING_ID": id, + "FEED_BACK": text, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + /// 安全例会详情图片 + static Future> addSafetyMeetDetailFeedBack(String imagePath,String id) async { + final file = File(imagePath); + if (!await file.exists()) { + throw ApiException('file_not_found', '图片不存在:$imagePath'); + } + final fileName = file.path.split(Platform.pathSeparator).last; + + return HttpManager().uploadFaceImage( + baseUrl: basePath, + path: '/app/safetyMeeting/upload', + fromData: { + 'FOREIGN_KEY': id, + 'CORPINFO_ID': SessionService.instance.corpinfoId, + "TYPE":"106", + 'FFILE': await MultipartFile.fromFile( + file.path, + filename: fileName + ), + } + ); + } + + + /// 获取设备巡检列表 + static Future> getEquipmentInspectionList(int page,int selectedTab) { + return HttpManager().request( + basePath, + '/app/specialequipmentaqxj/list?showCount=100¤tPage=$page', + method: Method.post, + data: { + "UNCHECK": selectedTab==0?"":"1", + "tm": DateTime.now().millisecondsSinceEpoch.toString(), + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + + + + /// 开始巡检 + static Future> startInspection( + Map formData, + List filePaths, + ) async { + // 复制一份 formData + final data = Map.from(formData); + + // 把文件路径填成 MultipartFile + for (var i = 0; i < filePaths.length; i++) { + final path = filePaths[i]; + data['file$i'] = await MultipartFile.fromFile( + path, + filename: path.split(Platform.pathSeparator).last, + ); + } + return HttpManager().uploadFaceImage( + baseUrl: basePath, + path: '/app/specialequipmentaqxj/add', + fromData: data, + ); + } + + + + /// 设备巡检记录 + static Future> getEquipmentDetailList(String id,int selectedTab) { + return HttpManager().request( + basePath, + '/app/specialequipmentaqxj/listByEquipment', + method: Method.post, + data: { + "SPECIALEQUIPMENT_ID": id, + "IS_CHECKED": selectedTab, + "tm": DateTime.now().millisecondsSinceEpoch.toString(), + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + /// 巡检记录-详情 + static Future> getEquimentDetailListinfo(String id) { + return HttpManager().request( + basePath, + '/app/specialequipmentaqxj/goEdit', + method: Method.post, + data: { + "SPECIALEQUIPMENTAQXJ_ID": id, + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + /// 获取公司安全承诺列表 + static Future> getCompanySafetyCommitmentList(int page,String keyWord,String id) { + return HttpManager().request( + basePath, + '/app/commitmentcompany/list?showCount=-1¤tPage=$page', + method: Method.post, + data: { + + "DEPARTMENT_ID": id, + "tm": DateTime.now().millisecondsSinceEpoch.toString(), + "KEYWORDS": keyWord, //关键字模糊查询 + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + /// 获取车间安全承诺列表 + static Future> getWorkshopSafetyCommitmentList(int page,String keyWord,String id) { + return HttpManager().request( + basePath, + '/app/commitmentworkshop/list?showCount=-1¤tPage=$page', + method: Method.post, + data: { + + "DEPARTMENT_ID": id, + "tm": DateTime.now().millisecondsSinceEpoch.toString(), + "KEYWORDS": keyWord, //关键字模糊查询 + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + + /// 获取班组安全承诺列表 + static Future> getTeamSafetyCommitmentList(int page,String keyWord,String id) { + return HttpManager().request( + basePath, + '/app/commitment/team/list?showCount=-1¤tPage=$page', + method: Method.post, + data: { + + "DEPARTMENT_ID": id, + "tm": DateTime.now().millisecondsSinceEpoch.toString(), + "KEYWORDS": keyWord, //关键字模糊查询 + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + + /// 获取公司安全承诺列表-验证申请 + static Future> getCompanySafetyCommitmentPermission(String id) { + return HttpManager().request( + basePath, + '/app/commitmentcompany/check', + method: Method.post, + data: { + "DEPARTMENT_ID": id, + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + /// 获取车间安全承诺列表-验证申请 + static Future> getWorkshopSafetyCommitmentPermission(String id) { + return HttpManager().request( + basePath, + '/app/commitmentworkshop/check', + method: Method.post, + data: { + "DEPARTMENT_ID": id, + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + /// 获取班组安全承诺列表-验证申请 + static Future> getTeamSafetyCommitmentPermission(String id) { + return HttpManager().request( + basePath, + '/app/commitment/team/check', + method: Method.post, + data: { + "DEPARTMENT_ID": id, + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + + /// 公司安全承诺-提交 + static Future> upCompanySafetyCommitmentApply( + Map formData, + List filePaths, + ) async { + // 复制一份 formData + final data = Map.from(formData); + + // 把文件路径填成 MultipartFile + // for (var i = 0; i < filePaths.length; i++) { + final path = filePaths[0]; + data['FFILE'] = await MultipartFile.fromFile( + path, + filename: path.split(Platform.pathSeparator).last, + ); + // } + return HttpManager().uploadFaceImage( + baseUrl: basePath, + path: '/app/commitmentcompany/add', + fromData: data, + ); + } + + /// 获取车间安全承诺列表-提交 + static Future> upWorkshopSafetyCommitmentApply( + Map formData, + List filePaths, + ) async { + // 复制一份 formData + final data = Map.from(formData); + + // 把文件路径填成 MultipartFile + // for (var i = 0; i < filePaths.length; i++) { + final path = filePaths[0]; + data['FFILE'] = await MultipartFile.fromFile( + path, + filename: path.split(Platform.pathSeparator).last, + ); + // } + return HttpManager().uploadFaceImage( + baseUrl: basePath, + path: '/app/commitmentworkshop/add', + fromData: data, + ); + } + + + /// 获取班组安全承诺列表-提交 + static Future> upTeamSafetyCommitmentApply( + Map formData, + List filePaths, + ) async { + // 复制一份 formData + final data = Map.from(formData); + + // 把文件路径填成 MultipartFile + // for (var i = 0; i < filePaths.length; i++) { + final path = filePaths[0]; + data['FFILE'] = await MultipartFile.fromFile( + path, + filename: path.split(Platform.pathSeparator).last, + ); + // } + return HttpManager().uploadFaceImage( + baseUrl: basePath, + path: '/app/commitment/team/add', + fromData: data, + ); + } + + + + /// 获取公司安全承诺列表-详情 + static Future> getCompanySafetyCommitmentDetail(String id) { + return HttpManager().request( + basePath, + '/app/commitmentcompany/goEdit', + method: Method.post, + data: { + "COMMITMENTCOMPANY_ID": id, + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + /// 获取车间安全承诺列表-详情 + static Future> getWorkshopSafetyCommitmentDetail(String id) { + return HttpManager().request( + basePath, + '/app/commitmentworkshop/goEdit', + method: Method.post, + data: { + "COMMITMENTWORKSHOP_ID": id, + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + /// 获取班组安全承诺列表-详情 + static Future> getTeamSafetyCommitmentDetail(String id) { + return HttpManager().request( + basePath, + '/app/commitment/team/goEdit', + method: Method.post, + data: { + "COMMITMENTTEAM_ID": id, + "CORPINFO_ID": SessionService.instance.corpinfoId, + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + + /// 获取其他行业承诺-我的承诺列表 + static Future> getMyOtherCommitmentsList() { + return HttpManager().request( + basePath, + '/app/corppromise/promiselist_II', + method: Method.post, + data: { + "showCount": "-1", + "currentPage": "1", + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + /// 获取其他行业承诺-接收承诺列表 + static Future> getAcceptCommitmentList() { + return HttpManager().request( + basePath, + '/app/corppromise/receivePromiseList_II', + method: Method.post, + data: { + "showCount": "-1", + "currentPage": "1", + "USER_ID": SessionService.instance.loginUserId, + }, + ); + } + + + + + } + diff --git a/lib/pages/app/Danger_paicha/check_record_detail_page.dart b/lib/pages/app/Danger_paicha/check_record_detail_page.dart index b531776..cfbcf10 100644 --- a/lib/pages/app/Danger_paicha/check_record_detail_page.dart +++ b/lib/pages/app/Danger_paicha/check_record_detail_page.dart @@ -9,13 +9,15 @@ import 'package:qhd_prevention/http/ApiService.dart'; import 'package:qhd_prevention/pages/app/danger_wait_list_page.dart'; import 'package:qhd_prevention/pages/app/detail_images_page.dart'; import 'package:qhd_prevention/pages/app/hidden_record_detail_page.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; import 'package:qhd_prevention/tools/tools.dart'; class CheckRecordDetailPage extends StatefulWidget { - const CheckRecordDetailPage(this.id, {super.key}); + const CheckRecordDetailPage(this.id, this.type, {super.key}); + final int type; final String id; @override _CheckRecordDetailPageState createState() => _CheckRecordDetailPageState(); @@ -81,7 +83,13 @@ class _CheckRecordDetailPageState extends State { Future _getInspectRecordsDetail() async { try { - final result = await ApiService.getInspectRecordsDetail(widget.id); + final Map result; + if(widget.type==1){ + result = await ApiService.getInspectRecordsDetailYin(widget.id); + }else{ + result = await ApiService.getInspectRecordsDetail(widget.id); + } + // final result = await ApiService.getInspectRecordsDetail(widget.id); if (result['result'] == 'success') { final List qianmingList = result['qianming'] ?? []; setState(() { @@ -106,7 +114,13 @@ class _CheckRecordDetailPageState extends State { Future _getInspectRecordsDetailTwo() async { try { - final result = await ApiService.getInspectRecordsDetailTwo(widget.id); + final Map result; + if(widget.type==1){ + result = await ApiService.getInspectRecordsDetailTwoYin(widget.id); + }else{ + result = await ApiService.getInspectRecordsDetailTwo(widget.id); + } + // final result = await ApiService.getInspectRecordsDetailTwo(widget.id); if (result['result'] == 'success') { final List newList = result['hiddenList'] ?? []; setState(() { @@ -129,7 +143,8 @@ class _CheckRecordDetailPageState extends State { @override Widget build(BuildContext context) { return Scaffold( - appBar: _buildAppBar(), + appBar: MyAppbar(title: "检查记录详情"), + // _buildAppBar(), body: SingleChildScrollView( child: Column( crossAxisAlignment: CrossAxisAlignment.start, @@ -148,17 +163,17 @@ class _CheckRecordDetailPageState extends State { ); } - AppBar _buildAppBar() { - return AppBar( - leading: IconButton( - icon: Icon(Icons.arrow_back, color: Colors.white), - onPressed: () => Navigator.pop(context), - ), - title: Text("检查记录详情", style: TextStyle(color: Colors.white)), - backgroundColor: Colors.blue, - centerTitle: true, - ); - } + // AppBar _buildAppBar() { + // return AppBar( + // leading: IconButton( + // icon: Icon(Icons.arrow_back, color: Colors.white), + // onPressed: () => Navigator.pop(context), + // ), + // title: Text("检查记录详情", style: TextStyle(color: Colors.white)), + // backgroundColor: Colors.blue, + // centerTitle: true, + // ); + // } Widget _buildSectionTitle(String title) { return Padding( diff --git a/lib/pages/app/Danger_paicha/check_record_list_page.dart b/lib/pages/app/Danger_paicha/check_record_list_page.dart index d7d2c30..41888d3 100644 --- a/lib/pages/app/Danger_paicha/check_record_list_page.dart +++ b/lib/pages/app/Danger_paicha/check_record_list_page.dart @@ -145,7 +145,7 @@ class _CheckRecordListPageState extends State void _handleItemTap( item, int index) { if(_selectedTab==0){ print("点击了是: ${index}"); - pushPage(CheckRecordDetailPage(item['CHECKRECORD_ID']), context); + pushPage(CheckRecordDetailPage(item['CHECKRECORD_ID'],widget.type), context); } } // 显示分类选择器 diff --git a/lib/pages/app/checking_information_one_page.dart b/lib/pages/app/checking_information_one_page.dart index e59cc51..032afaf 100644 --- a/lib/pages/app/checking_information_one_page.dart +++ b/lib/pages/app/checking_information_one_page.dart @@ -55,6 +55,7 @@ class _CheckingInformationOnePageState extends State // TODO: implement initState super.initState(); + CHECKRECORD_ID= widget.checkrecordId??""; final now =DateTime.now(); dataTime=DateFormat('yyyy-MM-dd').format(now); stringTime=DateFormat('HH:mm').format(now); @@ -86,7 +87,7 @@ class _CheckingInformationOnePageState extends State final List newList = result['hiddenList'] ?? []; setState(() { - CHECKRECORD_ID= result['CHECKRECORD_ID']; + // CHECKRECORD_ID= result['CHECKRECORD_ID']; listDates.addAll(newList);//"HIDDENDESCR" -> "3111111" for(int i=0;i final List newList = result['hiddenList'] ?? []; setState(() { - CHECKRECORD_ID= result['CHECKRECORD_ID']; + // CHECKRECORD_ID= result['CHECKRECORD_ID']; listDates.addAll(newList);//"HIDDENDESCR" -> "3111111" for(int i=0;i _normalRectificationSubmission() async { - try { + String dataTime= dannerRepairKey.currentState!.dataTime; @@ -616,6 +616,8 @@ class _PendingRectificationDetailPageState extends State createState() => _EquimentDetailListPageState(); +} + +class _EquimentDetailListPageState extends State + with SingleTickerProviderStateMixin{ + + late TabController _tabController= TabController(length: 2, vsync: this); + int _selectedTab = 0; + late List _list = []; + + + @override + void initState() { + super.initState(); + // _tabController = TabController(length: 2, vsync: this); + _tabController.addListener(() { + // if (!_tabController.indexIsChanging) { + // setState(() => _selectedTab = _tabController.index); + // } + + if (_tabController.indexIsChanging) { + setState(() => _selectedTab = _tabController.index); + print('切换到标签:${_tabController.index}'); + reRefreshData(); + } + + }); + + _getEquipmentDetailList(false); + } + + void reRefreshData(){ + _list.clear(); + _getEquipmentDetailList(false); + + } + + Future _getEquipmentDetailList(bool loadMore) async { + try { + + final result = await ApiService.getEquipmentDetailList(widget.id,_selectedTab ); + if (result['result'] == 'success') { + + final List newList = result['varList'] ?? []; + setState(() { + _list.addAll(newList); + }); + + }else{ + ToastUtil.showNormal(context, "加载数据失败"); + // _showMessage('加载数据失败'); + } + + } catch (e) { + // 出错时可以 Toast 或者在页面上显示错误状态 + print('加载数据失败:$e'); + } + } + + + + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppbar(title: "设备巡检记录"), + body: + GestureDetector( + onTap: () { + FocusScope.of(context).unfocus(); // 收起键盘 + }, + behavior: HitTestBehavior.opaque, + child: Scaffold( + body: SafeArea( + child: Column( + children: [ + // Tab bar + Container( + color: Colors.white, + child: TabBar( + controller: _tabController, + labelStyle: TextStyle(fontSize: 16), + indicator: UnderlineTabIndicator( + borderSide: BorderSide(width: 3.0, color: Colors.blue), + insets: EdgeInsets.symmetric(horizontal: 100.0), + ), + labelColor: Colors.blue, + unselectedLabelColor: Colors.grey, + tabs: const [Tab(text: '已检查记录'), Tab(text: '超期未检查记录')], + ), + ), + + // Search bar + // List + Expanded( + child: + _list.isEmpty + ? NoDataWidget.show() + : ListView.builder( + itemCount: _list.length, + itemBuilder: (context, index) { + return _itemCell(_list[index]); + }, + ), + ), + + + ], + ), + ), + ), + ), + ); + } + + Widget _itemCell(final record) { + return Card( + color: Colors.white, + margin: const EdgeInsets.only(top: 15,left: 15,right: 15), + elevation: 2, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(8), + ), + child: InkWell( + onTap:() { + _goToDetail(record); + } , + child: Padding( + padding: const EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + _buildInfoRow('人员:${record['INSPECTOR']}'), + const SizedBox(height: 8), + _buildInfoRow( + '检查周期:${ DateFormat('yyyy-MM-dd').format(DateTime.parse(record['PERIOD_START_DATE']))} ' + '- ${DateFormat('yyyy-MM-dd').format(DateTime.parse(record['PERIOD_END_DATE']))}' + ), + const SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + _buildInfoRow('检查时间:${record['INSPECTIONTIME']}'), + _buildInfoRow('是否故障:${record['ISFAULT']}'), + ], + ), + ], + ), + ), + ), + ); + } + + Widget _buildInfoRow(String text) { + return Text( + text, + style: const TextStyle(color: Colors.grey, fontSize: 14), + ); + } + + + void _goToDetail(item){ + // pushPage(SafetyMeetingDetailPage( + // id,_selectedTab, + // onClose: (String result) { + // setState(() { + // reRefreshData(); + // }); + // + // }, + // ), context); + pushPage(EquimentDetailListinfo(item["SPECIALEQUIPMENTAQXJ_ID"]), context); + } + + + + + + +} + + + diff --git a/lib/pages/home/EquipmentInspection/equiment_detail_listinfo.dart b/lib/pages/home/EquipmentInspection/equiment_detail_listinfo.dart new file mode 100644 index 0000000..44b5e1a --- /dev/null +++ b/lib/pages/home/EquipmentInspection/equiment_detail_listinfo.dart @@ -0,0 +1,159 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:qhd_prevention/customWidget/ItemWidgetFactory.dart'; +import 'package:qhd_prevention/customWidget/custom_button.dart'; +import 'package:qhd_prevention/customWidget/date_picker_dialog.dart'; +import 'package:qhd_prevention/customWidget/photo_picker_row.dart'; +import 'package:qhd_prevention/customWidget/single_image_viewer.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + + + +class EquimentDetailListinfo extends StatefulWidget { + const EquimentDetailListinfo(this. id, {super.key}); + + final String id; + + @override + State createState() => _EquimentDetailListinfoState(); +} + +class _EquimentDetailListinfoState extends State { + + + final TextEditingController _xunController = TextEditingController(); + final TextEditingController _neiRongController = TextEditingController(); + // 是否有故障 + bool _isFault = false; + String dataTime=""; + + List faultImgs = []; + List handleImgs = []; + List inspectionImgs = []; + + dynamic pd={}; + + @override + void initState() { + // TODO: implement initState + super.initState(); + + _getEquimentDetailListinfo(); + } + + Future _getEquimentDetailListinfo() async { + try { + final result = await ApiService.getEquimentDetailListinfo(widget.id); + if (result['result'] == 'success') { + + setState(() { + + pd= result['pd']; + faultImgs.addAll(result['faultImgs'] ?? []); + handleImgs.addAll(result['handleImgs'] ?? []); + inspectionImgs.addAll(result['inspectionImgs'] ?? []); + + }); + } + } catch (e) { + print('Error fetching data: $e'); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppbar(title: "开始巡检"), + body: ListView( + children: [ + Container( + color: Colors.white, + child: Column(children: [ + ItemListWidget.singleLineTitleText( + label: '巡检人:', + isEditable: false, + controller: _xunController, + text: pd["INSPECTOR"]??"", + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '巡检时间:', + isEditable: false, + controller: _xunController, + text: pd["INSPECTIONTIME"]??"", + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '巡检内容:', + isEditable: false, + controller: _xunController, + text: pd["INSPECTIONCONTENT"]??"", + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '是否有故障:', + isEditable: false, + controller: _xunController, + text: pd["ISFAULT"]??"", + ), + + if(faultImgs.isNotEmpty) + Divider(), + if(faultImgs.isNotEmpty) + ItemListWidget.twoRowTitleAndImages( + onTapCallBack: (val) { + presentOpaque(SingleImageViewer(imageUrl: val), context); + }, + title: '故障照片:', + imageUrls: faultImgs + .map((item) => item['FILEPATH'] as String) // 提取并转换为 String + .toList(), + ), + + if(faultImgs.isNotEmpty) + Divider(), + if(faultImgs.isNotEmpty) + ItemListWidget.twoRowTitleAndImages( + onTapCallBack: (val) { + presentOpaque(SingleImageViewer(imageUrl: val), context); + }, + title: '故障处理后照片:', + imageUrls: handleImgs + .map((item) => item['FILEPATH'] as String) // 提取并转换为 String + .toList(), + ), + + const Divider(), + ItemListWidget.twoRowTitleAndImages( + onTapCallBack: (val) { + presentOpaque(SingleImageViewer(imageUrl: val), context); + }, + title: '巡检照片:', + imageUrls: inspectionImgs + .map((item) => item['FILEPATH'] as String) // 提取并转换为 String + .toList(), + ), + + SizedBox(height: 20,) + + ], + ), + ), + + ], + ), + ); + } + + + + + +} diff --git a/lib/pages/home/EquipmentInspection/equipment_inspection_list_page.dart b/lib/pages/home/EquipmentInspection/equipment_inspection_list_page.dart new file mode 100644 index 0000000..83d7553 --- /dev/null +++ b/lib/pages/home/EquipmentInspection/equipment_inspection_list_page.dart @@ -0,0 +1,362 @@ +import 'dart:convert'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/pages/home/EquipmentInspection/immediately_inspection.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + +import 'equiment_detail_list_page.dart'; + +class EquipmentInspectionListPage extends StatefulWidget { + const EquipmentInspectionListPage({super.key}); + + @override + State createState() => + _EquipmentInspectionListPageState(); +} + +class _EquipmentInspectionListPageState + extends State + with SingleTickerProviderStateMixin { + late TabController _tabController; + int _currentTabIndex = 0; + List _equipList = []; + List _periodList = ['每日', '每周', '每旬', '每月']; + int _currentPage = 1; + int _totalPage = 0; + bool _isLoading = false; + bool _noMoreData = false; + ScrollController _scrollController = ScrollController(); + + @override + void initState() { + super.initState(); + _tabController = TabController(length: 2, vsync: this); + _tabController.addListener(_handleTabSelection); + + _scrollController.addListener(() { + if (_scrollController.position.pixels == + _scrollController.position.maxScrollExtent) { + _loadMoreData(); + } + }); + + _fetchData(); + } + + void _handleTabSelection() { + if (_tabController.indexIsChanging) { + setState(() { + _currentTabIndex = _tabController.index; + _resetPageData(); + _fetchData(); + }); + } + } + + void _resetPageData() { + setState(() { + _currentPage = 1; + _equipList.clear(); + _noMoreData = false; + }); + } + + Future _fetchData() async { + if (_isLoading) return; + + setState(() { + _isLoading = true; + }); + + try { + await Future.delayed(Duration(seconds: 1)); + + final result = await ApiService.getEquipmentInspectionList( + _currentPage, + _currentTabIndex, + ); + if (result['result'] == 'success') { + // final List newItems = result['varList'] ?? []; + // final data = json.decode(response.body); + final newItems = + (result['varList'] as List) + .map((item) => EquipItem.fromJson(item)) + .toList(); + + setState(() { + _equipList.addAll(newItems); + _totalPage = result['page']['totalPage']; + _noMoreData = _currentPage >= _totalPage; + _currentPage++; + }); + } + } catch (e) { + print('Error fetching data: $e'); + } finally { + setState(() { + _isLoading = false; + }); + } + } + + void _loadMoreData() { + if (_isLoading || _noMoreData) return; + _fetchData(); + } + + Future _goToAdd(EquipItem item) async { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => InspectionAddPage(equipmentId: item.id), + // ), + // ); + await Navigator.push( + context, + MaterialPageRoute(builder: (context) => ImmediatelyInspection(item.id)), + ); + _resetPageData(); + _fetchData(); + // pushPage(ImmediatelyInspection(item.id), context); + } + + void _goToRecordList(EquipItem item) { + // Navigator.push( + // context, + // MaterialPageRoute( + // builder: (context) => InspectionRecordPage(equipmentId: item.id), + // ), + // ); + pushPage(EquimentDetailListPage(item.id), context); + + } + + String _handleIsChecked(EquipItem item) { + final now = DateTime.now(); + final nextInspection = DateFormat( + 'yyyy-MM-dd hh:mm', + ).parse(item.periodStartDate); + + if (nextInspection.isAfter(now)) { + return "已检查"; + } else { + return "未检查"; + } + } + + Widget _buildFirstTab() { + // 按周期分组 + Map> groupedItems = {}; + for (var period in _periodList) { + groupedItems[period] = + _equipList.where((item) => item.periodName == period).toList(); + } + + return ListView.builder( + controller: _scrollController, + itemCount: _periodList.length, + itemBuilder: (context, index) { + final period = _periodList[index]; + final items = groupedItems[period] ?? []; + + return Container( + color: Colors.white, + child: ExpansionTile( + title: Text( + period, + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), + ), + children: items.map((item) => _buildEquipItem(item)).toList(), + ), + ); + }, + ); + } + + Widget _buildSecondTab() { + return ListView.builder( + controller: _scrollController, + itemCount: _equipList.length + 1, + itemBuilder: (context, index) { + if (index == _equipList.length) { + return _buildLoader(); + } + return _equipList.isNotEmpty + ? _buildEquipItem(_equipList[index]) + : null; + }, + ); + } + + Widget _buildEquipItem(EquipItem item) { + return Card( + color: Colors.white, + margin: EdgeInsets.all(8), + child: Padding( + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '设备名称:${item.equipmentName}', + style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold), + ), + SizedBox(height: 8), + Text( + '设备类型:${item.equipmentTypeName}', + style: TextStyle(color: Colors.grey[600]), + ), + SizedBox(height: 8), + Text( + '巡检周期:${item.periodName}', + style: TextStyle(color: Colors.grey[600]), + ), + SizedBox(height: 12), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + if (_currentTabIndex == 0) + Text( + _handleIsChecked(item), + style: TextStyle(color: Colors.orange), + ) + else + Text('巡检次数: ${item.inspectionCount}'), + ElevatedButton( + onPressed: + () => + _currentTabIndex == 0 + ? _goToAdd(item) + : _goToRecordList(item), + style: ElevatedButton.styleFrom( + backgroundColor: Colors.orange, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.circular(20), + ), + ), + child: Text( + _currentTabIndex == 0 ? '立即巡检' : '巡检记录', + style: TextStyle(color: Colors.white), + ), + ), + ], + ), + ], + ), + ), + ); + } + + Widget _buildLoader() { + return Container( + padding: EdgeInsets.symmetric(vertical: 16), + alignment: Alignment.center, + child: + _isLoading + ? CircularProgressIndicator() + : Text( + _noMoreData ? '--已经没有更多了--' : '', + style: TextStyle(color: Colors.grey), + ), + ); + } + + Widget _buildEmptyState() { + return Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Image.asset('assets/images/null.png', width: 200, height: 200), + SizedBox(height: 16), + Text('暂无数据', style: TextStyle(fontSize: 18, color: Colors.grey)), + ], + ), + ); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppbar(title: "我的任务"), + + body: Column( + children: [ + // 将 TabBar 放在 body 顶部 + Container( + color: Colors.white, // 白色背景 + child: TabBar( + controller: _tabController, + labelStyle: TextStyle(fontSize: 16), + indicator: UnderlineTabIndicator( + borderSide: BorderSide(width: 3.0, color: Colors.blue), + insets: EdgeInsets.symmetric(horizontal: 100.0), + ), + labelColor: Colors.blue, + unselectedLabelColor: Colors.grey, + tabs: const [Tab(text: '待反馈'), Tab(text: '已反馈')], + ), + ), + + // 内容区域(可滚动) + Expanded( + child: TabBarView( + controller: _tabController, + children: [ + // 第一个选项卡 + _equipList.isEmpty ? _buildEmptyState() : _buildFirstTab(), + + // 第二个选项卡 + _equipList.isEmpty ? _buildEmptyState() : _buildSecondTab(), + ], + ), + ), + ], + ), + ); + } + + @override + void dispose() { + _tabController.dispose(); + _scrollController.dispose(); + super.dispose(); + } +} + +class EquipItem { + final String id; + final String equipmentName; + final String equipmentTypeName; + final String periodName; + final String periodStartDate; + final int inspectionCount; + + EquipItem({ + required this.id, + required this.equipmentName, + required this.equipmentTypeName, + required this.periodName, + required this.periodStartDate, + required this.inspectionCount, + }); + + factory EquipItem.fromJson(Map json) { + return EquipItem( + id: json['SPECIALEQUIPMENT_ID'] ?? '', + equipmentName: json['EQUIPMENTNAME'] ?? '', + equipmentTypeName: json['EQUIPMENTTYPENAME'] ?? '', + periodName: json['PERIOD_NAME'] ?? '', + periodStartDate: json['PERIOD_START_DATE'] ?? '', + inspectionCount: json['XJCOUNT'] ?? 0, + ); + } +} + + + + diff --git a/lib/pages/home/EquipmentInspection/immediately_inspection.dart b/lib/pages/home/EquipmentInspection/immediately_inspection.dart new file mode 100644 index 0000000..20ad34b --- /dev/null +++ b/lib/pages/home/EquipmentInspection/immediately_inspection.dart @@ -0,0 +1,281 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:qhd_prevention/customWidget/ItemWidgetFactory.dart'; +import 'package:qhd_prevention/customWidget/custom_button.dart'; +import 'package:qhd_prevention/customWidget/date_picker_dialog.dart'; +import 'package:qhd_prevention/customWidget/photo_picker_row.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + + + +class ImmediatelyInspection extends StatefulWidget { + const ImmediatelyInspection(this. id, {super.key}); + + final String id; + + @override + State createState() => _ImmediatelyInspectionState(); +} + +class _ImmediatelyInspectionState extends State { + + + final TextEditingController _xunController = TextEditingController(); + final TextEditingController _neiRongController = TextEditingController(); + // 是否有故障 + bool _isFault = false; + String dataTime=""; + + List _guZhangImages = []; + List _xiuGaiImages = []; + List _xunJianImages = []; + + List allImagePaths = []; + List allImageTypes = []; + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppbar(title: "开始巡检"), + body: ListView( + children: [ + Container( + color: Colors.white, + child: Column(children: [ + ItemListWidget.singleLineTitleText( + label: '巡检人:', + isEditable: true, + controller: _xunController, + hintText: '请输入巡检人', + text: '', + ), + const Divider(), + Padding( + padding: EdgeInsets.symmetric(horizontal: 15,vertical: 10), + child: GestureDetector( + child: ItemListWidget.selectableLineTitleTextRightButton(label: '巡检日期', text: dataTime.isEmpty? + '请选择':dataTime??'', isEditable: true, isRequired: true,horizontalnum: 0), + onTap: () async { + showDialog( + context: context, + builder: + (_) => HDatePickerDialog( + initialDate: DateTime.now(), + onCancel: () => Navigator.of(context).pop(), + onConfirm: (selected) { + Navigator.of(context).pop(); + setState(() { + + dataTime= DateFormat('yyyy-MM-dd').format(selected); + + }); + }, + ), + ); + }, + ), + // ListItemFactory.createRowSpaceBetweenItem( + // leftText: "巡检日期", + // rightText: dataTime.isEmpty?"请选择":dataTime, + // isRight: true, + // ), + ), + + ], + ), + ), + + + SizedBox(height: 15,), + + Container( + color: Colors.white, + child: ItemListWidget.multiLineTitleTextField( + label: '巡检内容:', + isEditable: true, + controller: _neiRongController, + hintText: "(必填)", + text:'', + ), + ), + + SizedBox(height: 15,), + ListItemFactory.createYesNoSection( + title: '是否有故障', + horizontalPadding: 0, + groupValue: _isFault, + onChanged: (val) { + setState(() { + _isFault = val; + }); + }, + ), + + // if(_isFault) + // SizedBox(height: 15,), + if(_isFault) + RepairedPhotoSection( + horizontalPadding: 15, + title: "故障照片", + maxCount: 4, + mediaType: MediaType.image, + onMediaAdded: (value) { + _guZhangImages.add(value); + }, + onMediaRemoved: (value) { + _guZhangImages.remove(value); + }, + onChanged: (files) { + }, + onAiIdentify: () { + + }, + ), + + + SizedBox(height:_isFault? 15:0,), + if(_isFault) + RepairedPhotoSection( + horizontalPadding: 15, + title: "故障处理后照片", + maxCount: 4, + mediaType: MediaType.image, + onMediaAdded: (value) { + _xiuGaiImages.add(value); + }, + onMediaRemoved: (value) { + _xiuGaiImages.remove(value); + }, + onChanged: (files) { + }, + onAiIdentify: () { + + }, + ), + + + SizedBox(height:_isFault? 15:0,), + RepairedPhotoSection( + horizontalPadding: 15, + title: "巡检照片", + maxCount: 4, + mediaType: MediaType.image, + onMediaAdded: (value) { + _xunJianImages.add(value); + }, + onMediaRemoved: (value) { + _xunJianImages.remove(value); + }, + onChanged: (files) { + }, + onAiIdentify: () { + + }, + ), + + SizedBox(height:25,), + CustomButton( + text: "提交", + backgroundColor: Colors.blue, + height: 42, + onPressed: () { + _startInspection(); + }, + ), + SizedBox(height:25,), + ], + ), + ); + } + + Future _startInspection() async { + try { + + String person=_xunController.text.trim(); + if(person.isEmpty){ + ToastUtil.showNormal(context, "请填巡检人"); + return; + } + + if(dataTime.isEmpty){ + ToastUtil.showNormal(context, "请选择巡检时间"); + return; + } + + String content=_neiRongController.text.trim(); + if(content.isEmpty){ + ToastUtil.showNormal(context, "请选巡检内容"); + return; + } + + if(_isFault&&_guZhangImages.isEmpty){ + ToastUtil.showNormal(context, "请上传故障照片"); + return; + } + + if(_isFault&&_xiuGaiImages.isEmpty){ + ToastUtil.showNormal(context, "请上传故障处理后照片"); + return; + } + + if(_xunJianImages.isEmpty){ + ToastUtil.showNormal(context, "请上传巡检图片"); + return; + } + + + LoadingDialogHelper.show(message: "提交中..."); + + for(int i=0;i<_guZhangImages.length;i++){ + allImagePaths.add(_guZhangImages[i]); + allImageTypes.add("24"); + } + + for(int m=0;m<_xiuGaiImages.length;m++){ + allImagePaths.add(_xiuGaiImages[m]); + allImageTypes.add("25"); + } + + for(int n=0;n<_xunJianImages.length;n++){ + allImagePaths.add(_xunJianImages[n]); + allImageTypes.add("26"); + } + + + + final formData = { + 'SPECIALEQUIPMENT_ID': widget.id, + 'CREATOR': SessionService.instance.username, + 'ISFAULT': _isFault?"是":"否", + 'INSPECTOR': person, + 'INSPECTIONCONTENT': content, + 'INSPECTIONTIME': dataTime, + + 'TYPES':allImageTypes.join(','), + "CORPINFO_ID": SessionService.instance.corpinfoId, + 'USER_ID': SessionService.instance.loginUserId, + }; + + final result = await ApiService.startInspection(formData,allImagePaths); + LoadingDialogHelper.hide(); + if (result['result'] == 'success') { + setState(() { + ToastUtil.showNormal(context, "提交成功"); + Navigator.pop(context); + + }); + } + } catch (e) { + LoadingDialogHelper.hide(); + print('Error fetching data: $e'); + } + } + + + +} diff --git a/lib/pages/home/SafetyCommitment/commitment_workshop_detail_page.dart b/lib/pages/home/SafetyCommitment/commitment_workshop_detail_page.dart new file mode 100644 index 0000000..76b9557 --- /dev/null +++ b/lib/pages/home/SafetyCommitment/commitment_workshop_detail_page.dart @@ -0,0 +1,450 @@ +import 'package:flutter/material.dart'; +import 'package:photo_view/photo_view.dart'; +import 'package:http/http.dart' as http; +import 'package:qhd_prevention/customWidget/ItemWidgetFactory.dart'; +import 'package:qhd_prevention/customWidget/single_image_viewer.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; +import 'dart:convert'; + +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + +class CommitmentWorkshopDetailPage extends StatefulWidget { + final String commitmentWorkshopId; + + const CommitmentWorkshopDetailPage({ + Key? key, + required this.commitmentWorkshopId, + }) : super(key: key); + + @override + _CommitmentWorkshopDetailPageState createState() => _CommitmentWorkshopDetailPageState(); +} + +class _CommitmentWorkshopDetailPageState extends State { + Map pd = {}; + bool isLoading = true; + String errorMessage = ''; + + @override + void initState() { + super.initState(); + _getData(); + } + + Future _getData() async { + setState(() { + isLoading = true; + }); + + try { + final response = await ApiService.getWorkshopSafetyCommitmentDetail( widget.commitmentWorkshopId); + + if (response['result'] == 'success') { + setState(() { + pd = response['pd']; + isLoading = false; + }); + } else { + ToastUtil.showNormal(context, '数据加载失败'); + setState(() { + isLoading = false; + }); + } + + } catch (e) { + ToastUtil.showNormal(context, '发生错误: ${e.toString()}'); + setState(() { + isLoading = false; + }); + } + } + + + + + Widget _buildInfoItem(String label, dynamic value, {bool isMarked = true}) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4), + child: RichText( + text: TextSpan( + style: const TextStyle(fontSize: 14, color: Colors.black87), + children: [ + TextSpan(text: label), + if (isMarked) + TextSpan( + text: value.toString(), + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ) + else + TextSpan(text: value.toString()), + ], + ), + ), + ); + } + + Widget _buildParagraph(List children) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: children, + ), + ); + } + + @override + Widget build(BuildContext context) { + if (isLoading) { + return const Scaffold( + body: Center(child: CircularProgressIndicator()), + ); + } + + if (errorMessage.isNotEmpty) { + return Scaffold( + appBar: AppBar(), + body: Center(child: Text(errorMessage)), + ); + } + + return Scaffold( + appBar: MyAppbar(title: "安全承诺"), + body: Container( + color: Colors.white, + child: SingleChildScrollView( + padding: const EdgeInsets.all(16), + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // 标题部分 + Center( + child: Text( + '【${pd['DEPARTMENT_NAME'] ?? '未知车间'}】车间', + style: const TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + const SizedBox(height: 5), + + // 企业状态部分 + ListItemFactory.createBuildSimpleSection('企业状态',horPadding: 0), + + Container( + padding: EdgeInsets.only(top: 15,bottom: 15,left: 15,right: 15), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey,width: 1) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + ListItemFactory.createBlueDotSection('高危生产活动及作业的安全风险可控状态'), + // _buildSubTitle('高危生产活动及作业的安全风险可控状态'), + + + _buildParagraph([ + _buildInfoItem('特殊作业 ', pd['INPUT1'] ?? ''), + _buildInfoItem('风险辨识、作业许可及管控措施的落实情况: ', + (pd['RADIO1'] == 1 ? '是' : '否')), + + _buildWorkInfoParagraph(), + + _buildInfoItem('处于试生产情况: ', (pd['RADIO2'] == 1 ? '是' : '否')), + _buildInfoItem('处于开停车情况: ', (pd['RADIO3'] == 1 ? '开' : '停')), + _buildWorkInfoParagraphThree(), + // _buildInfoItem('承包商作业 ${pd['INPUT14'] ?? ''} 处,管控情况: ', + // (pd['RADIO4'] == 1 ? '受控' : '非受控')), + _buildInfoItem('变更情况: ', (pd['RADIO5'] == 1 ? '是' : '否')), + _buildInfoItem('落实审批程序情况: ', (pd['RADIO6'] == 1 ? '是' : '否')), + _buildInfoItem('罐区、仓库等危险源是否处于安全状态: ', + (pd['RADIO7'] == 1 ? '是' : '否')), + ]), + + ListItemFactory.createBlueDotSection('车间安全状态'), + // _buildSubTitle('车间安全状态:'), + _buildParagraph([ + _buildWorkInfoParagraphSecond(), + // _buildInfoItem( + // '车间岗位 ${pd['INPUT15'] ?? ''} 处,其中运行 ${pd['INPUT16'] ?? ''} 处,' + // '停产 ${pd['INPUT17'] ?? ''} 处,检修 ${pd['INPUT18'] ?? ''} 处。', + // '', isMarked: false), + ]), + + ListItemFactory.createBlueDotSection('生产装置的安全运行状态'), + // _buildSubTitle('生产装置的安全运行状态'), + _buildParagraph([ + _buildInfoItem('生产装置的温度、压力、组分液位、流量等主要工艺参数是否处于指标范围: ', + (pd['RADIO8'] == 1 ? '是' : '否')), + _buildInfoItem('压力容器、压力管道等特种设备处于安全运行状态: ', + (pd['RADIO9'] == 1 ? '是' : '否')), + _buildInfoItem('设备设施的静动密封完好无泄漏: ', + (pd['RADIO10'] == 1 ? '是' : '否')), + _buildInfoItem('超限报警、紧急切断、联锁等各类安全设施配备完好投用,并可靠运行: ', + (pd['RADIO11'] == 1 ? '是' : '否')), + ]), + + ListItemFactory.createBlueDotSection('危险化学品罐区、仓库等重大危险源的安全运行状态'), + // _buildSubTitle('危险化学品罐区、仓库等重大危险源的安全运行状态'), + _buildParagraph([ + _buildInfoItem('储罐、管道、机泵、阀门及仪表系统完好无泄漏: ', + (pd['RADIO12'] == 1 ? '是' : '否')), + _buildInfoItem('储罐的液位、温度、压力、气柜钟罩无超限运行: ', + (pd['RADIO13'] == 1 ? '是' : '否')), + _buildInfoItem('手动放脱水、装卸车时确保人员在岗: ', + (pd['RADIO14'] == 1 ? '是' : '否')), + _buildInfoItem('可燃及有毒气体报警和联锁处于可靠运行状态: ', + (pd['RADIO15'] == 1 ? '是' : '否')), + Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + '仓库是否按照国家标准分区分类储存危险化学品,是否超量、超品种储存,相互禁配物质是否混放混存。', + style: TextStyle(fontSize: 14), + ), + const SizedBox(height: 8), + // Container( + // padding: const EdgeInsets.all(12), + // decoration: BoxDecoration( + // border: Border.all(color: Colors.blue), + // borderRadius: BorderRadius.circular(4), + // ), + // child: + Text( + pd['INPUT19'] ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + // ), + ], + ), + ), + ]), + ], + ), + ), + + + // 企业承诺部分 + ListItemFactory.createBuildSimpleSection('企业承诺',horPadding: 0), + // _buildSectionTitle('企业承诺'), + + Container( + padding: EdgeInsets.only(top: 5,bottom: 5,left: 15,right: 15), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey,width: 1) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Text.rich( + TextSpan( + children: [ + const TextSpan(text: '今日('), + TextSpan( + text: pd['START_TIME'] ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + const TextSpan(text: ' 至 '), + TextSpan( + text: pd['END_TIME'] ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + const TextSpan( + text: ')我车间已进行安全风险研判,各项安全风险防控措施已落实到位。' + '我承诺本生产装置/业务活动处于安全运行状态,涉及罐区、仓库等危险源安全风险得到有效管控。', + ), + ], + ), + style: const TextStyle(fontSize: 14), + ), + ), + + // 签名部分 + GestureDetector( + onTap: () { + presentOpaque(SingleImageViewer(imageUrl:ApiService.baseImgPath+ pd['SIGN_PATH']), context); + }, + child: Row( + children: [ + // if (imagePath.isNotEmpty) + Text('签字照片:', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: Colors.grey, + ), + ), + const SizedBox(width: 15), + if (pd['SIGN_PATH'] != null) + Image.network(ApiService.baseImgPath+pd['SIGN_PATH'],width: 230,height: 150,fit: BoxFit.cover,), + + ], + ), + ), + + //签字时间 + _buildParagraph([ + _buildInfoItem('签字时间: ', pd['SIGN_TIME']??""), + ]), + + ], + ), + ), + + ], + ), + ), + + ), + ); + } + + + Widget _buildWorkInfoParagraph() { + // 定义一个样式映射函数,将数据部分标记为蓝色加粗 + TextSpan _buildStyledText(String label, String? value) { + return TextSpan( + children: [ + TextSpan(text: label), + TextSpan( + text: value ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + ], + ); + } + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: RichText( + text: TextSpan( + style: const TextStyle(fontSize: 14, color: Colors.black87), + children: [ + _buildStyledText('动火作业 ', pd['INPUT2']?.toString()), + const TextSpan(text: ' 处,其中特级 '), + _buildStyledText('', pd['INPUT3']?.toString()), + const TextSpan(text: ' 处,一级 '), + _buildStyledText('', pd['INPUT4']?.toString()), + const TextSpan(text: ' 处,二级 '), + _buildStyledText('', pd['INPUT5']?.toString()), + const TextSpan(text: ' 处,高处作业 '), + _buildStyledText('', pd['INPUT6']?.toString()), + const TextSpan(text: ' 处,受限空间作业 '), + _buildStyledText('', pd['INPUT7']?.toString()), + const TextSpan(text: ' 处,吊装作业 '), + _buildStyledText('', pd['INPUT8']?.toString()), + const TextSpan(text: ' 处,临时用电作业 '), + _buildStyledText('', pd['INPUT9']?.toString()), + const TextSpan(text: ' 处,盲板抽堵作业 '), + _buildStyledText('', pd['INPUT10']?.toString()), + const TextSpan(text: ' 处,动土作业 '), + _buildStyledText('', pd['INPUT11']?.toString()), + const TextSpan(text: ' 处,断路作业 '), + _buildStyledText('', pd['INPUT12']?.toString()), + const TextSpan(text: ' 处,检修作业 '), + _buildStyledText('', pd['INPUT13']?.toString()), + const TextSpan(text: ' 处。'), + ], + ), + ), + ); + } + + + Widget _buildWorkInfoParagraphSecond() { + // 定义一个样式映射函数,将数据部分标记为蓝色加粗 + TextSpan _buildStyledText(String label, String? value) { + return TextSpan( + children: [ + TextSpan(text: label), + TextSpan( + text: value ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + ], + ); + } + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: RichText( + text: TextSpan( + style: const TextStyle(fontSize: 14, color: Colors.black87), + children: [ + _buildStyledText('车间岗位 ', pd['INPUT15']?.toString()), + const TextSpan(text: ' 处,其中运行 '), + _buildStyledText('', pd['INPUT16']?.toString()), + const TextSpan(text: ' 处,停产 '), + _buildStyledText('', pd['INPUT17']?.toString()), + const TextSpan(text: ' 处,检修 '), + _buildStyledText('', pd['INPUT18']?.toString()), + const TextSpan(text: ' 处。'), + ], + ), + ), + ); + } + + + Widget _buildWorkInfoParagraphThree() { + // 定义一个样式映射函数,将数据部分标记为蓝色加粗 + TextSpan _buildStyledText(String label, String? value) { + return TextSpan( + children: [ + TextSpan(text: label), + TextSpan( + text: value ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + ], + ); + } + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: RichText( + text: TextSpan( + style: const TextStyle(fontSize: 14, color: Colors.black87), + children: [ + _buildStyledText('承包商作业 ', pd['INPUT14']?.toString()), + const TextSpan(text: ' 处,管控情况: '), + _buildStyledText('', (pd['RADIO4'] == 1 ? '受控' : '非受控')), + + ], + ), + ), + ); + } + + +} \ No newline at end of file diff --git a/lib/pages/home/SafetyCommitment/company_safety_commitment_apply.dart b/lib/pages/home/SafetyCommitment/company_safety_commitment_apply.dart new file mode 100644 index 0000000..4898a78 --- /dev/null +++ b/lib/pages/home/SafetyCommitment/company_safety_commitment_apply.dart @@ -0,0 +1,528 @@ +import 'dart:io'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:qhd_prevention/customWidget/ItemWidgetFactory.dart'; +import 'package:qhd_prevention/customWidget/custom_button.dart'; +import 'package:qhd_prevention/customWidget/picker/CupertinoDatePicker.dart'; +import 'package:qhd_prevention/customWidget/single_image_viewer.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/http/HttpManager.dart'; +import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart'; +import 'package:qhd_prevention/pages/mine/mine_sign_page.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + + + +class CompanySafetyCommitmentApply extends StatefulWidget { + const CompanySafetyCommitmentApply({super.key}); + + @override + State createState() => _CompanySafetyCommitmentApplyState(); +} + +class _CompanySafetyCommitmentApplyState extends State { + + + final TextEditingController _controller1 = TextEditingController(); + final TextEditingController _controller2 = TextEditingController(); + final TextEditingController _controller3 = TextEditingController(); + final TextEditingController _controller4 = TextEditingController(); + final TextEditingController _controller5 = TextEditingController(); + final TextEditingController _controller6 = TextEditingController(); + final TextEditingController _controller7 = TextEditingController(); + final TextEditingController _controller8 = TextEditingController(); + final TextEditingController _controller9 = TextEditingController(); + final TextEditingController _controller10 = TextEditingController(); + + bool _isFault1 = true; + bool _isFault2 = true; + bool _isFault3 = true; + + DateTime? dataStart; + String dataTimeStart=""; + DateTime? dataEnd; + String dataTimeEnd=""; + + List signImgList = []; + + + + + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppbar(title: "安全承诺"), + body:Container( + padding: EdgeInsets.only(top: 15,bottom:15,left: 15,right: 15), + child: ListView( + children: [ + ListItemFactory.createBuildSimpleSection('企业状态',horPadding: 0,color: Color(0x00000000)), + + Container( + padding: EdgeInsets.symmetric(vertical: 5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + + ItemListWidget.singleLineTitleText( + label: '生产装置:', + isEditable: true, + controller: _controller1, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '运行:', + isEditable: true, + controller: _controller2, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '停产:', + isEditable: true, + controller: _controller3, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '检修:', + isEditable: true, + controller: _controller4, + text: '', + ), + + + ], + ), + ), + + + SizedBox(height: 15,), + + Container( + padding: EdgeInsets.symmetric(vertical: 5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + + ItemListWidget.singleLineTitleText( + label: '特级动火作业:', + isEditable: true, + controller: _controller5, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '一级动火作业:', + isEditable: true, + controller: _controller6, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '二级动火作业:', + isEditable: true, + controller: _controller7, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '受限空间作业:', + isEditable: true, + controller: _controller8, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '登高作业:', + isEditable: true, + controller: _controller9, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '其他特殊作业:', + isEditable: true, + controller: _controller10, + text: '', + ), + + ], + ), + ), + + SizedBox(height: 15,), + + Container( + padding: EdgeInsets.symmetric(vertical: 5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + + ListItemFactory.createYesNoSection( + title: '是否处于生产', + horizontalPadding: 0, + groupValue: _isFault1, + onChanged: (val) { + setState(() { + _isFault1 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '是否处于开停车状态', + horizontalPadding: 0, + groupValue: _isFault2, + onChanged: (val) { + setState(() { + _isFault2 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '罐区、库房等危险源是否处于安全状态', + horizontalPadding: 0, + groupValue: _isFault3, + onChanged: (val) { + setState(() { + _isFault3 = val; + }); + }, + ), + + + ], + ), + ), + + SizedBox(height: 5,), + ListItemFactory.createBuildSimpleSection('企业承诺',horPadding: 0,color: Color(0x00000000)), + SizedBox(height: 5,), + + Container( + padding: EdgeInsets.symmetric(vertical: 5,horizontal: 15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + + GestureDetector( + child: ItemListWidget.selectableLineTitleTextRightButton(label: '今日', text: dataTimeStart.isEmpty? + '请选择':dataTimeStart??'', isEditable: true, isRequired: true,horizontalnum: 0), + onTap: () async { + DateTime? picked = await BottomDateTimePicker.showDate(context,allowFuture: true); + if (picked != null) { + + setState(() { + dataStart=picked; + if(dataTimeEnd.isNotEmpty) { + bool isChao= validateDateRange(dataStart!,dataEnd!); + if(!isChao){ + return; + } + } + dataTimeStart = DateFormat('yyyy-MM-dd HH:mm').format(picked); + }); + } + }, + ), + + + const Divider(), + GestureDetector( + child:ItemListWidget.selectableLineTitleTextRightButton(label: '至', text: dataTimeEnd.isEmpty? + '请选择':dataTimeEnd, isEditable: true, isRequired: true,horizontalnum: 0), + onTap: () async { + DateTime? picked = await BottomDateTimePicker.showDate(context,allowFuture: true); + if (picked != null) { + + setState(() { + dataEnd=picked; + if(dataTimeStart.isNotEmpty) { + bool isChao= validateDateRange(dataStart!, dataEnd!); + if(!isChao){ + return; + } + } + dataTimeEnd = DateFormat('yyyy-MM-dd HH:mm').format(picked); + }); + } + }, + ), + + + const Divider(), + Text("今天我公司已进行安全风险研判,各项安全风险防控措施已落实到位,我承诺所有生产设施处于安全运行状态,罐区、库房等危险源安全风险得到有效控制。", + style: TextStyle(color: Colors.black,fontSize: 13),), + const Divider(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('承诺人:', style: TextStyle(fontSize: 16)), + CustomButton( + text: '手写签字', + height: 36, + backgroundColor: Colors.green, + onPressed: _sign, + ), + ], + ), + if (signImgList.isNotEmpty) _signListWidget(), + + ], + ), + ), + + SizedBox(height: 15,), + + CustomButton( + backgroundColor: Colors.green, + text: "提交", + onPressed: () { + // TODO: 完成回调 + _upData(); + } + ), + + + ], + ), + ) , + + ); + } + + + + Future _upData() async { + try { + + String text1=_controller1.text.trim(); + if(text1.isEmpty){ + ToastUtil.showNormal(context, "请输入生产装置数"); + return; + } + + String text2=_controller2.text.trim(); + if(text1.isEmpty){ + ToastUtil.showNormal(context, "请输入生产装置运行数"); + return; + } + + String text3=_controller3.text.trim(); + if(text1.isEmpty){ + ToastUtil.showNormal(context, "请输入生产装置停产数"); + return; + } + + String text4=_controller4.text.trim(); + if(text1.isEmpty){ + ToastUtil.showNormal(context, "请输入生产装置检修数"); + return; + } + + String text5=_controller5.text.trim(); + if(text1.isEmpty){ + ToastUtil.showNormal(context, "请输入特级动火作业数"); + return; + } + + String text6=_controller6.text.trim(); + if(text1.isEmpty){ + ToastUtil.showNormal(context, "请输入一级动火作业数"); + return; + } + + String text7=_controller7.text.trim(); + if(text1.isEmpty){ + ToastUtil.showNormal(context, "请输入二级动火作业数"); + return; + } + + String text8=_controller8.text.trim(); + if(text1.isEmpty){ + ToastUtil.showNormal(context, "请输入受限空间作业数"); + return; + } + + String text9=_controller9.text.trim(); + if(text1.isEmpty){ + ToastUtil.showNormal(context, "请输入登高作业数"); + return; + } + + String text10=_controller10.text.trim(); + if(text1.isEmpty){ + ToastUtil.showNormal(context, "请输入其他特殊作业数"); + return; + } + + if(dataTimeStart.isEmpty){ + ToastUtil.showNormal(context, "请选择承诺时间"); + return; + } + + if(dataTimeEnd.isEmpty){ + ToastUtil.showNormal(context, "请选择承诺时间"); + return; + } + + if(signImgList.isEmpty){ + ToastUtil.showNormal(context, "请签字"); + return; + } + + LoadingDialogHelper.show(message: "提交中。。。"); + + + String nowTime= DateFormat('yyyy-MM-dd HH:mm').format(DateTime.now()); + + final formData = { + 'INPUT1': text1, + 'INPUT2': text2, + 'INPUT3': text3, + 'INPUT4': text4, + 'INPUT5': text5, + 'INPUT6': text6, + 'INPUT7': text7, + 'INPUT8': text8, + 'INPUT9': text9, + 'INPUT10': text10, + + 'RADIO1': _isFault1?"1":"-1", + 'RADIO2': _isFault2?"1":"-1", + 'RADIO3': _isFault3?"1":"-1", + + 'START_TIME':dataTimeStart, + 'END_TIME': dataTimeEnd, + + + "SIGNER_TIME": nowTime, + 'DEPARTMENT_ID':SessionService.instance.loginUser?["DEPARTMENT_ID"], + 'SIGN_USER': SessionService.instance.loginUserId, + "CORPINFO_ID": SessionService.instance.corpinfoId, + 'USER_ID': SessionService.instance.loginUserId, + }; + + print(formData.toString()); + final file = File(signImgList[0]); + if (!await file.exists()) { + throw ApiException('file_not_found', '图片不存在:${signImgList[0]}'); + } + final Mapresponse = await ApiService.upCompanySafetyCommitmentApply(formData,signImgList); + LoadingDialogHelper.hide(); + if (response['result'] == 'success') { + setState(() { + Navigator.pop(context); + }); + }else{ + ToastUtil.showNormal(context, response['msg']); + } + } catch (e) { + LoadingDialogHelper.hide(); + print('Error fetching data: $e'); + + } + } + + + + Future _sign() async { + final String path = await Navigator.push( + context, + MaterialPageRoute(builder: (c) => MineSignPage()), + ); + if (path != null) { + setState(() { + signImgList.add(path); + }); + + } + } + + Widget _signListWidget() { + return Column( + children: + signImgList.map((imgData) { + final idx = signImgList.indexOf(imgData); + return Column( + children: [ + const SizedBox(height: 10), + const Divider(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + child: ConstrainedBox( + constraints: const BoxConstraints( + maxWidth: 230, + maxHeight: 150, + ), + child: + Image.file( + File(signImgList[0] ?? ''), + fit: BoxFit.contain, + ), + ), + onTap: + () => presentOpaque( + SingleImageViewer(imageUrl:signImgList[0] ?? ''), + context, + ), + ), + Column( + children: [ + CustomButton( + text: '删除', + height: 30, + padding: const EdgeInsets.symmetric(horizontal: 10), + backgroundColor: Colors.red, + onPressed: () { + setState(() => signImgList.removeAt(idx)); + }, + ), + const SizedBox(height: 80), + ], + ), + ], + ), + ], + ); + }).toList(), + ); + } + + + bool validateDateRange(DateTime startTime, DateTime endTime) { + const int thirtyDaysInMilliseconds = 30 * 24 * 60 * 60 * 1000; // 30 天的毫秒数 + final int difference = endTime.millisecondsSinceEpoch - startTime.millisecondsSinceEpoch; + + if (difference > thirtyDaysInMilliseconds) { + ToastUtil.showNormal(context, "只能选择30天内的日期"); + return false; + }else{ + return true; + } + } + + +} diff --git a/lib/pages/home/SafetyCommitment/company_safety_commitment_detail.dart b/lib/pages/home/SafetyCommitment/company_safety_commitment_detail.dart new file mode 100644 index 0000000..0367055 --- /dev/null +++ b/lib/pages/home/SafetyCommitment/company_safety_commitment_detail.dart @@ -0,0 +1,392 @@ +import 'package:flutter/material.dart'; +import 'dart:convert'; +import 'package:http/http.dart' as http; + +import 'package:photo_view/photo_view.dart'; +import 'package:qhd_prevention/customWidget/ItemWidgetFactory.dart'; +import 'package:qhd_prevention/customWidget/single_image_viewer.dart'; +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + +class CompanySafetyCommitmentDetail extends StatefulWidget { + final String commitmentId; + + const CompanySafetyCommitmentDetail({Key? key, required this.commitmentId}) : super(key: key); + + @override + _CompanySafetyCommitmentDetailState createState() => _CompanySafetyCommitmentDetailState(); +} + +class _CompanySafetyCommitmentDetailState extends State { + Map pd = {}; + bool isLoading = true; + + + @override + void initState() { + super.initState(); + _getData(); + } + + Future _getData() async { + try { + + final data = await ApiService.getCompanySafetyCommitmentDetail( widget.commitmentId); + + if (data['result'] == 'success') { + setState(() { + pd = data['pd']; + isLoading = false; + }); + } else { + _showError('数据加载失败: ${data['message']}'); + } + + } catch (e) { + _showError('网络请求失败: $e'); + } + } + + void _showError(String message) { + ScaffoldMessenger.of(context).showSnackBar( + SnackBar(content: Text(message)), + ); + setState(() => isLoading = false); + } + + void _showImagePreview(String imageUrl) { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => Scaffold( + appBar: AppBar(), + body: PhotoView( + imageProvider: NetworkImage(imageUrl), + ), + ), + ), + ); + } + + // 构建高亮文本 + Widget _highlightText(String text) { + return Text( + text, + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ); + } + + // 构建问题行 + Widget _questionRow(String question, String answer) { + return Padding( + padding: const EdgeInsets.only(bottom: 8), + child: Row( + children: [ + Expanded( + child: Text(question), + ), + const SizedBox(width: 8), + Text( + answer, + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + ], + ), + ); + } + + @override + Widget build(BuildContext context) { + if (isLoading) { + return const Scaffold( + body: Center(child: CircularProgressIndicator()), + ); + } + + + return Scaffold( + appBar: MyAppbar(title: "安全承诺"), + body: Container( + color: Colors.white, + child: SingleChildScrollView( + padding: const EdgeInsets.all(16), + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // 标题部分 + Center( + child: Text( + pd['CORP_NAME'] ?? '未知企业', + style: const TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + const SizedBox(height: 5), + + // 企业状态部分 + ListItemFactory.createBuildSimpleSection('企业状态',horPadding: 0), + + Container( + padding: EdgeInsets.only(top: 15,bottom: 15,left: 15,right: 15), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey,width: 1) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + + _buildParagraph([ + + _buildWorkInfoParagraph1(), + _buildWorkInfoParagraph2(), + + const SizedBox(height: 2), + const Text('特殊作业:'), + const SizedBox(height: 2), + _buildWorkInfoParagraph3(), + + + _buildInfoItem('是否处于生产: ', (pd['RADIO1'] == 1 ? '是' : '否')), + _buildInfoItem('是否处于开停车状态: ', (pd['RADIO2'] == 1 ? '是' : '否')), + _buildInfoItem('罐区、库房等危险源是否处于安全状态: ', (pd['RADIO3'] == 1 ? '是' : '否')),]), + + ], + ), + ), + + + // 企业承诺部分 + ListItemFactory.createBuildSimpleSection('企业承诺',horPadding: 0), + // _buildSectionTitle('企业承诺'), + + Container( + padding: EdgeInsets.only(top: 5,bottom: 5,left: 15,right: 15), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey,width: 1) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Text.rich( + TextSpan( + children: [ + const TextSpan(text: '今日('), + TextSpan( + text: pd['START_TIME'] ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + const TextSpan(text: ' 至 '), + TextSpan( + text: pd['END_TIME'] ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + const TextSpan( + text: ')我车间已进行安全风险研判,各项安全风险防控措施已落实到位。' + '我承诺本生产装置/业务活动处于安全运行状态,涉及罐区、仓库等危险源安全风险得到有效管控。', + ), + ], + ), + style: const TextStyle(fontSize: 14), + ), + ), + + // 签名部分 + GestureDetector( + onTap: () { + presentOpaque(SingleImageViewer(imageUrl: ApiService.baseImgPath+pd['SIGN_PATH']), context); + }, + child: Row( + children: [ + // if (imagePath.isNotEmpty) + Text('签字照片:', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: Colors.grey, + ), + ), + const SizedBox(width: 15), + if (pd['SIGN_PATH'] != null) + Image.network(ApiService.baseImgPath+pd['SIGN_PATH'] ,width: 230,height: 150,fit: BoxFit.cover,), + + ], + ), + ), + + //签字时间 + _buildParagraph([ + _buildInfoItem('签字时间: ', pd['SIGN_TIME']??""), + ]), + + ], + ), + ), + + ], + ), + ), + + ), + ); + } + + + Widget _buildParagraph(List children) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: children, + ), + ); + } + + Widget _buildInfoItem(String label, dynamic value, {bool isMarked = true}) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4), + child: RichText( + text: TextSpan( + style: const TextStyle(fontSize: 14, color: Colors.black87), + children: [ + TextSpan(text: label), + if (isMarked) + TextSpan( + text: value.toString(), + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ) + else + TextSpan(text: value.toString()), + ], + ), + ), + ); + } + + Widget _buildWorkInfoParagraph1() { + // 定义一个样式映射函数,将数据部分标记为蓝色加粗 + TextSpan _buildStyledText(String label, String? value) { + return TextSpan( + children: [ + TextSpan(text: label), + TextSpan( + text: value ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + ], + ); + } + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 2), + child: RichText( + text: TextSpan( + style: const TextStyle(fontSize: 14, color: Colors.black87), + children: [ + _buildStyledText('生产装置 ', pd['INPUT1']?.toString()??"0"), + const TextSpan(text: ' 套,其中 '), + + ], + ), + ), + ); + } + + + Widget _buildWorkInfoParagraph2() { + // 定义一个样式映射函数,将数据部分标记为蓝色加粗 + TextSpan _buildStyledText(String label, String? value) { + return TextSpan( + children: [ + TextSpan(text: label), + TextSpan( + text: value ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + ], + ); + } + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 2), + child: RichText( + text: TextSpan( + style: const TextStyle(fontSize: 14, color: Colors.black87), + children: [ + _buildStyledText('运行 ', pd['INPUT2']?.toString()??"0"), + _buildStyledText(' 套, 停产', pd['INPUT3']?.toString()??"0"), + _buildStyledText('套, 检修 ', pd['INPUT4']?.toString()??"0"), + const TextSpan(text: ' 套。 '), + + ], + ), + ), + ); + } + + + Widget _buildWorkInfoParagraph3() { + // 定义一个样式映射函数,将数据部分标记为蓝色加粗 + TextSpan _buildStyledText(String label, String? value) { + return TextSpan( + children: [ + TextSpan(text: label), + TextSpan( + text: value ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + ], + ); + } + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 2), + child: RichText( + text: TextSpan( + style: const TextStyle(fontSize: 14, color: Colors.black87), + children: [ + _buildStyledText('特级动火作业', pd['INPUT5']?.toString()??"0"), + _buildStyledText(' 处, 一级动火作业', pd['INPUT6']?.toString()??"0"), + _buildStyledText('处, 二级动火作业 ', pd['INPUT7']?.toString()??"0"), + _buildStyledText('处, 受限空间作业 ', pd['INPUT8']?.toString()??"0"), + _buildStyledText(' 处, 登高作业', pd['INPUT9']?.toString()??"0"), + _buildStyledText('处, 其他特殊作业 ', pd['INPUT10']?.toString()??"0"), + const TextSpan(text: ' 处。 '), + + ], + ), + ), + ); + } + + +} \ No newline at end of file diff --git a/lib/pages/home/SafetyCommitment/safety_commitment_dh_list.dart b/lib/pages/home/SafetyCommitment/safety_commitment_dh_list.dart new file mode 100644 index 0000000..3b7fecf --- /dev/null +++ b/lib/pages/home/SafetyCommitment/safety_commitment_dh_list.dart @@ -0,0 +1,344 @@ +import 'package:flutter/material.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; +import 'package:qhd_prevention/pages/home/SafetyCommitment/company_safety_commitment_apply.dart'; +import 'package:qhd_prevention/pages/home/SafetyCommitment/team_safety_commitment_apply.dart'; +import 'package:qhd_prevention/pages/home/SafetyCommitment/team_safety_commitment_detail.dart'; +import 'package:qhd_prevention/pages/home/SafetyCommitment/work_shop_safety_commitment_apply.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/dh_work_detai/hotwork_apply_detail.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/aqcs_work_detail/hotwork_safe_func_sure.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/aqgl_work_detail/hotwork_aqgl_detail.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/aqjd_work_detail/hotwork_aqjd_detail.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/dbbz_work_detail/hotwork_dbbz_detail.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/dhsp_work_detail/hotwork_dhsp_detail.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/jhr_work_detail/hotwork_jhr_detail.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/jszy_work_detail/hotwork_jszy_detail.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/kszy_work_detail/hotwork_kszy_detail.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/szaq_work_detail/hotwork_set_safe_detail.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/szdw_work_detail/hotwork_szdw_detail.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/ysgd_work_detail/hotwork_ysgd_detail.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_wrok/dh_work/zyfz_work_detail/hotwork_zyfz_detail.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; +import 'package:qhd_prevention/customWidget/bottom_picker.dart'; +import 'package:qhd_prevention/customWidget/custom_button.dart'; +import 'package:qhd_prevention/customWidget/search_bar_widget.dart'; +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_Wrok/dh_work/qtfx_work_detail/hotwork_gas_list.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/special_Wrok/dh_work/jsjd_work_detail/hotwork_jsjd_detail.dart'; + +import 'commitment_workshop_detail_page.dart'; +import 'company_safety_commitment_detail.dart'; + +class SafetyCommitmentDhList extends StatefulWidget { + const SafetyCommitmentDhList({Key? key, required this.type, }) : super(key: key); + + final int type; + @override + _SafetyCommitmentDhListState createState() => _SafetyCommitmentDhListState(); +} + +class _SafetyCommitmentDhListState extends State { + // Data and state variables + List list = []; + int currentPage = 1; + int rows = 10; + int totalPage = 1; + bool isLoading = false; + + final TextEditingController _searchController = TextEditingController(); + + List> stepList = []; + int sindex = 0; + String searchKeywords = ''; + String id=""; + String title =""; + String itemTitle =""; + String itemTitleName=""; + + List> flowList = []; + final GlobalKey _scaffoldKey = GlobalKey(); + + final ScrollController _scrollController = ScrollController(); + + @override + void initState() { + super.initState(); + + id=SessionService.instance.loginUser?["DEPARTMENT_ID"]??""; + + switch(widget.type){ + case 1: + title="公司安全承诺"; + itemTitle="公开安全承诺报告"; + itemTitleName="CORP_NAME"; + break; + case 2: + title="风险研判报告及安全承诺公告"; + itemTitle="风险研判报告及安全承诺公告"; + itemTitleName="DEPARTMENT_NAME"; + break; + case 3: + title="班组风险研判及安全承诺"; + itemTitle="风险研判报告及安全承诺公告"; + itemTitleName="DEPARTMENTNAME"; + break; + } + + _fetchData(); + _scrollController.addListener(_onScroll); + } + + @override + void dispose() { + _scrollController.dispose(); + super.dispose(); + } + + void _onScroll() { + if (_scrollController.position.pixels >= + _scrollController.position.maxScrollExtent && + !isLoading) { + if (currentPage < totalPage) { + currentPage++; + _fetchData(); + } + } + } + + + + Future _fetchData() async { + if (isLoading) return; + setState(() => isLoading = true); + try { + final Map response; + if(widget.type==1) { + response = await ApiService.getCompanySafetyCommitmentList(currentPage, searchKeywords, id); + }else if(widget.type==2){ + response = await ApiService.getWorkshopSafetyCommitmentList(currentPage, searchKeywords,id); + }else { + response = await ApiService.getTeamSafetyCommitmentList(currentPage, searchKeywords,id); + } + + if (response['result'] == 'success') { + setState(() { + if (currentPage == 1) { + list = response['varList']; + } else { + list.addAll(response['varList']); + } + Map page = response['page']; + totalPage = page['totalPage'] ?? 1; + isLoading = false; + }); + }else{ + ToastUtil.showNormal(context, response['msg']); + } + } catch (e) { + print('Error fetching data: $e'); + setState(() => isLoading = false); + } + } + + void _search() { + searchKeywords = _searchController.text.trim(); + currentPage = 1; + list.clear(); + _fetchData(); + } + + + /// 申请 + Future _handleApply() async { + // 处理申请按钮点击逻辑 + + setState(() async { + if(widget.type==1) { + await pushPage(CompanySafetyCommitmentApply(), context); + }else if(widget.type==2){ + await pushPage(WorkShopSafetyCommitmentApply(), context); + }else { + await pushPage(TeamSafetyCommitmentApply(), context); + } + + searchKeywords = ""; + currentPage = 1; + list.clear(); + _fetchData(); + }); + + // try { + // final Map response; + // if(widget.type==1) { + // response = await ApiService.getCompanySafetyCommitmentPermission( id); + // }else if(widget.type==2){ + // response = await ApiService.getWorkshopSafetyCommitmentPermission(id); + // }else { + // response = await ApiService.getTeamSafetyCommitmentPermission(id); + // } + // + // if (response['result'] == 'success') { + // setState(() async { + // if(widget.type==1) { + // await pushPage(CompanySafetyCommitmentApply(), context); + // }else if(widget.type==2){ + // + // }else { + // + // } + // + // searchKeywords = ""; + // currentPage = 1; + // list.clear(); + // _fetchData(); + // }); + // }else{ + // ToastUtil.showNormal(context, response['msg']); + // } + // } catch (e) { + // ToastUtil.showNormal(context,'$e'); + // print('Error fetching data: $e'); + // } + + + } + + + + void _goToDetail(Map item) { + if(widget.type==1) { + pushPage(CompanySafetyCommitmentDetail( commitmentId:item['COMMITMENTCOMPANY_ID'],), context); + }else if(widget.type==2){ + pushPage(CommitmentWorkshopDetailPage( commitmentWorkshopId:item['COMMITMENTWORKSHOP_ID'],), context); + }else { + pushPage(TeamSafetyCommitmentDetail( commitmentWorkshopId:item['COMMITMENTTEAM_ID'],), context); + } + + } + + + + Widget _buildListItem(Map item) { + return InkWell( + onTap: () => _goToDetail(item), + child: Container( + padding: const EdgeInsets.all(20), + margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: Colors.black12, + blurRadius: 4, + offset: const Offset(0, 2), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '$itemTitle-${item[itemTitleName]}', + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('承诺时间: ${item['SIGN_TIME']??""}'), + Text('承诺人: ${item['SIGN_USER_NAME']??""}'), + ], + ), + ], + ), + ), + + ); + } + + + + + + Widget _buildListContent() { + if (isLoading && list.isEmpty) { + // 初始加载时显示居中的加载指示器 + return Center(child: CircularProgressIndicator()); + } else if (list.isEmpty) { + // 没有数据 + return NoDataWidget.show(); + } else { + // 有数据或加载更多 + return ListView.builder( + padding: EdgeInsets.zero, + + controller: _scrollController, + itemCount: list.length + (isLoading ? 1 : 0), + itemBuilder: (context, index) { + if (index >= list.length) { + // 加载更多时在列表底部显示加载指示器 + return Padding( + padding: const EdgeInsets.symmetric(vertical: 16.0), + child: Center(child: CircularProgressIndicator()), + ); + } + return _buildListItem(list[index]); + }, + ); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + key: _scaffoldKey, + appBar: MyAppbar( + title: title, + actions: [ + TextButton( + onPressed: _handleApply, + child: const Text( + '承诺', + style: TextStyle(color: Colors.white, fontSize: 17), + ), + ), + ], + ), + + body: Column( + children: [ + // Filter bar + Container( + color: Colors.white, + padding: const EdgeInsets.symmetric(horizontal: 5, vertical: 8), + child: Row( + children: [ + + + Expanded( + flex: 2, + child: SearchBarWidget( + showResetButton: false, + hintText: "请输入关键字", + // isClickableOnly: true, + onSearch: (text) { + _search(); + }, + controller: _searchController, + ), + ), + ], + ), + ), + const Divider(height: 1), + // List + Expanded(child: _buildListContent()), + ], + ), + ); + } +} diff --git a/lib/pages/home/SafetyCommitment/safety_commitment_other_list_page.dart b/lib/pages/home/SafetyCommitment/safety_commitment_other_list_page.dart new file mode 100644 index 0000000..1fe21cb --- /dev/null +++ b/lib/pages/home/SafetyCommitment/safety_commitment_other_list_page.dart @@ -0,0 +1,251 @@ +import 'package:flutter/material.dart'; +import 'package:http/http.dart' as http; +import 'package:intl/intl.dart'; +import 'package:qhd_prevention/customWidget/custom_button.dart'; +import 'package:qhd_prevention/customWidget/search_bar_widget.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; +import 'dart:convert'; +import 'dart:math' as math; + +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/pages/home/Safetymeeting/safety_meeting_detail_page.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/pages/notif/notif_detail_page.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + + +class SafetyCommitmentOtherListPage extends StatefulWidget { + const SafetyCommitmentOtherListPage({Key? key}) : super(key: key); + + @override + State createState() => _SafetyCommitmentOtherListPageState(); +} + +class _SafetyCommitmentOtherListPageState extends State + with SingleTickerProviderStateMixin{ + + + + late TabController _tabController= TabController(length: 2, vsync: this); + int _selectedTab = 0; + + int _page = 1; + String searchKey=""; + int _totalPage=1; + late List _list = []; + bool _isLoading = false; + bool _hasMore = true; + + + + @override + void initState() { + super.initState(); + // _tabController = TabController(length: 2, vsync: this); + _tabController.addListener(() { + // if (!_tabController.indexIsChanging) { + // setState(() => _selectedTab = _tabController.index); + // } + + if (_tabController.indexIsChanging) { + setState(() => _selectedTab = _tabController.index); + print('切换到标签:${_tabController.index}'); + reRefreshData(); + } + + }); + + _getSafetyMeetingList(false); + } + + void reRefreshData(){ + _page=1; + _list.clear(); + _getSafetyMeetingList(false); + + } + + Future _getSafetyMeetingList(bool loadMore) async { + // LoadingDialogHelper.show(); + try { + if (_isLoading) return; + _isLoading = true; + + + final Map result; + if(_selectedTab==0){ + result = await ApiService.getMyOtherCommitmentsList(); + }else{ + result = await ApiService.getAcceptCommitmentList( ); + } + + if (result['result'] == 'success') { + _totalPage =result["page"]['totalPage'] ?? 1; + final List newList = result['varList'] ?? []; + // setState(() { + // _list.addAll(newList); + // }); + + setState(() { + if (loadMore) { + _list.addAll(newList); + } else { + _list = newList; + } + _hasMore = _page < _totalPage; + // if (_hasMore) _page++; + }); + + }else{ + ToastUtil.showNormal(context, "加载数据失败"); + // _showMessage('加载数据失败'); + } + + } catch (e) { + // 出错时可以 Toast 或者在页面上显示错误状态 + print('加载数据失败:$e'); + } finally { + // if (!loadMore) LoadingDialogHelper.hide(); + _isLoading = false; + } + } + + + + + + + + @override + void dispose() { + _tabController.dispose(); + super.dispose(); + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppbar(title: "其他行业安全承诺"), + body: + GestureDetector( + onTap: () { + FocusScope.of(context).unfocus(); // 收起键盘 + }, + behavior: HitTestBehavior.opaque, + child: Scaffold( + body: SafeArea( + child: Column( + children: [ + // Tab bar + TabBar( + controller: _tabController, + labelStyle: TextStyle(fontSize: 16), + indicator: UnderlineTabIndicator( + borderSide: BorderSide(width: 3.0, color: Colors.blue), + insets: EdgeInsets.symmetric(horizontal: 100.0), + ), + labelColor: Colors.blue, + unselectedLabelColor: Colors.grey, + tabs: const [Tab(text: '我的承诺'), Tab(text: '接收承诺')], + ), + + // Search bar + // List + NotificationListener( + onNotification: _onScroll, + child: Expanded( + child: + _list.isEmpty + ? NoDataWidget.show() + : ListView.builder( + itemCount: _list.length, + itemBuilder: (context, index) { + return _itemCell(_list[index]); + }, + ), + ), + ), + + ], + ), + ), + ), + ), + ); + } + + Widget _itemCell(final item) { + return InkWell( + onTap: () => _goToDetail(item), + child: Container( + padding: const EdgeInsets.all(20), + margin: const EdgeInsets.symmetric(vertical: 8, horizontal: 16), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(10), + boxShadow: [ + BoxShadow( + color: Colors.black12, + blurRadius: 4, + offset: const Offset(0, 2), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '-${item['DEPARTMENT_NAME']}',//$itemTitle + style: const TextStyle( + fontSize: 16, + fontWeight: FontWeight.bold, + ), + ), + const SizedBox(height: 8), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('承诺时间: ${item['SIGN_TIME']}'), + Text('承诺人: ${item['SIGN_USER_NAME']}'), + ], + ), + ], + ), + ), + + ); + } + + + bool _onScroll(ScrollNotification n) { + if (n.metrics.pixels > n.metrics.maxScrollExtent - 100 && + _hasMore && !_isLoading) { + + _page++; + _getSafetyMeetingList(true); + } + return false; + } + + + void _goToDetail(String id){ + pushPage(SafetyMeetingDetailPage( + id,_selectedTab, + onClose: (String result) { + setState(() { + reRefreshData(); + }); + + }, + ), context); + } + + + + + + +} + + + diff --git a/lib/pages/home/SafetyCommitment/safety_commitment_page.dart b/lib/pages/home/SafetyCommitment/safety_commitment_page.dart new file mode 100644 index 0000000..83ed122 --- /dev/null +++ b/lib/pages/home/SafetyCommitment/safety_commitment_page.dart @@ -0,0 +1,56 @@ +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:qhd_prevention/pages/home/SafetyCommitment/safety_commitment_other_list_page.dart'; +import 'package:qhd_prevention/pages/home/SafetyCommitment/safety_commitment_tab_list.dart'; +import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + + +class SafetyCommitmentPage extends StatefulWidget { + const SafetyCommitmentPage({super.key}); + + @override + State createState() => _SafetyCommitmentPageState(); +} + + +class _SafetyCommitmentPageState extends State { + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppbar(title: "安全承诺"), + body: Column( + children: [ + Padding(padding: EdgeInsets.only(top: 10), + child: ItemListWidget.selectableLineTitleTextRightButton( + label: '危化行业安全承诺:', + isEditable: true, + isRequired:false, + onTap: () { + pushPage(SafetyCommitmentTabList(), context); + }, + text:' ', + ), + + ), + + const Divider(), + // Padding(padding: EdgeInsets.only(top: 10), + // child:ItemListWidget.selectableLineTitleTextRightButton( + // label: '其他行业安全承诺:', + // isEditable: true, + // isRequired:false, + // onTap: () { + // pushPage(SafetyCommitmentOtherListPage(), context); + // + // }, + // text: ' ', + // ), + // ), + // const Divider(), + ], + ), + ); + } +} diff --git a/lib/pages/home/SafetyCommitment/safety_commitment_tab_list.dart b/lib/pages/home/SafetyCommitment/safety_commitment_tab_list.dart new file mode 100644 index 0000000..34027c0 --- /dev/null +++ b/lib/pages/home/SafetyCommitment/safety_commitment_tab_list.dart @@ -0,0 +1,76 @@ +import 'package:flutter/material.dart'; +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/pages/home/SafetyCommitment/safety_commitment_dh_list.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/work_tab_dh_list.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/work_tab_dl_list.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/work_tab_dt_list.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/work_tab_dz_list.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/work_tab_gc_list.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/work_tab_icon_grid.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/work_tab_lsyd_list.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/work_tab_mbcd_list.dart'; +import 'package:qhd_prevention/pages/home/tap/tabList/work_tab_sxkj_list.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + +class SafetyCommitmentTabList extends StatefulWidget { + const SafetyCommitmentTabList({super.key}); + + @override + State createState() => _SafetyCommitmentTabListState(); +} + +class _SafetyCommitmentTabListState extends State { + late List> buttonInfos = []; + + @override + void initState() { + super.initState(); + _getData(); + } + Future _getData() async { + + setState(() { + + buttonInfos = [ + { + "icon": "assets/icon-apps/icon_101.png", + "title": "动火作业", + "unreadCount": 0, + }, + { + "icon": "assets/icon-apps/icon_100.png", + "title": "车间风险研判\n及安全承诺", + "unreadCount": 0, + }, + { + "icon": "assets/icon-apps/icon_102.png", + "title": "班组风险研判\n及安全承诺", + "unreadCount": 0, + }, + + ]; + }); + } + void _handleItemPressed(int index) async { + switch (index) { + case 0:await pushPage(SafetyCommitmentDhList(type:1,), context); break; + case 1:await pushPage(SafetyCommitmentDhList(type:2,), context); break; + case 2:await pushPage(SafetyCommitmentDhList(type:3,), context); break; + + } + _getData(); + } + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppbar(title: '危化行业安全承诺'), + body: SafeArea( + child: WorkTabIconGrid( + buttonInfos: buttonInfos, + onItemPressed: _handleItemPressed, + ), + ), + ); + } +} diff --git a/lib/pages/home/SafetyCommitment/team_safety_commitment_apply.dart b/lib/pages/home/SafetyCommitment/team_safety_commitment_apply.dart new file mode 100644 index 0000000..8143dcf --- /dev/null +++ b/lib/pages/home/SafetyCommitment/team_safety_commitment_apply.dart @@ -0,0 +1,898 @@ +import 'dart:io'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:qhd_prevention/customWidget/ItemWidgetFactory.dart'; +import 'package:qhd_prevention/customWidget/custom_button.dart'; +import 'package:qhd_prevention/customWidget/picker/CupertinoDatePicker.dart'; +import 'package:qhd_prevention/customWidget/single_image_viewer.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart'; +import 'package:qhd_prevention/pages/mine/mine_sign_page.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + + + +class TeamSafetyCommitmentApply extends StatefulWidget { + const TeamSafetyCommitmentApply({super.key}); + + @override + State createState() => _TeamSafetyCommitmentApplyState(); +} + +class _TeamSafetyCommitmentApplyState extends State { + + + final TextEditingController _controller1 = TextEditingController(); + final TextEditingController _controller2 = TextEditingController(); + final TextEditingController _controller3 = TextEditingController(); + final TextEditingController _controller4 = TextEditingController(); + final TextEditingController _controller5 = TextEditingController(); + final TextEditingController _controller6 = TextEditingController(); + final TextEditingController _controller7 = TextEditingController(); + final TextEditingController _controller8 = TextEditingController(); + final TextEditingController _controller9 = TextEditingController(); + final TextEditingController _controller10 = TextEditingController(); + final TextEditingController _controller11 = TextEditingController(); + final TextEditingController _controller12 = TextEditingController(); + final TextEditingController _controller13 = TextEditingController(); + final TextEditingController _controller14 = TextEditingController(); + final TextEditingController _controller15 = TextEditingController(); + final TextEditingController _controller16 = TextEditingController(); + final TextEditingController _controller17 = TextEditingController(); + final TextEditingController _controller18 = TextEditingController(); + final TextEditingController _controller19 = TextEditingController(); + + + bool _isFault1 = true; + bool _isFault2 = true; + bool _isFault3 = true; + bool _isFault4 = true; + bool _isFault5 = true; + bool _isFault6 = true; + bool _isFault7 = true; + bool _isFault8 = true; + bool _isFault9 = true; + bool _isFault10 = true; + bool _isFault11 = true; + bool _isFault12 = true; + bool _isFault13 = true; + bool _isFault14 = true; + bool _isFault15 = true; + bool _isFault16 = true; + + DateTime? dataStart; + String dataTimeStart=""; + DateTime? dataEnd; + String dataTimeEnd=""; + + List signImgList = []; + + + + + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppbar(title: "安全承诺"), + body:Container( + padding: EdgeInsets.only(top: 15,bottom:15,left: 15,right: 15), + child: ListView( + children: [ + + ListItemFactory.createBuildSimpleSection('企业状态',horPadding: 0,color: Color(0x00000000)), + + Container( + padding: EdgeInsets.symmetric(vertical: 5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + + ListItemFactory.createBlueDotSection('高危生产活动及作业的安全风险可控状态',color: 0xffffffff), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '检维修作业:', + isEditable: true, + controller: _controller1, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '特殊作业:', + isEditable: true, + controller: _controller2, + text: '', + ), + + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '动火作业:', + isEditable: true, + controller: _controller3, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '其中特级:', + isEditable: true, + controller: _controller4, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '一级:', + isEditable: true, + controller: _controller5, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '二级:', + isEditable: true, + controller: _controller6, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '高处作业:', + isEditable: true, + controller: _controller7, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '受限空间作业:', + isEditable: true, + controller: _controller8, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '吊装作业:', + isEditable: true, + controller: _controller9, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '临时用电作业:', + isEditable: true, + controller: _controller10, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '盲板抽堵作业:', + isEditable: true, + controller: _controller11, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '动土作业:', + isEditable: true, + controller: _controller12, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '断路作业:', + isEditable: true, + controller: _controller13, + text: '', + ), + // const Divider(), + // ItemListWidget.singleLineTitleText( + // label: '检维修作业:', + // isEditable: true, + // controller: _controller13, + // text: '', + // ), + + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 风险辨识、作业许可及管控措施的落实情况', + horizontalPadding: 0, + groupValue: _isFault1, + onChanged: (val) { + setState(() { + _isFault1 = val; + }); + }, + ), + + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 处于试生产情况', + horizontalPadding: 0, + groupValue: _isFault2, + onChanged: (val) { + setState(() { + _isFault2 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 处于开停车情况', + horizontalPadding: 0, + yesLabel:"开", + noLabel:"停", + groupValue: _isFault3, + onChanged: (val) { + setState(() { + _isFault3 = val; + }); + }, + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '承包商作业:', + isEditable: true, + controller: _controller14, + text: '', + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 管控情况', + horizontalPadding: 0, + yesLabel:"受控", + noLabel:"非受控", + groupValue: _isFault4, + onChanged: (val) { + setState(() { + _isFault4 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 变更情况', + horizontalPadding: 0, + yesLabel:"有", + noLabel:"没有", + groupValue: _isFault5, + onChanged: (val) { + setState(() { + _isFault5 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 落实审批程序情况', + horizontalPadding: 0, + groupValue: _isFault6, + onChanged: (val) { + setState(() { + _isFault6 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 罐区、仓库等危险源是否处于安全状态', + horizontalPadding: 0, + groupValue: _isFault7, + onChanged: (val) { + setState(() { + _isFault7 = val; + }); + }, + ), + + + ], + ), + ), + + + SizedBox(height: 15,), + + Container( + padding: EdgeInsets.symmetric(vertical: 5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + ListItemFactory.createBlueDotSection('车间安全状态',color: 0xffffffff), + const Divider(), + // ItemListWidget.singleLineTitleText( + // label: '车间岗位:', + // isEditable: true, + // controller: _controller15, + // text: '', + // ), + Padding( + padding: EdgeInsets.only(left: 15,right: 15), + child: ListItemFactory.createBuildMultilineInput( + "岗位主要设备(装置)名称、数量", + "请输入...", + _controller15, + isRequired:true, + ), + + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '其中运行:', + isEditable: true, + controller: _controller16, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '停产:', + isEditable: true, + controller: _controller17, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '检修:', + isEditable: true, + controller: _controller18, + text: '', + ), + + ], + ), + ), + + SizedBox(height: 15,), + + Container( + padding: EdgeInsets.symmetric(vertical: 5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + ListItemFactory.createBlueDotSection('生产装置的安全运行状态',color: 0xffffffff), + const Divider(), + ListItemFactory.createYesNoSection( + title: '生产装置的温度、压力、组分液位、流量等主要工艺参数是否处于指标范围', + horizontalPadding: 0, + groupValue: _isFault8, + onChanged: (val) { + setState(() { + _isFault8 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '压力容器、压力管道等特种设备处于安全运行状态', + horizontalPadding: 0, + groupValue: _isFault9, + onChanged: (val) { + setState(() { + _isFault9 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '设备设施的静动密封完好无泄漏', + horizontalPadding: 0, + groupValue: _isFault10, + onChanged: (val) { + setState(() { + _isFault10 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '超限报警、紧急切断、联锁等各类安全设施配备完好投用,并可靠运行', + horizontalPadding: 0, + groupValue: _isFault11, + onChanged: (val) { + setState(() { + _isFault11 = val; + }); + }, + ), + + + ], + ), + ), + + + SizedBox(height: 15,), + + Container( + padding: EdgeInsets.symmetric(vertical: 5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + ListItemFactory.createBlueDotSection('危险化学品罐区、仓库等重大危险源安全运行状态',color: 0xffffffff), + const Divider(), + ListItemFactory.createYesNoSection( + title: '储罐、管道、机泵、阀门及仪表系统完好无泄漏', + horizontalPadding: 0, + groupValue: _isFault12, + onChanged: (val) { + setState(() { + _isFault12 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '储罐的液位、温度、压力、气柜钟罩无超限运行', + horizontalPadding: 0, + groupValue: _isFault13, + onChanged: (val) { + setState(() { + _isFault13 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '气柜钟罩超高、低运行', + horizontalPadding: 0, + groupValue: _isFault14, + onChanged: (val) { + setState(() { + _isFault14 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '手动放脱水、装卸车时确保人员在岗', + horizontalPadding: 0, + groupValue: _isFault15, + onChanged: (val) { + setState(() { + _isFault15 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '可燃及有毒气体报警和联锁处于可靠运行状态', + horizontalPadding: 0, + groupValue: _isFault16, + onChanged: (val) { + setState(() { + _isFault16 = val; + }); + }, + ), + const Divider(), + Padding( + padding: EdgeInsets.only(left: 15,right: 15), + child: ListItemFactory.createBuildMultilineInput( + "仓库是否按照国家标准分区分类储存危险化学品,是否超量、超品种储存,相互禁配物质是否混放混存。", + "请输入...", + _controller19, + isRequired:true, + ), + + ), + + + ], + ), + ), + + SizedBox(height: 5,), + ListItemFactory.createBuildSimpleSection('企业承诺',horPadding: 0,color: Color(0x00000000)), + SizedBox(height: 5,), + + Container( + padding: EdgeInsets.symmetric(vertical: 5,horizontal: 15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + + GestureDetector( + child: ItemListWidget.selectableLineTitleTextRightButton(label: '今日', text: dataTimeStart.isEmpty? + '请选择':dataTimeStart??'', isEditable: true, isRequired: true,horizontalnum: 0), + onTap: () async { + DateTime? picked = await BottomDateTimePicker.showDate(context,allowFuture: true); + if (picked != null) { + + setState(() { + dataStart=picked; + if(dataTimeEnd.isNotEmpty) { + bool isChao= validateDateRange(dataStart!,dataEnd!); + if(!isChao){ + return; + } + } + dataTimeStart = DateFormat('yyyy-MM-dd HH:mm').format(picked); + }); + } + }, + ), + + + const Divider(), + GestureDetector( + child:ItemListWidget.selectableLineTitleTextRightButton(label: '至', text: dataTimeEnd.isEmpty? + '请选择':dataTimeEnd, isEditable: true, isRequired: true,horizontalnum: 0), + onTap: () async { + DateTime? picked = await BottomDateTimePicker.showDate(context,allowFuture: true); + if (picked != null) { + + setState(() { + dataEnd=picked; + if(dataTimeStart.isNotEmpty) { + bool isChao= validateDateRange(dataStart!, dataEnd!); + if(!isChao){ + return; + } + } + dataTimeEnd = DateFormat('yyyy-MM-dd HH:mm').format(picked); + }); + } + }, + ), + + + const Divider(), + Text("今天我公司已进行安全风险研判,各项安全风险防控措施已落实到位,我承诺所有生产设施处于安全运行状态,罐区、库房等危险源安全风险得到有效控制。", + style: TextStyle(color: Colors.black,fontSize: 13),), + const Divider(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('承诺人:', style: TextStyle(fontSize: 16)), + CustomButton( + text: '手写签字', + height: 36, + backgroundColor: Colors.green, + onPressed: _sign, + ), + ], + ), + if (signImgList.isNotEmpty) _signListWidget(), + + ], + ), + ), + + SizedBox(height: 15,), + + CustomButton( + backgroundColor: Colors.green, + text: "提交", + onPressed: () { + // TODO: 完成回调 + _upData(); + } + ), + + + ], + ), + ) , + + ); + } + + + + Future _upData() async { + try { + + + + String text1=_controller1.text.trim(); + if(text1.isEmpty){ + ToastUtil.showNormal(context, "请输入检维修作业数"); + return; + } + + String text2=_controller2.text.trim(); + if(text2.isEmpty){ + ToastUtil.showNormal(context, "请输入特殊作业数"); + return; + } + + String text3=_controller3.text.trim(); + if(text3.isEmpty){ + ToastUtil.showNormal(context, "请输入动火作业数"); + return; + } + + String text4=_controller4.text.trim(); + if(text4.isEmpty){ + ToastUtil.showNormal(context, "请输入特级动火作业数"); + return; + } + + String text5=_controller5.text.trim(); + if(text5.isEmpty){ + ToastUtil.showNormal(context, "请输入一级动火作业数"); + return; + } + + String text6=_controller6.text.trim(); + if(text6.isEmpty){ + ToastUtil.showNormal(context, "请输入二级动火作业数"); + return; + } + + String text7=_controller7.text.trim(); + if(text7.isEmpty){ + ToastUtil.showNormal(context, "请输入高处作业数"); + return; + } + + String text8=_controller8.text.trim(); + if(text8.isEmpty){ + ToastUtil.showNormal(context, "请输入受限空间作业数"); + return; + } + + String text9=_controller9.text.trim(); + if(text9.isEmpty){ + ToastUtil.showNormal(context, "请输入吊装作业数"); + return; + } + + String text10=_controller10.text.trim(); + if(text10.isEmpty){ + ToastUtil.showNormal(context, "请输入临时用电作业数"); + return; + } + + String text11=_controller11.text.trim(); + if(text11.isEmpty){ + ToastUtil.showNormal(context, "请输入盲板抽堵作业数"); + return; + } + + String text12=_controller12.text.trim(); + if(text12.isEmpty){ + ToastUtil.showNormal(context, "请输入动土作业数"); + return; + } + + String text13=_controller13.text.trim(); + if(text13.isEmpty){ + ToastUtil.showNormal(context, "请输入断路作业数"); + return; + } + + String text14=_controller14.text.trim(); + if(text14.isEmpty){ + ToastUtil.showNormal(context, "请输入承包商作业数"); + return; + } + + String text15=_controller15.text.trim(); + if(text15.isEmpty){ + ToastUtil.showNormal(context, "请输入车间岗位数"); + return; + } + + String text16=_controller16.text.trim(); + if(text16.isEmpty){ + ToastUtil.showNormal(context, "请输入车间岗位运行数"); + return; + } + + String text17=_controller17.text.trim(); + if(text17.isEmpty){ + ToastUtil.showNormal(context, "请输入车间岗位停产数"); + return; + } + + String text18=_controller18.text.trim(); + if(text18.isEmpty){ + ToastUtil.showNormal(context, "请输入车间岗位检修数"); + return; + } + + String text19=_controller19.text.trim(); + if(text19.isEmpty){ + ToastUtil.showNormal(context, "请输入仓库是否按照国家标准分区分类储存危险化学品,是否超量、超品种储存,相互禁配物质是否混放混存"); + return; + } + + + + + + + + + if(dataTimeStart.isEmpty){ + ToastUtil.showNormal(context, "请选择承诺时间"); + return; + } + + if(dataTimeEnd.isEmpty){ + ToastUtil.showNormal(context, "请选择承诺时间"); + return; + } + + if(signImgList.isEmpty){ + ToastUtil.showNormal(context, "请签字"); + return; + } + + LoadingDialogHelper.show(message: "提交中。。。"); + + final formData = { + 'INPUT1': text1, + 'INPUT2': text2, + 'INPUT3': text3, + 'INPUT4': text4, + 'INPUT5': text5, + 'INPUT6': text6, + 'INPUT7': text7, + 'INPUT8': text8, + 'INPUT9': text9, + 'INPUT10': text10, + 'INPUT11': text11, + 'INPUT12': text12, + 'INPUT13': text13, + 'INPUT14': text14, + 'INPUT15': text15, + 'INPUT16': text16, + 'INPUT17': text17, + 'INPUT18': text18, + 'INPUT19': text19, + + + 'RADIO1': _isFault1?"1":"-1", + 'RADIO2': _isFault2?"1":"-1", + 'RADIO3': _isFault3?"1":"-1", + 'RADIO4': _isFault4?"1":"-1", + 'RADIO5': _isFault5?"1":"-1", + 'RADIO6': _isFault6?"1":"-1", + 'RADIO7': _isFault7?"1":"-1", + 'RADIO8': _isFault8?"1":"-1", + 'RADIO9': _isFault9?"1":"-1", + 'RADIO10': _isFault10?"1":"-1", + 'RADIO11': _isFault11?"1":"-1", + 'RADIO12': _isFault12?"1":"-1", + 'RADIO13': _isFault13?"1":"-1", + 'RADIO14': _isFault14?"1":"-1", + 'RADIO15': _isFault15?"1":"-1", + 'RADIO16': _isFault16?"1":"-1", + + 'START_TIME':dataTimeStart, + 'END_TIME': dataTimeEnd, + + + "SIGNER_TIME":DateFormat('yyyy-MM-dd HH:mm').format(DateTime.now()) , + 'DEPARTMENT_ID':SessionService.instance.loginUser?["DEPARTMENT_ID"], + 'SIGN_USER': SessionService.instance.loginUserId, + "CORPINFO_ID": SessionService.instance.corpinfoId, + 'USER_ID': SessionService.instance.loginUserId, + }; + + + final Mapresponse = await ApiService.upTeamSafetyCommitmentApply(formData,signImgList); + LoadingDialogHelper.hide(); + if (response['result'] == 'success') { + setState(() { + Navigator.pop(context); + }); + }else{ + ToastUtil.showNormal(context, response['msg']); + } + } catch (e) { + LoadingDialogHelper.hide(); + print('Error fetching data: $e'); + + } + } + + + + Future _sign() async { + final String path = await Navigator.push( + context, + MaterialPageRoute(builder: (c) => MineSignPage()), + ); + if (path != null) { + setState(() { + signImgList.add(path); + }); + + } + } + + Widget _signListWidget() { + return Column( + children: + signImgList.map((imgData) { + final idx = signImgList.indexOf(imgData); + return Column( + children: [ + const SizedBox(height: 10), + const Divider(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + child: ConstrainedBox( + constraints: const BoxConstraints( + maxWidth: 230, + maxHeight: 150, + ), + child: + Image.file( + File(signImgList[0] ?? ''), + fit: BoxFit.contain, + ), + ), + onTap: + () => presentOpaque( + SingleImageViewer(imageUrl:signImgList[0] ?? ''), + context, + ), + ), + Column( + children: [ + CustomButton( + text: '删除', + height: 30, + padding: const EdgeInsets.symmetric(horizontal: 10), + backgroundColor: Colors.red, + onPressed: () { + setState(() => signImgList.removeAt(idx)); + }, + ), + const SizedBox(height: 80), + ], + ), + ], + ), + ], + ); + }).toList(), + ); + } + + + bool validateDateRange(DateTime startTime, DateTime endTime) { + const int thirtyDaysInMilliseconds = 30 * 24 * 60 * 60 * 1000; // 30 天的毫秒数 + final int difference = endTime.millisecondsSinceEpoch - startTime.millisecondsSinceEpoch; + + if (difference > thirtyDaysInMilliseconds) { + ToastUtil.showNormal(context, "只能选择30天内的日期"); + return false; + }else{ + return true; + } + } + + +} diff --git a/lib/pages/home/SafetyCommitment/team_safety_commitment_detail.dart b/lib/pages/home/SafetyCommitment/team_safety_commitment_detail.dart new file mode 100644 index 0000000..e36e437 --- /dev/null +++ b/lib/pages/home/SafetyCommitment/team_safety_commitment_detail.dart @@ -0,0 +1,440 @@ +import 'package:flutter/material.dart'; +import 'package:photo_view/photo_view.dart'; +import 'package:http/http.dart' as http; +import 'package:qhd_prevention/customWidget/ItemWidgetFactory.dart'; +import 'package:qhd_prevention/customWidget/single_image_viewer.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; +import 'dart:convert'; + +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + +class TeamSafetyCommitmentDetail extends StatefulWidget { + final String commitmentWorkshopId; + + const TeamSafetyCommitmentDetail({ + Key? key, + required this.commitmentWorkshopId, + }) : super(key: key); + + @override + _TeamSafetyCommitmentDetailState createState() => _TeamSafetyCommitmentDetailState(); +} + +class _TeamSafetyCommitmentDetailState extends State { + Map pd = {}; + bool isLoading = true; + String errorMessage = ''; + + @override + void initState() { + super.initState(); + _getData(); + } + + Future _getData() async { + setState(() { + isLoading = true; + }); + + try { + final response = await ApiService.getTeamSafetyCommitmentDetail( widget.commitmentWorkshopId); + + if (response['result'] == 'success') { + setState(() { + pd = response['pd']; + isLoading = false; + }); + } else { + ToastUtil.showNormal(context, '数据加载失败'); + setState(() { + isLoading = false; + }); + } + + } catch (e) { + ToastUtil.showNormal(context, '发生错误: ${e.toString()}'); + setState(() { + isLoading = false; + }); + } + } + + + + + Widget _buildInfoItem(String label, dynamic value, {bool isMarked = true}) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 4), + child: RichText( + text: TextSpan( + style: const TextStyle(fontSize: 14, color: Colors.black87), + children: [ + TextSpan(text: label), + if (isMarked) + TextSpan( + text: value.toString(), + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ) + else + TextSpan(text: value.toString()), + ], + ), + ), + ); + } + + Widget _buildParagraph(List children) { + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: children, + ), + ); + } + + @override + Widget build(BuildContext context) { + if (isLoading) { + return const Scaffold( + body: Center(child: CircularProgressIndicator()), + ); + } + + if (errorMessage.isNotEmpty) { + return Scaffold( + appBar: AppBar(), + body: Center(child: Text(errorMessage)), + ); + } + + return Scaffold( + appBar: MyAppbar(title: "安全承诺"), + body: Container( + color: Colors.white, + child: SingleChildScrollView( + padding: const EdgeInsets.all(16), + child:Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + // 标题部分 + Center( + child: Text( + "【${pd['DEPARTMENTNAME'] ?? '未知车间'}】车间 【${pd['POSTNAME'] ?? '未知岗位'}】岗位", + style: const TextStyle( + fontSize: 20, + fontWeight: FontWeight.bold, + ), + ), + ), + const SizedBox(height: 5), + + // 企业状态部分 + ListItemFactory.createBuildSimpleSection('班组状态',horPadding: 0), + + Container( + padding: EdgeInsets.only(top: 15,bottom: 15,left: 15,right: 15), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey,width: 1) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + ListItemFactory.createBlueDotSection('高危生产活动及作业的安全风险可控状态'), + // _buildSubTitle('高危生产活动及作业的安全风险可控状态'), + + + _buildParagraph([ + + _buildWorkInfoParagraph1(), + + _buildInfoItem('风险辨识、作业许可及管控措施的落实情况: ', (pd['RADIO1'] == 1 ? '是' : '否')), + _buildInfoItem('处于试生产情况: ', (pd['RADIO2'] == 1 ? '是' : '否')), + _buildInfoItem('处于开停车情况: ', (pd['RADIO3'] == 1 ? '开' : '停')), + + _buildWorkInfoParagraph2(), + + _buildInfoItem('变更情况: ', (pd['RADIO5'] == 1 ? '是' : '否')), + _buildInfoItem('落实审批程序情况: ', (pd['RADIO6'] == 1 ? '是' : '否')), + _buildInfoItem('罐区、仓库等危险源是否处于安全状态: ', + (pd['RADIO7'] == 1 ? '是' : '否')), + + + + + + ]), + + + + ListItemFactory.createBlueDotSection('班组安全状态'), + _buildParagraph([ + _buildWorkInfoParagraph3(), + ]), + + ListItemFactory.createBlueDotSection('生产装置的安全运行状态'), + // _buildSubTitle('生产装置的安全运行状态'), + _buildParagraph([ + _buildInfoItem('生产装置的温度、压力、组分液位、流量等主要工艺参数是否处于指标范围: ', + (pd['RADIO8'] == 1 ? '是' : '否')), + _buildInfoItem('压力容器、压力管道等特种设备处于安全运行状态: ', + (pd['RADIO9'] == 1 ? '是' : '否')), + _buildInfoItem('设备设施的静动密封完好无泄漏: ', + (pd['RADIO10'] == 1 ? '是' : '否')), + _buildInfoItem('超限报警、紧急切断、联锁等各类安全设施配备完好投用,并可靠运行: ', + (pd['RADIO11'] == 1 ? '是' : '否')), + ]), + + ListItemFactory.createBlueDotSection('危险化学品罐区、仓库等重大危险源的安全运行状态'), + // _buildSubTitle('危险化学品罐区、仓库等重大危险源的安全运行状态'), + _buildParagraph([ + _buildInfoItem('储罐、管道、机泵、阀门及仪表系统完好无泄漏: ', + (pd['RADIO12'] == 1 ? '是' : '否')), + _buildInfoItem('储罐的液位、温度、压力、气柜钟罩无超限运行: ', + (pd['RADIO13'] == 1 ? '是' : '否')), + _buildInfoItem('气柜钟罩超高、低运行: ', + (pd['RADIO14'] == 1 ? '是' : '否')), + _buildInfoItem('手动放脱水、装卸车时确保人员在岗: ', + (pd['RADIO15'] == 1 ? '是' : '否')), + _buildInfoItem('可燃及有毒气体报警和联锁处于可靠运行状态: ', + (pd['RADIO16'] == 1 ? '是' : '否')), + Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + const Text( + '仓库是否按照国家标准分区分类储存危险化学品,是否超量、超品种储存,相互禁配物质是否混放混存。', + style: TextStyle(fontSize: 14), + ), + const SizedBox(height: 8), + // Container( + // padding: const EdgeInsets.all(12), + // decoration: BoxDecoration( + // border: Border.all(color: Colors.blue), + // borderRadius: BorderRadius.circular(4), + // ), + // child: + Text( + pd['INPUT19'] ?? '无内容', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + // ), + ], + ), + ), + ]), + ], + ), + ), + + + + + // 企业承诺部分 + ListItemFactory.createBuildSimpleSection('班组承诺',horPadding: 0), + // _buildSectionTitle('企业承诺'), + + Container( + padding: EdgeInsets.only(top: 5,bottom: 5,left: 15,right: 15), + decoration: BoxDecoration( + border: Border.all(color: Colors.grey,width: 1) + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: Text.rich( + TextSpan( + children: [ + const TextSpan(text: '今日('), + TextSpan( + text: pd['START_TIME'] ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + const TextSpan(text: ' 至 '), + TextSpan( + text: pd['END_TIME'] ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + const TextSpan( + text: ')我车间已进行安全风险研判,各项安全风险防控措施已落实到位。' + '我承诺本生产装置/业务活动处于安全运行状态,涉及罐区、仓库等危险源安全风险得到有效管控。', + ), + ], + ), + style: const TextStyle(fontSize: 14), + ), + ), + + // 签名部分 + GestureDetector( + onTap: () { + presentOpaque(SingleImageViewer(imageUrl:ApiService.baseImgPath+ pd['SIGN_PATH']), context); + }, + child: Row( + children: [ + // if (imagePath.isNotEmpty) + Text('签字照片:', + style: TextStyle( + fontSize: 14, + fontWeight: FontWeight.bold, + color: Colors.grey, + ), + ), + const SizedBox(width: 15), + if (pd['SIGN_PATH'] != null) + Image.network(ApiService.baseImgPath+pd['SIGN_PATH'],width: 230,height: 150,fit: BoxFit.cover,), + + ], + ), + ), + + //签字时间 + _buildParagraph([ + _buildInfoItem('签字时间: ', pd['SIGN_TIME']??""), + ]), + + ], + ), + ), + + ], + ), + ), + + ), + ); + } + + + Widget _buildWorkInfoParagraph1() { + // 定义一个样式映射函数,将数据部分标记为蓝色加粗 + TextSpan _buildStyledText(String label, String? value) { + return TextSpan( + children: [ + TextSpan(text: label), + TextSpan( + text: value ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + ], + ); + } + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: RichText( + text: TextSpan( + style: const TextStyle(fontSize: 14, color: Colors.black87), + children: [ + _buildStyledText('检修作业 ', pd['INPUT1']?.toString()??"0"), + _buildStyledText(' 处, 特殊作业 ', pd['INPUT2']?.toString()??"0"), + _buildStyledText('处, 动火作业', pd['INPUT3']?.toString()??"0"), + _buildStyledText('处, 其中特级', pd['INPUT4']?.toString()??"0"), + _buildStyledText('处, 一级 ', pd['INPUT5']?.toString()??"0"), + _buildStyledText(' 处, 二级', pd['INPUT6']?.toString()??"0"), + _buildStyledText(' 处, 高处作业', pd['INPUT7']?.toString()??"0"), + _buildStyledText('处, 受限空间作业', pd['INPUT8']?.toString()??"0"), + _buildStyledText(' 处, 吊装作业', pd['INPUT9']?.toString()??"0"), + _buildStyledText('处, 临时用电作业', pd['INPUT10']?.toString()??"0"), + _buildStyledText('处, 盲板抽堵作业', pd['INPUT11']?.toString()??"0"), + _buildStyledText('处, 动土作业', pd['INPUT12']?.toString()??"0"), + _buildStyledText('处, 断路作业', pd['INPUT13']?.toString()??"0"), + const TextSpan(text: ' 处。'), + ], + ), + ), + ); + } + + + Widget _buildWorkInfoParagraph2() { + // 定义一个样式映射函数,将数据部分标记为蓝色加粗 + TextSpan _buildStyledText(String label, String? value) { + return TextSpan( + children: [ + TextSpan(text: label), + TextSpan( + text: value ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + ], + ); + } + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: RichText( + text: TextSpan( + style: const TextStyle(fontSize: 14, color: Colors.black87), + children: [ + _buildStyledText('承包商作业 ', pd['INPUT14']?.toString()??"0"), + _buildStyledText('处, 管控情况:', pd['RADIO4'] == 1 ? '受控' : '非受控'), + + ], + ), + ), + ); + } + + + Widget _buildWorkInfoParagraph3() { + // 定义一个样式映射函数,将数据部分标记为蓝色加粗 + TextSpan _buildStyledText(String label, String? value) { + return TextSpan( + children: [ + TextSpan(text: label), + TextSpan( + text: value ?? '', + style: const TextStyle( + fontWeight: FontWeight.bold, + color: Colors.blue, + ), + ), + ], + ); + } + + return Padding( + padding: const EdgeInsets.symmetric(vertical: 8), + child: RichText( + text: TextSpan( + style: const TextStyle(fontSize: 14, color: Colors.black87), + children: [ + _buildStyledText('岗位主要设备(装置)名称、数量 ', pd['INPUT15']?.toString()??"0"), + _buildStyledText(', 其中运行', pd['INPUT16']?.toString()??"0"), + _buildStyledText('处, 停产', pd['INPUT17']?.toString()??"0"), + _buildStyledText(' 处, 检修 ', pd['INPUT18']?.toString()??"0"), + const TextSpan(text: ' 处。 '), + ], + ), + ), + ); + } + + +} \ No newline at end of file diff --git a/lib/pages/home/SafetyCommitment/work_shop_safety_commitment_apply.dart b/lib/pages/home/SafetyCommitment/work_shop_safety_commitment_apply.dart new file mode 100644 index 0000000..d5c99b5 --- /dev/null +++ b/lib/pages/home/SafetyCommitment/work_shop_safety_commitment_apply.dart @@ -0,0 +1,861 @@ +import 'dart:io'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:qhd_prevention/customWidget/ItemWidgetFactory.dart'; +import 'package:qhd_prevention/customWidget/custom_button.dart'; +import 'package:qhd_prevention/customWidget/picker/CupertinoDatePicker.dart'; +import 'package:qhd_prevention/customWidget/single_image_viewer.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart'; +import 'package:qhd_prevention/pages/mine/mine_sign_page.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + + + +class WorkShopSafetyCommitmentApply extends StatefulWidget { + const WorkShopSafetyCommitmentApply({super.key}); + + @override + State createState() => _WorkShopSafetyCommitmentApplyState(); +} + +class _WorkShopSafetyCommitmentApplyState extends State { + + + final TextEditingController _controller1 = TextEditingController(); + final TextEditingController _controller2 = TextEditingController(); + final TextEditingController _controller3 = TextEditingController(); + final TextEditingController _controller4 = TextEditingController(); + final TextEditingController _controller5 = TextEditingController(); + final TextEditingController _controller6 = TextEditingController(); + final TextEditingController _controller7 = TextEditingController(); + final TextEditingController _controller8 = TextEditingController(); + final TextEditingController _controller9 = TextEditingController(); + final TextEditingController _controller10 = TextEditingController(); + final TextEditingController _controller11 = TextEditingController(); + final TextEditingController _controller12 = TextEditingController(); + final TextEditingController _controller13 = TextEditingController(); + final TextEditingController _controller14 = TextEditingController(); + final TextEditingController _controller15 = TextEditingController(); + final TextEditingController _controller16 = TextEditingController(); + final TextEditingController _controller17 = TextEditingController(); + final TextEditingController _controller18 = TextEditingController(); + final TextEditingController _controller19 = TextEditingController(); + + + bool _isFault1 = true; + bool _isFault2 = true; + bool _isFault3 = true; + bool _isFault4 = true; + bool _isFault5 = true; + bool _isFault6 = true; + bool _isFault7 = true; + bool _isFault8 = true; + bool _isFault9 = true; + bool _isFault10 = true; + bool _isFault11 = true; + bool _isFault12 = true; + bool _isFault13 = true; + bool _isFault14 = true; + bool _isFault15 = true; + + DateTime? dataStart; + String dataTimeStart=""; + DateTime? dataEnd; + String dataTimeEnd=""; + + List signImgList = []; + + + + + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppbar(title: "安全承诺"), + body:Container( + padding: EdgeInsets.only(top: 15,bottom:15,left: 15,right: 15), + child: ListView( + children: [ + + ListItemFactory.createBuildSimpleSection('企业状态',horPadding: 0,color: Color(0x00000000)), + + Container( + padding: EdgeInsets.symmetric(vertical: 5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + + ListItemFactory.createBlueDotSection('高危生产活动及作业的安全风险可控状态',color: 0xffffffff), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '特殊作业:', + isEditable: true, + controller: _controller1, + text: '', + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 风险辨识、作业许可及管控措施的落实情况', + horizontalPadding: 0, + groupValue: _isFault1, + onChanged: (val) { + setState(() { + _isFault1 = val; + }); + }, + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '动火作业:', + isEditable: true, + controller: _controller2, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '其中特级:', + isEditable: true, + controller: _controller3, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '一级:', + isEditable: true, + controller: _controller4, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '二级:', + isEditable: true, + controller: _controller5, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '高处作业:', + isEditable: true, + controller: _controller6, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '受限空间作业:', + isEditable: true, + controller: _controller7, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '吊装作业:', + isEditable: true, + controller: _controller8, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '临时用电作业:', + isEditable: true, + controller: _controller9, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '盲板抽堵作业:', + isEditable: true, + controller: _controller10, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '动土作业:', + isEditable: true, + controller: _controller11, + text: '', + ), + + const Divider(), + ItemListWidget.singleLineTitleText( + label: '断路作业:', + isEditable: true, + controller: _controller12, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '检维修作业:', + isEditable: true, + controller: _controller13, + text: '', + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 处于试生产情况', + horizontalPadding: 0, + groupValue: _isFault2, + onChanged: (val) { + setState(() { + _isFault2 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 处于开停车情况', + horizontalPadding: 0, + yesLabel:"开", + noLabel:"停", + groupValue: _isFault3, + onChanged: (val) { + setState(() { + _isFault3 = val; + }); + }, + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '承包商作业:', + isEditable: true, + controller: _controller14, + text: '', + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 管控情况', + horizontalPadding: 0, + yesLabel:"受控", + noLabel:"非受控", + groupValue: _isFault4, + onChanged: (val) { + setState(() { + _isFault4 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 变更情况', + horizontalPadding: 0, + yesLabel:"有", + noLabel:"没有", + groupValue: _isFault5, + onChanged: (val) { + setState(() { + _isFault5 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 落实审批程序情况', + horizontalPadding: 0, + groupValue: _isFault6, + onChanged: (val) { + setState(() { + _isFault6 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: ' 罐区、仓库等危险源是否处于安全状态', + horizontalPadding: 0, + groupValue: _isFault7, + onChanged: (val) { + setState(() { + _isFault7 = val; + }); + }, + ), + + + ], + ), + ), + + + SizedBox(height: 15,), + + Container( + padding: EdgeInsets.symmetric(vertical: 5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + ListItemFactory.createBlueDotSection('车间安全状态',color: 0xffffffff), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '车间岗位:', + isEditable: true, + controller: _controller15, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '其中运行:', + isEditable: true, + controller: _controller16, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '停产:', + isEditable: true, + controller: _controller17, + text: '', + ), + const Divider(), + ItemListWidget.singleLineTitleText( + label: '检修:', + isEditable: true, + controller: _controller18, + text: '', + ), + + ], + ), + ), + + SizedBox(height: 15,), + + Container( + padding: EdgeInsets.symmetric(vertical: 5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + ListItemFactory.createBlueDotSection('生产装置的安全运行状态',color: 0xffffffff), + const Divider(), + ListItemFactory.createYesNoSection( + title: '生产装置的温度、压力、组分液位、流量等主要工艺参数是否处于指标范围', + horizontalPadding: 0, + groupValue: _isFault8, + onChanged: (val) { + setState(() { + _isFault8 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '压力容器、压力管道等特种设备处于安全运行状态', + horizontalPadding: 0, + groupValue: _isFault9, + onChanged: (val) { + setState(() { + _isFault9 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '设备设施的静动密封完好无泄漏', + horizontalPadding: 0, + groupValue: _isFault10, + onChanged: (val) { + setState(() { + _isFault10 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '超限报警、紧急切断、联锁等各类安全设施配备完好投用,并可靠运行', + horizontalPadding: 0, + groupValue: _isFault11, + onChanged: (val) { + setState(() { + _isFault11 = val; + }); + }, + ), + + + ], + ), + ), + + + SizedBox(height: 15,), + + Container( + padding: EdgeInsets.symmetric(vertical: 5), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + ListItemFactory.createBlueDotSection('危险化学品罐区、仓库等重大危险源安全运行状态',color: 0xffffffff), + const Divider(), + ListItemFactory.createYesNoSection( + title: '储罐、管道、机泵、阀门及仪表系统完好无泄漏', + horizontalPadding: 0, + groupValue: _isFault12, + onChanged: (val) { + setState(() { + _isFault12 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '储罐的液位、温度、压力、气柜钟罩无超限运行', + horizontalPadding: 0, + groupValue: _isFault13, + onChanged: (val) { + setState(() { + _isFault13 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '手动放脱水、装卸车时确保人员在岗', + horizontalPadding: 0, + groupValue: _isFault14, + onChanged: (val) { + setState(() { + _isFault14 = val; + }); + }, + ), + const Divider(), + ListItemFactory.createYesNoSection( + title: '可燃及有毒气体报警和联锁处于可靠运行状态', + horizontalPadding: 0, + groupValue: _isFault15, + onChanged: (val) { + setState(() { + _isFault15 = val; + }); + }, + ), + const Divider(), + Padding( + padding: EdgeInsets.only(left: 15,right: 15), + child: ListItemFactory.createBuildMultilineInput( + "仓库是否按照国家标准分区分类储存危险化学品,是否超量、超品种储存,相互禁配物质是否混放混存。", + "请输入...", + _controller19, + isRequired:true, + ), + + ), + + + ], + ), + ), + + SizedBox(height: 5,), + ListItemFactory.createBuildSimpleSection('企业承诺',horPadding: 0,color: Color(0x00000000)), + SizedBox(height: 5,), + + Container( + padding: EdgeInsets.symmetric(vertical: 5,horizontal: 15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + + GestureDetector( + child: ItemListWidget.selectableLineTitleTextRightButton(label: '今日', text: dataTimeStart.isEmpty? + '请选择':dataTimeStart??'', isEditable: true, isRequired: true,horizontalnum: 0), + onTap: () async { + DateTime? picked = await BottomDateTimePicker.showDate(context,allowFuture: true); + if (picked != null) { + + setState(() { + dataStart=picked; + if(dataTimeEnd.isNotEmpty) { + bool isChao= validateDateRange(dataStart!,dataEnd!); + if(!isChao){ + return; + } + } + dataTimeStart = DateFormat('yyyy-MM-dd HH:mm').format(picked); + }); + } + }, + ), + + + const Divider(), + GestureDetector( + child:ItemListWidget.selectableLineTitleTextRightButton(label: '至', text: dataTimeEnd.isEmpty? + '请选择':dataTimeEnd, isEditable: true, isRequired: true,horizontalnum: 0), + onTap: () async { + DateTime? picked = await BottomDateTimePicker.showDate(context,allowFuture: true); + if (picked != null) { + + setState(() { + dataEnd=picked; + if(dataTimeStart.isNotEmpty) { + bool isChao= validateDateRange(dataStart!, dataEnd!); + if(!isChao){ + return; + } + } + dataTimeEnd = DateFormat('yyyy-MM-dd HH:mm').format(picked); + }); + } + }, + ), + + + const Divider(), + Text("今天我公司已进行安全风险研判,各项安全风险防控措施已落实到位,我承诺所有生产设施处于安全运行状态,罐区、库房等危险源安全风险得到有效控制。", + style: TextStyle(color: Colors.black,fontSize: 13),), + const Divider(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Text('承诺人:', style: TextStyle(fontSize: 16)), + CustomButton( + text: '手写签字', + height: 36, + backgroundColor: Colors.green, + onPressed: _sign, + ), + ], + ), + if (signImgList.isNotEmpty) _signListWidget(), + + ], + ), + ), + + SizedBox(height: 15,), + + CustomButton( + backgroundColor: Colors.green, + text: "提交", + onPressed: () { + // TODO: 完成回调 + _upData(); + } + ), + + + ], + ), + ) , + + ); + } + + + + Future _upData() async { + try { + + String text1=_controller1.text.trim(); + if(text1.isEmpty){ + ToastUtil.showNormal(context, "请输入特殊作业数"); + return; + } + + String text2=_controller2.text.trim(); + if(text2.isEmpty){ + ToastUtil.showNormal(context, "请输入动火作业数"); + return; + } + + String text3=_controller3.text.trim(); + if(text3.isEmpty){ + ToastUtil.showNormal(context, "请输入特级动火作业数"); + return; + } + + String text4=_controller4.text.trim(); + if(text4.isEmpty){ + ToastUtil.showNormal(context, "请输入一级动火作业数"); + return; + } + + String text5=_controller5.text.trim(); + if(text5.isEmpty){ + ToastUtil.showNormal(context, "请输入二级动火作业数"); + return; + } + + String text6=_controller6.text.trim(); + if(text6.isEmpty){ + ToastUtil.showNormal(context, "请输入高处作业数"); + return; + } + + String text7=_controller7.text.trim(); + if(text7.isEmpty){ + ToastUtil.showNormal(context, "请输入受限空间作业数"); + return; + } + + String text8=_controller8.text.trim(); + if(text8.isEmpty){ + ToastUtil.showNormal(context, "请输入吊装作业数"); + return; + } + + String text9=_controller9.text.trim(); + if(text9.isEmpty){ + ToastUtil.showNormal(context, "请输入临时用电作业数"); + return; + } + + String text10=_controller10.text.trim(); + if(text10.isEmpty){ + ToastUtil.showNormal(context, "请输入盲板抽堵作业数"); + return; + } + + String text11=_controller11.text.trim(); + if(text11.isEmpty){ + ToastUtil.showNormal(context, "请输入动土作业数"); + return; + } + + String text12=_controller12.text.trim(); + if(text12.isEmpty){ + ToastUtil.showNormal(context, "请输入断路作业数"); + return; + } + + String text13=_controller13.text.trim(); + if(text13.isEmpty){ + ToastUtil.showNormal(context, "请输入检维修作业数"); + return; + } + + String text14=_controller14.text.trim(); + if(text14.isEmpty){ + ToastUtil.showNormal(context, "请输入承包商作业数"); + return; + } + + String text15=_controller15.text.trim(); + if(text15.isEmpty){ + ToastUtil.showNormal(context, "请输入车间岗位数"); + return; + } + + String text16=_controller16.text.trim(); + if(text16.isEmpty){ + ToastUtil.showNormal(context, "请输入车间岗位运行数"); + return; + } + + String text17=_controller17.text.trim(); + if(text17.isEmpty){ + ToastUtil.showNormal(context, "请输入车间岗位停产数"); + return; + } + + String text18=_controller18.text.trim(); + if(text18.isEmpty){ + ToastUtil.showNormal(context, "请输入车间岗位检修数"); + return; + } + + String text19=_controller19.text.trim(); + if(text19.isEmpty){ + ToastUtil.showNormal(context, "请输入仓库是否按照国家标准分区分类储存危险化学品,是否超量、超品种储存,相互禁配物质是否混放混存"); + return; + } + + + + + + + + + if(dataTimeStart.isEmpty){ + ToastUtil.showNormal(context, "请选择承诺时间"); + return; + } + + if(dataTimeEnd.isEmpty){ + ToastUtil.showNormal(context, "请选择承诺时间"); + return; + } + + if(signImgList.isEmpty){ + ToastUtil.showNormal(context, "请签字"); + return; + } + + LoadingDialogHelper.show(message: "提交中。。。"); + + final formData = { + 'INPUT1': text1, + 'INPUT2': text2, + 'INPUT3': text3, + 'INPUT4': text4, + 'INPUT5': text5, + 'INPUT6': text6, + 'INPUT7': text7, + 'INPUT8': text8, + 'INPUT9': text9, + 'INPUT10': text10, + 'INPUT11': text11, + 'INPUT12': text12, + 'INPUT13': text13, + 'INPUT14': text14, + 'INPUT15': text15, + 'INPUT16': text16, + 'INPUT17': text17, + 'INPUT18': text18, + 'INPUT19': text19, + + + 'RADIO1': _isFault1?"1":"-1", + 'RADIO2': _isFault2?"1":"-1", + 'RADIO3': _isFault3?"1":"-1", + 'RADIO4': _isFault4?"1":"-1", + 'RADIO5': _isFault5?"1":"-1", + 'RADIO6': _isFault6?"1":"-1", + 'RADIO7': _isFault7?"1":"-1", + 'RADIO8': _isFault8?"1":"-1", + 'RADIO9': _isFault9?"1":"-1", + 'RADIO10': _isFault10?"1":"-1", + 'RADIO11': _isFault11?"1":"-1", + 'RADIO12': _isFault12?"1":"-1", + 'RADIO13': _isFault13?"1":"-1", + 'RADIO14': _isFault14?"1":"-1", + 'RADIO15': _isFault15?"1":"-1", + + 'START_TIME':dataTimeStart, + 'END_TIME': dataTimeEnd, + + + "SIGNER_TIME":DateFormat('yyyy-MM-dd HH:mm').format(DateTime.now()) , + 'DEPARTMENT_ID':SessionService.instance.loginUser?["DEPARTMENT_ID"], + 'SIGN_USER': SessionService.instance.loginUserId, + "CORPINFO_ID": SessionService.instance.corpinfoId, + 'USER_ID': SessionService.instance.loginUserId, + }; + + + final Mapresponse = await ApiService.upWorkshopSafetyCommitmentApply(formData,signImgList); + LoadingDialogHelper.hide(); + if (response['result'] == 'success') { + setState(() { + Navigator.pop(context); + }); + }else{ + ToastUtil.showNormal(context, response['msg']); + } + } catch (e) { + LoadingDialogHelper.hide(); + print('Error fetching data: $e'); + + } + } + + + + Future _sign() async { + final String path = await Navigator.push( + context, + MaterialPageRoute(builder: (c) => MineSignPage()), + ); + if (path != null) { + setState(() { + signImgList.add(path); + }); + + } + } + + Widget _signListWidget() { + return Column( + children: + signImgList.map((imgData) { + final idx = signImgList.indexOf(imgData); + return Column( + children: [ + const SizedBox(height: 10), + const Divider(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + child: ConstrainedBox( + constraints: const BoxConstraints( + maxWidth: 230, + maxHeight: 150, + ), + child: + Image.file( + File(signImgList[0] ?? ''), + fit: BoxFit.contain, + ), + ), + onTap: + () => presentOpaque( + SingleImageViewer(imageUrl:signImgList[0] ?? ''), + context, + ), + ), + Column( + children: [ + CustomButton( + text: '删除', + height: 30, + padding: const EdgeInsets.symmetric(horizontal: 10), + backgroundColor: Colors.red, + onPressed: () { + setState(() => signImgList.removeAt(idx)); + }, + ), + const SizedBox(height: 80), + ], + ), + ], + ), + ], + ); + }).toList(), + ); + } + + + bool validateDateRange(DateTime startTime, DateTime endTime) { + const int thirtyDaysInMilliseconds = 30 * 24 * 60 * 60 * 1000; // 30 天的毫秒数 + final int difference = endTime.millisecondsSinceEpoch - startTime.millisecondsSinceEpoch; + + if (difference > thirtyDaysInMilliseconds) { + ToastUtil.showNormal(context, "只能选择30天内的日期"); + return false; + }else{ + return true; + } + } + + +} diff --git a/lib/pages/home/Safetymeeting/safety_meeting_detail_page.dart b/lib/pages/home/Safetymeeting/safety_meeting_detail_page.dart new file mode 100644 index 0000000..9fb2b34 --- /dev/null +++ b/lib/pages/home/Safetymeeting/safety_meeting_detail_page.dart @@ -0,0 +1,378 @@ +import 'dart:io'; + +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:intl/intl.dart'; +import 'package:qhd_prevention/customWidget/ItemWidgetFactory.dart'; +import 'package:qhd_prevention/customWidget/custom_button.dart'; +import 'package:qhd_prevention/customWidget/single_image_viewer.dart'; +import 'package:qhd_prevention/customWidget/toast_util.dart'; +import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/http/HttpManager.dart'; +import 'package:qhd_prevention/pages/home/tap/item_list_widget.dart'; +import 'package:qhd_prevention/pages/mine/mine_sign_page.dart'; +import 'package:qhd_prevention/pages/my_appbar.dart'; +import 'package:qhd_prevention/tools/tools.dart'; + + + +class SafetyMeetingDetailPage extends StatefulWidget { + const SafetyMeetingDetailPage(this.id, this.selectedTab, {super.key,required this.onClose}); + + final int selectedTab; + final String id; + final Function(String) onClose; // 回调函数 + + @override + State createState() => _SafetyMeetingDetailPageState(); +} + +class _SafetyMeetingDetailPageState extends State { + + final TextEditingController contentController = TextEditingController(); + List signImages = []; + late List _listImage = []; + late Map pd = {}; + + late List qianZiImages = []; + + @override + void initState() { + // TODO: implement initState + super.initState(); + getSafetyMeetDetail(); + } + + + Future getSafetyMeetDetail() async { + + try { + + final result = await ApiService.getSafetyMeetDetail(widget.id ); + + if (result['result'] == 'success') { + final List newList = result['imgs'] ?? []; + setState(() { + pd= result['pd']; + _listImage.addAll(newList); + if(widget.selectedTab==1&&result.containsKey('singImgs')){ + final List singList = result['singImgs'] ?? []; + if(singList.isNotEmpty){ + qianZiImages.add(singList[0]); + } + + // qianZiImages=result['singImgs'][0]["FILEPATH"]?? []; + } + }); + + }else{ + ToastUtil.showNormal(context, "加载数据失败"); + // _showMessage('加载数据失败'); + } + + } catch (e) { + // 出错时可以 Toast 或者在页面上显示错误状态 + print('加载数据失败:$e'); + } + } + + @override + Widget build(BuildContext context) { + return Scaffold( + appBar: MyAppbar(title: "安全例会-详情"), + body: SingleChildScrollView( + padding: EdgeInsets.all(16), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + + Container( + padding: EdgeInsets.only(top: 5,left: 5,right: 5,bottom: 15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + // 例会标题 + ItemListWidget.singleLineTitleText( + label: '例会标题:', + isEditable: false, + text: pd['SAFETY_MEETING_TITLE'] ?? '', + ), + Divider(height: 30), + + // 内容 + ItemListWidget.singleLineTitleText( + label: '内容:', + isEditable: false, + text: pd['SAFETY_MEETING_CONTENT'] ?? '', + ), + Divider(height: 30), + + // 附件 + ItemListWidget.twoRowTitleAndImages( + onTapCallBack: (val) { + presentOpaque(SingleImageViewer(imageUrl: val), context); + }, + title: '附件:', + imageUrls: _listImage + .map((item) => item['FILEPATH'] as String) // 提取并转换为 String + .toList(), + ), + ], + + ) + ), + + SizedBox(height: 15), + + if(widget.selectedTab==1) + Container( + padding: EdgeInsets.only(top: 5,left: 5,right: 5,bottom: 15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + // 反馈意见 + ItemListWidget.multiLineTitleTextField( + label: '反馈意见:', + isEditable: false, + isRequired: false, + controller: contentController, + text:pd["FEED_BACK"], + ), + Divider(), + + // 签字区域 + if(qianZiImages.isNotEmpty) + ItemListWidget.twoRowTitleAndImages( + onTapCallBack: (val) { + presentOpaque(SingleImageViewer(imageUrl: val), context); + }, + title: '签字信息:', + imageUrls: qianZiImages + .map((item) => item['FILEPATH'] as String) // 提取并转换为 String + .toList(), + ), + + ], + + ) + ), + + if(widget.selectedTab==0) + Container( + padding: EdgeInsets.only(top: 5,left: 5,right: 5,bottom: 15), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(5), + ), + child: Column( + children: [ + // 反馈意见 + ItemListWidget.multiLineTitleTextField( + label: '反馈意见:', + isEditable: true, + controller: contentController, + hintText: "(必填)", + text:'', + ), + Divider(), + + // 签字区域 + Padding( + padding: EdgeInsets.only(left: 10,right: 10), + child: Column( + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + ListItemFactory.headerTitle('签字'), + CustomButton( + text: '手写签字', + height: 36, + backgroundColor: Colors.green, + onPressed: () { + _sign(); + }, + ), + ], + ), + if (signImages.isNotEmpty) _signListWidget(), + ], + ), + ), + ], + + ) + ), + SizedBox(height: 15), + + // 提交按钮 + if (widget.selectedTab==0) + CustomButton( + text: '提交', + backgroundColor: Colors.blue, + textStyle: TextStyle(color: Colors.white,fontSize: 12), + onPressed: () { + setSafetyMeetDetailFeedback(); + }, + ), + + ], + ), + ), + + + ); + } + + + Future setSafetyMeetDetailFeedback() async { + try { + + String text=contentController.text.trim(); + if(text.isEmpty){ + ToastUtil.showNormal(context, "请填写反馈意见"); + return; + } + + if(signImages.isEmpty){ + ToastUtil.showNormal(context, "请签字"); + return; + } + + + LoadingDialogHelper.show(); + final result = await ApiService.setSafetyMeetDetailFeedback(widget.id ,text); + if (result['result'] == 'success') { + String SAFETY_MEETING_PEOPLE_ID= result['pd']['SAFETY_MEETING_PEOPLE_ID']; + + addSafetyMeetDetailFeedBack(SAFETY_MEETING_PEOPLE_ID); + setState(() { + LoadingDialogHelper.hide(); + ToastUtil.showNormal(context, "提交成功"); + widget.onClose('提交成功'); + Navigator.pop(context); + }); + + }else{ + ToastUtil.showNormal(context, "加载数据失败"); + LoadingDialogHelper.hide(); + // _showMessage('加载数据失败'); + } + + } catch (e) { + // 出错时可以 Toast 或者在页面上显示错误状态 + print('加载数据失败:$e'); + LoadingDialogHelper.hide(); + } + } + + + + Future addSafetyMeetDetailFeedBack(id) async { + try { + + final result = await ApiService.addSafetyMeetDetailFeedBack(signImages[0] ,id); + if (result['result'] == 'success') { + + + }else{ + ToastUtil.showNormal(context, "加载数据失败"); + // _showMessage('加载数据失败'); + } + + } catch (e) { + // 出错时可以 Toast 或者在页面上显示错误状态 + print('加载数据失败:$e'); + } + } + + + + /// 签字 + Future _sign() async { + final path = await Navigator.push( + context, + MaterialPageRoute(builder: (context) => MineSignPage()), + ); + if (path != null) { + // final now = DateFormat('yyyy-MM-dd HH:mm').format(DateTime.now()); + + final file = File(path); + if (!await file.exists()) { + throw ApiException('file_not_found', '图片不存在:$path'); + } + + setState(() { + signImages.add(path); + // signTimes.add(now); + FocusHelper.clearFocus(context); + }); + } + } + + Widget _signListWidget() { + return Column( + children: + signImages.map((path) { + return Column( + children: [ + const SizedBox(height: 10), + const Divider(), + Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + GestureDetector( + child: // 用一个 ConstrainedBox 限制最大尺寸,并改为 BoxFit.contain + ConstrainedBox( + constraints: const BoxConstraints( + maxWidth: 200, + maxHeight: 150, + ), + child: Image.file( + File(path), + // 改为完整显示 + fit: BoxFit.contain, + ), + ), + onTap: () { + presentOpaque( + SingleImageViewer(imageUrl: path), + context, + ); + }, + ), + Column( + children: [ + Container( + padding: const EdgeInsets.only(right: 5), + child: CustomButton( + text: 'X', + height: 30, + padding: const EdgeInsets.symmetric(horizontal: 10), + backgroundColor: Colors.red, + onPressed: () { + setState(() { + signImages.remove(path); + }); + }, + ), + ), + const SizedBox(height: 80), + ], + ), + ], + ), + ], + ); + }).toList(), + ); + } + + +} \ No newline at end of file diff --git a/lib/pages/home/Safetymeeting/safety_meeting_list_page.dart b/lib/pages/home/Safetymeeting/safety_meeting_list_page.dart index c0e38f5..3a7c800 100644 --- a/lib/pages/home/Safetymeeting/safety_meeting_list_page.dart +++ b/lib/pages/home/Safetymeeting/safety_meeting_list_page.dart @@ -1,11 +1,14 @@ import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; +import 'package:intl/intl.dart'; +import 'package:qhd_prevention/customWidget/custom_button.dart'; import 'package:qhd_prevention/customWidget/search_bar_widget.dart'; import 'package:qhd_prevention/customWidget/toast_util.dart'; import 'dart:convert'; import 'dart:math' as math; import 'package:qhd_prevention/http/ApiService.dart'; +import 'package:qhd_prevention/pages/home/Safetymeeting/safety_meeting_detail_page.dart'; import 'package:qhd_prevention/pages/my_appbar.dart'; import 'package:qhd_prevention/pages/notif/notif_detail_page.dart'; import 'package:qhd_prevention/tools/tools.dart'; @@ -107,22 +110,7 @@ class _SafetyMeetingListPageState extends State - Future _deleteNotif(String id) async { - // LoadingDialogHelper.show(); - try { - final result = await ApiService.deleteNotif(id); - if (result['result'] == 'success') { - setState(() { - reRefreshData(); - }); - } - } catch (e) { - print('加载出错: $e'); - } finally { - LoadingDialogHelper.hide(); - } - } @@ -185,100 +173,66 @@ class _SafetyMeetingListPageState extends State } Widget _itemCell(final item) { - return Column( - children: [ - ListTile( - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => NotifDetailPage( - item,_selectedTab, - onClose: (result) { - print('详情页面已关闭,返回结果: $result'); - reRefreshData(); - }, + return Container( + padding: EdgeInsets.all(20), + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.circular(8), + boxShadow: [ + BoxShadow( + color: Colors.black12, + blurRadius: 4, + offset: Offset(0, 2), + ), + ], + ), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + children: [ + Expanded( + child: Text( + item["SAFETY_MEETING_TITLE"], + style: TextStyle( + fontSize: 18, + fontWeight: FontWeight.bold, + ), ), ), - ); - - // pushPage(NotifDetailPage(item,_selectedTab), context); - }, - contentPadding: const EdgeInsets.symmetric( - horizontal: 16, - vertical: 10, + ], ), - title: Padding( - padding: const EdgeInsets.only(bottom: 20), // 减小底部间距 - child: Text(item['SYNOPSIS'], style: const TextStyle(fontSize: 14)), + SizedBox(height: 8), + Text( + '例会正文:${item["SAFETY_MEETING_CONTENT"]}', + style: TextStyle(color: Colors.grey[600]), + maxLines: 2, + overflow: TextOverflow.ellipsis, ), - - subtitle: Text(item['CREATTIME'], style: TextStyle(fontSize: 13)), - - trailing: Container( - constraints: const BoxConstraints(minHeight: 100), // 确保最小高度 - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - mainAxisSize: MainAxisSize.min, // 关键修改:使用最小尺寸 - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - if (0 != _selectedTab) - Text( - item['TYPE'] == 1 ? '已读' : '未读', - style: TextStyle( - fontSize: 12, // 稍微减小字体大小 - color: item['TYPE'] == 1 ? Colors.grey : Colors.red, - ), - ), - SizedBox(height: 15), - - if (0 != _selectedTab && item['TYPE'] == 1) - SizedBox( - height: 24, // 固定按钮高度 - child: TextButton( - onPressed: () async{ - // 显示确认对话框 - bool? confirm = await showDialog( - context: context, - builder: (context) => AlertDialog( - title: Text("确认删除"), - content: Text("确定要删除这条通知吗?"), - actions: [ - TextButton( - onPressed: () => Navigator.pop(context, false), - // onPressed: () => Navigator.pop(context, false), - child: Text("取消"), - ), - TextButton( - onPressed: () => Navigator.pop(context, true), - // onPressed: () => Navigator.pop(context, true), - child: Text("确定", style: TextStyle(color: Colors.red)), - ), - ], - ), - ); - if (confirm == true) { - _deleteNotif(item['NOTICECORPUSERID_ID']); - } - - }, - style: TextButton.styleFrom( - padding: const EdgeInsets.symmetric(horizontal: 12), - backgroundColor: Colors.red, - shape: RoundedRectangleBorder( - borderRadius: BorderRadius.circular(12), - ), - ), - child: Text( '删除', style: TextStyle(fontSize: 13, color: Colors.white),), - - ), - ), - ], + SizedBox(height: 8), + Text('发布人:${item["NAME"]}'), + SizedBox(height: 8), + Text('发布时间:${item["CREATTIME"]}'), + SizedBox(height: 8), + Align( + alignment: Alignment.centerRight, + child: + SizedBox( + width: 90, + height: 40, + child: CustomButton( + text: _selectedTab == 0 ? '立即反馈' : '查看', + backgroundColor: Colors.blue, + textStyle: TextStyle(color: Colors.white,fontSize: 12), + onPressed: () { + _goToDetail(item["SAFETY_MEETING_ID"]); + }, + ), ), ), - ), - Divider(height: 1, color: Colors.black12), - ], + ], + ), ); } @@ -294,6 +248,23 @@ class _SafetyMeetingListPageState extends State } + void _goToDetail(String id){ + pushPage(SafetyMeetingDetailPage( + id,_selectedTab, + onClose: (String result) { + setState(() { + reRefreshData(); + }); + + }, + ), context); + } + + + + + + } diff --git a/lib/pages/home/home_page.dart b/lib/pages/home/home_page.dart index f70c735..3d11130 100644 --- a/lib/pages/home/home_page.dart +++ b/lib/pages/home/home_page.dart @@ -17,6 +17,8 @@ import 'package:qhd_prevention/pages/app/danger_wait_list_page.dart'; import 'package:qhd_prevention/pages/home/work/laws_regulations_page.dart'; import 'package:qhd_prevention/pages/home/workSet_page.dart'; +import 'EquipmentInspection/equipment_inspection_list_page.dart'; +import 'SafetyCommitment/safety_commitment_page.dart'; import 'Safetymeeting/safety_meeting_list_page.dart'; import 'hidden_roll_widget.dart'; import '../../http/ApiService.dart'; @@ -340,9 +342,15 @@ class _HomePageState extends State { case 5: // 重点工程管理 await pushPage(KeyprojectsTabList(), context); break; + case 6://安全承诺 + pushPage(SafetyCommitmentPage(), context); + break; case 7: pushPage(StudyGardenPage(), context); break; + case 9: + pushPage(EquipmentInspectionListPage(), context); + break; case 8: // 安全检查 await pushPage(SafecheckTabList(), context); break; diff --git a/lib/pages/home/tap/item_list_widget.dart b/lib/pages/home/tap/item_list_widget.dart index d48bda3..b39b19b 100644 --- a/lib/pages/home/tap/item_list_widget.dart +++ b/lib/pages/home/tap/item_list_widget.dart @@ -161,11 +161,12 @@ class ItemListWidget { VoidCallback? onTapClean, // 清除回调 bool isRequired = true, String cleanText = '清除', + double horizontalnum=12, }) { return InkWell( onTap: isEditable ? onTap : null, child: Container( - padding: const EdgeInsets.symmetric(vertical: 5, horizontal: 12), + padding: EdgeInsets.symmetric(vertical: 5, horizontal: horizontalnum), child: Row( children: [ // 1. 标题 @@ -820,4 +821,11 @@ class ItemListWidget { child: child, ); } + + + + + + + } diff --git a/lib/pages/home/work/danger_project_page.dart b/lib/pages/home/work/danger_project_page.dart index f3ca363..f849077 100644 --- a/lib/pages/home/work/danger_project_page.dart +++ b/lib/pages/home/work/danger_project_page.dart @@ -12,8 +12,9 @@ import 'package:qhd_prevention/tools/tools.dart'; import 'package:qhd_prevention/pages/my_appbar.dart'; class DangerProjectPage extends StatefulWidget { - const DangerProjectPage(this.item, this.type, {super.key}); + const DangerProjectPage(this.item, this.type, this.checkrecordId, {super.key}); + final String checkrecordId; final int type; final item; @override @@ -98,9 +99,8 @@ class _DangerProjectPageState extends State { // listDatesTwo.addAll(newListTwo);option1 for(int i=0;i { (listDates[i] as Map)["ids"] = ""; } + }else{ + (listDates[i] as Map)["ids"] = ""; } + }else{ + (listDates[i] as Map)["ids"] = ""; } } - + }else{ + (listDates[i] as Map)["ids"] = ""; + } } @@ -163,38 +169,47 @@ class _DangerProjectPageState extends State { for(int i=0;i)["REFERENCE_BASIS"] = "option1"; - break; - case 1: - (listDates[i] as Map)["REFERENCE_BASIS"] = "option2"; - break; - case 2: - (listDates[i] as Map)["REFERENCE_BASIS"] = "option3"; - break; + if(listDatesSelect.isNotEmpty){ + switch(listDatesSelect[m]["ISNORMAL"] ){ + case 0: + (listDates[i] as Map)["REFERENCE_BASIS"] = "option1"; + break; + case 1: + (listDates[i] as Map)["REFERENCE_BASIS"] = "option2"; + break; + case 2: + (listDates[i] as Map)["REFERENCE_BASIS"] = "option3"; + break; + } + }else { + (listDates[i] as Map)["REFERENCE_BASIS"] = ""; + } + + if(listDatesSelect[m].containsKey("HIDDEN_ID")){ + (listDates[i] as Map)["ids"] = listDatesSelect[m]["HIDDEN_ID"]; + SessionService.instance.setUnqualifiedInspectionItemIDJson(listDatesSelect[m]["HIDDEN_ID"]); + }else{ + (listDates[i] as Map)["ids"] = ""; } - }else { - (listDates[i] as Map)["REFERENCE_BASIS"] = ""; - } - if(listDatesSelect[m].containsKey("HIDDEN_ID")){ - (listDates[i] as Map)["ids"] = listDatesSelect[m]["HIDDEN_ID"]; - SessionService.instance.setUnqualifiedInspectionItemIDJson(listDatesSelect[m]["HIDDEN_ID"]); }else{ (listDates[i] as Map)["ids"] = ""; } - + }else{ + (listDates[i] as Map)["ids"] = ""; } } + }else{ + (listDates[i] as Map)["ids"] = ""; } + } }); @@ -666,7 +681,7 @@ class _DangerProjectPageState extends State { return; } String itemsString= jsonEncode(upDataItemList); - String CHECKRECORD_ID= widget.item["CHECKRECORD_ID"] ?? ""; + String CHECKRECORD_ID= widget.checkrecordId?? ""; try { final Map result; diff --git a/lib/pages/home/work/risk_list_page.dart b/lib/pages/home/work/risk_list_page.dart index 5e8565f..2058775 100644 --- a/lib/pages/home/work/risk_list_page.dart +++ b/lib/pages/home/work/risk_list_page.dart @@ -44,6 +44,7 @@ class _riskListPageState extends State { void _getData(){ listDates.clear(); + checkMap.clear(); switch(widget.type ){ case 1://隐患排查 _getRiskPointsList(); @@ -273,7 +274,7 @@ class _riskListPageState extends State { final result = await Navigator.push( context, - MaterialPageRoute(builder: (_) => DangerProjectPage(item,widget.type )), + MaterialPageRoute(builder: (_) => DangerProjectPage(item,widget.type,checkrecordId )), ); _getData(); } @@ -282,7 +283,7 @@ class _riskListPageState extends State { // pushPage(DangerProjectPage(item), context); final result = await Navigator.push( context, - MaterialPageRoute(builder: (_) => DangerProjectPage(item,widget.type )), + MaterialPageRoute(builder: (_) => DangerProjectPage(item,widget.type,checkrecordId )), ); _getData(); break; diff --git a/pubspec.lock b/pubspec.lock index 1b0f070..46b9322 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -6,7 +6,7 @@ packages: description: name: args sha256: d0481093c50b1da8910eb0bb301626d4d8eb7284aa739614d2b394ee09e3ea04 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.7.0" asn1lib: @@ -14,7 +14,7 @@ packages: description: name: asn1lib sha256: "9a8f69025044eb466b9b60ef3bc3ac99b4dc6c158ae9c56d25eeccf5bc56d024" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.6.5" async: @@ -22,7 +22,7 @@ packages: description: name: async sha256: "758e6d74e971c3e5aceb4110bfd6698efc7f501675bcfe0c775459a8140750eb" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.13.0" boolean_selector: @@ -30,7 +30,7 @@ packages: description: name: boolean_selector sha256: "8aab1771e1243a5063b8b0ff68042d67334e3feab9e95b9490f9a6ebf73b42ea" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" camera: @@ -38,7 +38,7 @@ packages: description: name: camera sha256: d6ec2cbdbe2fa8f5e0d07d8c06368fe4effa985a4a5ddade9cc58a8cd849557d - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.11.2" camera_android_camerax: @@ -46,7 +46,7 @@ packages: description: name: camera_android_camerax sha256: "58b8fe843a3c83fd1273c00cb35f5a8ae507f6cc9b2029bcf7e2abba499e28d8" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.19+1" camera_avfoundation: @@ -54,7 +54,7 @@ packages: description: name: camera_avfoundation sha256: e4aca5bccaf897b70cac87e5fdd789393310985202442837922fd40325e2733b - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.9.21+1" camera_platform_interface: @@ -62,7 +62,7 @@ packages: description: name: camera_platform_interface sha256: "2f757024a48696ff4814a789b0bd90f5660c0fb25f393ab4564fb483327930e2" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.10.0" camera_web: @@ -70,7 +70,7 @@ packages: description: name: camera_web sha256: "595f28c89d1fb62d77c73c633193755b781c6d2e0ebcd8dc25b763b514e6ba8f" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.5" characters: @@ -78,7 +78,7 @@ packages: description: name: characters sha256: f71061c654a3380576a52b451dd5532377954cf9dbd272a78fc8479606670803 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.0" clock: @@ -86,7 +86,7 @@ packages: description: name: clock sha256: fddb70d9b5277016c77a80201021d40a2247104d9f4aa7bab7157b7e3f05b84b - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.2" collection: @@ -94,23 +94,23 @@ packages: description: name: collection sha256: "2f5709ae4d3d59dd8f7cd309b4e023046b57d8a6c82130785d2b0e5868084e76" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.19.1" connectivity_plus: dependency: "direct main" description: name: connectivity_plus - sha256: "051849e2bd7c7b3bc5844ea0d096609ddc3a859890ec3a9ac4a65a2620cc1f99" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + sha256: b5e72753cf63becce2c61fd04dfe0f1c430cc5278b53a1342dc5ad839eab29ec + url: "https://pub.flutter-io.cn" source: hosted - version: "6.1.4" + version: "6.1.5" connectivity_plus_platform_interface: dependency: transitive description: name: connectivity_plus_platform_interface sha256: "42657c1715d48b167930d5f34d00222ac100475f73d10162ddf43e714932f204" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.1" convert: @@ -118,7 +118,7 @@ packages: description: name: convert sha256: b30acd5944035672bc15c6b7a8b47d773e41e2f17de064350988c5d02adb1c68 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.2" cross_file: @@ -126,7 +126,7 @@ packages: description: name: cross_file sha256: "7caf6a750a0c04effbb52a676dce9a4a592e10ad35c34d6d2d0e4811160d5670" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.3.4+2" crypto: @@ -134,7 +134,7 @@ packages: description: name: crypto sha256: "1e445881f28f22d6140f181e07737b22f1e099a5e1ff94b0af2f9e4a463f4855" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.6" csslib: @@ -142,7 +142,7 @@ packages: description: name: csslib sha256: "09bad715f418841f976c77db72d5398dc1253c21fb9c0c7f0b0b985860b2d58e" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" cupertino_icons: @@ -150,7 +150,7 @@ packages: description: name: cupertino_icons sha256: ba631d1c7f7bef6b729a622b7b752645a2d076dba9976925b8f25725a30e1ee6 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.8" dbus: @@ -158,7 +158,7 @@ packages: description: name: dbus sha256: "79e0c23480ff85dc68de79e2cd6334add97e48f7f4865d17686dd6ea81a47e8c" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.11" dio: @@ -166,7 +166,7 @@ packages: description: name: dio sha256: d90ee57923d1828ac14e492ca49440f65477f4bb1263575900be731a3dac66a9 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "5.9.0" dio_web_adapter: @@ -174,7 +174,7 @@ packages: description: name: dio_web_adapter sha256: "7586e476d70caecaf1686d21eee7247ea43ef5c345eab9e0cc3583ff13378d78" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" dotted_border: @@ -182,7 +182,7 @@ packages: description: name: dotted_border sha256: "99b091ec6891ba0c5331fdc2b502993c7c108f898995739a73c6845d71dad70c" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.0" encrypt: @@ -190,7 +190,7 @@ packages: description: name: encrypt sha256: "62d9aa4670cc2a8798bab89b39fc71b6dfbacf615de6cf5001fb39f7e4a996a2" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.3" extended_image: @@ -198,7 +198,7 @@ packages: description: name: extended_image sha256: f6cbb1d798f51262ed1a3d93b4f1f2aa0d76128df39af18ecb77fa740f88b2e0 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "10.0.1" extended_image_library: @@ -206,7 +206,7 @@ packages: description: name: extended_image_library sha256: "1f9a24d3a00c2633891c6a7b5cab2807999eb2d5b597e5133b63f49d113811fe" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.1" extension: @@ -214,7 +214,7 @@ packages: description: name: extension sha256: be3a6b7f8adad2f6e2e8c63c895d19811fcf203e23466c6296267941d0ff4f24 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.6.0" fake_async: @@ -222,7 +222,7 @@ packages: description: name: fake_async sha256: "5368f224a74523e8d2e7399ea1638b37aecfca824a3cc4dfdf77bf1fa905ac44" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.3.3" ffi: @@ -230,7 +230,7 @@ packages: description: name: ffi sha256: "289279317b4b16eb2bb7e271abccd4bf84ec9bdcbe999e278a94b804f5630418" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.4" file: @@ -238,7 +238,7 @@ packages: description: name: file sha256: a3b4f84adafef897088c160faf7dfffb7696046cb13ae90b508c2cbc95d3b8d4 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "7.0.1" file_selector_linux: @@ -246,7 +246,7 @@ packages: description: name: file_selector_linux sha256: "54cbbd957e1156d29548c7d9b9ec0c0ebb6de0a90452198683a7d23aed617a33" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.9.3+2" file_selector_macos: @@ -254,7 +254,7 @@ packages: description: name: file_selector_macos sha256: "8c9250b2bd2d8d4268e39c82543bacbaca0fda7d29e0728c3c4bbb7c820fd711" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.9.4+3" file_selector_platform_interface: @@ -262,7 +262,7 @@ packages: description: name: file_selector_platform_interface sha256: a3994c26f10378a039faa11de174d7b78eb8f79e4dd0af2a451410c1a5c3f66b - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.6.2" file_selector_windows: @@ -270,7 +270,7 @@ packages: description: name: file_selector_windows sha256: "320fcfb6f33caa90f0b58380489fc5ac05d99ee94b61aa96ec2bff0ba81d3c2b" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.9.3+4" fixnum: @@ -278,7 +278,7 @@ packages: description: name: fixnum sha256: b6dc7065e46c974bc7c5f143080a6764ec7a4be6da1285ececdc37be96de53be - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" flutter: @@ -291,7 +291,7 @@ packages: description: name: flutter_easyloading sha256: ba21a3c883544e582f9cc455a4a0907556714e1e9cf0eababfcb600da191d17c - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.5" flutter_html: @@ -299,7 +299,7 @@ packages: description: name: flutter_html sha256: "38a2fd702ffdf3243fb7441ab58aa1bc7e6922d95a50db76534de8260638558d" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" flutter_lints: @@ -307,7 +307,7 @@ packages: description: name: flutter_lints sha256: "5398f14efa795ffb7a33e9b6a08798b26a180edac4ad7db3f231e40f82ce11e1" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "5.0.0" flutter_new_badger: @@ -315,7 +315,7 @@ packages: description: name: flutter_new_badger sha256: d3742ace8009663db1ac6ba0377b092f479c35deb33e05514ba05cc0b0a5aaaa - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" flutter_plugin_android_lifecycle: @@ -323,17 +323,17 @@ packages: description: name: flutter_plugin_android_lifecycle sha256: "6382ce712ff69b0f719640ce957559dde459e55ecd433c767e06d139ddf16cab" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.29" flutter_spinkit: dependency: transitive description: name: flutter_spinkit - sha256: d2696eed13732831414595b98863260e33e8882fc069ee80ec35d4ac9ddb0472 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + sha256: "77850df57c00dc218bfe96071d576a8babec24cf58b2ed121c83cca4a2fdce7f" + url: "https://pub.flutter-io.cn" source: hosted - version: "5.2.1" + version: "5.2.2" flutter_test: dependency: "direct dev" description: flutter @@ -349,7 +349,7 @@ packages: description: name: fluttertoast sha256: "25e51620424d92d3db3832464774a6143b5053f15e382d8ffbfd40b6e795dcf1" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "8.2.12" geolocator: @@ -357,7 +357,7 @@ packages: description: name: geolocator sha256: f4efb8d3c4cdcad2e226af9661eb1a0dd38c71a9494b22526f9da80ab79520e5 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "10.1.1" geolocator_android: @@ -365,7 +365,7 @@ packages: description: name: geolocator_android sha256: fcb1760a50d7500deca37c9a666785c047139b5f9ee15aa5469fae7dbbe3170d - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "4.6.2" geolocator_apple: @@ -373,7 +373,7 @@ packages: description: name: geolocator_apple sha256: dbdd8789d5aaf14cf69f74d4925ad1336b4433a6efdf2fce91e8955dc921bf22 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.13" geolocator_platform_interface: @@ -381,7 +381,7 @@ packages: description: name: geolocator_platform_interface sha256: "30cb64f0b9adcc0fb36f628b4ebf4f731a2961a0ebd849f4b56200205056fe67" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "4.2.6" geolocator_web: @@ -389,7 +389,7 @@ packages: description: name: geolocator_web sha256: "102e7da05b48ca6bf0a5bda0010f886b171d1a08059f01bfe02addd0175ebece" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" geolocator_windows: @@ -397,7 +397,7 @@ packages: description: name: geolocator_windows sha256: "175435404d20278ffd220de83c2ca293b73db95eafbdc8131fe8609be1421eb6" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.5" html: @@ -405,7 +405,7 @@ packages: description: name: html sha256: "6d1264f2dffa1b1101c25a91dff0dc2daee4c18e87cd8538729773c073dbf602" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.15.6" http: @@ -413,7 +413,7 @@ packages: description: name: http sha256: bb2ce4590bc2667c96f318d68cac1b5a7987ec819351d32b1c987239a815e007 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.5.0" http_client_helper: @@ -421,7 +421,7 @@ packages: description: name: http_client_helper sha256: "8a9127650734da86b5c73760de2b404494c968a3fd55602045ffec789dac3cb1" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.0" http_parser: @@ -429,7 +429,7 @@ packages: description: name: http_parser sha256: "178d74305e7866013777bab2c3d8726205dc5a4dd935297175b19a23a2e66571" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "4.1.2" image_picker: @@ -437,7 +437,7 @@ packages: description: name: image_picker sha256: "021834d9c0c3de46bf0fe40341fa07168407f694d9b2bb18d532dc1261867f7a" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.2" image_picker_android: @@ -445,7 +445,7 @@ packages: description: name: image_picker_android sha256: b08e9a04d0f8d91f4a6e767a745b9871bfbc585410205c311d0492de20a7ccd6 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.8.12+25" image_picker_for_web: @@ -453,7 +453,7 @@ packages: description: name: image_picker_for_web sha256: "717eb042ab08c40767684327be06a5d8dbb341fe791d514e4b92c7bbe1b7bb83" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.6" image_picker_ios: @@ -461,7 +461,7 @@ packages: description: name: image_picker_ios sha256: "05da758e67bc7839e886b3959848aa6b44ff123ab4b28f67891008afe8ef9100" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.8.12+2" image_picker_linux: @@ -469,7 +469,7 @@ packages: description: name: image_picker_linux sha256: "34a65f6740df08bbbeb0a1abd8e6d32107941fd4868f67a507b25601651022c9" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1+2" image_picker_macos: @@ -477,7 +477,7 @@ packages: description: name: image_picker_macos sha256: "1b90ebbd9dcf98fb6c1d01427e49a55bd96b5d67b8c67cf955d60a5de74207c1" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1+2" image_picker_platform_interface: @@ -485,7 +485,7 @@ packages: description: name: image_picker_platform_interface sha256: "886d57f0be73c4b140004e78b9f28a8914a09e50c2d816bdd0520051a71236a0" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.10.1" image_picker_windows: @@ -493,7 +493,7 @@ packages: description: name: image_picker_windows sha256: "6ad07afc4eb1bc25f3a01084d28520496c4a3bb0cb13685435838167c9dcedeb" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1+1" intl: @@ -501,7 +501,7 @@ packages: description: name: intl sha256: "3df61194eb431efc39c4ceba583b95633a403f46c9fd341e550ce0bfa50e9aa5" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.20.2" js: @@ -509,7 +509,7 @@ packages: description: name: js sha256: "53385261521cc4a0c4658fd0ad07a7d14591cf8fc33abbceae306ddb974888dc" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.2" leak_tracker: @@ -517,7 +517,7 @@ packages: description: name: leak_tracker sha256: "6bb818ecbdffe216e81182c2f0714a2e62b593f4a4f13098713ff1685dfb6ab0" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "10.0.9" leak_tracker_flutter_testing: @@ -525,7 +525,7 @@ packages: description: name: leak_tracker_flutter_testing sha256: f8b613e7e6a13ec79cfdc0e97638fddb3ab848452eff057653abd3edba760573 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.9" leak_tracker_testing: @@ -533,7 +533,7 @@ packages: description: name: leak_tracker_testing sha256: "6ba465d5d76e67ddf503e1161d1f4a6bc42306f9d66ca1e8f079a47290fb06d3" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.0.1" lints: @@ -541,7 +541,7 @@ packages: description: name: lints sha256: c35bb79562d980e9a453fc715854e1ed39e24e7d0297a880ef54e17f9874a9d7 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "5.1.1" list_counter: @@ -549,7 +549,7 @@ packages: description: name: list_counter sha256: c447ae3dfcd1c55f0152867090e67e219d42fe6d4f2807db4bbe8b8d69912237 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.2" matcher: @@ -557,7 +557,7 @@ packages: description: name: matcher sha256: dc58c723c3c24bf8d3e2d3ad3f2f9d7bd9cf43ec6feaa64181775e60190153f2 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.12.17" material_color_utilities: @@ -565,7 +565,7 @@ packages: description: name: material_color_utilities sha256: f7142bb1154231d7ea5f96bc7bde4bda2a0945d2806bb11670e30b850d56bdec - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.11.1" meta: @@ -573,7 +573,7 @@ packages: description: name: meta sha256: e3641ec5d63ebf0d9b41bd43201a66e3fc79a65db5f61fc181f04cd27aab950c - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.16.0" mime: @@ -581,7 +581,7 @@ packages: description: name: mime sha256: "41a20518f0cb1256669420fdba0cd90d21561e560ac240f26ef8322e45bb7ed6" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.0.0" mobile_scanner: @@ -589,7 +589,7 @@ packages: description: name: mobile_scanner sha256: "54005bdea7052d792d35b4fef0f84ec5ddc3a844b250ecd48dc192fb9b4ebc95" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "7.0.1" ndef_record: @@ -597,7 +597,7 @@ packages: description: name: ndef_record sha256: "0c72dfac0d5c16fc264846d103ee5d8249cd3858261a5a537b455a24c1bd5857" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.1" nested: @@ -605,7 +605,7 @@ packages: description: name: nested sha256: "03bac4c528c64c95c722ec99280375a6f2fc708eec17c7b3f07253b626cd2a20" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.0" nfc_manager: @@ -613,7 +613,7 @@ packages: description: name: nfc_manager sha256: "164cc0223dee528d4d05a542da921f0b3a31ca0312400701c93ebf4ce757f676" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "4.0.2" nfc_manager_ndef: @@ -621,7 +621,7 @@ packages: description: name: nfc_manager_ndef sha256: "676e741c42b63ab1fda5a981015cb706ab4fdb76e5d0eec6611993bb27d7e7bf" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.1" nm: @@ -629,31 +629,31 @@ packages: description: name: nm sha256: "2c9aae4127bdc8993206464fcc063611e0e36e72018696cd9631023a31b24254" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.5.0" package_info_plus: dependency: "direct main" description: name: package_info_plus - sha256: "7976bfe4c583170d6cdc7077e3237560b364149fcd268b5f53d95a991963b191" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + sha256: "16eee997588c60225bda0488b6dcfac69280a6b7a3cf02c741895dd370a02968" + url: "https://pub.flutter-io.cn" source: hosted - version: "8.3.0" + version: "8.3.1" package_info_plus_platform_interface: dependency: transitive description: name: package_info_plus_platform_interface - sha256: "6c935fb612dff8e3cc9632c2b301720c77450a126114126ffaafe28d2e87956c" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + sha256: "202a487f08836a592a6bd4f901ac69b3a8f146af552bbd14407b6b41e1c3f086" + url: "https://pub.flutter-io.cn" source: hosted - version: "3.2.0" + version: "3.2.1" path: dependency: transitive description: name: path sha256: "75cca69d1490965be98c73ceaea117e8a04dd21217b37b292c9ddbec0d955bc5" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.9.1" path_provider: @@ -661,7 +661,7 @@ packages: description: name: path_provider sha256: "50c5dd5b6e1aaf6fb3a78b33f6aa3afca52bf903a8a5298f53101fdaee55bbcd" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.5" path_provider_android: @@ -669,7 +669,7 @@ packages: description: name: path_provider_android sha256: d0d310befe2c8ab9e7f393288ccbb11b60c019c6b5afc21973eeee4dda2b35e9 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.17" path_provider_foundation: @@ -677,7 +677,7 @@ packages: description: name: path_provider_foundation sha256: "4843174df4d288f5e29185bd6e72a6fbdf5a4a4602717eed565497429f179942" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" path_provider_linux: @@ -685,7 +685,7 @@ packages: description: name: path_provider_linux sha256: f7a1fe3a634fe7734c8d3f2766ad746ae2a2884abe22e241a8b301bf5cac3279 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.1" path_provider_platform_interface: @@ -693,7 +693,7 @@ packages: description: name: path_provider_platform_interface sha256: "88f5779f72ba699763fa3a3b06aa4bf6de76c8e5de842cf6f29e2e06476c2334" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.2" path_provider_windows: @@ -701,7 +701,7 @@ packages: description: name: path_provider_windows sha256: bd6f00dbd873bfb70d0761682da2b3a2c2fccc2b9e84c495821639601d81afe7 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.0" pdfx: @@ -709,7 +709,7 @@ packages: description: name: pdfx sha256: "29db9b71d46bf2335e001f91693f2c3fbbf0760e4c2eb596bf4bafab211471c1" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.9.2" petitparser: @@ -717,7 +717,7 @@ packages: description: name: petitparser sha256: "07c8f0b1913bcde1ff0d26e57ace2f3012ccbf2b204e070290dad3bb22797646" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.0" photo_manager: @@ -725,7 +725,7 @@ packages: description: name: photo_manager sha256: a0d9a7a9bc35eda02d33766412bde6d883a8b0acb86bbe37dac5f691a0894e8a - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.7.1" photo_manager_image_provider: @@ -733,7 +733,7 @@ packages: description: name: photo_manager_image_provider sha256: b6015b67b32f345f57cf32c126f871bced2501236c405aafaefa885f7c821e4f - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.2.0" photo_view: @@ -741,7 +741,7 @@ packages: description: name: photo_view sha256: "1fc3d970a91295fbd1364296575f854c9863f225505c28c46e0a03e48960c75e" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.15.0" platform: @@ -749,7 +749,7 @@ packages: description: name: platform sha256: "5d6b1b0036a5f331ebc77c850ebc8506cbc1e9416c27e59b439f917a902a4984" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.6" plugin_platform_interface: @@ -757,7 +757,7 @@ packages: description: name: plugin_platform_interface sha256: "4820fbfdb9478b1ebae27888254d445073732dae3d6ea81f0b7e06d5dedc3f02" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.8" pointycastle: @@ -765,7 +765,7 @@ packages: description: name: pointycastle sha256: "4be0097fcf3fd3e8449e53730c631200ebc7b88016acecab2b0da2f0149222fe" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.9.1" provider: @@ -773,7 +773,7 @@ packages: description: name: provider sha256: "4abbd070a04e9ddc287673bf5a030c7ca8b685ff70218720abab8b092f53dd84" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "6.1.5" shared_preferences: @@ -781,7 +781,7 @@ packages: description: name: shared_preferences sha256: "6e8bf70b7fef813df4e9a36f658ac46d107db4b4cfe1048b477d4e453a8159f5" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.5.3" shared_preferences_android: @@ -789,7 +789,7 @@ packages: description: name: shared_preferences_android sha256: "5bcf0772a761b04f8c6bf814721713de6f3e5d9d89caf8d3fe031b02a342379e" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.11" shared_preferences_foundation: @@ -797,7 +797,7 @@ packages: description: name: shared_preferences_foundation sha256: "6a52cfcdaeac77cad8c97b539ff688ccfc458c007b4db12be584fbe5c0e49e03" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.5.4" shared_preferences_linux: @@ -805,7 +805,7 @@ packages: description: name: shared_preferences_linux sha256: "580abfd40f415611503cae30adf626e6656dfb2f0cee8f465ece7b6defb40f2f" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" shared_preferences_platform_interface: @@ -813,7 +813,7 @@ packages: description: name: shared_preferences_platform_interface sha256: "57cbf196c486bc2cf1f02b85784932c6094376284b3ad5779d1b1c6c6a816b80" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" shared_preferences_web: @@ -821,7 +821,7 @@ packages: description: name: shared_preferences_web sha256: c49bd060261c9a3f0ff445892695d6212ff603ef3115edbb448509d407600019 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.3" shared_preferences_windows: @@ -829,7 +829,7 @@ packages: description: name: shared_preferences_windows sha256: "94ef0f72b2d71bc3e700e025db3710911bd51a71cefb65cc609dd0d9a982e3c1" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" simple_gesture_detector: @@ -837,7 +837,7 @@ packages: description: name: simple_gesture_detector sha256: ba2cd5af24ff20a0b8d609cec3f40e5b0744d2a71804a2616ae086b9c19d19a3 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.2.1" sky_engine: @@ -850,7 +850,7 @@ packages: description: name: source_span sha256: "254ee5351d6cb365c859e20ee823c3bb479bf4a293c22d17a9f1bf144ce86f7c" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.10.1" sprintf: @@ -858,7 +858,7 @@ packages: description: name: sprintf sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "7.0.0" stack_trace: @@ -866,7 +866,7 @@ packages: description: name: stack_trace sha256: "8b27215b45d22309b5cddda1aa2b19bdfec9df0e765f2de506401c071d38d1b1" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.12.1" stream_channel: @@ -874,7 +874,7 @@ packages: description: name: stream_channel sha256: "969e04c80b8bcdf826f8f16579c7b14d780458bd97f56d107d3950fdbeef059d" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.4" stream_transform: @@ -882,7 +882,7 @@ packages: description: name: stream_transform sha256: ad47125e588cfd37a9a7f86c7d6356dde8dfe89d071d293f80ca9e9273a33871 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.1" string_scanner: @@ -890,7 +890,7 @@ packages: description: name: string_scanner sha256: "921cd31725b72fe181906c6a94d987c78e3b98c2e205b397ea399d4054872b43" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.1" synchronized: @@ -898,7 +898,7 @@ packages: description: name: synchronized sha256: c254ade258ec8282947a0acbbc90b9575b4f19673533ee46f2f6e9b3aeefd7c0 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.4.0" table_calendar: @@ -906,7 +906,7 @@ packages: description: name: table_calendar sha256: "0c0c6219878b363a2d5f40c7afb159d845f253d061dc3c822aa0d5fe0f721982" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.0" term_glyph: @@ -914,7 +914,7 @@ packages: description: name: term_glyph sha256: "7f554798625ea768a7518313e58f83891c7f5024f88e46e7182a4558850a4b8e" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.2.2" test_api: @@ -922,7 +922,7 @@ packages: description: name: test_api sha256: fb31f383e2ee25fbbfe06b40fe21e1e458d14080e3c67e7ba0acfde4df4e0bbd - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.7.4" typed_data: @@ -930,7 +930,7 @@ packages: description: name: typed_data sha256: f9049c039ebfeb4cf7a7104a675823cd72dba8297f264b6637062516699fa006 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.4.0" universal_platform: @@ -938,7 +938,7 @@ packages: description: name: universal_platform sha256: "64e16458a0ea9b99260ceb5467a214c1f298d647c659af1bff6d3bf82536b1ec" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" url_launcher: @@ -946,7 +946,7 @@ packages: description: name: url_launcher sha256: f6a7e5c4835bb4e3026a04793a4199ca2d14c739ec378fdfe23fc8075d0439f8 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "6.3.2" url_launcher_android: @@ -954,7 +954,7 @@ packages: description: name: url_launcher_android sha256: "0aedad096a85b49df2e4725fa32118f9fa580f3b14af7a2d2221896a02cd5656" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "6.3.17" url_launcher_ios: @@ -962,7 +962,7 @@ packages: description: name: url_launcher_ios sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "6.3.3" url_launcher_linux: @@ -970,7 +970,7 @@ packages: description: name: url_launcher_linux sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.1" url_launcher_macos: @@ -978,7 +978,7 @@ packages: description: name: url_launcher_macos sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.2.2" url_launcher_platform_interface: @@ -986,7 +986,7 @@ packages: description: name: url_launcher_platform_interface sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.3.2" url_launcher_web: @@ -994,7 +994,7 @@ packages: description: name: url_launcher_web sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.1" url_launcher_windows: @@ -1002,7 +1002,7 @@ packages: description: name: url_launcher_windows sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.1.4" uuid: @@ -1010,7 +1010,7 @@ packages: description: name: uuid sha256: a5be9ef6618a7ac1e964353ef476418026db906c4facdedaa299b7a2e71690ff - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "4.5.1" vector_math: @@ -1018,7 +1018,7 @@ packages: description: name: vector_math sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.1.4" video_player: @@ -1026,7 +1026,7 @@ packages: description: name: video_player sha256: "0d55b1f1a31e5ad4c4967bfaa8ade0240b07d20ee4af1dfef5f531056512961a" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.10.0" video_player_android: @@ -1034,7 +1034,7 @@ packages: description: name: video_player_android sha256: d26f8791c8f670825cc227e2cad4319d2ac02b71b2ad5c2b67786bb873ac43b1 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.8.11" video_player_avfoundation: @@ -1042,7 +1042,7 @@ packages: description: name: video_player_avfoundation sha256: f52261d11f97bf14c43e8ed5714f71d8ce4538552b8cc87f45e5d87d3c205e41 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.8.3" video_player_platform_interface: @@ -1050,7 +1050,7 @@ packages: description: name: video_player_platform_interface sha256: cf2a1d29a284db648fd66cbd18aacc157f9862d77d2cc790f6f9678a46c1db5a - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "6.4.0" video_player_web: @@ -1058,7 +1058,7 @@ packages: description: name: video_player_web sha256: "9f3c00be2ef9b76a95d94ac5119fb843dca6f2c69e6c9968f6f2b6c9e7afbdeb" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.4.0" visibility_detector: @@ -1066,7 +1066,7 @@ packages: description: name: visibility_detector sha256: dd5cc11e13494f432d15939c3aa8ae76844c42b723398643ce9addb88a5ed420 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "0.4.0+2" vm_service: @@ -1074,7 +1074,7 @@ packages: description: name: vm_service sha256: ddfa8d30d89985b96407efce8acbdd124701f96741f2d981ca860662f1c0dc02 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "15.0.0" web: @@ -1082,7 +1082,7 @@ packages: description: name: web sha256: "868d88a33d8a87b18ffc05f9f030ba328ffefba92d6c127917a2ba740f9cfe4a" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.1" webview_flutter: @@ -1090,7 +1090,7 @@ packages: description: name: webview_flutter sha256: c3e4fe614b1c814950ad07186007eff2f2e5dd2935eba7b9a9a1af8e5885f1ba - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "4.13.0" webview_flutter_android: @@ -1098,7 +1098,7 @@ packages: description: name: webview_flutter_android sha256: "414174cacd339046a1a6dbf93cac62422194c676fed11119ccf228b81640e887" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "4.9.1" webview_flutter_platform_interface: @@ -1106,7 +1106,7 @@ packages: description: name: webview_flutter_platform_interface sha256: "63d26ee3aca7256a83ccb576a50272edd7cfc80573a4305caa98985feb493ee0" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "2.14.0" webview_flutter_wkwebview: @@ -1114,7 +1114,7 @@ packages: description: name: webview_flutter_wkwebview sha256: fb46db8216131a3e55bcf44040ca808423539bc6732e7ed34fb6d8044e3d512f - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "3.23.0" wechat_assets_picker: @@ -1122,7 +1122,7 @@ packages: description: name: wechat_assets_picker sha256: "8bffdf50d250e802fa6ac8a557594c9bfbb0080fc52220513aeb7a5040729fcd" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "9.6.0" wechat_picker_library: @@ -1130,7 +1130,7 @@ packages: description: name: wechat_picker_library sha256: a42e09cb85b15fc9410f6a69671371cc60aa99c4a1f7967f6593a7f665f6f47a - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.0.5" win32: @@ -1138,7 +1138,7 @@ packages: description: name: win32 sha256: "66814138c3562338d05613a6e368ed8cfb237ad6d64a9e9334be3f309acfca03" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "5.14.0" xdg_directories: @@ -1146,7 +1146,7 @@ packages: description: name: xdg_directories sha256: "7a3f37b05d989967cdddcbb571f1ea834867ae2faa29725fd085180e0883aa15" - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "1.1.0" xml: @@ -1154,7 +1154,7 @@ packages: description: name: xml sha256: b015a8ad1c488f66851d762d3090a21c600e479dc75e68328c52774040cf9226 - url: "https://mirrors.tuna.tsinghua.edu.cn/dart-pub/" + url: "https://pub.flutter-io.cn" source: hosted version: "6.5.0" sdks: