2026.5.12 重大较大隐患,图标,重点作业
parent
5420cfe4aa
commit
171cb3acf6
Binary file not shown.
|
After Width: | Height: | Size: 419 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.3 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 3.5 KiB |
|
|
@ -1,4 +1,5 @@
|
|||
import 'package:dio/dio.dart';
|
||||
import 'package:qhd_prevention/common/route_service.dart';
|
||||
import 'package:qhd_prevention/http/ApiService.dart';
|
||||
import 'package:qhd_prevention/http/HttpManager.dart';
|
||||
import 'package:qhd_prevention/services/SessionService.dart';
|
||||
|
|
@ -7,12 +8,16 @@ class KeyTasksApi {
|
|||
|
||||
|
||||
/// 重点作业确认分页-监管-分公司
|
||||
static Future<Map<String, dynamic>> getKeyTasksConfirmList(Map data) {
|
||||
static Future<Map<String, dynamic>> getKeyTasksConfirmList(Map data) async {
|
||||
final parentPerm = 'dashboard:Key-assignment:Key-Task-Application';
|
||||
final targetPerm = '';
|
||||
final menuPath = await RouteService.getMenuPath(parentPerm, targetPerm);
|
||||
return HttpManager().request(
|
||||
'${ApiService.basePath}/keyProject',
|
||||
'/keyProject/pageConfirm',
|
||||
method: Method.post,
|
||||
data: {
|
||||
"menuPath": menuPath,
|
||||
...data
|
||||
},
|
||||
);
|
||||
|
|
@ -57,12 +62,16 @@ class KeyTasksApi {
|
|||
|
||||
|
||||
/// 安全环保检查分页
|
||||
static Future<Map<String, dynamic>> getKeyTasksSafetyEnvironmentalInspectionList(Map data) {
|
||||
static Future<Map<String, dynamic>> getKeyTasksSafetyEnvironmentalInspectionList(Map data) async {
|
||||
final parentPerm = 'dashboard:Key-assignment:Confirmed-by-the-inspectee';
|
||||
final targetPerm = '';
|
||||
final menuPath = await RouteService.getMenuPath(parentPerm, targetPerm);
|
||||
return HttpManager().request(
|
||||
'${ApiService.basePath}/keyProject',
|
||||
'/safetyEnvironmentalInspection/list',
|
||||
method: Method.post,
|
||||
data: {
|
||||
"menuPath": menuPath,
|
||||
...data
|
||||
},
|
||||
);
|
||||
|
|
@ -131,6 +140,17 @@ class KeyTasksApi {
|
|||
);
|
||||
}
|
||||
|
||||
/// 待整改数量
|
||||
static Future<Map<String, dynamic>> getKeyTasksToDoCount(String id) {
|
||||
return HttpManager().request(
|
||||
'${ApiService.basePath}/keyProject',
|
||||
'/keyProject/count/$id',
|
||||
method: Method.get,
|
||||
data: {
|
||||
// ...data
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -12,13 +12,15 @@ typedef ItemTapCallback = void Function();
|
|||
class AppSectionItem {
|
||||
final String title;
|
||||
final String icon; // asset path
|
||||
final int badge;
|
||||
final String menuPerms; // 路由唯一权限标识
|
||||
int badge;
|
||||
final bool visible;
|
||||
final ItemTapCallback? onTap;
|
||||
|
||||
AppSectionItem({
|
||||
required this.title,
|
||||
required this.icon,
|
||||
required this.menuPerms,
|
||||
this.badge = 0,
|
||||
this.visible = true,
|
||||
this.onTap,
|
||||
|
|
@ -50,6 +52,7 @@ class _DoorcarTabPageState extends State<DoorcarTabPage> {
|
|||
AppSectionItem(
|
||||
title: '进港口门申请',
|
||||
icon: 'assets/images/door_ico9.png',
|
||||
menuPerms:'',
|
||||
badge: 0,
|
||||
onTap: () async {
|
||||
await pushPage(DoorareaTypePage(1), context);
|
||||
|
|
@ -59,6 +62,7 @@ class _DoorcarTabPageState extends State<DoorcarTabPage> {
|
|||
AppSectionItem(
|
||||
title: '进港口门申请记录',
|
||||
icon: 'assets/images/door_ico10.png',
|
||||
menuPerms:'',
|
||||
badge: 0,
|
||||
onTap: () async {
|
||||
await pushPage(DoorareaTypePage(2), context);
|
||||
|
|
@ -71,6 +75,7 @@ class _DoorcarTabPageState extends State<DoorcarTabPage> {
|
|||
AppSectionItem(
|
||||
title: '封闭区域口门申请',
|
||||
icon: 'assets/images/door_ico9.png',
|
||||
menuPerms:'',
|
||||
badge: 0,
|
||||
onTap: () async {
|
||||
await pushPage(DoorareaTypePage(3), context);
|
||||
|
|
@ -80,6 +85,7 @@ class _DoorcarTabPageState extends State<DoorcarTabPage> {
|
|||
AppSectionItem(
|
||||
title: '封闭区域口门申请记录',
|
||||
icon: 'assets/images/door_ico10.png',
|
||||
menuPerms:'',
|
||||
badge: 0,
|
||||
onTap: () async {
|
||||
await pushPage(DoorareaTypePage(4), context);
|
||||
|
|
|
|||
|
|
@ -9,6 +9,7 @@ import 'package:qhd_prevention/customWidget/custom_alert_dialog.dart';
|
|||
import 'package:qhd_prevention/customWidget/custom_button.dart';
|
||||
import 'package:qhd_prevention/customWidget/toast_util.dart';
|
||||
import 'package:qhd_prevention/http/ApiService.dart';
|
||||
import 'package:qhd_prevention/http/modules/key_tasks_api.dart';
|
||||
import 'package:qhd_prevention/pages/home/Study/study_tab_list_page.dart';
|
||||
import 'package:qhd_prevention/pages/home/Tap/work_tab_list_page.dart';
|
||||
import 'package:qhd_prevention/pages/home/doorAndCar/doorCar_tab_page.dart';
|
||||
|
|
@ -19,6 +20,7 @@ import 'package:qhd_prevention/pages/main_tab.dart';
|
|||
import 'package:qhd_prevention/pages/mine/onboarding_full_page.dart';
|
||||
import 'package:qhd_prevention/pages/user/choose_userFirm_page.dart';
|
||||
import 'package:qhd_prevention/pages/user/firm_list_page.dart';
|
||||
import 'package:qhd_prevention/services/SessionService.dart';
|
||||
import 'package:qhd_prevention/services/auth_service.dart';
|
||||
import 'package:qhd_prevention/services/scan_service.dart';
|
||||
import 'package:qhd_prevention/tools/h_colors.dart';
|
||||
|
|
@ -120,7 +122,7 @@ class HomePageState extends RouteAwareState<HomePage>
|
|||
"现场监管": "dashboard-Site-Supervision",
|
||||
"危险作业": "dashboard-Hazardous-Work",
|
||||
"隐患治理": "dashboard-Hazard-Management",
|
||||
"重点作业": "dashboard-Hazard-Management", // 无对应,暂时留空
|
||||
"重点作业": "dashboard:Key-assignment",
|
||||
"口门门禁": "dashboard-Gate-Access-Control",
|
||||
"入港培训": "dashboard-Study-Training",
|
||||
};
|
||||
|
|
@ -1103,7 +1105,9 @@ class HomePageState extends RouteAwareState<HomePage>
|
|||
};
|
||||
final result = await TodoApi.getTodoList(data);
|
||||
final specialWork = await SpecialWorkApi.specialWorkTaskLogTotalCount();
|
||||
final keyTasksWork = await KeyTasksApi.getKeyTasksToDoCount(SessionService.instance.accountId??'');
|
||||
int specialWorkNum = 0;
|
||||
int keyTasksNum = 0;
|
||||
try {
|
||||
if (specialWork['success']) {
|
||||
List<dynamic> specialWorkList = specialWork['data'] ?? [];
|
||||
|
|
@ -1114,11 +1118,21 @@ class HomePageState extends RouteAwareState<HomePage>
|
|||
}
|
||||
}
|
||||
}
|
||||
if (keyTasksWork['success']) {
|
||||
int zdzysqCount = int.parse(keyTasksWork['data']['zdzysqCount']??0);
|
||||
int bjcrqrCount = int.parse(keyTasksWork['data']['bjcrqrCount']??0);
|
||||
int yhdzgCount = int.parse(keyTasksWork['data']['yhdzgCount']??0);
|
||||
keyTasksNum = bjcrqrCount+yhdzgCount+zdzysqCount;
|
||||
}
|
||||
setState(() {
|
||||
for (var section in buttonInfos) {
|
||||
if (section['title'] == '危险作业') {
|
||||
section['unreadCount'] = specialWorkNum;
|
||||
}
|
||||
if (section['title'] == '重点作业') {
|
||||
section['unreadCount'] = keyTasksNum;
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
} catch (e) {}
|
||||
|
|
|
|||
|
|
@ -481,12 +481,12 @@ class _KeyTasksHiddenDangerDetailState extends State<KeyTasksHiddenDangerDetail>
|
|||
|
||||
_buildInfoItem(
|
||||
'整改部门',
|
||||
pd["rectificationRecord"]['rectificationDepartmentIdName'] ?? '',
|
||||
pd['rectificationDepartmentName'] ?? '',
|
||||
),
|
||||
Divider(height: 1),
|
||||
_buildInfoItem(
|
||||
'整改人',
|
||||
pd["rectificationRecord"]['rectificationUserIdName'] ?? '',
|
||||
pd['rectificationUserName'] ?? '',
|
||||
),
|
||||
|
||||
Divider(height: 1),
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:intl/intl.dart';
|
||||
import 'package:qhd_prevention/CustomWidget/range_filter_bar.dart';
|
||||
import 'package:qhd_prevention/common/route_service.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';
|
||||
|
|
@ -48,19 +49,31 @@ class _KeyTasksHiddenDangerListState extends State<KeyTasksHiddenDangerList> {
|
|||
|
||||
_searchController.addListener(_onSearchChanged);
|
||||
|
||||
_distinguishData();
|
||||
// _getListData(false);
|
||||
}
|
||||
|
||||
Future<void> _distinguishData() async {
|
||||
switch (widget.appItem) {
|
||||
case 1:
|
||||
buttonTextTwo = '整改';
|
||||
title = "隐患整改";
|
||||
keyTasksHiddenDangerListData['stateList']=[1];
|
||||
keyTasksHiddenDangerListData['stateList']=[1,4];
|
||||
final parentPerm = 'dashboard:Key-assignment:Hidden-danger-rectification';
|
||||
final targetPerm = '';
|
||||
final menuPath = await RouteService.getMenuPath(parentPerm, targetPerm);
|
||||
keyTasksHiddenDangerListData['menuPath']=menuPath;
|
||||
break;
|
||||
case 2:
|
||||
buttonTextTwo = '查看';
|
||||
title = "隐患记录";
|
||||
keyTasksHiddenDangerListData['stateList']=[1,2,3,4];
|
||||
final parentPerm = 'dashboard:Key-assignment:Hidden-Hazard-Record';
|
||||
final targetPerm = '';
|
||||
final menuPath = await RouteService.getMenuPath(parentPerm, targetPerm);
|
||||
keyTasksHiddenDangerListData['menuPath']=menuPath;
|
||||
break;
|
||||
}
|
||||
|
||||
_getListData(false);
|
||||
}
|
||||
|
||||
|
|
@ -304,7 +317,7 @@ class _KeyTasksHiddenDangerListState extends State<KeyTasksHiddenDangerList> {
|
|||
// 隐患发现人 - 使用 Expanded 包裹
|
||||
Expanded(
|
||||
child: Text(
|
||||
'发现人:${truncateString(pageData['createName'] ?? '')}',
|
||||
'发现人:${truncateString(pageData['findUserName'] ?? '')}',
|
||||
style: TextStyle(fontSize: 14, color: Colors.black87),
|
||||
maxLines: 1,
|
||||
overflow: TextOverflow.ellipsis,
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ import 'package:qhd_prevention/customWidget/toast_util.dart';
|
|||
import 'package:qhd_prevention/http/ApiService.dart';
|
||||
import 'package:qhd_prevention/http/modules/auth_api.dart';
|
||||
import 'package:qhd_prevention/http/modules/hidden_danger_api.dart';
|
||||
import 'package:qhd_prevention/http/modules/key_tasks_api.dart';
|
||||
import 'package:qhd_prevention/http/modules/safety_check_api.dart';
|
||||
import 'package:qhd_prevention/pages/my_appbar.dart';
|
||||
import 'package:qhd_prevention/services/SessionService.dart';
|
||||
|
|
@ -105,7 +106,7 @@ class _KeyTaskesDangerPageState extends State<KeyTaskesDangerPage> {
|
|||
"hiddenUserId": "", //整改id(整改图片反的id)
|
||||
"hiddenPartName": "", //隐患部位名称
|
||||
|
||||
'hiddenFindUserdList':[],//隐患发现人多选
|
||||
'hiddenFindUserList':[],//隐患发现人多选
|
||||
'hiddenFindUserdName':'',//隐患发现人多选名字
|
||||
|
||||
};
|
||||
|
|
@ -185,16 +186,26 @@ class _KeyTaskesDangerPageState extends State<KeyTaskesDangerPage> {
|
|||
}
|
||||
|
||||
Future<void> _getHiddenDetail() async {
|
||||
// LoadingDialogHelper.show();
|
||||
// final result = await HiddenDangerApi.getDangerDetail(widget.initData['id']);
|
||||
// LoadingDialogHelper.hide();
|
||||
// if (result['success']) {
|
||||
// final data = result['data'];
|
||||
// setState(() {
|
||||
// addData = data;
|
||||
_getHiddenImages();
|
||||
// });
|
||||
// }
|
||||
LoadingDialogHelper.show();
|
||||
final result = await KeyTasksApi.getKeyTasksHiddenDangerDetail(widget.initData['id']);
|
||||
LoadingDialogHelper.hide();
|
||||
if (result['success']) {
|
||||
final data = result['data'];
|
||||
setState(() {
|
||||
addData['rectificationDepartmentId'] = data['rectificationDepartmentId'];
|
||||
addData['rectificationDepartmentName'] = data['rectificationDepartmentName'];
|
||||
addData['rectificationUserId'] = data['rectificationUserId'];
|
||||
addData['rectificationUserName'] = data['rectificationUserName'];
|
||||
|
||||
//发现人
|
||||
List<dynamic> result = addData['findUserList']??[];
|
||||
addData['hiddenFindUserName'] = result.map((user) => user['findUserName']).join(',');
|
||||
List<String> idList = result.map<String>((item) => item['findUserId'].toString()).toList();
|
||||
addData['hiddenFindUserList'] = idList;
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
/// 获取隐患照片
|
||||
|
|
@ -610,7 +621,7 @@ class _KeyTaskesDangerPageState extends State<KeyTaskesDangerPage> {
|
|||
}
|
||||
|
||||
// 获取当前已选择的项目
|
||||
final dynamic currentSelected = addData['hiddenFindUserdList'] ?? [];
|
||||
final dynamic currentSelected = addData['hiddenFindUserList'] ?? [];
|
||||
List<String> selectedList = [];
|
||||
|
||||
if (currentSelected is List) {
|
||||
|
|
@ -657,7 +668,7 @@ class _KeyTaskesDangerPageState extends State<KeyTaskesDangerPage> {
|
|||
String userName = person['userName']?.toString() ?? '';
|
||||
return selectedItems.contains(userName);
|
||||
}).toList();
|
||||
addData['hiddenFindUserdList'] = result;
|
||||
addData['hiddenFindUserList'] = result;
|
||||
|
||||
});
|
||||
}
|
||||
|
|
|
|||
|
|
@ -38,8 +38,8 @@ class _KeyTasksConfirmDetailPageState extends State<KeyTasksConfirmDetailPage> {
|
|||
|
||||
final _standardController = TextEditingController();
|
||||
|
||||
double centerLat = 39.8883;
|
||||
double centerLng = 119.519;
|
||||
double centerLat = 0;
|
||||
double centerLng = 0;
|
||||
|
||||
late Map<String, dynamic> pd = {};
|
||||
|
||||
|
|
@ -208,6 +208,7 @@ class _KeyTasksConfirmDetailPageState extends State<KeyTasksConfirmDetailPage> {
|
|||
|
||||
},
|
||||
),
|
||||
if(centerLat!=0)
|
||||
Container(
|
||||
height: 200,
|
||||
margin: EdgeInsetsGeometry.symmetric(horizontal: 15),
|
||||
|
|
@ -357,7 +358,11 @@ class _KeyTasksConfirmDetailPageState extends State<KeyTasksConfirmDetailPage> {
|
|||
_buildTableHeaderCell("视频类型"),
|
||||
]),
|
||||
if (monitorList.isEmpty)
|
||||
TableRow(children: [Padding(padding: EdgeInsets.all(12), child: Text("暂无数据")), SizedBox()])
|
||||
TableRow(children: [
|
||||
SizedBox(),
|
||||
Padding(padding: EdgeInsets.all(12), child: Text("暂无数据",textAlign: TextAlign.center, )),
|
||||
Padding(padding: EdgeInsets.all(12), child: Text("暂无数据",textAlign: TextAlign.center, )),
|
||||
])
|
||||
else
|
||||
...monitorList.asMap().entries.map((entry) {
|
||||
final index = entry.key + 1; // 序号从1开始
|
||||
|
|
@ -412,7 +417,12 @@ class _KeyTasksConfirmDetailPageState extends State<KeyTasksConfirmDetailPage> {
|
|||
_buildTableHeaderCell("操作"),
|
||||
]),
|
||||
if (monitorList.isEmpty)
|
||||
TableRow(children: [Padding(padding: EdgeInsets.all(12), child: Text("暂无数据")), SizedBox()])
|
||||
TableRow(children: [
|
||||
SizedBox(),
|
||||
Padding(padding: EdgeInsets.all(12), child: Text("暂无数据",textAlign: TextAlign.center, )),
|
||||
Padding(padding: EdgeInsets.all(12), child: Text("暂无数据",textAlign: TextAlign.center, )),
|
||||
SizedBox()
|
||||
])
|
||||
else
|
||||
...monitorList.asMap().entries.map((entry) {
|
||||
final index = entry.key + 1; // 序号从1开始
|
||||
|
|
|
|||
|
|
@ -2,11 +2,14 @@
|
|||
import 'dart:ffi';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:qhd_prevention/common/route_service.dart';
|
||||
import 'package:qhd_prevention/http/modules/key_tasks_api.dart';
|
||||
import 'package:qhd_prevention/pages/home/doorAndCar/doorCar_tab_page.dart';
|
||||
import 'package:qhd_prevention/pages/home/keyTasks/keyTasksDetail/keyTasksHiddenDanger/key_tasks_hidden_danger_list.dart';
|
||||
import 'package:qhd_prevention/pages/home/keyTasks/key_tasks_check_list_page.dart';
|
||||
import 'package:qhd_prevention/pages/home/keyTasks/key_tasks_confirm_list_page.dart';
|
||||
import 'package:qhd_prevention/pages/my_appbar.dart';
|
||||
import 'package:qhd_prevention/services/SessionService.dart';
|
||||
import 'package:qhd_prevention/tools/tools.dart';
|
||||
|
||||
|
||||
|
|
@ -20,7 +23,7 @@ class KeyTasksTabPage extends StatefulWidget {
|
|||
|
||||
class _DoorcarTabPageState extends State<KeyTasksTabPage> {
|
||||
|
||||
final String bannerAsset = 'assets/images/door_banner.png';
|
||||
final String bannerAsset = 'assets/images/key_tasks_banner.jpg';
|
||||
late List<AppSection> defaultSections;
|
||||
|
||||
|
||||
|
|
@ -40,7 +43,8 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
|
|||
AppSection(title: '重点作业管理', items: [
|
||||
AppSectionItem(
|
||||
title: '重点作业申请',
|
||||
icon: 'assets/images/door_ico9.png',
|
||||
icon: 'assets/images/key_tasks_ico2.png',
|
||||
menuPerms:'dashboard:Key-assignment:Key-Task-Application',
|
||||
badge: 0,
|
||||
onTap: () async {
|
||||
await pushPage(KeyTasksConfirmListPage(), context);
|
||||
|
|
@ -49,7 +53,8 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
|
|||
),
|
||||
AppSectionItem(
|
||||
title: '被检查确认',
|
||||
icon: 'assets/images/door_ico9.png',
|
||||
icon: 'assets/images/key_tasks_ico3.png',
|
||||
menuPerms:'dashboard:Key-assignment:Key-Task-Application',
|
||||
badge: 0,
|
||||
onTap: () async {
|
||||
await pushPage(KeyTasksCheckListPage(), context);
|
||||
|
|
@ -58,7 +63,8 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
|
|||
),
|
||||
AppSectionItem(
|
||||
title: '隐患整改',
|
||||
icon: 'assets/images/door_ico9.png',
|
||||
icon: 'assets/images/key_tasks_ico6.png',
|
||||
menuPerms:'dashboard:Key-assignment:Hidden-danger-rectification',
|
||||
badge: 0,
|
||||
onTap: () async {
|
||||
await pushPage(KeyTasksHiddenDangerList(1), context);
|
||||
|
|
@ -67,7 +73,8 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
|
|||
),
|
||||
AppSectionItem(
|
||||
title: '隐患记录',
|
||||
icon: 'assets/images/door_ico9.png',
|
||||
icon: 'assets/images/key_tasks_ico7.png',
|
||||
menuPerms:'dashboard:Key-assignment:Hidden-Hazard-Record',
|
||||
badge: 0,
|
||||
onTap: () async {
|
||||
await pushPage(KeyTasksHiddenDangerList(2), context);
|
||||
|
|
@ -81,106 +88,32 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
|
|||
}
|
||||
|
||||
Future<void> _getDoorCarCount() async {
|
||||
// try {
|
||||
// final result = await DoorAndCarApi.getDoorCarCount();
|
||||
// if (result['success'] ) {
|
||||
// List< dynamic> data = result['data']??[] ;
|
||||
//
|
||||
// int stakeholderPersonCount =0;
|
||||
// int stakeholderCarCount =0;
|
||||
// int temporaryPersonCount =0;
|
||||
// int temporaryCarCount =0;
|
||||
// int companyCarCount =0;
|
||||
// int closureLongPersonCount =0;
|
||||
// int closureLongCarCount =0;
|
||||
// int closureTemporaryPersonCount =0;
|
||||
// int closureTemporaryCarCount =0;
|
||||
// for(int i=0;i<data.length;i++){
|
||||
// if(data[i]['type']=='one_level_person'){
|
||||
// if(data[i]['belongType']=='3'){
|
||||
// stakeholderPersonCount=data[i]['waitAuditCount']??0;
|
||||
// }
|
||||
// if(data[i]['belongType']=='4'){
|
||||
// temporaryPersonCount=data[i]['waitAuditCount']??0;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if(data[i]['type']=='one_level_car'){
|
||||
// if(widget.isLoginJGD&&data[i]['belongType']=='2'){
|
||||
// stakeholderCarCount=data[i]['waitAuditCount']??0;
|
||||
// }
|
||||
// if(!widget.isLoginJGD&&data[i]['belongType']=='4'){
|
||||
// temporaryCarCount=data[i]['waitAuditCount']??0;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
//
|
||||
// if(data[i]['type']=='one_level_car'){//公司车辆审批
|
||||
// if(data[i]['belongType']=='2'){
|
||||
// companyCarCount=data[i]['waitAuditCount']??0;
|
||||
// }
|
||||
// if(data[i]['belongType']=='4'){
|
||||
// companyCarCount=data[i]['waitAuditCount']??0;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if(data[i]['type']=='two_level_person'){
|
||||
// if(data[i]['belongType']=='1'||data[i]['belongType']=='2'||data[i]['belongType']=='3'){
|
||||
// closureLongPersonCount=closureLongPersonCount+((data[i]['waitAuditCount']??0)as int);
|
||||
// }
|
||||
// if(data[i]['belongType']=='4'){
|
||||
// closureTemporaryPersonCount=data[i]['waitAuditCount']??0;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if(data[i]['type']=='two_level_car'){
|
||||
// if(data[i]['belongType']=='1'||data[i]['belongType']=='2'||data[i]['belongType']=='3'){
|
||||
// closureLongCarCount=closureLongCarCount+((data[i]['waitAuditCount']??0)as int);
|
||||
// }
|
||||
// if(data[i]['belongType']=='4'){
|
||||
// closureTemporaryCarCount=data[i]['waitAuditCount']??0;
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// }
|
||||
//
|
||||
// setState(() {
|
||||
// // 更新一级口门审核管理的 badge
|
||||
// final gateSection = defaultSections[0];
|
||||
//
|
||||
// // 相关方人员审核
|
||||
// gateSection.items[0].badge = stakeholderPersonCount;
|
||||
// // 相关方车辆审核
|
||||
// gateSection.items[1].badge = stakeholderCarCount;
|
||||
// // 临时访客审核
|
||||
// gateSection.items[3].badge = temporaryPersonCount;
|
||||
// // 临时车辆审核
|
||||
// gateSection.items[4].badge = temporaryCarCount;
|
||||
//
|
||||
// // 公司车辆审核
|
||||
// gateSection.items[7].badge = companyCarCount;
|
||||
//
|
||||
// // 如果有封闭区域审核管理部分(非JGD用户)
|
||||
// if (!widget.isLoginJGD && defaultSections.length > 2) {
|
||||
// final closureSection = defaultSections[2];
|
||||
// // 长期人员审核
|
||||
// closureSection.items[0].badge = closureLongPersonCount;
|
||||
// // 长期车辆审核
|
||||
// closureSection.items[1].badge = closureLongCarCount;
|
||||
// // 临时访客审核
|
||||
// closureSection.items[2].badge = closureTemporaryPersonCount;
|
||||
// // 临时车辆审核
|
||||
// closureSection.items[3].badge = closureTemporaryCarCount;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
// // else {
|
||||
// // ToastUtil.showNormal(context, result['errMessage'] ?? "加载数据失败");
|
||||
// // }
|
||||
// } catch (e) {
|
||||
// LoadingDialogHelper.hide();
|
||||
// print('加载数据失败:$e');
|
||||
try {
|
||||
String userId= SessionService.instance.accountId??'';
|
||||
final result = await KeyTasksApi.getKeyTasksToDoCount(userId);
|
||||
if (result['success'] ) {
|
||||
dynamic data = result['data']?? {} ;
|
||||
|
||||
setState(() {
|
||||
// 重点作业管理
|
||||
final gateSection = defaultSections[0];
|
||||
|
||||
// // 重点作业申请
|
||||
gateSection.items[0].badge = int.parse(data['zdzysqCount']??0);
|
||||
// 确认
|
||||
gateSection.items[1].badge = int.parse(data['bjcrqrCount']??0);
|
||||
// 整改
|
||||
gateSection.items[2].badge = int.parse(data['yhdzgCount']??0);
|
||||
|
||||
});
|
||||
}
|
||||
// else {
|
||||
// ToastUtil.showNormal(context, result['errMessage'] ?? "加载数据失败");
|
||||
// }
|
||||
} catch (e) {
|
||||
LoadingDialogHelper.hide();
|
||||
print('加载数据失败:$e');
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -191,12 +124,28 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
|
|||
const double iconOverlapBanner = 30.0;
|
||||
|
||||
// 过滤掉没有可见 items 的分组
|
||||
final visibleSections = defaultSections
|
||||
.map((s) => AppSection(
|
||||
title: s.title,
|
||||
items: s.items.where((it) => it.visible).toList()))
|
||||
.where((s) => s.items.isNotEmpty)
|
||||
.toList();
|
||||
// final visibleSections = defaultSections
|
||||
// .map((s) => AppSection(
|
||||
// title: s.title,
|
||||
// items: s.items.where((it) => it.visible).toList()))
|
||||
// .where((s) => s.items.isNotEmpty)
|
||||
// .toList();
|
||||
final routeService = RouteService();
|
||||
|
||||
return AnimatedBuilder(
|
||||
animation: routeService,
|
||||
builder: (context, _)
|
||||
{
|
||||
final rebuiltVisibleSections = defaultSections.map((section) {
|
||||
final visibleItems = section.items.where((item) {
|
||||
return item.visible && routeService.hasPerm(item.menuPerms);
|
||||
}).toList();
|
||||
|
||||
return AppSection(
|
||||
title: section.title,
|
||||
items: visibleItems,
|
||||
);
|
||||
}).where((section) => section.items.isNotEmpty).toList();
|
||||
|
||||
return Scaffold(
|
||||
extendBodyBehindAppBar: true,
|
||||
|
|
@ -222,13 +171,15 @@ class _DoorcarTabPageState extends State<KeyTasksTabPage> {
|
|||
right: 10,
|
||||
top: bannerHeight - iconOverlapBanner,
|
||||
height: iconSectionHeight,
|
||||
child: _buildIconSection(context, visibleSections),
|
||||
child: _buildIconSection(context, rebuiltVisibleSections),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue