2026.3.25 列表权限

master
xufei 2026-03-25 16:09:17 +08:00
parent c30ace06df
commit d363c40408
9 changed files with 497 additions and 362 deletions

View File

@ -21,7 +21,7 @@ class CategoryEnterpriseType {
factory CategoryEnterpriseType.fromJson(Map<String, dynamic> json) {
return CategoryEnterpriseType(
id: json['corpinfoId'] != null ? json['corpinfoId'].toString() : "",
id: json['id'] != null ? json['id'].toString() : "",
name: json['corpName'] != null ? json['corpName'].toString() : "",
pdId: json['parentId'] != null ? json['parentId'].toString() : "",
children: _safeParseChildren(json['childrenList']),
@ -54,8 +54,10 @@ typedef DeptSelectCallback = void Function(String id, String name,String pdId);
class DepartmentPickerEnterprise extends StatefulWidget {
/// id name
final DeptSelectCallback onSelected;
///id
final String jurisdictionalAuthorityId;
const DepartmentPickerEnterprise({Key? key, required this.onSelected}) : super(key: key);
const DepartmentPickerEnterprise(this.jurisdictionalAuthorityId,{Key? key, required this.onSelected}) : super(key: key);
@override
_DepartmentPickerEnterpriseState createState() => _DepartmentPickerEnterpriseState();

View File

@ -221,3 +221,17 @@ class CertificateApi {
}
}
//
class TodoApi {
static Future<Map<String, dynamic>> getTodoList(Map data) {
return HttpManager().request(
ApiService.basePath + '/appmenu',
'/todoList/list',
method: Method.post,
data: {
...data
},
);
}
}

View File

@ -60,10 +60,17 @@ class DoorAndCarApi {
///
static Future<Map<String, dynamic>> getApproverList(String corpId,String deptId) {
static Future<Map<String, dynamic>> getApproverList(String corpId,String deptId,
String personnelPermissionFlag, //(1-,2-)
String vehiclePermissionFlag,//(1-,2-)
String temporaryPermissionFlag,//(1-,2-)
) {
return HttpManager().request(
'${ApiService.basePath}/primeport',
'/mkmjApprovalUser/listAll?corpId=$corpId',
'/mkmjApprovalUser/listAll?corpId=$corpId'
'&personnelPermissionFlag=$personnelPermissionFlag'
'&vehiclePermissionFlag=$vehiclePermissionFlag'
'&temporaryPermissionFlag=$temporaryPermissionFlag',
method: Method.get,
data: {
// ...data

View File

@ -82,8 +82,16 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
ListItemFactory.createBuildSimpleSection('申请信息'),
const Divider(),
ItemListWidget.selectableLineTitleTextRightButton(
label: '选择港区:',
isEditable: true,
text: addData['portAreaName'] ?? '请选择',
isRequired: true,
onTap: () async {
_getPortAreaType();
},
),
const Divider(),
ItemListWidget.selectableLineTitleTextRightButton(
label: '选择管辖单位:',
@ -91,6 +99,10 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
text: addData['jurisdictionalCorpName'] ?? '请选择',
isRequired: true,
onTap: () {
if( addData['portAreaId'].isEmpty){
ToastUtil.showNormal(context, '请先选择港区');
return;
}
showModalBottomSheet(
context: context,
isScrollControlled: true,
@ -98,6 +110,7 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
backgroundColor: Colors.transparent,
builder:
(ctx) => DepartmentPickerEnterprise(
addData['portAreaId'],
onSelected: (id, name,pdId) async {
setState(() {
addData['jurisdictionalCorpId']= id;
@ -495,94 +508,54 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
Future<void> _getVisitPortArea() async {
try {
LoadingDialogHelper.show();
final raw = await DoorAndCarApi.getEnclosedAreaById(addData['jurisdictionalCorpId']);
LoadingDialogHelper.hide();
if (raw['success'] ) {
List<dynamic> newList = raw['data'] ?? [];
List<String> result = [];
//
final List<int> initialIndices = [];
final resultList = await DoorAndCarApi.getEnclosedAreaById(addData['jurisdictionalCorpName']);
List<dynamic> raw = resultList["data"] as List<dynamic>;
result = raw.map((item) => item['closedAreaName'].toString()).toList();
if(addData['gateLevelAuthArea'].isNotEmpty){
// JSON
Map<String, dynamic> jsonData = json.decode(addData['gateLevelAuthArea']);
List<dynamic> areaList = jsonData['area'];
// value
List<String> targetValues = areaList.map((item) => item['value'].toString()).toList();
// raw
for (String targetValue in targetValues) {
for (int i = 0; i < raw.length; i++) {
var item = raw[i];
if (item != null && item is Map && item.containsKey('dictLabel')) {
if (item['dictLabel'].toString() == targetValue) {
initialIndices.add(i);// 0
break;
}
}
}
}
for(int i=0;i<newList.length;i++){
newList[i]["dataId"] = newList[i]["id"];
newList[i]["dataName"] = newList[i]["closedAreaName"];
}
//
final selectedItems = await CenterMultiPicker.show<String>(
context,
items: result,
itemBuilder: (item) => Text(
item,
style: const TextStyle(fontSize: 16),
),
initialSelectedIndices: initialIndices, //
maxSelection: null, //
allowEmpty: true,
title: '管辖区域',
);
//
if (selectedItems != null) {
showModalBottomSheet(
context: context,
isScrollControlled: true,
barrierColor: Colors.black54,
backgroundColor: Colors.transparent,
builder:
(ctx) => DepartmentPickerThree(
listdata: newList,
onSelected: (id, name,pdId) async {
setState(() {
addData['gateLevelAuthAreaName'] = selectedItems.join(',');
// JSON
List<Map<String, dynamic>> areaList = [];
// raw
for (String selectedItem in selectedItems) {
for (var item in raw) {
if (item != null && item is Map && item.containsKey('dictLabel')) {
if (item['dictLabel'].toString() == selectedItem) {
// value(dictLabel) bianma(dictValue)
areaList.add({
'value': item['dictLabel'].toString(),
'bianma': item['dictValue'].toString(), // 使 toString()
});
break;
}
}
}
}
// JSON
Map<String, dynamic> jsonData = {
'area': areaList
};
// Map JSON
addData['gateLevelAuthArea'] = json.encode(jsonData);
addData['closedAreaId']=id;//id
addData['closedAreaName']=name;//
});
},
),
);
}else{
ToastUtil.showNormal(context, "获取列表失败");
LoadingDialogHelper.hide();
// _showMessage('反馈提交失败');
// return "";
}
} catch (e) {
// Toast
print('加载首页数据失败:$e');
// return "";
LoadingDialogHelper.hide();
}
}
Future<void> _getApproverList() async {
try {
LoadingDialogHelper.show();
final raw = await DoorAndCarApi.getApproverList( addData['auditPersonCorpId'],'');//addData['auditDeptId']
final raw = await DoorAndCarApi.getApproverList( addData['auditPersonCorpId'],'','','1','');//addData['auditDeptId']
LoadingDialogHelper.hide();
if (raw['success'] ) {
List<dynamic> newList = raw['data'] ?? [];
@ -703,6 +676,31 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
});
}
Future<void> _getPortAreaType() async {
showModalBottomSheet(
context: context,
isScrollControlled: true,
barrierColor: Colors.black54,
backgroundColor: Colors.transparent,
builder:
(_) => MultiDictValuesPicker(
title: '港区',
dictType: 'HG_AUTH_AREA',
allowSelectParent: false,
onSelected: (id, name, extraData) {
setState(() {
addData['portAreaId'] = extraData?['dictValue'];//id
addData['portAreaName'] = name;//
});
},
),
).then((_) {
// FocusHelper.clearFocus(context);
});
}
Future<void> _getLicensePlateType() async {
showModalBottomSheet(
context: context,
@ -789,19 +787,24 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
Future<void> _saveSuccess() async {
try {
if(addData['projectName'].isEmpty){
ToastUtil.showNormal(context, '请选择选择项目名称');
if(addData['jurisdictionalCorpId'].isEmpty){
ToastUtil.showNormal(context, '请选择选择管辖单位');
return;
}
if(addData['auditUserName'].isEmpty){
if(addData['auditPersonUserName'].isEmpty){
ToastUtil.showNormal(context, '请选择审核人员');
return;
}
if(addData['gateLevelAuthAreaName'].isEmpty){
ToastUtil.showNormal(context, '请选择访问港区');
if(addData['projectName'].isEmpty){
ToastUtil.showNormal(context, '请选择项目');
return;
}
if(addData['applyReason'].isEmpty){
ToastUtil.showNormal(context, '请填写申请原因');
return;
}
@ -836,20 +839,6 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
return;
}
if(addData['licenceTypeName'].isEmpty){
ToastUtil.showNormal(context, '请选择车牌类型');
return;
}
if(addData['vehicleBelongType'].isEmpty){
ToastUtil.showNormal(context, '请选择车辆类型');
return;
}
if(addData['licenceNo'].isEmpty){
ToastUtil.showNormal(context, '请输入车牌号');
return;
}
bool isLicenseTrue = isValidChineseLicensePlate(addData['licenceNo']);
if(!isLicenseTrue){
@ -857,6 +846,11 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
return;
}
if(_vehicleImages.isEmpty){
ToastUtil.showNormal(context, '请上传车辆照片');
return;
}
if(_vehicleLicenseImages.isEmpty){
ToastUtil.showNormal(context, '请上传行驶证照片');
return;
@ -865,10 +859,6 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
return;
}
if(_vehicleImages.isEmpty){
ToastUtil.showNormal(context, '请上传车辆照片');
return;
}
if(signImages.isEmpty){
ToastUtil.showNormal(context, '请阅读《安全进港须知》并签字');
@ -968,6 +958,8 @@ class _DoorareaCarAddPageState extends State<DoorareaCarAddPage> {
"userPhone": "", //
"userCard": "", //
"portAreaId": '', //id
"portAreaName": '', //
"auditAllTime": '', //
};

View File

@ -537,7 +537,7 @@ class _FirstlevelCarAddPageState extends State<FirstlevelCarAddPage> {
Future<void> _getApproverList() async {
try {
LoadingDialogHelper.show();
final raw = await DoorAndCarApi.getApproverList( corpinfoId,'');
final raw = await DoorAndCarApi.getApproverList( corpinfoId,'','','1','');
LoadingDialogHelper.hide();
if (raw['success'] ) {
List<dynamic> newList = raw['data'] ?? [];
@ -757,6 +757,8 @@ class _FirstlevelCarAddPageState extends State<FirstlevelCarAddPage> {
return;
}
addData['drivingUserId']=_personList[0].userPhone;
addData['drivingUserName']=_personList[0].userCard;
addData['lsUserPhone']=_personList[0].userPhone;
addData['lsUserIdcard']=_personList[0].userCard;

View File

@ -5,6 +5,7 @@ import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
import 'package:qhd_prevention/constants/app_enums.dart';
import 'package:qhd_prevention/customWidget/ItemWidgetFactory.dart';
import 'package:qhd_prevention/customWidget/MultiDictValuesPicker.dart';
import 'package:qhd_prevention/customWidget/bottom_picker.dart';
import 'package:qhd_prevention/customWidget/center_multi_picker.dart';
import 'package:qhd_prevention/customWidget/custom_alert_dialog.dart';
@ -80,12 +81,26 @@ class _DoorareaPersonApplyPageState extends State<DoorareaPersonApplyPage> {
children: [
ListItemFactory.createBuildSimpleSection('申请信息'),
const Divider(),
ItemListWidget.selectableLineTitleTextRightButton(
label: '选择港区:',
isEditable: true,
text: addData['portAreaName'] ?? '请选择',
isRequired: true,
onTap: () async {
_getPortAreaType();
},
),
const Divider(),
ItemListWidget.selectableLineTitleTextRightButton(
label: '选择管辖单位:',
isEditable: true,
text: addData['jurisdictionalCorpName'] ?? '请选择',
isRequired: true,
onTap: () {
if( addData['portAreaId'].isEmpty){
ToastUtil.showNormal(context, '请先选择港区');
return;
}
showModalBottomSheet(
context: context,
isScrollControlled: true,
@ -93,6 +108,7 @@ class _DoorareaPersonApplyPageState extends State<DoorareaPersonApplyPage> {
backgroundColor: Colors.transparent,
builder:
(ctx) => DepartmentPickerEnterprise(
addData['portAreaId'],
onSelected: (id, name,pdId) async {
setState(() {
addData['jurisdictionalCorpId']= id;
@ -526,95 +542,81 @@ class _DoorareaPersonApplyPageState extends State<DoorareaPersonApplyPage> {
});
}
Future<void> _getVisitPortArea() async {
List<String> result = [];
//
final List<int> initialIndices = [];
final resultList = await DoorAndCarApi.getEnclosedAreaById(addData['jurisdictionalCorpName']);
List<dynamic> raw = resultList["data"] as List<dynamic>;
result = raw.map((item) => item['closedAreaName'].toString()).toList();
if(addData['gateLevelAuthArea'].isNotEmpty){
// JSON
Map<String, dynamic> jsonData = json.decode(addData['gateLevelAuthArea']);
List<dynamic> areaList = jsonData['area'];
// value
List<String> targetValues = areaList.map((item) => item['value'].toString()).toList();
// raw
for (String targetValue in targetValues) {
for (int i = 0; i < raw.length; i++) {
var item = raw[i];
if (item != null && item is Map && item.containsKey('dictLabel')) {
if (item['dictLabel'].toString() == targetValue) {
initialIndices.add(i);// 0
break;
}
}
}
}
}
//
final selectedItems = await CenterMultiPicker.show<String>(
context,
items: result,
itemBuilder: (item) => Text(
item,
style: const TextStyle(fontSize: 16),
),
initialSelectedIndices: initialIndices, //
maxSelection: null, //
allowEmpty: true,
title: '管辖区域',
);
//
if (selectedItems != null) {
Future<void> _getPortAreaType() async {
showModalBottomSheet(
context: context,
isScrollControlled: true,
barrierColor: Colors.black54,
backgroundColor: Colors.transparent,
builder:
(_) => MultiDictValuesPicker(
title: '港区',
dictType: 'HG_AUTH_AREA',
allowSelectParent: false,
onSelected: (id, name, extraData) {
setState(() {
addData['gateLevelAuthAreaName'] = selectedItems.join(',');
addData['portAreaId'] = extraData?['dictValue'];//id
addData['portAreaName'] = name;//
// JSON
List<Map<String, dynamic>> areaList = [];
// raw
for (String selectedItem in selectedItems) {
for (var item in raw) {
if (item != null && item is Map && item.containsKey('dictLabel')) {
if (item['dictLabel'].toString() == selectedItem) {
// value(dictLabel) bianma(dictValue)
areaList.add({
'value': item['dictLabel'].toString(),
'bianma': item['dictValue'].toString(), // 使 toString()
});
break;
}
}
}
}
// JSON
Map<String, dynamic> jsonData = {
'area': areaList
};
// Map JSON
addData['gateLevelAuthArea'] = json.encode(jsonData);
},
),
).then((_) {
// FocusHelper.clearFocus(context);
});
}
Future<void> _getVisitPortArea() async {
try {
LoadingDialogHelper.show();
final raw = await DoorAndCarApi.getEnclosedAreaById(addData['jurisdictionalCorpId']);
LoadingDialogHelper.hide();
if (raw['success'] ) {
List<dynamic> newList = raw['data'] ?? [];
for(int i=0;i<newList.length;i++){
newList[i]["dataId"] = newList[i]["id"];
newList[i]["dataName"] = newList[i]["closedAreaName"];
}
showModalBottomSheet(
context: context,
isScrollControlled: true,
barrierColor: Colors.black54,
backgroundColor: Colors.transparent,
builder:
(ctx) => DepartmentPickerThree(
listdata: newList,
onSelected: (id, name,pdId) async {
setState(() {
addData['closedAreaId']=id;//id
addData['closedAreaName']=name;//
});
},
),
);
}else{
ToastUtil.showNormal(context, "获取列表失败");
LoadingDialogHelper.hide();
// _showMessage('反馈提交失败');
// return "";
}
} catch (e) {
// Toast
print('加载首页数据失败:$e');
// return "";
LoadingDialogHelper.hide();
}
}
Future<void> _getApproverList() async {
try {
LoadingDialogHelper.show();
final raw = await DoorAndCarApi.getApproverList( addData['auditPersonCorpId'],'');//addData['auditDeptId']
final raw = await DoorAndCarApi.getApproverList( addData['auditPersonCorpId'],'','1','','');//addData['auditDeptId']
LoadingDialogHelper.hide();
if (raw['success'] ) {
List<dynamic> newList = raw['data'] ?? [];
@ -765,7 +767,7 @@ class _DoorareaPersonApplyPageState extends State<DoorareaPersonApplyPage> {
}
// List<Person> List<Map<String, dynamic>>
addData['personApplyList'] = _personList.map((person) => person.toJson()).toList();
addData['entourage'] = _personList.map((person) => person.toJson()).toList();
if(signImages.isEmpty){
ToastUtil.showNormal(context, '请阅读《安全进港须知》并签字');
@ -839,21 +841,23 @@ class _DoorareaPersonApplyPageState extends State<DoorareaPersonApplyPage> {
"userPhone": "", //
"userCard": "", //
"portAreaId": '', //id
"portAreaName": '', //
"auditAllTime": '', //
"personApplyList": [],
};
Map<String, dynamic> addPersonData= {
"personCorpId": '', //ID
"personCorpName": '', //
"personDepartmentId": '', //id
"personDepartmentName": '', //
"employeePersonUserId": '', //id
"employeePersonUserName": '', //
"userFaceUrl": '', //
"userPhone": '', //
"userCard": '', //
};
// Map<String, dynamic> addPersonData= {
// "personCorpId": '', //ID
// "personCorpName": '', //
// "personDepartmentId": '', //id
// "personDepartmentName": '', //
// "employeePersonUserId": '', //id
// "employeePersonUserName": '', //
// "userFaceUrl": '', //
// "userPhone": '', //
// "userCard": '', //
// };

View File

@ -66,24 +66,34 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
buttonName='查看';
isAdd=true;
xgfDataApplyListData['processOrRecord']=1;
xgfDataApplyListData['xgf-stk-personnel-application'] = '/primeport/container/stakeholder/firstLevelDoor/personnelApplication/list';
break;
case 2:// 2 ()
titleName='人员审核记录';
buttonName='查看';
isAdd=false;
xgfDataApplyListData['processOrRecord']=2;
xgfDataApplyListData['xgf-stk-personnel-app-records'] = '/primeport/container/stakeholder/firstLevelDoor/personnelApplicationRecords/list';
break;
case 3://3 ()
titleName='人员审核';
buttonName='查看';
isAdd=true;
xgfDataApplyListData['processOrRecord']=1;
xgfDataApplyListData['personBelongType']=3;
xgfDataApplyListData['xgs-ren-yuan-feng-bi-qu-yu-shen-qing'] = '/primeport/container/stakeholder/enclosedArea/apply/personnel/list';
break;
case 4://4 ()
titleName='人员审核记录';
buttonName='查看';
isAdd=false;
xgfDataApplyListData['processOrRecord']=2;
xgfDataApplyListData['personBelongType']=3;
xgfDataApplyListData['xgs-ren-yuan-feng-bi-qu-yu-shen-qing-ji-lu'] = '/primeport/container/stakeholder/enclosedArea/apply/personnelRecords/list';
break;
case 5: //5 ()
titleName='车辆审核';
@ -91,6 +101,8 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
isAdd=true;
xgfDataApplyListData['processOrRecord']=1;
xgfDataApplyListData['vehicleBelongType']='5';
xgfDataApplyListData['xgf-stk-vehicle-application'] = '/primeport/container/stakeholder/firstLevelDoor/vehicleApplication/list';
break;
case 6: // 6 ()
titleName='车辆审核记录';
@ -98,18 +110,26 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
isAdd=false;
xgfDataApplyListData['processOrRecord']=2;
xgfDataApplyListData['vehicleBelongType']='5';
xgfDataApplyListData['xgf-stk-vehicle-app-records'] = '/primeport/container/stakeholder/firstLevelDoor/vehicleApplicationRecords/list';
break;
case 7: // 7 ()
titleName='车辆审核';
buttonName='查看';
isAdd=true;
xgfDataApplyListData['processOrRecord']=1;
xgfDataApplyListData['personBelongType']=3;
xgfDataApplyListData['xgs-che-liang-feng-bi-qu-yu-shen-qing'] = '/primeport/container/stakeholder/enclosedArea/apply/vehicle/list';
break;
case 8: // 8 ()
titleName='车辆审核记录';
buttonName='查看';
isAdd=false;
xgfDataApplyListData['processOrRecord']=2;
xgfDataApplyListData['personBelongType']=3;
xgfDataApplyListData['xgs-che-liang-feng-bi-qu-yu-shen-qing-ji-lu'] = '/primeport/container/stakeholder/enclosedArea/apply/vehicleRecords/list';
break;
}
@ -190,7 +210,7 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
switch(widget.type){
case 1:
case 2:
await pushPage(OnlylookPersonApplication(3,item['id']), context);//
await pushPage(OnlylookPersonApplication(3,item['id']), context);
break;
case 3:
case 4:
@ -446,6 +466,7 @@ class _DoorareaPersonRecordPageState extends State<DoorareaPersonRecordPage> {
"licenceNo": "", //
"vehicleBelongTypeArr": "", // 1-2-3-4- 5- 6:7
"vehicleBelongType": "", // 1-2-3-4- 5- 6:7
"personBelongType": '', //1234
};

View File

@ -544,7 +544,7 @@ class _FirstlevelPersonAddPageState extends State<FirstlevelPersonAddPage> {
Future<void> _getApproverList() async {
try {
LoadingDialogHelper.show();
final raw = await DoorAndCarApi.getApproverList( corpinfoId,'');
final raw = await DoorAndCarApi.getApproverList( corpinfoId,'','1','','');
LoadingDialogHelper.hide();
if (raw['success'] ) {
List<dynamic> newList = raw['data'] ?? [];

View File

@ -10,6 +10,7 @@ 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/pages/home/Study/study_tab_list_page.dart';
import 'package:qhd_prevention/pages/home/doorAndCar/doorCar_tab_page.dart';
import 'package:qhd_prevention/pages/home/scan_page.dart';
import 'package:qhd_prevention/pages/home/unit/unit_tab_page.dart';
import 'package:qhd_prevention/pages/main_tab.dart';
@ -60,28 +61,31 @@ class HomePageState extends RouteAwareState<HomePage>
List totalList = [];
Map<String, int> workStats = {'total': 36, 'processed': 30, 'pending': 6};
//
Map<String, int> workStats = {'total': 0, 'processed': 0, 'pending': 0};
List<Map<String, dynamic>> checkLists = [
{
"title": "电工班车间清单",
"type": "隐患排查",
"time": "2025-11-17",
"color": Color(0xFF4CAF50),
},
{
"title": "工地区消防点检清单",
"type": "消防点检",
"time": "2025-11-17",
"color": Color(0xFF2196F3),
},
{
"title": "消防专项检查清单",
"type": "重点作业",
"time": "2025-11-17",
"color": Color(0xFFFF9800),
},
];
//
List<dynamic> checkLists = [];
// List<Map<String, dynamic>> checkLists = [
// {
// "title": "电工班车间清单",
// "type": "隐患排查",
// "time": "2025-11-17",
// "color": Color(0xFF4CAF50),
// },
// {
// "title": "工地区消防点检清单",
// "type": "消防点检",
// "time": "2025-11-17",
// "color": Color(0xFF2196F3),
// },
// {
// "title": "消防专项检查清单",
// "type": "安环检查",
// "time": "2025-11-17",
// "color": Color(0xFFFF9800),
// },
// ];
final List<String> _notifications = [
"系统通知今晚20:00 将进行系统维护,请提前保存数据。",
@ -128,6 +132,8 @@ class HomePageState extends RouteAwareState<HomePage>
"scan": "dashboard-scan",
};
int pcType=1;
@override
void initState() {
super.initState();
@ -158,6 +164,10 @@ class HomePageState extends RouteAwareState<HomePage>
Future.microtask(() {
_updateModuleAndButtonVisibility();
});
if(_isShowCheckLogin){
_getToDoWorkList(pcType);
}
}
@override
@ -622,6 +632,9 @@ class HomePageState extends RouteAwareState<HomePage>
case "入港培训":
pushPage(StudyTabListPage(), context);
break;
case "口门门禁":
pushPage(DoorcarTabPage(), context);
break;
default:
ToastUtil.showNormal(context, '功能开发中...');
break;
@ -629,77 +642,17 @@ class HomePageState extends RouteAwareState<HomePage>
}
Widget _buildWorkStatsSection() {
double buttonHeight = 45.0;
return Container(
padding: const EdgeInsets.all(1),
padding: const EdgeInsets.all(15),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 2))],
boxShadow: const [
BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 2)),
],
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: screenWidth(context),
height: buttonHeight,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Expanded(
child: GestureDetector(
onTap: () => setState(() => _isMobileSelected = true),
child: Container(
decoration: BoxDecoration(
color: _isMobileSelected ? const Color(0xFFE9F4FE) : Colors.white,
borderRadius: const BorderRadius.only(topLeft: Radius.circular(12)),
),
child: Center(
child: Text(
"手机端",
style: TextStyle(
fontSize: 14,
color: _isMobileSelected ? Colors.black : Colors.blue,
fontWeight: FontWeight.w500,
),
),
),
),
),
),
Image.asset(
'assets/images/${_isMobileSelected ? 'img2.png' : 'img1.png'}',
fit: BoxFit.cover,
height: buttonHeight,
width: 30,
),
Expanded(
child: GestureDetector(
onTap: () => setState(() => _isMobileSelected = false),
child: Container(
decoration: BoxDecoration(
color: !_isMobileSelected ? const Color(0xFFE9F4FE) : Colors.white,
borderRadius: const BorderRadius.only(topRight: Radius.circular(12)),
),
child: Center(
child: Text(
"电脑端",
style: TextStyle(
fontSize: 15,
color: !_isMobileSelected ? Colors.black : Colors.blue,
fontWeight: FontWeight.w500,
),
),
),
),
),
),
],
),
),
Padding(
padding: const EdgeInsets.all(15),
child: Column(
children: [
Container(
width: double.infinity,
@ -707,83 +660,215 @@ class HomePageState extends RouteAwareState<HomePage>
child: RichText(
text: TextSpan(
children: [
const TextSpan(text: "今日有工作项", style: TextStyle(fontSize: 16, color: Colors.black87)),
TextSpan(
text: "今日有工作项",
style: TextStyle(fontSize: 16, color: Colors.black87),
),
TextSpan(
text: " ${workStats['total']}",
style: const TextStyle(fontSize: 16, color: Color(0xFF2A75F8), fontWeight: FontWeight.bold),
style: const TextStyle(
fontSize: 16,
color: Color(0xFF2A75F8),
fontWeight: FontWeight.bold,
),
),
TextSpan(
text: "",
style: TextStyle(fontSize: 16, color: Colors.black87),
),
const TextSpan(text: "", style: TextStyle(fontSize: 16, color: Colors.black87)),
],
),
),
),
const SizedBox(height: 15),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
Container(
width: screenWidth(context),
height: 36,
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(20),
border: Border.all(color: Colors.grey[300]!, width: 1),
),
child: Row(
children: [
RichText(
text: TextSpan(
children: [
const TextSpan(text: "已处理工作项:", style: TextStyle(fontSize: 14, color: Colors.black87)),
TextSpan(
text: " ${workStats['processed']}",
style: const TextStyle(fontSize: 14, color: Colors.greenAccent, fontWeight: FontWeight.bold),
),
const TextSpan(text: "", style: TextStyle(fontSize: 14, color: Colors.black87)),
],
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
_isMobileSelected = true;
});
pcType=1;
_getToDoWorkList(pcType);
},
child: Container(
decoration: BoxDecoration(
color:
_isMobileSelected ? const Color(0xFF2A75F8) : Colors.white,
borderRadius: const BorderRadius.only(
topLeft: Radius.circular(20),
bottomLeft: Radius.circular(20),
),
),
child: Center(
child: Text(
"手机端",
style: TextStyle(
fontSize: 14,
color: _isMobileSelected ? Colors.white : Colors.black87,
fontWeight: FontWeight.w500,
),
),
),
),
),
),
Expanded(
child: GestureDetector(
onTap: () {
setState(() {
_isMobileSelected = false;
});
pcType=2;
_getToDoWorkList(pcType);
},
child: Container(
decoration: BoxDecoration(
color: !_isMobileSelected ? const Color(0xFF2A75F8) : Colors.white,
borderRadius: const BorderRadius.only(
topRight: Radius.circular(20),
bottomRight: Radius.circular(20),
),
),
child: Center(
child: Text(
"电脑端",
style: TextStyle(
fontSize: 14,
color: !_isMobileSelected ? Colors.white : Colors.black87,
fontWeight: FontWeight.w500,
),
),
),
RichText(
text: TextSpan(
children: [
const TextSpan(text: "待处理工作项:", style: TextStyle(fontSize: 14, color: Colors.black87)),
TextSpan(
text: " ${workStats['pending']}",
style: const TextStyle(fontSize: 14, color: Colors.orange, fontWeight: FontWeight.bold),
),
const TextSpan(text: "", style: TextStyle(fontSize: 14, color: Colors.black87)),
],
),
),
],
),
],
),
),
// const SizedBox(height: 15),
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: [
// RichText(
// text: TextSpan(
// children: [
// TextSpan(
// text: "已处理工作项:",
// style: TextStyle(fontSize: 14, color: Colors.black87),
// ),
// TextSpan(
// text: " ${workStats['processed']}",
// style: const TextStyle(
// fontSize: 14,
// color: Colors.greenAccent,
// fontWeight: FontWeight.bold,
// ),
// ),
// TextSpan(
// text: "",
// style: TextStyle(fontSize: 14, color: Colors.black87),
// ),
// ],
// ),
// ),
// RichText(
// text: TextSpan(
// children: [
// TextSpan(
// text: "待处理工作项:",
// style: TextStyle(fontSize: 14, color: Colors.black87),
// ),
// TextSpan(
// text: " ${workStats['processed']}",
// style: const TextStyle(
// fontSize: 14,
// color: Colors.orange,
// fontWeight: FontWeight.bold,
// ),
// ),
// TextSpan(
// text: "",
// style: TextStyle(fontSize: 14, color: Colors.black87),
// ),
// ],
// ),
// ),
// ],
// ),
],
),
);
}
// Widget _buildCheckListSection() {
// return Column(
// children: [
// Row(
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
// children: const [
// Text(' 待办清单', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
// SizedBox(),
// ],
// ),
// const SizedBox(height: 8),
// Container(
// decoration: BoxDecoration(
// color: Colors.white,
// borderRadius: BorderRadius.circular(12),
// boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 2))],
// ),
// child: Column(children: [...checkLists.map((item) => _buildCheckListItem(item))]),
// ),
// ],
// );
// }
Widget _buildCheckListSection() {
return Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const [
Text(' 待办清单', style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold)),
SizedBox(),
],
),
const SizedBox(height: 8),
Container(
return Container(
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12),
boxShadow: const [BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 2))],
),
child: Column(children: [...checkLists.map((item) => _buildCheckListItem(item))]),
),
boxShadow: const [
BoxShadow(color: Colors.black12, blurRadius: 6, offset: Offset(0, 2)),
],
),
child: Column(
children: checkLists.map((item) => _buildCheckListItem(item)).toList(),
),
);
}
Widget _buildCheckListItem(Map<String, dynamic> item) {
return Container(
return GestureDetector(
onTap: () async {
if(pcType==2){
return;
}
// if(item['appName']=="隐患治理"||item['appName']=="隐患管理"||item['appName']=="风险管控应用"){
// await pushPage(ApplicationPageTwo(), context);
// }else if(item['appName']=="消防检查"){
// await pushPage(FireManagementTabPage(), context);
// }else{
// await pushPage(SafecheckTabList(), context);
// }
_getToDoWorkList(pcType);
// _getHiddenIssuesNum();
},
child: Container(
padding: const EdgeInsets.all(15),
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Colors.grey[200]!, width: 1)),
),
decoration:
BoxDecoration(border: Border(bottom: BorderSide(color: Colors.grey[200]!, width: 1))),
child: Row(
children: [
Expanded(
@ -793,44 +878,28 @@ class HomePageState extends RouteAwareState<HomePage>
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(
child: Text(
Text(
item['title'],
style: const TextStyle(fontSize: 15, fontWeight: FontWeight.bold, color: Colors.black87),
overflow: TextOverflow.ellipsis,
maxLines: 1,
),
),
const SizedBox(width: 8),
Text(item['type'], style: TextStyle(fontSize: 12, color: Colors.grey[500])),
Text(item['content'], style: TextStyle(fontSize: 12, color: Colors.grey[500])),
],
),
const SizedBox(height: 8),
const Divider(),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Flexible(
child: Container(
Row(
children: [
Image.asset('assets/images/mine1.png', width: 15, height: 15),
Container(
padding: const EdgeInsets.symmetric(horizontal: 6, vertical: 2),
decoration: BoxDecoration(
color: Colors.grey[100],
borderRadius: BorderRadius.circular(4),
),
child: Text(
"类型:${item['type']}",
style: const TextStyle(fontSize: 12, color: Colors.blue),
overflow: TextOverflow.ellipsis,
),
),
),
const SizedBox(width: 8),
Flexible(
child: Text(
"时间:${item['time']}",
style: const TextStyle(fontSize: 12, color: Colors.grey),
overflow: TextOverflow.ellipsis,
decoration: BoxDecoration(color: Colors.grey[100], borderRadius: BorderRadius.circular(4)),
child: Text("类型:${item['appName']}", style: const TextStyle(fontSize: 12, color: Colors.blue)),
),
],
),
Text("时间:${item['createTime']}", style: const TextStyle(fontSize: 12, color: Colors.grey)),
],
),
],
@ -838,6 +907,30 @@ class HomePageState extends RouteAwareState<HomePage>
),
],
),
),
);
}
//
void _getToDoWorkList(int type) async {
Map data = {
"eqAppFlag": type==1?"1":"",
"eqPcFlag": type==1?"":"1",
"eqStatus": "1",
"pageIndex": '1',
"pageSize": '999',
};
final result = await TodoApi.getTodoList(data);
if (result['success']) {
setState(() {
workStats['total'] =result['totalCount'] ;
checkLists=result['data'];
// checkLists = result['data'];
int m= checkLists.length;
});
}
}
}