master
parent
37651441b2
commit
0b5f169a91
|
|
@ -9,6 +9,7 @@ class ApiService {
|
||||||
static final bool isProduct = true;
|
static final bool isProduct = true;
|
||||||
|
|
||||||
/// 登录及其他管理后台接口
|
/// 登录及其他管理后台接口
|
||||||
|
// static final String basePath = "http://192.168.198.8:30140";
|
||||||
static final String basePath =
|
static final String basePath =
|
||||||
isProduct
|
isProduct
|
||||||
? "https://gbs-gateway.qhdsafety.com"
|
? "https://gbs-gateway.qhdsafety.com"
|
||||||
|
|
@ -20,6 +21,8 @@ class ApiService {
|
||||||
isProduct
|
isProduct
|
||||||
? "https://jpfz.qhdsafety.com/gbsFileTest/"
|
? "https://jpfz.qhdsafety.com/gbsFileTest/"
|
||||||
: "http://192.168.20.240:9787/mnt/"; //内网图片地址
|
: "http://192.168.20.240:9787/mnt/"; //内网图片地址
|
||||||
|
// static final String baseImgPath = "https://skqhdg.porthebei.com:9004/file/";
|
||||||
|
|
||||||
|
|
||||||
static const publicKey =
|
static const publicKey =
|
||||||
'0402df2195296d4062ac85ad766994d73e871b887e18efb9a9a06b4cebc72372869b7da6c347c129dee2b46a0f279ff066b01c76208c2a052af75977c722a2ccee';
|
'0402df2195296d4062ac85ad766994d73e871b887e18efb9a9a06b4cebc72372869b7da6c347c129dee2b46a0f279ff066b01c76208c2a052af75977c722a2ccee';
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,14 @@ import 'dart:convert';
|
||||||
import 'dart:io';
|
import 'dart:io';
|
||||||
import 'dart:ui';
|
import 'dart:ui';
|
||||||
import 'package:dio/dio.dart';
|
import 'package:dio/dio.dart';
|
||||||
|
import 'package:qhd_prevention/customWidget/custom_alert_dialog.dart';
|
||||||
|
import 'package:qhd_prevention/customWidget/toast_util.dart';
|
||||||
|
import 'package:qhd_prevention/main.dart';
|
||||||
|
|
||||||
import 'package:qhd_prevention/services/SessionService.dart';
|
import 'package:qhd_prevention/services/SessionService.dart';
|
||||||
import 'package:qhd_prevention/tools/tools.dart';
|
import 'package:qhd_prevention/tools/tools.dart';
|
||||||
|
import 'package:flutter/widgets.dart';
|
||||||
|
|
||||||
|
|
||||||
/// 全局接口异常
|
/// 全局接口异常
|
||||||
class ApiException implements Exception {
|
class ApiException implements Exception {
|
||||||
|
|
|
||||||
|
|
@ -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: {
|
||||||
|
'eqFlag' : 1,
|
||||||
|
...data
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -196,6 +196,7 @@ class _StudyClassListPageState extends State<StudyClassListPage> {
|
||||||
Text("培训结束时间: ${item["endTime"] ?? ''}"),
|
Text("培训结束时间: ${item["endTime"] ?? ''}"),
|
||||||
Text("班级状态: ${getStatusName(item['state'])}"),
|
Text("班级状态: ${getStatusName(item['state'])}"),
|
||||||
const SizedBox(height: 8),
|
const SizedBox(height: 8),
|
||||||
|
if (item['state'] == 3)
|
||||||
Row(
|
Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: buttonRowChildren,
|
children: buttonRowChildren,
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:qhd_prevention/customWidget/IconBadgeButton.dart';
|
import 'package:qhd_prevention/customWidget/IconBadgeButton.dart';
|
||||||
|
import 'package:qhd_prevention/customWidget/custom_alert_dialog.dart';
|
||||||
import 'package:qhd_prevention/pages/home/Study/study_class_list_page.dart';
|
import 'package:qhd_prevention/pages/home/Study/study_class_list_page.dart';
|
||||||
import 'package:qhd_prevention/pages/home/scan_page.dart';
|
import 'package:qhd_prevention/pages/home/scan_page.dart';
|
||||||
import 'package:qhd_prevention/pages/my_appbar.dart';
|
import 'package:qhd_prevention/pages/my_appbar.dart';
|
||||||
|
|
|
||||||
|
|
@ -208,7 +208,6 @@ class _StudyTakeExamPageState extends State<StudyTakeExamPage> {
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<void> _submit() async {
|
Future<void> _submit() async {
|
||||||
LoadingDialogHelper.show(message: '正在提交');
|
|
||||||
|
|
||||||
// 按原逻辑:若多选题需要去掉逗号(保留你的业务要求)
|
// 按原逻辑:若多选题需要去掉逗号(保留你的业务要求)
|
||||||
for (var q in questions) {
|
for (var q in questions) {
|
||||||
|
|
@ -233,6 +232,9 @@ class _StudyTakeExamPageState extends State<StudyTakeExamPage> {
|
||||||
'examTimeEnd': DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()),
|
'examTimeEnd': DateFormat('yyyy-MM-dd HH:mm:ss').format(DateTime.now()),
|
||||||
'questionList': questionList, // 这里放真正的 List<Map<String,dynamic>>
|
'questionList': questionList, // 这里放真正的 List<Map<String,dynamic>>
|
||||||
};
|
};
|
||||||
|
// final r = await CustomAlertDialog.showConfirm(context, title: '参数', content: jsonEncode(data));
|
||||||
|
// if (!r) return;
|
||||||
|
LoadingDialogHelper.show(message: '正在提交');
|
||||||
|
|
||||||
final res = await EduApi.submitExam(data);
|
final res = await EduApi.submitExam(data);
|
||||||
LoadingDialogHelper.hide();
|
LoadingDialogHelper.hide();
|
||||||
|
|
|
||||||
|
|
@ -174,6 +174,7 @@ class HomePageState extends RouteAwareState<HomePage>
|
||||||
|
|
||||||
// 通知滚动 PageController
|
// 通知滚动 PageController
|
||||||
_notifPageController = PageController(initialPage: 0);
|
_notifPageController = PageController(initialPage: 0);
|
||||||
|
_getToDoWorkList();
|
||||||
|
|
||||||
// 启动定时器:每 3 秒切换一条通知
|
// 启动定时器:每 3 秒切换一条通知
|
||||||
_notifTimer = Timer.periodic(const Duration(seconds: 3), (timer) {
|
_notifTimer = Timer.periodic(const Duration(seconds: 3), (timer) {
|
||||||
|
|
@ -189,7 +190,7 @@ class HomePageState extends RouteAwareState<HomePage>
|
||||||
);
|
);
|
||||||
} catch (_) {}
|
} catch (_) {}
|
||||||
_getNeedSafetyCommitment();
|
_getNeedSafetyCommitment();
|
||||||
|
// 获取待办事项
|
||||||
setState(() {});
|
setState(() {});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -200,8 +201,15 @@ class HomePageState extends RouteAwareState<HomePage>
|
||||||
Future.delayed(const Duration(seconds: 1), () {
|
Future.delayed(const Duration(seconds: 1), () {
|
||||||
_firstLoad = true;
|
_firstLoad = true;
|
||||||
});
|
});
|
||||||
}
|
|
||||||
|
|
||||||
|
}
|
||||||
|
// 获取待办事项
|
||||||
|
void _getToDoWorkList() async {
|
||||||
|
final result = await TodoApi.getTodoList({});
|
||||||
|
setState(() {
|
||||||
|
totalList = result['data'];
|
||||||
|
});
|
||||||
|
}
|
||||||
/// 校验是否入职
|
/// 校验是否入职
|
||||||
Future<void> _getNeedSafetyCommitment() async {
|
Future<void> _getNeedSafetyCommitment() async {
|
||||||
if (_isShowCheckLogin) {
|
if (_isShowCheckLogin) {
|
||||||
|
|
|
||||||
|
|
@ -536,6 +536,35 @@ class _CertificateDetailPageState extends State<CertificateDetailPage> {
|
||||||
const Divider(),
|
const Divider(),
|
||||||
|
|
||||||
if (_chooseMode == CertifitcateTypeMode.specialWorker) ...[
|
if (_chooseMode == CertifitcateTypeMode.specialWorker) ...[
|
||||||
|
ItemListWidget.selectableLineTitleTextRightButton(
|
||||||
|
label: '行业类别:',
|
||||||
|
isEditable: _isEdit,
|
||||||
|
text: pd['industryCategoryName'] ?? '请选择',
|
||||||
|
isRequired: _isEdit,
|
||||||
|
onTap: () async {
|
||||||
|
final found = await BottomPicker.show(
|
||||||
|
context,
|
||||||
|
items: _specialWorkList,
|
||||||
|
itemBuilder:
|
||||||
|
(i) => Text(
|
||||||
|
i['dictLabel']!,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
initialIndex: 0,
|
||||||
|
);
|
||||||
|
//FocusHelper.clearFocus(context);
|
||||||
|
if (found != null) {
|
||||||
|
setState(() {
|
||||||
|
pd['industryCategoryName'] = found['dictLabel'];
|
||||||
|
pd['industryCategoryCode'] = found['dictValue'];
|
||||||
|
_chooseWorkTypeList = found['children'] ?? [];
|
||||||
|
pd['industryOperatingItemsName'] = '';
|
||||||
|
pd['industryOperatingItemsCode'] = '';
|
||||||
|
});
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
const Divider(),
|
||||||
ItemListWidget.selectableLineTitleTextRightButton(
|
ItemListWidget.selectableLineTitleTextRightButton(
|
||||||
label: '操作项目:',
|
label: '操作项目:',
|
||||||
isEditable: _isEdit,
|
isEditable: _isEdit,
|
||||||
|
|
@ -564,38 +593,10 @@ class _CertificateDetailPageState extends State<CertificateDetailPage> {
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
const Divider(),
|
const Divider(),
|
||||||
ItemListWidget.selectableLineTitleTextRightButton(
|
|
||||||
label: '行业类别:',
|
|
||||||
isEditable: _isEdit,
|
|
||||||
text: pd['industryCategoryName'] ?? '请选择',
|
|
||||||
isRequired: _isEdit,
|
|
||||||
onTap: () async {
|
|
||||||
final found = await BottomPicker.show(
|
|
||||||
context,
|
|
||||||
items: _specialWorkList,
|
|
||||||
itemBuilder:
|
|
||||||
(i) => Text(
|
|
||||||
i['dictLabel']!,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
initialIndex: 0,
|
|
||||||
);
|
|
||||||
//FocusHelper.clearFocus(context);
|
|
||||||
if (found != null) {
|
|
||||||
setState(() {
|
|
||||||
pd['industryCategoryName'] = found['dictLabel'];
|
|
||||||
pd['industryCategoryCode'] = found['dictValue'];
|
|
||||||
_chooseWorkTypeList = found['children'] ?? [];
|
|
||||||
pd['industryOperatingItemsName'] = '';
|
|
||||||
pd['industryOperatingItemsCode'] = '';
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
const Divider(),
|
|
||||||
|
|
||||||
],
|
],
|
||||||
if (_chooseMode == CertifitcateTypeMode.specialEquipment) ...[
|
if (_chooseMode == CertifitcateTypeMode.specialEquipment ) ...[
|
||||||
ItemListWidget.selectableLineTitleTextRightButton(
|
ItemListWidget.selectableLineTitleTextRightButton(
|
||||||
label: '操作项目:',
|
label: '操作项目:',
|
||||||
isEditable: _isEdit,
|
isEditable: _isEdit,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue