Commit f8c76167 by 吴春元

考试系统

监察记录
parent eef72d47
......@@ -11,7 +11,8 @@ import 'package:special_equipment_flutter/ui/login/login_page.dart';
import 'package:special_equipment_flutter/ui/main/tab_home_page.dart';
import 'package:special_equipment_flutter/ui/main/unit/equipment_personnel_page.dart';
import 'package:special_equipment_flutter/ui/overseer/equipment_list_page.dart';
import 'package:special_equipment_flutter/ui/overseer/overseer_list_page.dart';
import 'package:special_equipment_flutter/ui/overseer/overseer_history_details_page.dart';
import 'package:special_equipment_flutter/ui/overseer/overseer_history_list_page.dart';
import 'package:special_equipment_flutter/ui/overseer/overseer_settings_page.dart';
import 'package:special_equipment_flutter/ui/overseer/unit_list_page.dart';
import 'package:special_equipment_flutter/ui/register/address_page.dart';
......@@ -129,7 +130,7 @@ class RouteString {
static const String EQUIPMENT_LIST_PAGE = "/EquipmentListPage";
///监察人-考核列表
static const String OVERSEER_LIST_PAGE = "/OverseerListPage";
static const String OVERSEER_HISTORY_LIST_PAGE = "/OverseerHistoryListPage";
///测试练习结果页面
static const String TEST_RESULT_PAGE = "/TestResultPage";
......@@ -137,6 +138,10 @@ class RouteString {
///测试练习设置
static const String TEST_SETTING_PAGE = "/TestSettingPage";
///监察记录
static const String OVERSEER_HISTROY_DETAILS_PAGE =
"/OverseerHistroyDetailsPage";
static final routes = [
///登录
GetPage(name: LOGIN, page: () => const LoginPage()),
......@@ -226,7 +231,9 @@ class RouteString {
GetPage(name: EQUIPMENT_LIST_PAGE, page: () => EquipmentListPage()),
///考核列表
GetPage(name: OVERSEER_LIST_PAGE, page: () => OverseerListPage()),
GetPage(
name: OVERSEER_HISTORY_LIST_PAGE,
page: () => OverseerHistoryListPage()),
///测试练习结果
GetPage(name: TEST_RESULT_PAGE, page: () => TestResultPage()),
......@@ -234,6 +241,11 @@ class RouteString {
///测试练习设置
GetPage(name: TEST_SETTING_PAGE, page: () => TestSettingPage()),
///监察记录
GetPage(
name: OVERSEER_HISTROY_DETAILS_PAGE,
page: () => OverseerHistroyDetailsPage()),
// GetPage(
// name: "/shop",
// page: () => const ShopPage(),
......
......@@ -8,9 +8,10 @@ class Api {
///演示 ip
// static String URL = "http://47.92.138.92:8009/";
static String URL = "http://192.168.19.164:8087/";
// static String URL = "http://192.168.19.165:2212/";
// static String URL = "http://192.168.19.164:8087/";
static String URL = "http://192.168.19.165:2212/";
static String START_URL = "special/a/",
END_URL = "__ajax=true&mobileLogin=true";
......@@ -223,6 +224,21 @@ class Api {
/// 考核 是否显示答案
static String SHOW_ANSWER = "${URL + START_URL}sys/dict/showAnswer";
/// 监察记录 列表
static String EXAM_SETUP_GET_PAPERS =
"${URL + START_URL}exam/examSetup/getPapers";
/// 获取详情基本信息
static String GET_PAPERS_DETAIL =
"${URL + START_URL}exam/examSetup/getPapersDetail";
/// 监察记录 详情
static String EXAM_PERSON_DATA =
"${URL + START_URL}exam/examPerson/getDetail";
/// 监察记录 删除
static String EXAM_SETUP_DELETE = "${URL + START_URL}exam/examSetup/delete";
/// 获取考核信息
// static String EXAMINE_PERSON = "${URL + START_URL}/exam/examPerson/checkHaveExam";
}
......@@ -26,6 +26,9 @@ import 'package:special_equipment_flutter/model/exam/exam_unit_list.dart';
import 'package:special_equipment_flutter/model/exam/examine_person_bo.dart';
import 'package:special_equipment_flutter/model/exam/examine_questions_bo.dart';
import 'package:special_equipment_flutter/model/exam/find_question_num.dart';
import 'package:special_equipment_flutter/model/exam/overseer_history_details_bo.dart';
import 'package:special_equipment_flutter/model/exam/overseer_history_information_bo.dart';
import 'package:special_equipment_flutter/model/exam/overseer_history_list_bo.dart';
import 'package:special_equipment_flutter/model/exam/show_answer_bo.dart';
import 'package:special_equipment_flutter/model/exam/test_questions_bo.dart';
import 'package:special_equipment_flutter/model/exam/unit_person_list_bo.dart';
......@@ -1563,6 +1566,114 @@ class HttpUtils {
}
}
///监察记录 详情基本信息
static Future getPapers2(
BuildContext context, String inspectorsId, String setup) async {
Map<String, dynamic> params = {
"inspectorsId": inspectorsId,
"setup": setup
};
var response = await NetUtils.get(
context,
'${Api.GET_PAPERS_DETAIL};JSESSIONID=${StorageUtil.getInstance().getJsessionId()}',
false,
params);
try {
BaseModel entity = BaseModel.fromJson(response);
Map<String, dynamic> resultData = entity.body;
OverseerHistoryInformationBo mOverseerHistoryListBo =
OverseerHistoryInformationBo.fromJson(resultData);
if (entity.errorCode == "-1") {
return mOverseerHistoryListBo;
} else {
ToastUtils.showCenter(entity.msg!);
return;
}
} catch (e) {
log(e.toString());
return {"message": e.toString()};
}
}
///监察记录 列表
static Future getPapers(BuildContext context, String inspectorsId, int pageNo,
int pageSize) async {
Map<String, dynamic> params = {
"inspectorsId": inspectorsId,
"pageNo": pageNo,
"pageSize": pageSize
};
var response = await NetUtils.get(
context,
'${Api.EXAM_SETUP_GET_PAPERS};JSESSIONID=${StorageUtil.getInstance().getJsessionId()}',
false,
params);
try {
BaseModel entity = BaseModel.fromJson(response);
Map<String, dynamic> resultData = entity.body;
OverseerHistoryListBo mOverseerHistoryListBo =
OverseerHistoryListBo.fromJson(resultData);
if (entity.errorCode == "-1") {
return mOverseerHistoryListBo;
} else {
ToastUtils.showCenter(entity.msg!);
return;
}
} catch (e) {
log(e.toString());
return {"message": e.toString()};
}
}
///监察记录 详情
static Future getExamPersonData(BuildContext context, String setup) async {
Map<String, dynamic> params = {"setup": setup};
var response = await NetUtils.get(
context,
'${Api.EXAM_PERSON_DATA};JSESSIONID=${StorageUtil.getInstance().getJsessionId()}',
false,
params);
try {
BaseModel entity = BaseModel.fromJson(response);
Map<String, dynamic> resultData = entity.body;
OverseerHistoryDetailsBo mOverseerHistoryDetailsBo =
OverseerHistoryDetailsBo.fromJson(resultData);
if (entity.errorCode == "-1") {
return mOverseerHistoryDetailsBo;
} else {
ToastUtils.showCenter(entity.msg!);
return;
}
} catch (e) {
log(e.toString());
return {"message": e.toString()};
}
}
///监察记录 删除
static Future getExamSetupDelete(BuildContext context, String id) async {
Map<String, dynamic> params = {"id": id};
var response = await NetUtils.get(
context,
'${Api.EXAM_SETUP_DELETE};JSESSIONID=${StorageUtil.getInstance().getJsessionId()}',
false,
params);
try {
BaseModel entity = BaseModel.fromJson(response);
Map<String, dynamic> resultData = entity.body;
ShowAnswerBo mShowAnswerBo = ShowAnswerBo.fromJson(resultData);
if (entity.errorCode == "-1") {
return mShowAnswerBo;
} else {
ToastUtils.showCenter(entity.msg!);
return;
}
} catch (e) {
log(e.toString());
return {"message": e.toString()};
}
}
// HttpUtils.getList(context, _page, 20).then((value) {
// ListBo listBo = value;
// print(listBo);
......
......@@ -7,6 +7,7 @@ class ExamSettingSubmitBo {
this.aqzgIds,
this.aqyIds,
this.type,
this.unitId,
});
ExamSettingSubmitBo.fromJson(dynamic json) {
......@@ -17,6 +18,7 @@ class ExamSettingSubmitBo {
aqzgIds = json['aqzgIds'] != null ? json['aqzgIds'].cast<String>() : [];
aqyIds = json['aqyIds'] != null ? json['aqyIds'].cast<String>() : [];
type = json['type'];
unitId = json['unitId'];
}
int? aqzgPdNum;
......@@ -26,6 +28,7 @@ class ExamSettingSubmitBo {
List<String>? aqzgIds;
List<String>? aqyIds;
String? type;
String? unitId;
ExamSettingSubmitBo copyWith({
int? aqzgPdNum,
......@@ -35,6 +38,7 @@ class ExamSettingSubmitBo {
List<String>? aqzgIds,
List<String>? aqyIds,
String? type,
String? unitId,
}) =>
ExamSettingSubmitBo(
aqzgPdNum: aqzgPdNum ?? this.aqzgPdNum,
......@@ -44,6 +48,7 @@ class ExamSettingSubmitBo {
aqzgIds: aqzgIds ?? this.aqzgIds,
aqyIds: aqyIds ?? this.aqyIds,
type: type ?? this.type,
unitId: unitId ?? this.unitId,
);
Map<String, dynamic> toJson() {
......@@ -55,6 +60,7 @@ class ExamSettingSubmitBo {
map['aqzgIds'] = aqzgIds;
map['aqyIds'] = aqyIds;
map['type'] = type;
map['unitId'] = unitId;
return map;
}
}
class OverseerHistoryDetailsBo {
OverseerHistoryDetailsBo({
this.data,
});
OverseerHistoryDetailsBo.fromJson(dynamic json) {
if (json['data'] != null) {
data = [];
json['data'].forEach((v) {
data?.add(DataHistoryDetails.fromJson(v));
});
}
}
List<DataHistoryDetails>? data;
OverseerHistoryDetailsBo copyWith({
List<DataHistoryDetails>? data,
}) =>
OverseerHistoryDetailsBo(
data: data ?? this.data,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (data != null) {
map['data'] = data?.map((v) => v.toJson()).toList();
}
return map;
}
}
class DataHistoryDetails {
DataHistoryDetails({
this.id,
this.inspectors,
this.user,
this.examDate,
this.pdNum,
this.xzNum,
this.type,
this.positionType,
this.setup,
this.unit,
this.adopt,
this.score,
});
DataHistoryDetails.fromJson(dynamic json) {
id = json['id'];
inspectors = json['inspectors'] != null
? Inspectors.fromJson(json['inspectors'])
: null;
user = json['user'] != null ? User.fromJson(json['user']) : null;
examDate = json['examDate'];
pdNum = json['pdNum'];
xzNum = json['xzNum'];
type = json['type'] != null ? Type.fromJson(json['type']) : null;
positionType = json['positionType'];
setup = json['setup'];
unit = json['unit'] != null ? Unit.fromJson(json['unit']) : null;
adopt = json['adopt'];
score = json['score'];
}
String? id;
Inspectors? inspectors;
User? user;
String? examDate;
num? pdNum;
num? xzNum;
Type? type;
String? positionType;
String? setup;
Unit? unit;
String? adopt;
num? score;
DataHistoryDetails copyWith({
String? id,
Inspectors? inspectors,
User? user,
String? examDate,
num? pdNum,
num? xzNum,
Type? type,
String? positionType,
String? setup,
Unit? unit,
String? adopt,
num? score,
}) =>
DataHistoryDetails(
id: id ?? this.id,
inspectors: inspectors ?? this.inspectors,
user: user ?? this.user,
examDate: examDate ?? this.examDate,
pdNum: pdNum ?? this.pdNum,
xzNum: xzNum ?? this.xzNum,
type: type ?? this.type,
positionType: positionType ?? this.positionType,
setup: setup ?? this.setup,
unit: unit ?? this.unit,
adopt: adopt ?? this.adopt,
score: score ?? this.score,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
if (inspectors != null) {
map['inspectors'] = inspectors?.toJson();
}
if (user != null) {
map['user'] = user?.toJson();
}
map['examDate'] = examDate;
map['pdNum'] = pdNum;
map['xzNum'] = xzNum;
if (type != null) {
map['type'] = type?.toJson();
}
map['positionType'] = positionType;
map['setup'] = setup;
if (unit != null) {
map['unit'] = unit?.toJson();
}
map['adopt'] = adopt;
map['score'] = score;
return map;
}
}
class Unit {
Unit({
this.id,
this.name,
this.sort,
this.hasChildren,
this.parentId,
});
Unit.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
sort = json['sort'];
hasChildren = json['hasChildren'];
parentId = json['parentId'];
}
String? id;
String? name;
num? sort;
bool? hasChildren;
String? parentId;
Unit copyWith({
String? id,
String? name,
num? sort,
bool? hasChildren,
String? parentId,
}) =>
Unit(
id: id ?? this.id,
name: name ?? this.name,
sort: sort ?? this.sort,
hasChildren: hasChildren ?? this.hasChildren,
parentId: parentId ?? this.parentId,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['name'] = name;
map['sort'] = sort;
map['hasChildren'] = hasChildren;
map['parentId'] = parentId;
return map;
}
}
class Type {
Type({
this.id,
this.name,
});
Type.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
}
String? id;
String? name;
Type copyWith({
String? id,
String? name,
}) =>
Type(
id: id ?? this.id,
name: name ?? this.name,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['name'] = name;
return map;
}
}
class User {
User({
this.id,
this.name,
this.loginFlag,
this.admin,
this.roleNames,
});
User.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
loginFlag = json['loginFlag'];
admin = json['admin'];
roleNames = json['roleNames'];
}
String? id;
String? name;
String? loginFlag;
bool? admin;
String? roleNames;
User copyWith({
String? id,
String? name,
String? loginFlag,
bool? admin,
String? roleNames,
}) =>
User(
id: id ?? this.id,
name: name ?? this.name,
loginFlag: loginFlag ?? this.loginFlag,
admin: admin ?? this.admin,
roleNames: roleNames ?? this.roleNames,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['name'] = name;
map['loginFlag'] = loginFlag;
map['admin'] = admin;
map['roleNames'] = roleNames;
return map;
}
}
class Inspectors {
Inspectors({
this.id,
this.name,
this.loginFlag,
this.admin,
this.roleNames,
});
Inspectors.fromJson(dynamic json) {
id = json['id'];
name = json['name'];
loginFlag = json['loginFlag'];
admin = json['admin'];
roleNames = json['roleNames'];
}
String? id;
String? name;
String? loginFlag;
bool? admin;
String? roleNames;
Inspectors copyWith({
String? id,
String? name,
String? loginFlag,
bool? admin,
String? roleNames,
}) =>
Inspectors(
id: id ?? this.id,
name: name ?? this.name,
loginFlag: loginFlag ?? this.loginFlag,
admin: admin ?? this.admin,
roleNames: roleNames ?? this.roleNames,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['id'] = id;
map['name'] = name;
map['loginFlag'] = loginFlag;
map['admin'] = admin;
map['roleNames'] = roleNames;
return map;
}
}
class OverseerHistoryInformationBo {
OverseerHistoryInformationBo({
this.data,
});
OverseerHistoryInformationBo.fromJson(dynamic json) {
data = json['data'] != null ? Data.fromJson(json['data']) : null;
}
Data? data;
OverseerHistoryInformationBo copyWith({
Data? data,
}) =>
OverseerHistoryInformationBo(
data: data ?? this.data,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (data != null) {
map['data'] = data?.toJson();
}
return map;
}
}
class Data {
Data({
this.officeName,
this.incomplete,
this.officeId,
this.typeName,
this.count,
this.typeId,
this.id,
this.state,
this.complete,
this.createDate,
});
Data.fromJson(dynamic json) {
officeName = json['officeName'];
incomplete = json['incomplete'];
officeId = json['officeId'];
typeName = json['typeName'];
count = json['count'];
typeId = json['typeId'];
id = json['id'];
state = json['state'];
complete = json['complete'];
createDate = json['createDate'];
}
String? officeName;
int? incomplete;
String? officeId;
String? typeName;
int? count;
String? typeId;
String? id;
String? state;
int? complete;
int? createDate;
Data copyWith({
String? officeName,
int? incomplete,
String? officeId,
String? typeName,
int? count,
String? typeId,
String? id,
String? state,
int? complete,
int? createDate,
}) =>
Data(
officeName: officeName ?? this.officeName,
incomplete: incomplete ?? this.incomplete,
officeId: officeId ?? this.officeId,
typeName: typeName ?? this.typeName,
count: count ?? this.count,
typeId: typeId ?? this.typeId,
id: id ?? this.id,
state: state ?? this.state,
complete: complete ?? this.complete,
createDate: createDate ?? this.createDate,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['officeName'] = officeName;
map['incomplete'] = incomplete;
map['officeId'] = officeId;
map['typeName'] = typeName;
map['count'] = count;
map['typeId'] = typeId;
map['id'] = id;
map['state'] = state;
map['complete'] = complete;
map['createDate'] = createDate;
return map;
}
}
class OverseerHistoryListBo {
OverseerHistoryListBo({
this.data,
this.count,
});
OverseerHistoryListBo.fromJson(dynamic json) {
if (json['data'] != null) {
data = [];
json['data'].forEach((v) {
data?.add(HistoryListData.fromJson(v));
});
}
count = json['count'];
}
List<HistoryListData>? data;
int? count;
OverseerHistoryListBo copyWith({
List<HistoryListData>? data,
int? count,
}) =>
OverseerHistoryListBo(
data: data ?? this.data,
count: count ?? this.count,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
if (data != null) {
map['data'] = data?.map((v) => v.toJson()).toList();
}
map['count'] = count;
return map;
}
}
class HistoryListData {
HistoryListData({
this.officeName,
this.incomplete,
this.officeId,
this.typeName,
this.count,
this.typeId,
this.id,
this.state,
this.complete,
this.createDate,
});
HistoryListData.fromJson(dynamic json) {
officeName = json['officeName'];
incomplete = json['incomplete'];
officeId = json['officeId'];
typeName = json['typeName'];
count = json['count'];
typeId = json['typeId'];
id = json['id'];
state = json['state'];
complete = json['complete'];
createDate = json['createDate'];
}
String? officeName;
int? incomplete;
String? officeId;
String? typeName;
int? count;
String? typeId;
String? id;
String? state;
int? complete;
int? createDate;
HistoryListData copyWith({
String? officeName,
int? incomplete,
String? officeId,
String? typeName,
int? count,
String? typeId,
String? id,
String? state,
int? complete,
int? createDate,
}) =>
HistoryListData(
officeName: officeName ?? this.officeName,
incomplete: incomplete ?? this.incomplete,
officeId: officeId ?? this.officeId,
typeName: typeName ?? this.typeName,
count: count ?? this.count,
typeId: typeId ?? this.typeId,
id: id ?? this.id,
state: state ?? this.state,
complete: complete ?? this.complete,
createDate: createDate ?? this.createDate,
);
Map<String, dynamic> toJson() {
final map = <String, dynamic>{};
map['officeName'] = officeName;
map['incomplete'] = incomplete;
map['officeId'] = officeId;
map['typeName'] = typeName;
map['count'] = count;
map['typeId'] = typeId;
map['id'] = id;
map['state'] = state;
map['complete'] = complete;
map['createDate'] = createDate;
return map;
}
}
......@@ -10,7 +10,7 @@ class StandingConfig {
static const String SAFETY_OFFICER = "安全员";
static const String SAFETY_DIRECTOR = "安全总监";
static const String PERSON_CHARGE = "主要负责人";
static const String INSPECTOR = "监察人员";
static const String INSPECTOR = "安全监察人员";
static const String SY_DEVICE = '客运索道,电梯,起重机械,锅炉,压力管道,压力容器,大型游乐设施,场车,气瓶';
}
......
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:special_equipment_flutter/common/color_const.dart';
import 'package:special_equipment_flutter/common/edgeInsets_const.dart';
import 'package:special_equipment_flutter/dio/http_utils.dart';
import 'package:special_equipment_flutter/model/day_control_list_sy_bo.dart';
import 'package:special_equipment_flutter/widgets/app_bar/custom_app_bar.dart';
import 'package:special_equipment_flutter/widgets/divider_custom.dart';
///考核历史页面
class ExamHistoryPage extends StatefulWidget {
......@@ -9,8 +16,149 @@ class ExamHistoryPage extends StatefulWidget {
}
class _ExamHistoryPageState extends State<ExamHistoryPage> {
final EasyRefreshController _controller = EasyRefreshController();
List<TaskDayList> list = [];
@override
void initState() {
super.initState();
// getData();
}
void getData() {
HttpUtils.getOverseerList(context, '0', '', '').then((value) {
DayControlListSyBo listBo = value;
if (mounted) {
setState(() {
var taskDayList = listBo.taskDayList;
list.clear();
list.addAll(taskDayList!);
_controller.finishRefresh();
});
}
});
}
@override
Widget build(BuildContext context) {
return Container();
return Scaffold(
appBar: AppBarCustom(text: '考核记录', height: 50),
backgroundColor: Colors.grey[100],
body: Column(
children: [
Expanded(
flex: 1,
child: EasyRefresh(
firstRefresh: true,
enableControlFinishRefresh: true,
// enableControlFinishLoad: true,
// firstRefreshWidget: const FirstRefreshWidget(),
// emptyWidget: list.isEmpty
// ? EmptyImgWidget(
// title: '暂无数据,点击刷新',
// onTap: () {
// getData();
// })
// : null,
controller: _controller,
onRefresh: () async {
// page = 1;
// getData();
},
// onLoad: () async {
// page++;
// getList();
// },
child: buildBody(),
)),
],
),
);
}
Column buildBody() {
return Column(
children: [
//文章列表
ListView.separated(
shrinkWrap: true,
padding: const EdgeInsets.symmetric(
horizontal: EdgeInsetsConst.padding_horizontal),
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (BuildContext context, int index) {
return buildItem(index, context);
},
itemCount: 4,
separatorBuilder: (BuildContext context, int index) {
return const SizedBox(
height: 0,
);
},
),
],
);
}
InkWell buildItem(int index, BuildContext context) {
return InkWell(
onTap: () {
// Get.toNamed(RouteString.DAY_INSPECT_SUBMIT_SY,
// arguments: {'argsData': widget.args, 'listBo': list(index)})
// ?.then((value) {
// if (value != null && value) {
// getData();
// }
// });
},
child: buildCard(context, index),
);
}
Card buildCard(BuildContext context, int index) {
return Card(
elevation: 3,
margin: const EdgeInsets.only(left: 0, right: 0, top: 15, bottom: 0),
color: Colors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(5)),
),
child: Container(
padding:
const EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
child: Column(
children: <Widget>[
const Column(
children: [
Text('山西盈中科技有限公司山西盈中科技有限公司',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
color: Colors.black87)),
Text('2024-05-21',
style: TextStyle(fontSize: 14, color: Colors.grey)),
],
),
///分割线
DividerCustom(Colors.grey[300], 8, 8, 0, 0),
Container(
margin:
const EdgeInsets.only(left: 8, top: 0, right: 0, bottom: 0),
child: const Row(children: [
Text('设备类型:',
style: TextStyle(
fontSize: 14,
color: ColorConst.blueColor,
fontWeight: FontWeight.bold)),
Text('电梯,锅炉', style: TextStyle()),
]),
),
],
),
),
);
}
}
import 'package:flutter/material.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:special_equipment_flutter/common/color_const.dart';
import 'package:special_equipment_flutter/common/edgeInsets_const.dart';
import 'package:special_equipment_flutter/dio/http_utils.dart';
import 'package:special_equipment_flutter/model/day_control_list_sy_bo.dart';
import 'package:special_equipment_flutter/widgets/app_bar/custom_app_bar.dart';
import 'package:special_equipment_flutter/widgets/divider_custom.dart';
///设置的考核列表
class OverseerListPage extends StatefulWidget {
const OverseerListPage({super.key});
@override
State<OverseerListPage> createState() => _OverseerListPageState();
}
class _OverseerListPageState extends State<OverseerListPage> {
final EasyRefreshController _controller = EasyRefreshController();
List<TaskDayList> list = [];
@override
void initState() {
super.initState();
// getData();
}
void getData() {
HttpUtils.getOverseerList(context, '0', '', '').then((value) {
DayControlListSyBo listBo = value;
if (mounted) {
setState(() {
var taskDayList = listBo.taskDayList;
list.clear();
list.addAll(taskDayList!);
_controller.finishRefresh();
});
}
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBarCustom(text: '考核列表', height: 50),
backgroundColor: Colors.grey[100],
body: Column(
children: [
Expanded(
flex: 1,
child: EasyRefresh(
firstRefresh: true,
enableControlFinishRefresh: true,
// enableControlFinishLoad: true,
// firstRefreshWidget: const FirstRefreshWidget(),
// emptyWidget: list.isEmpty
// ? EmptyImgWidget(
// title: '暂无数据,点击刷新',
// onTap: () {
// getData();
// })
// : null,
controller: _controller,
onRefresh: () async {
// page = 1;
// getData();
},
// onLoad: () async {
// page++;
// getList();
// },
child: buildBody(),
)),
],
),
);
}
Column buildBody() {
return Column(
children: [
//文章列表
ListView.separated(
shrinkWrap: true,
padding: const EdgeInsets.symmetric(
horizontal: EdgeInsetsConst.padding_horizontal),
physics: const NeverScrollableScrollPhysics(),
itemBuilder: (BuildContext context, int index) {
return buildItem(index, context);
},
itemCount: 4,
separatorBuilder: (BuildContext context, int index) {
return const SizedBox(
height: 0,
);
},
),
],
);
}
InkWell buildItem(int index, BuildContext context) {
return InkWell(
onTap: () {
// Get.toNamed(RouteString.DAY_INSPECT_SUBMIT_SY,
// arguments: {'argsData': widget.args, 'listBo': list(index)})
// ?.then((value) {
// if (value != null && value) {
// getData();
// }
// });
},
child: buildCard(context, index),
);
}
Card buildCard(BuildContext context, int index) {
return Card(
elevation: 3,
margin: const EdgeInsets.only(left: 0, right: 0, top: 15, bottom: 0),
color: Colors.white,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(5)),
),
child: Container(
padding:
const EdgeInsets.only(left: 10, right: 10, top: 10, bottom: 10),
child: Column(
children: <Widget>[
const Column(
children: [
Text('山西盈中科技有限公司山西盈中科技有限公司',
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 18,
color: Colors.black87)),
Text('2024-05-21',
style: TextStyle(fontSize: 14, color: Colors.grey)),
],
),
///分割线
DividerCustom(Colors.grey[300], 8, 8, 0, 0),
Container(
margin:
const EdgeInsets.only(left: 8, top: 0, right: 0, bottom: 0),
child: const Row(children: [
Text('设备类型:',
style: TextStyle(
fontSize: 14,
color: ColorConst.blueColor,
fontWeight: FontWeight.bold)),
Text('电梯,锅炉', style: TextStyle()),
]),
),
Container(
padding:
const EdgeInsets.only(left: 10, top: 5, right: 5, bottom: 5),
margin:
const EdgeInsets.only(left: 0, top: 10, right: 0, bottom: 0),
decoration: const BoxDecoration(
color: ColorConst.grayf5Color,
borderRadius: BorderRadius.all(Radius.circular(10)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Row(children: [
Text('安全总监:',
style: TextStyle(
fontSize: 14,
color: ColorConst.blueColor,
fontWeight: FontWeight.bold)),
Text('张三,李四', style: TextStyle()),
]),
const SizedBox(height: 5),
Container(
padding: const EdgeInsets.only(
left: 0, top: 0, right: 5, bottom: 0),
child: const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('总题数:20',
style: TextStyle(color: Colors.grey, fontSize: 14)),
Text('单选题数:10',
style: TextStyle(color: Colors.grey, fontSize: 14)),
Text('判断题数:10',
style: TextStyle(color: Colors.grey, fontSize: 14)),
],
),
),
],
),
),
Container(
padding:
const EdgeInsets.only(left: 10, top: 5, right: 5, bottom: 5),
margin:
const EdgeInsets.only(left: 0, top: 10, right: 0, bottom: 0),
decoration: const BoxDecoration(
color: ColorConst.grayf5Color,
borderRadius: BorderRadius.all(Radius.circular(10)),
),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
const Row(children: [
Text('安全员:',
style: TextStyle(
fontSize: 14,
color: ColorConst.blueColor,
fontWeight: FontWeight.bold)),
Text('张三,李四', style: TextStyle()),
]),
const SizedBox(height: 5),
Container(
padding: const EdgeInsets.only(
left: 0, top: 0, right: 5, bottom: 0),
child: const Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('总题数:20',
style: TextStyle(color: Colors.grey, fontSize: 14)),
Text('单选题数:10',
style: TextStyle(color: Colors.grey, fontSize: 14)),
Text('判断题数:10',
style: TextStyle(color: Colors.grey, fontSize: 14)),
],
),
),
],
),
),
const SizedBox(
height: 5,
)
// buildSubmits(context, index),
],
),
),
);
}
}
......@@ -756,6 +756,7 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
}
}
mExamSettingSubmitBo.aqyIds = aqyIds;
mExamSettingSubmitBo.unitId = mOfficeList!.id;
HttpUtils.getExamSettingSubmit(
context, mExamSettingSubmitBo)
.then((value) {
......@@ -763,7 +764,7 @@ class _OverseerSettingsState extends State<OverseerSettingsPage> {
if (mounted) {
setState(() {
ToastUtils.showCenter(bo.msg);
Get.back();
Get.back(result: true);
});
}
});
......
......@@ -62,7 +62,8 @@ class StringUtils {
/// @param pageSize 一页几条
/// @return
static int totalPage(int? count, int? pageSize) {
var pageTotle = (count! / pageSize!).truncate();
//向上取整(返回int)
var pageTotle = (count! / pageSize!).ceil();
return pageTotle;
}
......
......@@ -48,3 +48,9 @@ Future<String> getNetworkTimess() async {
throw Exception('Failed to get time data');
}
}
String timestampToDate(int timestamp) {
var date = DateTime.fromMillisecondsSinceEpoch(timestamp);
var formatter = DateFormat('yyyy-MM-dd HH:mm:ss');
return formatter.format(date);
}
......@@ -135,6 +135,7 @@ flutter:
- assets/examine/pass_icon.png
- assets/examine/no_pass_icon.png
- assets/examine/examine_gary_icon.png
- assets/examine/history_icon.png
# An image asset can refer to one or more resolution-specific "variants", see
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment