Compare commits

..

43 Commits

Author SHA1 Message Date
machuanyu 1fbb102370 Merge branch 'mcy_revision' into job_new_demand 2024-04-17 17:13:53 +08:00
machuanyu a759583ca0 答题轨迹按作业详情 2024-04-17 17:13:24 +08:00
1147192855@qq.com 0c3b3f8719 Merge branch 'main' into job_new_demand 2024-04-17 11:00:28 +08:00
1147192855@qq.com 0cb3d69201 no message 2024-04-17 10:59:45 +08:00
1147192855@qq.com 8b4f38558f 调整隐私政策和用户协议 2024-04-17 10:54:53 +08:00
machuanyu 1494e69b56 Merge branch 'mcy_revision' into job_new_demand 2024-04-17 09:02:07 +08:00
machuanyu fbebdbc428 答题轨迹 2024-04-17 09:01:41 +08:00
1147192855@qq.com 491cad7955 no message 2024-04-16 18:12:48 +08:00
1147192855@qq.com 1697f59d43 no message 2024-04-16 17:49:46 +08:00
1147192855@qq.com dd033fd20f Merge branch 'main' into job_new_demand
# Conflicts:
#	marking_app/lib/pages/mainPage.dart
2024-04-16 17:44:21 +08:00
1147192855@qq.com dc53062556 no message 2024-04-16 17:38:31 +08:00
1147192855@qq.com fb23ba02d1 添加用户协议框和隐私框 2024-04-16 16:16:30 +08:00
machuanyu 21183f11bc Merge branch 'job_new_demand' into mcy_revision
# Conflicts:
#	marking_app/lib/pages/homework_correction/job_home.dart
2024-04-16 13:47:19 +08:00
machuanyu 0c54c16865 答题轨迹 2024-04-16 13:44:34 +08:00
1147192855@qq.com d9adbe845b no message 2024-04-16 12:05:27 +08:00
1147192855@qq.com 4c78d903a1 Merge branch 'main' into job_new_demand
# Conflicts:
#	.gitignore
2024-04-15 18:22:40 +08:00
1147192855@qq.com 727c774ea0 no message 2024-04-15 18:16:52 +08:00
1147192855@qq.com 4e812bc5c0 no message 2024-04-15 15:41:13 +08:00
1147192855@qq.com 6e2010a7cc no message 2024-04-15 14:15:48 +08:00
豌杂 abb0d41d39 no message 2024-04-15 14:04:20 +08:00
machuanyu 42d2e4ab39 历史作业 2024-04-15 13:47:26 +08:00
1147192855@qq.com a614c90458 no message 2024-04-15 13:40:43 +08:00
1147192855@qq.com c43e75fafd 处理无法切换下一题BUG 2024-04-15 11:47:28 +08:00
1147192855@qq.com ecfb2c33b6 更新此次批阅优化问题 2024-04-12 12:20:36 +08:00
machuanyu 994ca04988 Merge branch 'job_new_demand' into mcy_revision 2024-04-12 11:23:53 +08:00
machuanyu e22d5f2655 知识点详情 2024-04-12 11:22:27 +08:00
1147192855@qq.com d5249ba0af 处理异常 2024-04-12 10:03:42 +08:00
1147192855@qq.com 326a2fe99e no message 2024-04-11 17:31:02 +08:00
machuanyu 5cdf645f86 -- 2024-04-11 17:24:00 +08:00
machuanyu 7e3c6882e9 合并代码 2024-04-11 17:19:21 +08:00
machuanyu 794e4d6cbe Merge branch 'mcy_revision' into job_new_demand
# Conflicts:
#	marking_app/lib/routes/RouterManager.dart
2024-04-11 17:18:15 +08:00
machuanyu 991ec9310e 知识点掌握 2024-04-11 17:15:27 +08:00
1147192855@qq.com f63c1ea678 Merge branch 'mcy_revision' of https://gitea.23544.com/marking/Marking.Client.Moblie into job_new_demand 2024-04-11 16:12:27 +08:00
1147192855@qq.com 74c8148305 no message 2024-04-11 15:53:31 +08:00
1147192855@qq.com ee41ad7d1b 添加作业首页 2024-04-11 15:53:04 +08:00
machuanyu aa920d41fa -- 2024-04-11 14:38:40 +08:00
1147192855@qq.com 5a43ccffcf no message 2024-04-11 14:29:27 +08:00
machuanyu 6719526cd2 Merge branch 'mcy_revision' into main 2024-04-11 13:45:33 +08:00
machuanyu 0149e0761f 优先批阅样式修改 2024-04-11 13:44:49 +08:00
1147192855@qq.com 1c17e014a4 no message 2024-04-11 10:59:15 +08:00
machuanyu aca987a4df Merge branch 'mcy_revision' into main 2024-04-11 10:36:13 +08:00
machuanyu 46f4beaf81 优先配置修改 2024-04-11 10:35:37 +08:00
1147192855@qq.com 9db7a540dd no message 2024-04-10 18:49:41 +08:00
68 changed files with 3362 additions and 683 deletions

13
.gitignore vendored
View File

@ -211,3 +211,16 @@ marking_app/lib/common/model/job/job_fav_student.g.dart
marking_app/lib/common/model/job/job_data_report.g.dart marking_app/lib/common/model/job/job_data_report.g.dart
marking_app/lib/common/model/job/job_student_history.g.dart marking_app/lib/common/model/job/job_student_history.g.dart
marking_app/lib/pages/homework_correction/job_personal_detail.g.dart marking_app/lib/pages/homework_correction/job_personal_detail.g.dart
marking_app/lib/common/model/event_bus/jobs/job_do_papers_submit_check_switch_bus.g.dart
marking_app/lib/common/model/event_bus/jobs/job_do_synchro_tab.g.dart
marking_app/lib/pages/homework_correction/widget/top_count.g.dart
marking_app/lib/common/model/event_bus/job_home_refresh_bus.g.dart
marking_app/lib/common/model/job/job_knowledge_points_detail.g.dart
marking_app/lib/common/model/job/job_knowledge_points.g.dart
marking_app/lib/pages/homework_correction/job_knowledge_points.g.dart
marking_app/lib/pages/homework_correction/job_knowledge_points_detail.g.dart
marking_app/lib/common/model/job/job_knowledge_detail_student.g.dart
marking_app/lib/common/model/job/job_knowledge_detail_student.g.dart
marking_app/lib/pages/homework_correction/job_home.g.dart
marking_app/lib/common/model/marking/keyboard_assist_event.g.dart
marking_app/lib/common/model/marking/marking_history_zoom_info.g.dart

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 229 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 467 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 25 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 724 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 286 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 293 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -352,7 +352,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = ""; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 20; CURRENT_PROJECT_VERSION = 21;
DEVELOPMENT_TEAM = CYDU583KN6; DEVELOPMENT_TEAM = CYDU583KN6;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -360,7 +360,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.102; MARKETING_VERSION = 1.0.104;
PRODUCT_BUNDLE_IDENTIFIER = com.example.markingApp; PRODUCT_BUNDLE_IDENTIFIER = com.example.markingApp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -490,7 +490,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = ""; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 20; CURRENT_PROJECT_VERSION = 21;
DEVELOPMENT_TEAM = CYDU583KN6; DEVELOPMENT_TEAM = CYDU583KN6;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -498,7 +498,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.102; MARKETING_VERSION = 1.0.104;
PRODUCT_BUNDLE_IDENTIFIER = com.example.markingApp; PRODUCT_BUNDLE_IDENTIFIER = com.example.markingApp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";
@ -520,7 +520,7 @@
ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES; ASSETCATALOG_COMPILER_INCLUDE_ALL_APPICON_ASSETS = YES;
ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = ""; ASSETCATALOG_COMPILER_LAUNCHIMAGE_NAME = "";
CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_MODULES = YES;
CURRENT_PROJECT_VERSION = 20; CURRENT_PROJECT_VERSION = 21;
DEVELOPMENT_TEAM = CYDU583KN6; DEVELOPMENT_TEAM = CYDU583KN6;
ENABLE_BITCODE = NO; ENABLE_BITCODE = NO;
INFOPLIST_FILE = Runner/Info.plist; INFOPLIST_FILE = Runner/Info.plist;
@ -528,7 +528,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.0.102; MARKETING_VERSION = 1.0.104;
PRODUCT_BUNDLE_IDENTIFIER = com.example.markingApp; PRODUCT_BUNDLE_IDENTIFIER = com.example.markingApp;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
SUPPORTED_PLATFORMS = "iphoneos iphonesimulator"; SUPPORTED_PLATFORMS = "iphoneos iphonesimulator";

View File

@ -0,0 +1,12 @@
import 'package:json_annotation/json_annotation.dart';
part 'job_home_refresh_bus.g.dart';
@JsonSerializable()
class JobHomeRefreshBus extends Object {
JobHomeRefreshBus();
factory JobHomeRefreshBus.fromJson(Map<String, dynamic> srcJson) => _$JobHomeRefreshBusFromJson(srcJson);
Map<String, dynamic> toJson() => _$JobHomeRefreshBusToJson(this);
}

View File

@ -0,0 +1,12 @@
import 'package:json_annotation/json_annotation.dart';
part 'job_do_papers_submit_check_switch_bus.g.dart';
@JsonSerializable()
class JobDoPapersSubmitCheckSwitchBus extends Object {
JobDoPapersSubmitCheckSwitchBus();
factory JobDoPapersSubmitCheckSwitchBus.fromJson(Map<String, dynamic> srcJson) => _$JobDoPapersSubmitCheckSwitchBusFromJson(srcJson);
Map<String, dynamic> toJson() => _$JobDoPapersSubmitCheckSwitchBusToJson(this);
}

View File

@ -0,0 +1,35 @@
import 'package:collection/collection.dart';
import 'package:json_annotation/json_annotation.dart';
import 'package:marking_app/common/model/job/job_page_tab.dart';
part 'job_do_synchro_tab.g.dart';
@JsonSerializable()
class JobDoSynchroTab extends Object {
List<JobPageTab> tabs;
JobDoSynchroTab(this.tabs);
factory JobDoSynchroTab.fromJson(Map<String, dynamic> srcJson) => _$JobDoSynchroTabFromJson(srcJson);
Map<String, dynamic> toJson() => _$JobDoSynchroTabToJson(this);
/// tab下一个tab的pageIndex
int? getNextPageIndex([int? pageIndex]) {
if (pageIndex == null) return null;
var _index = tabs.indexWhere((e) => e.pageIndex == pageIndex);
if (_index == -1) return null;
return _index == tabs.length - 1 ? null : tabs[_index + 1].pageIndex;
}
/// tab上一个tab的pageIndex
int? getPreviousPageIndex([int? pageIndex]) {
if (pageIndex == null) return null;
var _index = tabs.indexWhere((e) => e.pageIndex == pageIndex);
if (_index == -1) return null;
pageIndex = _index == 0 ? null : tabs[_index - 1].pageIndex;
print('这是上一页的数据:${pageIndex}');
return pageIndex;
}
}

View File

@ -0,0 +1,29 @@
import 'package:json_annotation/json_annotation.dart';
part 'job_knowledge_detail_student.g.dart';
@JsonSerializable()
class JobKnowledgeDetailStudent extends Object {
@JsonKey(name: 'studentId')
int studentId;
@JsonKey(name: 'studentName')
String studentName;
@JsonKey(name: 'isAnswer')
bool isAnswer;
@JsonKey(name: 'isCorrect')
bool isCorrect;
JobKnowledgeDetailStudent(this.studentId,this.studentName,this.isAnswer,this.isCorrect,);
factory JobKnowledgeDetailStudent.fromJson(Map<String, dynamic> srcJson) => _$JobKnowledgeDetailStudentFromJson(srcJson);
Map<String, dynamic> toJson() => _$JobKnowledgeDetailStudentToJson(this);
}

View File

@ -0,0 +1,29 @@
import 'package:json_annotation/json_annotation.dart';
part 'job_knowledge_points.g.dart';
@JsonSerializable()
class KnowledgePoints extends Object {
@JsonKey(name: 'knowledgeId')
int knowledgeId;
@JsonKey(name: 'knowledgeName')
String knowledgeName;
@JsonKey(name: 'correctRate')
int correctRate;
@JsonKey(name: 'count')
int count;
KnowledgePoints(this.knowledgeId,this.knowledgeName,this.correctRate,this.count,);
factory KnowledgePoints.fromJson(Map<String, dynamic> srcJson) => _$KnowledgePointsFromJson(srcJson);
Map<String, dynamic> toJson() => _$KnowledgePointsToJson(this);
}

View File

@ -0,0 +1,38 @@
import 'package:json_annotation/json_annotation.dart';
part 'job_knowledge_points_detail.g.dart';
@JsonSerializable()
class KnowledgePointsDetail extends Object {
@JsonKey(name: 'jobId')
int jobId;
@JsonKey(name: 'jobName')
String jobName;
@JsonKey(name: 'publishTime')
String publishTime;
@JsonKey(name: 'questionId')
int questionId;
@JsonKey(name: 'questionNo')
String questionNo;
@JsonKey(name: 'sectionId')
int sectionId;
@JsonKey(name: 'correctRate')
int correctRate;
KnowledgePointsDetail(this.jobId,this.jobName,this.publishTime,this.questionId,this.questionNo,this.sectionId,this.correctRate,);
factory KnowledgePointsDetail.fromJson(Map<String, dynamic> srcJson) => _$KnowledgePointsDetailFromJson(srcJson);
Map<String, dynamic> toJson() => _$KnowledgePointsDetailToJson(this);
}

View File

@ -18,17 +18,20 @@ class MarkingTextQuestionJobTabParams extends Object {
@JsonKey(name: 'studentId') @JsonKey(name: 'studentId')
int? studentId; int? studentId;
@JsonKey(name: 'defaultFirst')
bool? isDefaultFirst;
MarkingTextQuestionJobTabParams({ MarkingTextQuestionJobTabParams({
required this.taskId, required this.taskId,
required this.pageIndex, required this.pageIndex,
this.isDefaultFirst,
this.paperId, this.paperId,
this.studentId, this.studentId,
this.nextPageIndex, this.nextPageIndex,
this.previousPageIndex, this.previousPageIndex,
}); });
factory MarkingTextQuestionJobTabParams.fromJson(Map<String, dynamic> srcJson) => factory MarkingTextQuestionJobTabParams.fromJson(Map<String, dynamic> srcJson) => _$MarkingTextQuestionJobTabParamsFromJson(srcJson);
_$MarkingTextQuestionJobTabParamsFromJson(srcJson);
Map<String, dynamic> toJson() => _$MarkingTextQuestionJobTabParamsToJson(this); Map<String, dynamic> toJson() => _$MarkingTextQuestionJobTabParamsToJson(this);
} }

View File

@ -1,18 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'keyboard_assist_event.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
KeyboardAssistEvent _$KeyboardAssistEventFromJson(Map<String, dynamic> json) =>
KeyboardAssistEvent(
openAuxiliary: json['openAuxiliary'] as bool? ?? false,
);
Map<String, dynamic> _$KeyboardAssistEventToJson(
KeyboardAssistEvent instance) =>
<String, dynamic>{
'openAuxiliary': instance.openAuxiliary,
};

View File

@ -1,27 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'marking_history_zoom_info.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
MarkingHistoryZoomInfo _$MarkingHistoryZoomInfoFromJson(
Map<String, dynamic> json) =>
MarkingHistoryZoomInfo(
markingUserId: json['markingUserId'] as int,
questionNum: json['questionNum'] as String,
scale: (json['scale'] as num).toDouble(),
positionY: (json['positionY'] as num).toDouble(),
positionX: (json['positionX'] as num).toDouble(),
);
Map<String, dynamic> _$MarkingHistoryZoomInfoToJson(
MarkingHistoryZoomInfo instance) =>
<String, dynamic>{
'markingUserId': instance.markingUserId,
'questionNum': instance.questionNum,
'scale': instance.scale,
'positionY': instance.positionY,
'positionX': instance.positionX,
};

View File

@ -15,7 +15,7 @@ part 'marking_list_params.g.dart';
@JsonSerializable() @JsonSerializable()
class MarkingListParams extends BasePage { class MarkingListParams extends BasePage {
@JsonKey(name: 'isFinish') @JsonKey(name: 'isFinish')
bool isFinish; bool? isFinish;
// //
@JsonKey(name: 'PageType') @JsonKey(name: 'PageType')
@ -27,7 +27,7 @@ class MarkingListParams extends BasePage {
int? markingType; // 1 2 int? markingType; // 1 2
MarkingListParams({ MarkingListParams({
required this.isFinish, this.isFinish,
required this.pageType, required this.pageType,
required page, required page,
required limit, required limit,

View File

@ -0,0 +1,251 @@
import 'dart:convert';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:marking_app/common/config/request_config.dart';
import 'package:marking_app/common/mixin/common.dart';
import 'package:marking_app/common/model/common/base_page_data.dart';
import 'package:marking_app/common/model/common/base_structure_result.dart';
import 'package:marking_app/common/model/job/job_student_goups.dart';
import 'package:marking_app/common/model/job/job_task_item.dart';
import 'package:marking_app/common/model/marking/marking_list_params.dart';
import 'package:marking_app/components/ReturnToHomepage.dart';
import 'package:marking_app/pages/homework_correction/widget/answer_trajectory_job.dart';
import 'package:marking_app/pages/homework_correction/widget/student_group_list.dart';
import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/fast_data.dart';
import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/my_text.dart';
import 'package:marking_app/utils/request/rest_client.dart';
class AnswerTrajectory extends StatefulWidget {
const AnswerTrajectory({Key? key}) : super(key: key);
@override
State<AnswerTrajectory> createState() => _AnswerTrajectoryState();
}
class _AnswerTrajectoryState extends State<AnswerTrajectory>
with CommonMixin, SingleTickerProviderStateMixin {
late final EasyRefreshController refreshController;
late final EasyRefreshController refreshController2;
late String loginName;
List studentGroups = [];
List<JobTaskItem> jobList = [];
late TabController tabController;
int tabIndex = 0;
int page = 1;
int pageSize = 10;
int total = 0;
@override
void initState() {
super.initState();
refreshController = EasyRefreshController();
refreshController2 = EasyRefreshController();
tabController =
TabController(initialIndex: tabIndex, length: 2, vsync: this);
FastData fastData = FastData.getInstance();
fastData.getUser().then((value) {
if (value == null || value == '') return;
Map<String, dynamic> userInfo = json.decode(value);
setState(() {
loginName = userInfo['loginName'];
});
getStudentGroups();
getWorkList();
print(userInfo);
});
}
void getStudentGroups() async {
RestClient _client = await getClient();
BaseStructureResult<List<JobStudentGroups>> res =
await _client.getJobLevelStudentGroups(loginName);
setState(() {
if (res.code == 200) {
studentGroups = res.data!;
} else {
studentGroups = [];
}
});
refreshController.finishRefresh();
EasyLoading.dismiss();
}
void goNextPage(id, title) {
RouterManager.router.navigateTo(context,
'${RouterManager.jobPriorityReviewSetPath}?&groupId=$id&title=${Uri.encodeComponent(title)}&page=answerTrajectory',
transition: getTransition());
}
void getWorkList() async {
final MarkingListParams params = MarkingListParams(
page: page,
limit: pageSize,
pageType: 0,
markingType: 1,
);
print('params=${params.limit}&page=${params.page}');
RestClient client = await getClient();
BaseStructureResult<BasePageData<JobTaskItem>> res =
await client.getJobsByPage(params);
List<JobTaskItem> arr = [];
if (res.success) {
if (page == 1) {
arr = res.data!.items;
} else {
arr = [...jobList, ...res.data!.items];
}
total = res.data!.total;
} else {
jobList = [];
}
jobList = arr;
setState(() {});
print('total=${res.data!.total}');
refreshController2.finishRefresh();
EasyLoading.dismiss();
}
@override
void dispose() {
super.dispose();
refreshController.dispose();
refreshController2.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromRGBO(245, 245, 245, 1),
appBar: AppBar(
backgroundColor: Colors.white,
title: Text(
'答题轨迹',
style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)),
),
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
),
actions: [
ReturnToHomepage(),
],
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(
height: 10.r,
),
Container(
padding: EdgeInsets.symmetric(horizontal: 14.r),
decoration: BoxDecoration(
border: Border(
bottom: BorderSide(width: 1.r, color: Color(0xFFCCCCCC)))),
child: TabBar(
onTap: (int val) {
print(val);
setState(() {
tabIndex = val;
});
/*EasyLoading.show(status: 'loading...');
if(val == 0){
getStudentGroups();
}*/
},
tabs: [
SizedBox(
width: (MediaQuery.of(context).size.width - 28.r) / 2,
child: Tab(
text: '按学生',
),
),
SizedBox(
width: (MediaQuery.of(context).size.width - 28.r) / 2,
child: Tab(
text: '按作业',
),
)
],
controller: tabController,
unselectedLabelStyle:
TextStyle(fontSize: 14.sp, color: Color(0xFF666666)),
labelStyle: TextStyle(
fontSize: 14.sp,
color: Color(0xFF6888FD),
),
isScrollable: true,
labelColor: Color(0xFF6888FD),
unselectedLabelColor: Color(0xFF666666),
indicatorSize: TabBarIndicatorSize.label,
labelPadding: const EdgeInsets.all(0),
),
),
Expanded(
child: Padding(
padding:
EdgeInsets.only(top: 15.r, left: 14.r, right: 14.r),
child:
tabIndex == 0
?
EasyRefresh(
firstRefresh: false,
taskIndependence: true,
controller: refreshController,
header: MaterialHeader(),
footer: TaurusFooter(),
onRefresh: () async {
getStudentGroups();
},
child: StudentGroupList(studentGroups, goNextPage,
rightBtn: Container(
margin: EdgeInsets.only(left: 5.r),
height: 20.r,
width: 55.r,
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(20.r)),
border: Border.all(
width: 1.r, color: Color(0xFFFF9800)),
),
child: Center(
child: Text(
'详情',
style: TextStyle(
fontSize: 10.sp, color: Color(0xFFFF9800)),
),
),
)),
):EasyRefresh(
firstRefresh: false,
taskIndependence: true,
controller: refreshController2,
header: MaterialHeader(),
footer: TaurusFooter(),
onRefresh: () async {
page = 1;
setState(() {});
getWorkList();
},
onLoad: () async {
if (jobList.length < total) {
EasyLoading.show(status: 'loading...');
page = page + 1;
getWorkList();
}
},
child:AnswerTrajectoryJob(jobList)),
),
)
],
),
);
}
}

View File

@ -0,0 +1,279 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:marking_app/common/mixin/common.dart';
import 'package:marking_app/common/model/common/base_structure_result.dart';
import 'package:marking_app/common/model/job/job_concerned_with_student.dart';
import 'package:marking_app/common/model/job/job_concerned_with_student_params.dart';
import 'package:marking_app/common/model/job/job_task_item.dart';
import 'package:marking_app/components/ReturnToHomepage.dart';
import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/request/rest_client.dart';
class AnswerTrajectoryJobDetail extends StatefulWidget {
final int jobId;
final String jobName;
final String genderName;
const AnswerTrajectoryJobDetail(
{Key? key,
required this.jobId,
required this.jobName,
required this.genderName})
: super(key: key);
@override
State<AnswerTrajectoryJobDetail> createState() =>
_AnswerTrajectoryJobDetailState();
}
class _AnswerTrajectoryJobDetailState extends State<AnswerTrajectoryJobDetail>
with CommonMixin {
List<MarkingTasks> markList = [];
late MarkingTasks currentClass;
List<JobConcernedWithStudent> students = [];
late final EasyRefreshController refreshController;
@override
void initState() {
super.initState();
refreshController = EasyRefreshController();
EasyLoading.show(status: 'loading...');
getData();
}
void getData() async {
RestClient _client = await getClient();
BaseStructureResult<List<MarkingTasks>> res =
await _client.getJobListParticipateInClass(widget.jobId);
if (res.success) {
setState(() {
markList = res.data!;
if (markList.length > 0) {
currentClass = markList[0];
getStudentList();
}
});
}
}
void getStudentList() async {
RestClient _client = await getClient();
BaseStructureResult<List<JobConcernedWithStudent>> res =
await _client.getJobWithStudents(JobConcernedWithStudentParams([currentClass.id]));
if (res.success) {
setState(() {
students = res.data!;
});
}
refreshController.finishRefresh();
EasyLoading.dismiss();
}
@override
void dispose() {
super.dispose();
refreshController.dispose();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFF5F5F5),
appBar: AppBar(
centerTitle: true,
backgroundColor: Colors.white,
title: Text(
widget.jobName,
style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)),
overflow: TextOverflow.ellipsis,
),
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
),
actions: [
ReturnToHomepage(),
],
),
body: Column(
children: [
SizedBox(
height: 10.r,
),
if (markList.length > 0)
Padding(
padding: EdgeInsets.symmetric(horizontal: 14.r),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
SingleChildScrollView(
scrollDirection: Axis.horizontal,
child: Row(
children: List.generate(markList.length, (index) {
MarkingTasks item = markList[index];
return InkWell(
onTap: (){
if(currentClass.id != item.id){
EasyLoading.show(status: 'loading...');
setState(() {
currentClass = item;
});
getStudentList();
}
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5.r, horizontal: 10.r),
margin: EdgeInsets.only(
right: index < markList.length ? 8.r : 0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(4.r),
),
child: Center(
child: Text(
'${widget.genderName}${item.className}',
style: TextStyle(
fontSize: 10.sp,
color: currentClass.id == item.id
? Color(0xFF6888FD)
: Color(0xFF686868)),
),
),
),
);
})),
),
],
),
),
SizedBox(
height: 10.r,
),
Container(
height: 1.r,
color: Color(0xFFCCCCCC),
),
students.length>0? Expanded(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r),
child: EasyRefresh(
firstRefresh: true,
taskIndependence: true,
controller: refreshController,
header: MaterialHeader(),
footer: TaurusFooter(),
onRefresh: () async {
getStudentList();
},
child: students.length > 0
? isPad()
? GridView(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 10.r,
crossAxisSpacing: 10.r,
childAspectRatio: 556 / 112,
),
children: List.generate(students.length, (index) {
var item = students[index];
return InkWell(
onTap: (){
RouterManager.router.navigateTo(context,
'${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.r),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
item.studentName,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6888FD)),
)),
Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
border: Border.all(width: 1.r,color: Color(0xFFFFA41E)),
borderRadius: BorderRadius.all(Radius.circular(20.r)),
),
child: Center(child: Text('详情',style: TextStyle(fontSize: 10.r,color: Color(0xFFFFA41E))),
)),
],
),
),
);
}),
)
: ListView.builder(
itemBuilder: (context, index) {
var item = students[index];
return InkWell(
onTap: (){
RouterManager.router.navigateTo(context,
'${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
},
child: Container(
padding: EdgeInsets.symmetric(
vertical: 20.r, horizontal: 15.r),
margin: EdgeInsets.only(bottom: 15.r),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
item.studentName,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6888FD)),
)),
Container(
height: 24.r,
width: 72.r,
decoration: BoxDecoration(
border: Border.all(width: 1.r,color: Color(0xFFFFA41E)),
borderRadius: BorderRadius.all(Radius.circular(20.r)),
),
child: Center(child: Text('详情',style: TextStyle(fontSize: 10.r,color: Color(0xFFFFA41E))),
)),
],
),
),
);
},
itemCount: students.length,
)
: MyEmptyWidget(),
),
),
):MyEmptyWidget(),
],
),
);
}
}

View File

@ -1,4 +1,5 @@
import 'dart:async'; import 'dart:async';
import 'dart:convert';
import 'package:collection/collection.dart'; import 'package:collection/collection.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -10,6 +11,8 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:marking_app/common/mixin/common.dart'; import 'package:marking_app/common/mixin/common.dart';
import 'package:marking_app/common/model/common/base_structure_result.dart'; import 'package:marking_app/common/model/common/base_structure_result.dart';
import 'package:marking_app/common/model/event_bus/jobs/job_do_papers_student_bus.dart'; import 'package:marking_app/common/model/event_bus/jobs/job_do_papers_student_bus.dart';
import 'package:marking_app/common/model/event_bus/jobs/job_do_papers_submit_check_switch_bus.dart';
import 'package:marking_app/common/model/event_bus/jobs/job_do_synchro_tab.dart';
import 'package:marking_app/common/model/job/job_concerned_with_student.dart'; import 'package:marking_app/common/model/job/job_concerned_with_student.dart';
import 'package:marking_app/common/model/job/job_concerned_with_student_params.dart'; import 'package:marking_app/common/model/job/job_concerned_with_student_params.dart';
import 'package:marking_app/common/model/job/job_do_marking_status_info.dart'; import 'package:marking_app/common/model/job/job_do_marking_status_info.dart';
@ -22,6 +25,7 @@ import 'package:marking_app/pages/common/event_bus_mixin.dart';
import 'package:marking_app/pages/homework_correction/components/new_version_of_homework/bottom_annotation_switch_job.dart'; import 'package:marking_app/pages/homework_correction/components/new_version_of_homework/bottom_annotation_switch_job.dart';
import 'package:marking_app/pages/homework_correction/eventBus/marking_text_question_job_tab_params_bus.dart'; import 'package:marking_app/pages/homework_correction/eventBus/marking_text_question_job_tab_params_bus.dart';
import 'package:marking_app/pages/homework_correction/providers/drawing_provider.dart'; import 'package:marking_app/pages/homework_correction/providers/drawing_provider.dart';
import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/index.dart'; import 'package:marking_app/utils/index.dart';
// utils // utils
@ -147,7 +151,6 @@ class ReviewStatusInfo extends HookWidget with CommonMixin {
if (doMarkingInfo.value == null) return Container(); if (doMarkingInfo.value == null) return Container();
return InkWell( return InkWell(
onTap: () async { onTap: () async {
print('点击了...');
List<JobConcernedWithStudent>? students = await getStudents(); List<JobConcernedWithStudent>? students = await getStudents();
if (students == null) return; if (students == null) return;
students = students..sort((e, e1) => e.studentName.compareTo(e1.studentName)); students = students..sort((e, e1) => e.studentName.compareTo(e1.studentName));
@ -228,17 +231,18 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
UseSwitchStudentAndType _useSwitchStudentAndType = UseSwitchStudentAndType.use(); // UseSwitchStudentAndType _useSwitchStudentAndType = UseSwitchStudentAndType.use(); //
// tab改变时 // tab改变时
useValueChanged<JobPageTab?, String>(_useSwitchStudentAndType.currentTab.value, (_, __) { useValueChanged<List<JobPageTab>?, String>(_useSwitchStudentAndType.tabs.value, (_, __) {
_useSwitchStudentAndType.eventFire(model: JobDoSynchroTab(_useSwitchStudentAndType.tabs.value));
});
// tab改变时
useValueChanged<JobPageTab?, String>(_useSwitchStudentAndType.currentTab.value, (_oldValue, __) {
var thePageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex; var thePageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex;
JobDoPapersStudentBus? studentBus = _useSwitchStudentAndType.studentBusInfo.value; JobDoPapersStudentBus? studentBus = _useSwitchStudentAndType.studentBusInfo.value;
if (studentBus != null && studentBus.pageIndex == thePageIndex) return; // if (studentBus != null && studentBus.pageIndex == thePageIndex) return; //
if (thePageIndex != null) { if (thePageIndex != null) {
_useSwitchStudentAndType.getDataForStudents(taskId: taskId, pageIndex: thePageIndex); _useSwitchStudentAndType.getDataForStudents(taskId: taskId, pageIndex: thePageIndex);
int indexLocated = _useSwitchStudentAndType.tabs.value.indexWhere((element) => element.pageIndex == thePageIndex); _useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex));
_useSwitchStudentAndType.eventFire(
model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex,
nextPageIndex: _useSwitchStudentAndType.getNextPageIndex(indexLocated),
previousPageIndex: _useSwitchStudentAndType.getPreviousPageIndex(indexLocated)));
} }
}); });
useValueChanged<JobConcernedWithStudent?, String>(_useSwitchStudentAndType.currentStudent.value, (oldData, __) { useValueChanged<JobConcernedWithStudent?, String>(_useSwitchStudentAndType.currentStudent.value, (oldData, __) {
@ -247,15 +251,8 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
if (studentBus != null && studentBus.studentId == studentId) return; // if (studentBus != null && studentBus.studentId == studentId) return; //
var thePageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex; var thePageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex;
if (thePageIndex != null) // if (thePageIndex != null) {
{ _useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex, studentId: studentId));
int indexLocated = _useSwitchStudentAndType.tabs.value.indexWhere((element) => element.pageIndex == thePageIndex);
_useSwitchStudentAndType.eventFire(
model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex,
studentId: studentId,
nextPageIndex: _useSwitchStudentAndType.getNextPageIndex(indexLocated),
previousPageIndex: _useSwitchStudentAndType.getPreviousPageIndex(indexLocated)),
);
} }
}); });
@ -289,6 +286,29 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
_useSwitchStudentAndType.currentTab.value = _useSwitchStudentAndType.currentTab.value =
_useSwitchStudentAndType.tabs.value.firstWhere((element) => moldeParams.pageIndex == element.pageIndex); _useSwitchStudentAndType.tabs.value.firstWhere((element) => moldeParams.pageIndex == element.pageIndex);
break; break;
case JobDoPapersSubmitCheckSwitchBus: //
var _currentTab = _useSwitchStudentAndType.currentTab.value;
var _pageIndex = _currentTab?.pageIndex;
if (_currentTab == null || _pageIndex == null) return;
_useSwitchStudentAndType.refreshQuestionTypeData(context, taskId: taskId, exitCallback: exitCallback, getNewData: false).then((value) {
var params = MarkingTextQuestionJobTabParamsBus(taskId, _pageIndex);
if (_currentTab.finishCount < _currentTab.total) {
if (_currentTab.finishCount + 1 == _currentTab.total) {
var _currentTabNew =
_useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.pageIndex != _currentTab.pageIndex && e.finishCount != e.total);
//
if (_currentTabNew != null) params.pageIndex = _currentTabNew.pageIndex;
}
var _theCurrentPage = _useSwitchStudentAndType.tabs.value.firstWhereOrNull((element) => element.pageIndex == _pageIndex);
if (_theCurrentPage != null) {
_theCurrentPage.finishCount += 1;
_useSwitchStudentAndType.tabs.value = _useSwitchStudentAndType.tabs.value.map((e) => JobPageTab.fromJson(e.toJson())).toList();
}
}
_useSwitchStudentAndType.eventFire(model: params);
});
break;
default: default:
} }
}, },
@ -297,9 +317,6 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
_useSwitchStudentAndType.eventCancel(); _useSwitchStudentAndType.eventCancel();
}; };
}, []); }, []);
var _currentTab = _useSwitchStudentAndType.currentTab.value;
return Container( return Container(
padding: EdgeInsets.only(bottom: 2.r, left: 12.r, right: 12.r), padding: EdgeInsets.only(bottom: 2.r, left: 12.r, right: 12.r),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -348,7 +365,7 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
), ),
Expanded(flex: 1, child: SizedBox()), Expanded(flex: 1, child: SizedBox()),
Expanded( Expanded(
flex: 5, flex: 4,
child: Container( child: Container(
padding: EdgeInsets.only(left: 10.w), padding: EdgeInsets.only(left: 10.w),
decoration: BoxDecoration( decoration: BoxDecoration(
@ -384,12 +401,13 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
), ),
Expanded(flex: 1, child: SizedBox()), Expanded(flex: 1, child: SizedBox()),
Expanded( Expanded(
flex: 4, flex: isPad() ? 4 : 5,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
if (_useSwitchStudentAndType.isFinish.value && _currentTab?.finishCount != _currentTab?.total) if (_useSwitchStudentAndType.isFinish.value &&
_useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.finishCount < e.total) != null)
Expanded( Expanded(
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
@ -401,10 +419,8 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
onTap: () => easyThrottle( onTap: () => easyThrottle(
'DO_PAPERS_JOB_CONTINUE_TO_REVIEW', 'DO_PAPERS_JOB_CONTINUE_TO_REVIEW',
() { () {
var _pageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex; var _currentTabNew = _useSwitchStudentAndType.tabs.value.firstWhere((e) => e.finishCount < e.total);
if (_pageIndex == null) return; _useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, _currentTabNew.pageIndex));
_useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, _pageIndex));
}, },
), ),
child: quickText( child: quickText(
@ -418,6 +434,30 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
], ],
), ),
), ),
Expanded(
child: InkWell(
onTap: () => easyThrottle('DO_PAPERS_JOB_HISTORICAL_HOMEWORK', () {
JobConcernedWithStudent? _studentModel = _useSwitchStudentAndType.currentStudent.value;
if (_studentModel == null) return;
String url =
'${RouterManager.jobPersonalDetailPath}?studentId=${_studentModel.studentId}&studentName=${Uri.encodeComponent(_studentModel.studentName)}';
RouterManager.router.navigateTo(context, url, transition: getTransition());
}),
child: Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Icon(Icons.location_history, size: 12.sp, color: Color.fromRGBO(104, 103, 103, 1)),
SizedBox(width: 1.w),
quickText(
'历史作业',
size: 10.sp,
decoration: TextDecoration.underline,
color: Theme.of(context).primaryColor.withOpacity(0.8),
),
],
),
),
),
Stack( Stack(
alignment: const FractionalOffset(0.52, 0.24), alignment: const FractionalOffset(0.52, 0.24),
children: [ children: [
@ -429,49 +469,8 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
quickText('优先', size: 4.sp, color: Colors.white), quickText('优先', size: 4.sp, color: Colors.white),
], ],
), ),
SizedBox(width: 1.2.w),
quickText(
'优先批阅',
size: 10.sp,
color: _useSwitchStudentAndType.isFirst.value ? Color.fromRGBO(76, 199, 147, 1) : Color.fromRGBO(164, 164, 164, 1),
),
], ],
), ),
// InkWell(
// onTap: () => easyThrottle(
// 'prioritize_homework_review',
// () => !_useSwitchStudentAndType.isFirst.value
// ? _useSwitchStudentAndType.jobPriorityReviewJoin(jobId)
// : _useSwitchStudentAndType.jobPriorityReviewCancel(jobId)),
// child:
// Row(
// crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.start,
// children: [
// Stack(
// alignment: const FractionalOffset(0.52, 0.24),
// children: [
// Icon(
// const IconData(0xe63d, fontFamily: "AlibabaIcon"),
// size: 12.sp,
// color: _useSwitchStudentAndType.isFirst.value
// ? Color.fromRGBO(76, 199, 147, 1)
// : Color.fromRGBO(164, 164, 164, 1),
// ),
// quickText('优先', size: 4.sp, color: Colors.white),
// ],
// ),
// SizedBox(width: 1.2.w),
// quickText(
// '优先批阅',
// size: 10.sp,
// color: _useSwitchStudentAndType.isFirst.value
// ? Color.fromRGBO(76, 199, 147, 1)
// : Color.fromRGBO(164, 164, 164, 1),
// ),
// ],
// ),
// ),
), ),
], ],
), ),
@ -491,7 +490,9 @@ class ExamPaperAndScoringView extends StatefulHookConsumerWidget {
class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringView> with EventBusMixin, CommonMixin { class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringView> with EventBusMixin, CommonMixin {
final GlobalKey<JobPictureOverviewState> scaffoldKeyPictureOverview = GlobalKey<JobPictureOverviewState>(); final GlobalKey<JobPictureOverviewState> scaffoldKeyPictureOverview = GlobalKey<JobPictureOverviewState>();
Future<MarkingTextQuestionJob?>? _future; // Future<MarkingTextQuestionJob?>? _future; //
MarkingTextQuestionJob? theJobData;
bool firstLoading = true; bool firstLoading = true;
JobDoSynchroTab? synchroTabs;
late RemoveListener _doJobObtainGradingDataProviderListener; // late RemoveListener _doJobObtainGradingDataProviderListener; //
@override @override
@ -505,15 +506,30 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
eventOn(callback: (eventVal) { eventOn(callback: (eventVal) {
switch (eventVal.runtimeType) { switch (eventVal.runtimeType) {
case MarkingTextQuestionJobTabParamsBus: case MarkingTextQuestionJobTabParamsBus:
MarkingTextQuestionJobTabParamsBus theEventVal = eventVal as MarkingTextQuestionJobTabParamsBus; var theEventVal = eventVal as MarkingTextQuestionJobTabParamsBus;
bool? isDefaultFirst;
if (theJobData != null) {
isDefaultFirst = theJobData!.pageIndex == theEventVal.pageIndex ? null : theJobData!.pageIndex < theEventVal.pageIndex;
} else {
if (synchroTabs?.tabs.isNotEmpty ?? false) {
var _theTab = synchroTabs?.tabs.firstWhereOrNull((e) => e.pageIndex == theEventVal.pageIndex);
if (_theTab != null && _theTab.finishCount == _theTab.total) {
isDefaultFirst = false;
}
}
}
ref.read(doJobObtainGradingDataProvider.notifier).setVal(MarkingTextQuestionJobTabParams( ref.read(doJobObtainGradingDataProvider.notifier).setVal(MarkingTextQuestionJobTabParams(
pageIndex: theEventVal.pageIndex, pageIndex: theEventVal.pageIndex,
taskId: theEventVal.taskId, taskId: theEventVal.taskId,
studentId: theEventVal.studentId, studentId: theEventVal.studentId,
previousPageIndex: theEventVal.previousPageIndex, previousPageIndex: theEventVal.previousPageIndex,
nextPageIndex: theEventVal.nextPageIndex, nextPageIndex: theEventVal.nextPageIndex,
isDefaultFirst: isDefaultFirst,
)); ));
break; break;
case JobDoSynchroTab:
synchroTabs = eventVal as JobDoSynchroTab;
break;
default: default:
} }
}); });
@ -536,9 +552,10 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
BaseStructureResult<MarkingTextQuestionJob> _result = await _client.getJobTabOfExam(params); BaseStructureResult<MarkingTextQuestionJob> _result = await _client.getJobTabOfExam(params);
if (_result.success) { if (_result.success) {
var jobDetails = _result.data; var jobDetails = _result.data;
theJobData = jobDetails;
if (jobDetails != null) { if (jobDetails != null) {
jobDetails.previousPageIndex = params.previousPageIndex; jobDetails.previousPageIndex = synchroTabs?.getPreviousPageIndex(jobDetails.pageIndex);
jobDetails.nextPageIndex = params.nextPageIndex; jobDetails.nextPageIndex = synchroTabs?.getNextPageIndex(jobDetails.pageIndex);
// //
try { try {
// //
@ -577,6 +594,14 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
nextPageIndex: jobData.nextPageIndex, nextPageIndex: jobData.nextPageIndex,
previousPageIndex: jobData.previousPageIndex, previousPageIndex: jobData.previousPageIndex,
); );
if (jobData.nextId == 0 && (synchroTabs?.tabs.isNotEmpty ?? false)) {
var _pageIndex = jobData.pageIndex;
var _tabIndex = synchroTabs!.tabs.indexWhere((e) => e.pageIndex == _pageIndex);
if (_tabIndex != -1 && _tabIndex + 1 <= synchroTabs!.tabs.length - 1) {
model.isDefaultFirst = true;
}
}
if (model.paperId == 0 && jobData.nextPageIndex != null) { if (model.paperId == 0 && jobData.nextPageIndex != null) {
// //
model.paperId = null; model.paperId = null;
@ -593,6 +618,15 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
nextPageIndex: jobData.nextPageIndex, nextPageIndex: jobData.nextPageIndex,
previousPageIndex: jobData.previousPageIndex, previousPageIndex: jobData.previousPageIndex,
); );
if (jobData.prevId == 0 && (synchroTabs?.tabs.isNotEmpty ?? false)) {
var _pageIndex = jobData.pageIndex;
var _tabIndex = synchroTabs!.tabs.indexWhere((e) => e.pageIndex == _pageIndex);
if (_tabIndex != -1 && _tabIndex - 1 >= 0 && _tabIndex - 1 <= synchroTabs!.tabs.length - 1) {
model.isDefaultFirst = false;
}
}
if (model.paperId == 0 && jobData.previousPageIndex != null) { if (model.paperId == 0 && jobData.previousPageIndex != null) {
model.paperId = null; model.paperId = null;
model.pageIndex = jobData.previousPageIndex!; model.pageIndex = jobData.previousPageIndex!;
@ -627,8 +661,6 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
final double containerHeight = constraints.maxHeight; // final double containerHeight = constraints.maxHeight; //
if (jobData == null) return Container(); // if (jobData == null) return Container(); //
// print('容器宽度:${containerWidth};容器高度:${containerHeight}');
return Stack( return Stack(
children: [ children: [
JobPictureOverview( JobPictureOverview(
@ -700,12 +732,10 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
child: (jobData?.questions ?? []).isEmpty child: (jobData?.questions ?? []).isEmpty
? null ? null
: $ExamPaperAndScoringKeyboardView( : $ExamPaperAndScoringKeyboardView(
data: jobData!, data: jobData,
questions: questions, questions: questions,
toNextQuestionCall: () => switchTestQuestions(jobData: jobData), toNextQuestionCall: () => switchTestQuestions(jobData: jobData),
switchQuestionTypes: () { switchQuestionTypes: () => eventFire(model: JobCheckSwitchingQuestionTabBus(jobData.pageIndex)),
eventFire(model: JobCheckSwitchingQuestionTabBus(jobData.pageIndex));
},
viewHomeworkNotes: (JobReviewQuestions subJobQuestion) { viewHomeworkNotes: (JobReviewQuestions subJobQuestion) {
var _theBusModel = var _theBusModel =
JobNotesViewBus(taskId: jobData.taskId, paperId: jobData.paperId, questionNo: subJobQuestion.questionNo); JobNotesViewBus(taskId: jobData.taskId, paperId: jobData.paperId, questionNo: subJobQuestion.questionNo);
@ -756,7 +786,8 @@ Widget $examPaperAndScoringKeyboardView(
return; return;
} }
// //
toNextQuestionCall(); // toNextQuestionCall();
_useDoScoring.eventFire(model: JobDoPapersSubmitCheckSwitchBus());
}); });
} }
@ -824,7 +855,12 @@ Widget $examPaperAndScoringKeyboardView(
if (question.accuracy > 0) if (question.accuracy > 0)
Padding( Padding(
padding: EdgeInsets.only(bottom: 1.5.h), padding: EdgeInsets.only(bottom: 1.5.h),
child: quickText('正确率:${question.accuracy}%', size: 8.sp, color: Colors.white, align: TextAlign.end), child: quickText(
'正确率:${getDoubleRemoveZero(question.accuracy, question.accuracy.toString())}%',
size: 8.sp,
color: Colors.white,
align: TextAlign.end,
),
) )
], ],
), ),
@ -1027,7 +1063,7 @@ Widget $examPaperAndScoringKeyboardView(
} }
@swidget @swidget
Widget $materialBtn({required Widget child, Color? bgc, Color? splashColor, GestureTapCallback? onTap, BorderRadius? borderRadius}) { Widget $materialBtn({required Widget child, Color? bgc, Color? splashColor, GestureTapCallback? onTap, BorderRadiusGeometry? borderRadius}) {
return Material( return Material(
color: bgc, color: bgc,
borderRadius: borderRadius, borderRadius: borderRadius,

View File

@ -82,8 +82,8 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
RestClient client = await getClient(); RestClient client = await getClient();
BaseStructureResult<List<JobPageTab>> result = await client.getJobOfTabs(taskId); BaseStructureResult<List<JobPageTab>> result = await client.getJobOfTabs(taskId);
if (result.success && result.data != null) { if (result.success && result.data != null) {
tabs.value = result.data!;
if (synchronization) { if (synchronization) {
tabs.value = result.data!;
currentTab.value = tabs.value.firstWhere((e) => e.finishCount < e.total, orElse: () => tabs.value[0]); currentTab.value = tabs.value.firstWhere((e) => e.finishCount < e.total, orElse: () => tabs.value[0]);
} }
} else { } else {
@ -99,8 +99,12 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
} }
/// tab类型数据 /// tab类型数据
Future<JobPageTab?> refreshQuestionTypeData(BuildContext context, {required int taskId, required Function() exitCallback}) async { Future<JobPageTab?> refreshQuestionTypeData(BuildContext context,
List<JobPageTab>? tabDatas = await getDataForTestpaper(taskId: taskId, synchronization: false); {required int taskId, required Function() exitCallback, bool getNewData = true}) async {
List<JobPageTab>? tabDatas = tabs.value;
if (getNewData) {
tabDatas = await getDataForTestpaper(taskId: taskId, synchronization: false);
}
if (tabDatas?.isNotEmpty ?? false) { if (tabDatas?.isNotEmpty ?? false) {
JobPageTab? tabJob = tabDatas!.firstWhereOrNull((e) => e.finishCount < e.total); JobPageTab? tabJob = tabDatas!.firstWhereOrNull((e) => e.finishCount < e.total);
if (tabJob == null && !exitPromptFlag.value) { if (tabJob == null && !exitPromptFlag.value) {
@ -121,61 +125,29 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
exitPromptFlag.value = true; exitPromptFlag.value = true;
return tabJob; // return tabJob; //
} }
exitCallback(); exitCallback();
} else { } else {
// //
/** if (!getNewData) return tabJob;
*
var continueFlag = await showDialog<bool>(
context: context,
builder: (BuildContext context1) {
return AlertDialog(
title: quickText('页码跳转提示'),
content: Text('当前页:${currentTab.value?.pageIndex} 已批阅完成,是否跳转到页码:${tabJob.pageIndex}继续批阅?'),
actions: <Widget>[
TextButton(
child: Text(''),
onPressed: () {
Navigator.of(context1).pop(true);
},
),
TextButton(
child: Text(''),
onPressed: () {
//
Navigator.of(context1).pop(false);
},
),
],
);
},
);
if (continueFlag == null || !continueFlag) return tabJob; //
*/
tabs.value = tabDatas; tabs.value = tabDatas;
if (tabJob != null) currentTab.value = tabJob; if (tabJob != null) currentTab.value = tabJob;
if (tabJob == null && exitPromptFlag.value) ToastUtils.showSuccess('最后一题提交成功'); if (tabJob == null && exitPromptFlag.value) {
var _thePageIndex = currentTab.value?.pageIndex;
if (_thePageIndex != null) {
var _theIndex = tabDatas.indexWhere((e) => e.pageIndex == _thePageIndex);
if (_theIndex != -1 && _theIndex < tabDatas.length - 1) {
currentTab.value = tabDatas[_theIndex + 1];
return tabJob;
}
}
ToastUtils.showSuccess('最后一题提交成功');
}
return tabJob; return tabJob;
} }
} }
return null; return null;
} }
/// tab下一个tab的pageIndex
int? getNextPageIndex(int? indexLocated) {
if (indexLocated == null) indexLocated = currentTab.value?.pageIndex;
if (indexLocated == null) return null;
return indexLocated == tabs.value.length - 1 ? null : tabs.value[indexLocated + 1].pageIndex;
}
/// tab上一个tab的pageIndex
int? getPreviousPageIndex(int? indexLocated) {
if (indexLocated == null) indexLocated = currentTab.value?.pageIndex;
if (indexLocated == null) return null;
return indexLocated == 0 ? null : tabs.value[indexLocated - 1].pageIndex;
}
/// ==> /// ==>
Future<void> jobPriorityReviewCancel(int jobId) async { Future<void> jobPriorityReviewCancel(int jobId) async {
RestClient _client = await getClient(); RestClient _client = await getClient();

View File

@ -7,6 +7,8 @@
* @Description: * @Description:
*/ */
import 'dart:async';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart'; import 'package:flutter_hooks/flutter_hooks.dart';
@ -16,7 +18,9 @@ import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart'; import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:marking_app/common/config/request_config.dart'; import 'package:marking_app/common/config/request_config.dart';
import 'package:marking_app/common/model/event_bus/job_home_refresh_bus.dart';
import 'package:marking_app/common/model/job/job_task_item.dart'; import 'package:marking_app/common/model/job/job_task_item.dart';
import 'package:marking_app/pages/common/event_bus_mixin.dart';
import 'package:marking_app/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart'; import 'package:marking_app/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart';
import 'package:marking_app/provider/review_provider.dart'; import 'package:marking_app/provider/review_provider.dart';
import 'package:marking_app/routes/RouterManager.dart'; import 'package:marking_app/routes/RouterManager.dart';
@ -40,14 +44,7 @@ class HomeworkCorrection extends StatefulHookConsumerWidget {
} }
class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection> class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
with with CommonMixin, EventBusMixin, TickerProviderStateMixin, RefreshDataHandle<JobTaskItem, MarkingListParams> {
CommonMixin,
TickerProviderStateMixin,
RefreshDataHandle<JobTaskItem, MarkingListParams>,
AutomaticKeepAliveClientMixin {
@override
bool get wantKeepAlive => true;
/* Tab控制器 */ /* Tab控制器 */
late TabController _tabController; late TabController _tabController;
late TabController _tabController2; late TabController _tabController2;
@ -127,6 +124,7 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
_tabController.dispose(); _tabController.dispose();
_refreshController1.dispose(); _refreshController1.dispose();
_refreshController2.dispose(); _refreshController2.dispose();
eventCancel();
super.dispose(); super.dispose();
} }
@ -152,8 +150,6 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
super.build(context); //super.build(null)
return AnnotatedRegion( return AnnotatedRegion(
value: const SystemUiOverlayStyle( value: const SystemUiOverlayStyle(
systemNavigationBarColor: Color(0xFF000000), systemNavigationBarColor: Color(0xFF000000),
@ -176,7 +172,19 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded(flex: 1, child: SizedBox()), Expanded(
flex: 1,
child: Container(
alignment: Alignment.centerLeft,
padding: EdgeInsets.only(left: 10.w),
child: InkWell(
onTap: () => easyThrottle('BACK_JOB_HOME', () => Navigator.of(context).pop()),
child: Icon(
Icons.arrow_back_ios_sharp,
size: 16.sp,
),
),
)),
Expanded( Expanded(
flex: 4, flex: 4,
child: Container( child: Container(
@ -226,9 +234,7 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
child: quickText( child: quickText(
'待批阅', '待批阅',
size: 14.sp, size: 14.sp,
color: _tabIndex == 0 color: _tabIndex == 0 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1),
? Theme.of(context).primaryColor
: const Color.fromRGBO(80, 94, 110, 1),
fontWeight: _tabIndex == 0 ? FontWeight.bold : null, fontWeight: _tabIndex == 0 ? FontWeight.bold : null,
), ),
), ),
@ -246,9 +252,7 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
child: quickText( child: quickText(
'已批阅', '已批阅',
size: 14.sp, size: 14.sp,
color: _tabIndex == 1 color: _tabIndex == 1 ? Theme.of(context).primaryColor : const Color.fromRGBO(80, 94, 110, 1),
? Theme.of(context).primaryColor
: const Color.fromRGBO(80, 94, 110, 1),
fontWeight: _tabIndex == 1 ? FontWeight.bold : null, fontWeight: _tabIndex == 1 ? FontWeight.bold : null,
), ),
), ),
@ -261,16 +265,15 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
flex: 1, flex: 1,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
RouterManager.router RouterManager.router.navigateTo(context, RouterManager.jobStudentGroupPath, transition: getTransition());
.navigateTo(context, RouterManager.jobStudentGroupPath, transition: getTransition());
}, },
child: Icon(IconData(0xe63e, fontFamily: "AlibabaIcon"), child: Icon(IconData(0xe63e, fontFamily: "AlibabaIcon"), color: Color.fromRGBO(44, 48, 63, 1), size: 24.sp),
color: Color.fromRGBO(44, 48, 63, 1), size: 24.sp),
), ),
), ),
], ],
), ),
), ),
if (_tabIndex == 1) if (_tabIndex == 1)
$CompletedJobConditionFilter( $CompletedJobConditionFilter(
controller: _tabController2, controller: _tabController2,
@ -305,6 +308,9 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
data: markingDatas1, data: markingDatas1,
onLoad: onMyLoad, onLoad: onMyLoad,
onRefresh: onMyRefresh, onRefresh: onMyRefresh,
eventFire: () {
eventFire(model: JobHomeRefreshBus());
},
), ),
$EasyRefresh( $EasyRefresh(
controller: _refreshController2, controller: _refreshController2,
@ -313,6 +319,9 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
data: markingDatas2, data: markingDatas2,
onLoad: onMyLoad, onLoad: onMyLoad,
onRefresh: onMyRefresh, onRefresh: onMyRefresh,
eventFire: () {
eventFire(model: JobHomeRefreshBus());
},
), ),
], ],
), ),
@ -334,6 +343,7 @@ Widget $easyRefresh({
required EasyRefreshController controller, required EasyRefreshController controller,
required Future<void> Function(EasyRefreshController controller, MarkingListParams params, int tab) onRefresh, required Future<void> Function(EasyRefreshController controller, MarkingListParams params, int tab) onRefresh,
required Future<void> Function(EasyRefreshController controller, MarkingListParams params, int tab) onLoad, required Future<void> Function(EasyRefreshController controller, MarkingListParams params, int tab) onLoad,
required Function eventFire,
required MarkingListParams params, required MarkingListParams params,
required List<JobTaskItem> data, required List<JobTaskItem> data,
required int tab, required int tab,
@ -366,7 +376,10 @@ Widget $easyRefresh({
return HomeworkTasksViewItem( return HomeworkTasksViewItem(
completed: completed, completed: completed,
jobTaskItem: data[index], jobTaskItem: data[index],
call: () => controller.callRefresh(), call: () {
controller.callRefresh();
eventFire();
},
); );
}, },
itemCount: data.length, itemCount: data.length,
@ -414,9 +427,7 @@ Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.only(left: 2.w), padding: EdgeInsets.only(left: 2.w),
decoration: BoxDecoration( decoration: BoxDecoration(
color: jobTaskItem.markingTypeEnum.name == '作业' color: jobTaskItem.markingTypeEnum.name == '作业' ? const Color.fromRGBO(104, 136, 253, 1) : const Color.fromRGBO(255, 175, 56, 1),
? const Color.fromRGBO(104, 136, 253, 1)
: const Color.fromRGBO(255, 175, 56, 1),
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: Radius.circular(14.r), topLeft: Radius.circular(14.r),
topRight: Radius.circular(3.r), topRight: Radius.circular(3.r),
@ -477,8 +488,7 @@ Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
onTap: () => easyThrottle('go_to_homework_report', () { onTap: () => easyThrottle('go_to_homework_report', () {
RouterManager.router.navigateTo( RouterManager.router.navigateTo(
context, context,
RouterManager.jobReportPagePath + RouterManager.jobReportPagePath + '?title=${Uri.encodeComponent(jobTaskItem.title)}&id=${jobTaskItem.id}',
'?title=${Uri.encodeComponent(jobTaskItem.title)}&id=${jobTaskItem.id}',
transition: getTransition(), transition: getTransition(),
); );
}), }),
@ -521,8 +531,7 @@ Widget $theTabBar({required TabController controller, ValueChanged<int>? onTap,
if (customTime.endDate != null) { if (customTime.endDate != null) {
// print(customTime.startDate!.year == customTime.endDate!.year); // print(customTime.startDate!.year == customTime.endDate!.year);
if (!isPad() && customTime.startDate!.year == customTime.endDate!.year) { if (!isPad() && customTime.startDate!.year == customTime.endDate!.year) {
customTimeStr = customTimeStr = customTime.startDate.toString().substring(5, 10) + '~${customTime.endDate.toString().substring(5, 10)}';
customTime.startDate.toString().substring(5, 10) + '~${customTime.endDate.toString().substring(5, 10)}';
} else { } else {
customTimeStr += '~${customTime.endDate?.toString().substring(0, 10)}'; customTimeStr += '~${customTime.endDate?.toString().substring(0, 10)}';
} }

View File

@ -0,0 +1,262 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
import 'package:marking_app/common/mixin/common.dart';
import 'package:marking_app/common/model/event_bus/job_home_refresh_bus.dart';
import 'package:marking_app/common/model/marking/marking_list_params.dart';
import 'package:marking_app/pages/common/event_bus_mixin.dart';
import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/my_text.dart';
import 'package:badges/badges.dart' as badges;
import '../../utils/my_future_builder.dart';
part 'job_home.g.dart';
class JobHome extends StatefulWidget {
const JobHome({super.key});
@override
State<JobHome> createState() => _JobHomeState();
}
class _JobHomeState extends State<JobHome> with CommonMixin, EventBusMixin, AutomaticKeepAliveClientMixin {
@override
bool get wantKeepAlive => true;
@override
void initState() {
getData();
eventOn(callback: (JobHomeRefreshBus item) => getData());
super.initState();
}
@override
void dispose() {
eventCancel();
super.dispose();
}
Future<int> getData() async {
try {
var _client = await getClient();
var _result = await _client.getJobsByPage(MarkingListParams(
isFinish: false,
page: 1,
limit: 1,
pageType: 0,
));
var data = _result.data?.total ?? 0;
eventFire(model: QuantityToBeReviewedData(data));
return data;
} catch (e) {
return 0;
}
}
@override
Widget build(BuildContext context) {
super.build(context);
var spaceWidth = SizedBox(height: ScreenUtil().screenWidth / 19);
return AnnotatedRegion(
value: const SystemUiOverlayStyle(
systemNavigationBarColor: Color(0xFF000000),
systemNavigationBarDividerColor: null,
statusBarColor: Colors.white,
systemNavigationBarIconBrightness: Brightness.light,
statusBarIconBrightness: Brightness.dark,
statusBarBrightness: Brightness.light,
),
child: RefreshIndicator(
onRefresh: () async => eventFire(model: JobHomeRefreshBus()),
child: ListView(
children: [
Container(
height: 200.h,
width: double.infinity,
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage('assets/images/job_home_top_bgm.png'),
fit: BoxFit.fill, //
),
),
),
SizedBox(height: 30.h),
SlidingData([
EntranceModel(title: '作业批阅', image: 'assets/images/job_home_marking.png', navigationUrl: RouterManager.jobMainListPagePath),
EntranceModel(
title: '学生历史作业',
image: 'assets/images/job_home_history.png',
navigationUrl: '${RouterManager.jobStudentGroupPath}?page=history',
),
EntranceModel(title: '知识点点掌握', image: 'assets/images/job_home_knowledge.png', navigationUrl: RouterManager.jobKnowledgePointsPath)
]),
spaceWidth,
$TermRow([
EntranceModel(title: '答题轨迹', image: 'assets/images/job_home_answer_record.png', navigationUrl: RouterManager.answerTrajectoryPath),
EntranceModel(
title: '优先批阅设定',
image: 'assets/images/job_home_youxian.png',
navigationUrl: '${RouterManager.jobStudentGroupPath}?page=set',
)
], 0),
spaceWidth,
$TermRow([EntranceModel(title: '批阅设置', image: 'assets/images/job_home_marking_set.png', navigationUrl: '')], 0),
],
),
),
);
}
}
class EntranceModel extends Object {
String title;
String image;
String navigationUrl;
EntranceModel({required this.title, required this.image, required this.navigationUrl});
}
class QuantityToBeReviewedData extends Object {
int num;
QuantityToBeReviewedData(this.num);
}
@swidget
Widget $termRow(BuildContext context, List<EntranceModel> items, int data) {
var leng = items.length;
Widget childWidget;
switch (leng) {
case 1:
childWidget = Row(children: [Expanded(child: $TermItem(items[0], data))]);
break;
case 2:
childWidget = Row(children: [
Expanded(flex: 9, child: $TermItem(items[0], data)),
Expanded(flex: 1, child: SizedBox()),
Expanded(flex: 9, child: $TermItem(items[1], data)),
]);
break;
case 3:
double _theHeight = ScreenUtil().screenWidth / 19 + 54.h * 2;
childWidget = Row(
children: [
Expanded(child: $TermItem(items[0], data, theHeight: _theHeight)),
SizedBox(width: ScreenUtil().screenWidth / 19),
Expanded(
child: SizedBox(
height: _theHeight,
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
$TermItem(items[1], data),
$TermItem(items[2], data),
],
),
),
),
],
);
break;
default:
childWidget = Container();
}
return Container(padding: EdgeInsets.symmetric(horizontal: 14.w), child: childWidget);
}
@swidget
Widget $termItem(BuildContext context, EntranceModel e, int data, {double? theHeight}) {
bool isJob = e.title == '作业批阅';
return Material(
color: Colors.white,
elevation: 3.r,
shadowColor: const Color.fromRGBO(231, 231, 231, 1),
borderRadius: BorderRadius.all(Radius.circular(8.r)),
child: InkWell(
onTap: () => easyThrottle('GO_TO_JOB_HOME_NAVIGATION', () {
RouterManager.router.navigateTo(context, e.navigationUrl, transition: getTransition());
}),
// splashColor: splashColor,
borderRadius: BorderRadius.all(Radius.circular(8.r)),
child: badges.Badge(
showBadge: isJob && data > 0,
ignorePointer: false,
badgeContent: quickText(data, color: Colors.white, size: 10.sp),
badgeAnimation: badges.BadgeAnimation.rotation(
animationDuration: Duration(seconds: 1),
colorChangeAnimationDuration: Duration(seconds: 1),
loopAnimation: false,
curve: Curves.fastOutSlowIn,
colorChangeAnimationCurve: Curves.easeInCubic,
),
badgeStyle: badges.BadgeStyle(
badgeColor: Color.fromRGBO(255, 105, 105, 1),
shape: badges.BadgeShape.square,
borderRadius: BorderRadius.only(topLeft: Radius.circular(10.r), topRight: Radius.circular(8.5.r), bottomRight: Radius.circular(8.5.r)),
// borderSide: BorderSide(color: Colors.white, width: 2),
elevation: 1,
padding: EdgeInsets.symmetric(horizontal: isPad() ? 11.w : 16.w, vertical: 2.h),
),
position: badges.BadgePosition.topEnd(top: 10.r, end: 10.r),
child: Container(
height: theHeight,
padding: EdgeInsets.symmetric(vertical: 12.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(8.r)),
// boxShadow: [
// BoxShadow(
// color: const Color.fromRGBO(231, 231, 231, 1),
// offset: Offset(4.w, 6.h), //y轴偏移量
// blurRadius: 8, //
// spreadRadius: 0.2, //
// )
// ],
// border: Border.all(width: 0.5.w, color: Color.fromARGB(255, 219, 226, 250)),
),
alignment: Alignment.center,
child: isJob
? Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(e.image, height: 32.r, width: 32.r, fit: BoxFit.cover),
SizedBox(height: 6.r),
quickText(e.title, size: 12.sp, color: Color.fromRGBO(79, 79, 79, 1), fontWeight: FontWeight.w500),
],
)
: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(e.image, height: 32.r, width: 32.r, fit: BoxFit.cover),
SizedBox(width: 6.r),
quickText(e.title, size: 12.sp, color: Color.fromRGBO(79, 79, 79, 1), fontWeight: FontWeight.w500),
],
),
),
)),
);
}
class SlidingData extends HookWidget with EventBusMixin {
final List<EntranceModel> items;
SlidingData(this.items);
@override
Widget build(BuildContext context) {
var dataNumber = useState<QuantityToBeReviewedData?>(null);
useEffect(() {
eventOn(callback: (QuantityToBeReviewedData data) => (dataNumber.value = data));
return () {
eventCancel();
};
}, []);
return $TermRow(items, dataNumber.value?.num ?? 0);
}
}

View File

@ -0,0 +1,486 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
import 'package:marking_app/common/mixin/common.dart';
import 'package:marking_app/common/model/common/base_structure_result.dart';
import 'package:marking_app/common/model/job/job_knowledge_points.dart';
import 'package:marking_app/common/model/job/job_student_history.dart';
import 'package:marking_app/components/ReturnToHomepage.dart';
import 'package:marking_app/pages/homework_correction/widget/personal_detail_topbar.dart';
import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/my_text.dart';
import 'package:marking_app/utils/request/rest_client.dart';
import 'package:percent_indicator/percent_indicator.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
part 'job_knowledge_points.g.dart';
class JobKnowledgePoints extends StatefulWidget {
const JobKnowledgePoints({Key? key,}) : super(key: key);
@override
_JobKnowledgePointsState createState() => _JobKnowledgePointsState();
}
class _JobKnowledgePointsState extends State<JobKnowledgePoints> with CommonMixin, TickerProviderStateMixin {
@override
int page = 1;
int pageSize = 10;
int totalPages = 0;
late TabController tabController;
String startDataTime = CommonUtils.getWeekStartDate().toString().substring(0, 10);
String endDataTime = CommonUtils.getWeekEndDate().toString().substring(0, 10);
String customTimeStr = '自定义';
List<KnowledgePoints> dataList = [];
late final EasyRefreshController refreshController;
//
late final TextEditingController textController;
int studentId = 0;
@override
void initState() {
super.initState();
textController = TextEditingController();
refreshController = EasyRefreshController();
tabController = TabController(length: 3, vsync: this);
EasyLoading.show(status: 'loading...');
getList();
}
@override
void dispose() {
super.dispose();
tabController.dispose();
textController.dispose();
}
void getList() async {
print('startDataTime=$startDataTime');
print('endDataTime=$endDataTime');
RestClient _client = await getClient();
BaseStructureResult<List<KnowledgePoints>> res =
await _client.getKnowledgeReport(startDataTime,endDataTime,textController.text);
if (res.success) {
setState(() {
if (page == 1) {
dataList = res.data!;
} else {
dataList = [...dataList, ...res.data!];
}
// totalPages = res.data!.pagedList.totalPages;
});
}
EasyLoading.dismiss();
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromRGBO(245, 245, 245, 1),
appBar: AppBar(
backgroundColor: Colors.white,
title: Text('知识点掌握', style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))),
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
),
actions: [
ReturnToHomepage(),
],
elevation: 0,
),
body: Column(
children: [
Container(
margin: EdgeInsets.all(15.r),
height: 30.r,
child: Row(
children: [
Expanded(
child: Container(
padding: EdgeInsets.only(left: 10.r,right: 10.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
border: Border.all(width: 1.r,color: Color(0xFFDDDDDD)),
color: Colors.white,
),
child: TextField(
controller: textController,
textInputAction: TextInputAction.next,
style: TextStyle(
color: const Color.fromRGBO(80, 87, 103, 1),
fontSize: 10.sp,
),
decoration: InputDecoration(
hintText: "请输入知识点名称",
hintStyle: TextStyle(fontSize: 10.sp, color: const Color.fromRGBO(153, 153, 153, 1)),
labelStyle: TextStyle(fontSize: 10.sp, color: const Color.fromRGBO(148, 163, 182, 1)),
border: InputBorder.none,
),
),
),
),
SizedBox(width: 10.r,),
InkWell(
onTap: (){
page = 1;
setState(() {});
getList();
},
child: Container(
width: 50.r,
height: 30.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.r),
color: Color(0xFF6888FD),
),
child:Center(
child: Text('查询',style: TextStyle(fontSize: 12.sp,color: Colors.white),),
),
),
)
],
),
),
jobConditionFilter(context,
controller: tabController,
customTimeStr: customTimeStr,
customTime: tabController.index != 3 ||
((endDataTime == null || endDataTime == '') && (startDataTime == null || startDataTime == ''))
? null
: PickerDateRange(
startDataTime == null || startDataTime == '' ? null : DateTime.parse(startDataTime!),
endDataTime == null || endDataTime == '' ? null : DateTime.parse(endDataTime!),
), onTimeFilter: (String? startTime, String? endTime) {
EasyLoading.show(status: 'loading...');
if (startTime == null && endTime == null) {
if (tabController.index == 3) {
tabController.animateTo(0);
}
startDataTime = '';
endDataTime = '';
customTimeStr = '自定义';
} else {
startDataTime = startTime != null ? startTime : '';
endDataTime = endTime != null ? endTime : '';
}
page = 1;
setState(() {});
getList();
// _refreshController2.callRefresh();
}, refreshTime: (value) {
if (value != null && value.startDate != null) {
customTimeStr = value.startDate?.toString().substring(0, 10) ?? '';
setState(() {});
if (value.endDate != null) {
if (!isPad() && value.startDate!.year == value.endDate!.year) {
customTimeStr =
value.startDate.toString().substring(5, 10) + '~${value.endDate.toString().substring(5, 10)}';
setState(() {});
} else {
customTimeStr = '$customTimeStr~${value.endDate?.toString().substring(0, 10)}';
setState(() {});
}
}
}
}),
Expanded(
child: Padding(
padding: EdgeInsets.symmetric(vertical: 10.r),
child: EasyRefresh(
firstRefresh: false,
taskIndependence: true,
controller: refreshController,
header: MaterialHeader(),
footer: TaurusFooter(),
onRefresh: () async {
setState(() {
page = 1;
});
getList();
},
onLoad: () async {
if (page < totalPages) {
setState(() {
page += 1;
});
getList();
}
},
child: dataList.length > 0
? ListView.builder(
itemCount: dataList.length,
itemBuilder: (context, index) {
KnowledgePoints item = dataList[index];
return InkWell(
onTap: () {
RouterManager.router.navigateTo(
context,
RouterManager.jobKnowledgePointsDetailPath +
'?knowledgeName=${Uri.encodeComponent(item.knowledgeName)}&knowledgeId=${item.knowledgeId}',
transition: getTransition(),
);
},
child: Container(
margin: EdgeInsets.symmetric(vertical: 5.r, horizontal: 14.r),
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.r)),
color: Colors.white),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Expanded(
child: Text(
item.knowledgeName,
style: TextStyle(fontSize: 14.sp, color: Color(0xFF505050)),
)),
Container(
width: 49.r,
height: 22.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)),
border: Border.all(width: 1.r, color: Color(0xFF6888FD)),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
'2次',
style: TextStyle(fontSize: 10.sp, color: Color(0xFF6888FD)),
),
Image.asset('assets/images/right_icon_blue.png',width: 8.r,height: 8.r,),
],
),
),
],
),
SizedBox(height: 10.r,),
progressBar(context,
title: '正确率:',
color: Color(0xFF90E0BE),
percent: item.correctRate / 100,
padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h)),
],
),
),
);
})
: MyEmptyWidget(),
),
),
),
],
),
);
}
}
@swidget
Widget progressBar(
BuildContext context, {
double? fontSize,
double? lineHeight,
required String title,
required Color color,
required double percent,
required EdgeInsets padingEdg,
required EdgeInsets marginEdg,
}) {
var percentStr = '${doubleToStringAsFixed(percent * 100)}%';
fontSize ??= 10.sp;
lineHeight ??= 8.h;
return Container(
margin: marginEdg,
padding: padingEdg,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
quickText(title, color: Color(0xFF8B8B8B), size: fontSize),
Expanded(
flex: 1,
child: Container(
child: Row(
children: [
Expanded(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.r),
/* boxShadow: [
BoxShadow(
color: color,
spreadRadius: 0.6,
blurRadius: 3,
offset: Offset(0, 0),
),
],*/
),
child: LinearPercentIndicator(
padding: EdgeInsets.zero,
animation: true,
lineHeight: lineHeight,
animationDuration: 2500,
percent: percent,
/* center: Text(
percentStr,
style: TextStyle(color: Colors.white, fontSize: 4.5.sp),
),*/
// linearStrokeCap: LinearStrokeCap.butt,
progressColor: color,
backgroundColor: Color(0xFFE8E8E8),
barRadius: Radius.circular(10.r),
// linearGradient: LinearGradient(
// tileMode: TileMode.mirror,
// stops: [0.0, 1.0],
// colors: [color.withOpacity(0.1), color],
// ),
),
),
),
SizedBox(width: 4.w),
quickText(percentStr, size: fontSize, color: Color(0xFF606060))
],
),
),
),
],
),
);
}
///
@hwidget
Widget jobConditionFilter(BuildContext context,
{required TabController controller,
PickerDateRange? customTime,
required Function refreshTime,
required String customTimeStr,
required Function(String? startTime, String? endTime) onTimeFilter}) {
var customTimeState = PickerDateRange(null, null);
if (customTime != null) {
customTimeState = PickerDateRange(customTime!.startDate != null ? customTime!.startDate : null,
customTime!.endDate != null ? customTime!.endDate : null);
}
DateTime getMonthStartDate() {
DateTime now = DateTime.now();
return DateTime(now.year, now.month, 1); //
}
DateTime getMonthEndDate() {
DateTime now = DateTime.now();
int nextMonth = now.month + 1;
if (nextMonth > 12) {
nextMonth = 1;
now = now.add(Duration(days: 31 - now.day)); //
} else {
now = now.add(Duration(days: DateTime(now.year, nextMonth, 0).day - now.day)); //
}
return now;
}
return Container(
// height: 39.h,
// padding: EdgeInsets.only(left: 4.w, right: 12.w),
decoration: BoxDecoration(
color: Color.fromRGBO(244, 244, 244, 1),
// border: Border(bottom: BorderSide(color: Color.fromRGBO(204, 204, 204, 1), width: 1)),
),
child: Container(
alignment: Alignment.centerLeft,
decoration: BoxDecoration(
border: Border(bottom: BorderSide(width: 1.r,color: Color(0xFFCCCCCC)))
),
child: TabBar(
controller: controller,
unselectedLabelStyle: TextStyle(fontSize: 12.sp, color: const Color.fromRGBO(102, 102, 102, 1)),
labelStyle: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Color.fromRGBO(116, 145, 253, 1),
),
isScrollable: true,
labelColor: Color(0xFF6888FD),
unselectedLabelColor: Color(0xFF666666),
padding: EdgeInsets.symmetric(horizontal: 14.r),
// indicatorSize: TabBarIndicatorSize.label, //
onTap: (int val) async {
switch (val) {
case 0: //
onTimeFilter(
CommonUtils.getWeekStartDate().toString().substring(0, 10),
CommonUtils.getWeekEndDate().toString().substring(0, 10),
);
break;
case 1: //
onTimeFilter(
getMonthStartDate().toString().substring(0, 10),
getMonthEndDate().toString().substring(0, 10),
);
break;
default: //
var dialogData = await showDialog<PickerDateRange?>(
context: context,
builder: (BuildContext context1) {
return Center(
child: Container(
color: Colors.white,
width: isPad() ? ScreenUtil().screenWidth / 2 : ScreenUtil().screenWidth / 1.3,
height: ScreenUtil().screenHeight / 2,
child: SfDateRangePicker(
showActionButtons: true,
confirmText: '确定',
cancelText: '取消',
onSubmit: (p0) {
print(p0);
Navigator.of(context1).pop(p0);
refreshTime(p0);
},
onCancel: () {
Navigator.of(context1).pop();
},
selectionMode: DateRangePickerSelectionMode.range,
initialSelectedRange: customTimeState,
),
),
);
});
// startDate: 2024-03-04 18:47:00.117958, endDate: 2024-03-11 18:47:00.117986
// if (dialogData != null && (dialogData.startDate != null || dialogData.endDate != null)) {}
onTimeFilter(
dialogData?.startDate?.toString().substring(0, 10),
dialogData?.endDate?.toString().substring(0, 10),
);
customTimeState = dialogData!;
}
},
tabs: <Widget>[
const Tab(text: '近一周'),
const Tab(text: '近一月'),
Tab(text: customTimeStr),
],
),
),
);
}

View File

@ -0,0 +1,460 @@
import 'package:flutter/material.dart';
import 'package:flutter_easyloading/flutter_easyloading.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
import 'package:marking_app/common/mixin/common.dart';
import 'package:marking_app/common/model/common/base_structure_result.dart';
import 'package:marking_app/common/model/job/job_knowledge_detail_student.dart';
import 'package:marking_app/common/model/job/job_knowledge_points.dart';
import 'package:marking_app/common/model/job/job_knowledge_points_detail.dart';
import 'package:marking_app/common/model/job/job_student_history.dart';
import 'package:marking_app/components/ReturnToHomepage.dart';
import 'package:marking_app/pages/homework_correction/widget/personal_detail_topbar.dart';
import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/my_text.dart';
import 'package:marking_app/utils/request/rest_client.dart';
import 'package:percent_indicator/percent_indicator.dart';
import 'package:photo_view/photo_view.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
part 'job_knowledge_points_detail.g.dart';
class JobKnowledgePointsDetail extends StatefulWidget {
final String knowledgeName;
final int knowledgeId;
const JobKnowledgePointsDetail(
{Key? key, required this.knowledgeName, required this.knowledgeId})
: super(key: key);
@override
_JobKnowledgePointsDetailState createState() =>
_JobKnowledgePointsDetailState();
}
class _JobKnowledgePointsDetailState extends State<JobKnowledgePointsDetail>
with CommonMixin, TickerProviderStateMixin {
@override
List<KnowledgePointsDetail> dataList = [];
List<JobKnowledgeDetailStudent> studentList = [];
late final EasyRefreshController refreshController;
String paperImg = '';
int studentId = 0;
@override
void initState() {
super.initState();
refreshController = EasyRefreshController();
EasyLoading.show(status: 'loading...');
getList();
}
@override
void dispose() {
super.dispose();
}
void getList() async {
RestClient _client = await getClient();
BaseStructureResult<List<KnowledgePointsDetail>> res =
await _client.getKnowledgeReportDetail(widget.knowledgeId);
if (res.success) {
setState(() {
dataList = res.data!;
});
}
EasyLoading.dismiss();
}
showStudent(questionid, title) async {
await getStudents(questionid);
showModalBottomSheet(
context: context,
elevation: 10,
backgroundColor: Colors.white,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(20.r),
topRight: Radius.circular(20.r),
),
),
builder: (BuildContext context) {
return Padding(
padding: EdgeInsets.symmetric(horizontal: 2.w),
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 14.h),
child: quickText(
title,
size: 18.sp,
fontWeight: FontWeight.bold,
color: Color.fromRGBO(60, 60, 60, 1),
),
),
Expanded(
child: ListView(
padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 4.w),
children: [
Wrap(
spacing: 6.r, // ()
runSpacing: 4.r, //
alignment: WrapAlignment.spaceAround, //沿
children: studentList.map((e) {
return Container(
padding: EdgeInsets.symmetric(
vertical: 4.r, horizontal: 8.r),
decoration: BoxDecoration(
color: e.isAnswer
? Color(0xFF4CC793)
: Color(0xFFE2E2E2),
borderRadius: BorderRadius.circular(4.r),
),
child: quickText(e.studentName,
color:
e.isAnswer ? Colors.white : Color(0xFF505E6E),
size: 10.sp),
);
}).toList(),
),
],
),
)
],
),
);
},
);
EasyLoading.dismiss();
}
showImg(int sectionId, String questionNo) async {
await getImg(sectionId, questionNo);
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
insetPadding: EdgeInsets.symmetric(vertical: 55.r,horizontal: 45.r),
contentPadding: EdgeInsets.all(0),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(15.r))),
content: Container(
width: MediaQuery.of(context).size.width,
// height: MediaQuery.of(context).size.height,
child: Image.network(paperImg),
),
);
},
);
EasyLoading.dismiss();
}
getStudents(questionid) async {
RestClient _client = await getClient();
BaseStructureResult<List<JobKnowledgeDetailStudent>> res =
await _client.getKnowledgeStudent(questionid);
if (res.success) {
studentList = res.data!;
} else {
studentList = [];
}
}
getImg(int sectionId, String questionNo) async {
RestClient _client = await getClient();
BaseStructureResult<String> res =
await _client.getKnowledgeImg(sectionId, questionNo);
if (res.success) {
paperImg = res.data!;
} else {
paperImg = '';
}
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color.fromRGBO(245, 245, 245, 1),
appBar: AppBar(
backgroundColor: Colors.white,
title: Text(widget.knowledgeName,
style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333))),
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
),
actions: [
ReturnToHomepage(),
],
elevation: 0,
),
body: Padding(
padding: EdgeInsets.symmetric(vertical: 10.r),
child: EasyRefresh(
firstRefresh: false,
taskIndependence: true,
controller: refreshController,
header: MaterialHeader(),
footer: TaurusFooter(),
onRefresh: () async {
getList();
},
onLoad: () async {
// getList();
},
child: dataList.length > 0
? ListView.builder(
itemCount: dataList.length,
itemBuilder: (context, index) {
KnowledgePointsDetail item = dataList[index];
return InkWell(
onTap: () {
/* RouterManager.router.navigateTo(
context,
RouterManager.quickCheckPersonalPath +
'?jobId=${item.jobName}&studentId=$studentId',
transition: getTransition(),
);*/
},
child: Container(
margin: EdgeInsets.symmetric(
vertical: 5.r, horizontal: 14.r),
padding: EdgeInsets.symmetric(
vertical: 14.r, horizontal: 10.r),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10.r)),
color: Colors.white),
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.end,
children: [
Text(
item.publishTime.substring(0, 10),
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF505050)),
),
SizedBox(
width: 10.r,
),
Expanded(
child: Text(
item.jobName,
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF505050)),
)),
InkWell(
onTap: () {
EasyLoading.show(status: 'loading...');
showImg(item.sectionId, item.questionNo);
},
child: Container(
width: 49.r,
height: 22.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(20.r)),
border: Border.all(
width: 1.r, color: Color(0xFF8B8B8B)),
),
child: Center(
child: Text(
'${item.questionNo}',
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF8B8B8B)),
),
),
),
),
],
),
SizedBox(
height: 10.r,
),
Container(
margin: EdgeInsets.only(top: 8.h),
padding: EdgeInsets.zero,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
EasyLoading.show(status: 'loading...');
showStudent(
item.questionId, item.jobName);
},
child: Container(
margin: EdgeInsets.only(right: 6.r),
width: 56.r,
height: 20.r,
decoration: BoxDecoration(
color: Color(0xFFD4FFED),
borderRadius:
BorderRadius.circular(20.r),
),
child: Center(
child: quickText('正确率 >',
color: Color(0xFF4CC793),
size: 10.sp))),
),
Expanded(
flex: 1,
child: Container(
child: Row(
children: [
Expanded(
child: Container(
decoration: BoxDecoration(
borderRadius:
BorderRadius.circular(10.r),
),
child: LinearPercentIndicator(
padding: EdgeInsets.zero,
animation: true,
lineHeight: 8.h,
animationDuration: 2500,
percent: item.correctRate / 100,
progressColor:
Color(0xFF90E0BE),
backgroundColor:
Color(0xFFE8E8E8),
barRadius:
Radius.circular(10.r),
),
),
),
SizedBox(width: 4.w),
quickText(
'${doubleToStringAsFixed(item.correctRate / 100 * 100)}%',
size: 10.sp,
color: Color(0xFF606060))
],
),
),
),
],
),
),
/* progressBar(context,
title: '正确率 >',
color: Color(0xFF90E0BE),
percent: item.correctRate / 100,
padingEdg: EdgeInsets.zero,
marginEdg: EdgeInsets.only(top: 8.h),
studentCall:showStudent(item.questionId,item.jobName),
),*/
],
),
),
);
})
: MyEmptyWidget(),
),
),
);
}
}
@swidget
Widget progressBar(
BuildContext context, {
double? fontSize,
double? lineHeight,
required String title,
required Color color,
required double percent,
required EdgeInsets padingEdg,
required EdgeInsets marginEdg,
required Future<dynamic> studentCall,
}) {
var percentStr = '${doubleToStringAsFixed(percent * 100)}%';
fontSize ??= 10.sp;
lineHeight ??= 8.h;
return Container(
margin: marginEdg,
padding: padingEdg,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
InkWell(
onTap: () {
studentCall;
},
child: Container(
margin: EdgeInsets.only(right: 6.r),
width: 56.r,
height: 20.r,
decoration: BoxDecoration(
color: Color(0xFFD4FFED),
borderRadius: BorderRadius.circular(20.r),
),
child: Center(
child: quickText(title,
color: Color(0xFF4CC793), size: fontSize))),
),
Expanded(
flex: 1,
child: Container(
child: Row(
children: [
Expanded(
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10.r),
/* boxShadow: [
BoxShadow(
color: color,
spreadRadius: 0.6,
blurRadius: 3,
offset: Offset(0, 0),
),
],*/
),
child: LinearPercentIndicator(
padding: EdgeInsets.zero,
animation: true,
lineHeight: lineHeight,
animationDuration: 2500,
percent: percent,
/* center: Text(
percentStr,
style: TextStyle(color: Colors.white, fontSize: 4.5.sp),
),*/
// linearStrokeCap: LinearStrokeCap.butt,
progressColor: color,
backgroundColor: Color(0xFFE8E8E8),
barRadius: Radius.circular(10.r),
// linearGradient: LinearGradient(
// tileMode: TileMode.mirror,
// stops: [0.0, 1.0],
// colors: [color.withOpacity(0.1), color],
// ),
),
),
),
SizedBox(width: 4.w),
quickText(percentStr, size: fontSize, color: Color(0xFF606060))
],
),
),
),
],
),
);
}

View File

@ -60,6 +60,7 @@ class _JobPersonalDetailState extends State<JobPersonalDetail> with CommonMixin,
} }
void getList() async { void getList() async {
print(widget.studentId);
RestClient _client = await getClient(); RestClient _client = await getClient();
BaseStructureResult<JobStudentHistory> res = BaseStructureResult<JobStudentHistory> res =
await _client.getStudentJobHistory(widget.studentId, !isJob, startDataTime, endDataTime, page, pageSize); await _client.getStudentJobHistory(widget.studentId, !isJob, startDataTime, endDataTime, page, pageSize);

View File

@ -15,17 +15,23 @@ import 'package:marking_app/utils/request/rest_client.dart';
class JobPriorityReviewSet extends StatefulWidget { class JobPriorityReviewSet extends StatefulWidget {
final String groupId; final String groupId;
const JobPriorityReviewSet({Key? key,required this.groupId}) : super(key: key); final String title;
final String? page;
const JobPriorityReviewSet({Key? key, required this.groupId,required this.title,this.page = ''})
: super(key: key);
@override @override
State<JobPriorityReviewSet> createState() => _JobPriorityReviewSetState(); State<JobPriorityReviewSet> createState() => _JobPriorityReviewSetState();
} }
class _JobPriorityReviewSetState extends State<JobPriorityReviewSet> class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
with CommonMixin,SingleTickerProviderStateMixin { with CommonMixin, SingleTickerProviderStateMixin {
late final EasyRefreshController refreshController; late final EasyRefreshController refreshController;
late TabController tabController; late TabController tabController;
int tabIndex = 0; int tabIndex = 0;
List list1 = [];
List list2 = [];
List levelList = []; List levelList = [];
bool isClicking = false; bool isClicking = false;
@ -36,32 +42,47 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
refreshController = EasyRefreshController(); refreshController = EasyRefreshController();
tabController = tabController =
TabController(initialIndex: tabIndex, length: 2, vsync: this); TabController(initialIndex: tabIndex, length: 2, vsync: this);
getReadLevel(); getList();
} }
void getReadLevel() async{ void getList() async {
RestClient _client = await getClient(); await getReadLevel(1);
BaseStructureResult<List<JobStudentLevel>> res = await _client.getJobReadLevel(widget.groupId,tabIndex == 0?1:0); await getReadLevel(0);
setState(() { setState(() {
if(res.success){ levelList = [...list1, ...list2];
levelList = res.data!; isClicking = false;
isClicking = false;
}else{
levelList = [];
}
}); });
EasyLoading.dismiss(); EasyLoading.dismiss();
refreshController.finishRefresh(); refreshController.finishRefresh();
} }
void setJobReadLevel(int studentId,int level) async{ getReadLevel(int readLevel) async {
RestClient _client = await getClient();
BaseStructureResult<List<JobStudentLevel>> res =
await _client.getJobReadLevel(widget.groupId, readLevel);
if (res.success) {
if (readLevel == 1) {
list1 = res.data!;
} else {
list2 = res.data!;
}
} else {
if (readLevel == 1) {
list1 = [];
} else {
list2 = [];
}
}
}
void setJobReadLevel(int studentId, int level) async {
RestClient _client = await getClient(); RestClient _client = await getClient();
JobLevelSetParams params = JobLevelSetParams(studentId, level); JobLevelSetParams params = JobLevelSetParams(studentId, level);
BaseStructureResult res = await _client.getSetJobReadLevel(params); BaseStructureResult res = await _client.getSetJobReadLevel(params);
if(res.code == 200){ if (res.code == 200) {
getReadLevel(); getList();
}
}
} }
@override @override
@ -79,7 +100,7 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
appBar: AppBar( appBar: AppBar(
backgroundColor: Colors.white, backgroundColor: Colors.white,
title: Text( title: Text(
'优先批阅人配置', widget.title,
style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)), style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)),
), ),
centerTitle: true, centerTitle: true,
@ -94,8 +115,10 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
body: Column( body: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 10.r,), SizedBox(
Container( height: 10.r,
),
/* Container(
padding: EdgeInsets.symmetric(horizontal: 14.r), padding: EdgeInsets.symmetric(horizontal: 14.r),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border(bottom: BorderSide(width: 1.r,color: Color(0xFFCCCCCC))) border: Border(bottom: BorderSide(width: 1.r,color: Color(0xFFCCCCCC)))
@ -136,171 +159,284 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
indicatorSize: TabBarIndicatorSize.label, indicatorSize: TabBarIndicatorSize.label,
labelPadding: const EdgeInsets.all(0), labelPadding: const EdgeInsets.all(0),
), ),
), ),*/
Expanded( Expanded(
child:Padding( child: Padding(
padding: EdgeInsets.symmetric(vertical:14.r,horizontal: 14.r), padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r),
child: EasyRefresh( child: EasyRefresh(
firstRefresh: true, firstRefresh: true,
taskIndependence: true, taskIndependence: true,
controller: refreshController, controller: refreshController,
header: MaterialHeader(), header: MaterialHeader(),
footer: TaurusFooter(), footer: TaurusFooter(),
onRefresh: () async{ onRefresh: () async {
getReadLevel(); getList();
}, },
child: levelList.length>0?isPadFlag?GridView(gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( child: levelList.length > 0
crossAxisCount: 2, ? isPadFlag
mainAxisSpacing: 10.r, ? GridView(
crossAxisSpacing: 10.r, gridDelegate:
childAspectRatio: 556 / 112, SliverGridDelegateWithFixedCrossAxisCount(
),children: List.generate(levelList.length, (index) { crossAxisCount: 2,
JobStudentLevel item = levelList[index]; mainAxisSpacing: 10.r,
return Container( crossAxisSpacing: 10.r,
padding: EdgeInsets.symmetric(horizontal: 10.r), childAspectRatio: 556 / 112,
decoration: BoxDecoration( ),
borderRadius: BorderRadius.all(Radius.circular(10.r)), children: List.generate(levelList.length, (index) {
color: Colors.white, JobStudentLevel item = levelList[index];
), return InkWell(
child: Row( onTap: (){
mainAxisAlignment: MainAxisAlignment.spaceBetween, RouterManager.router.navigateTo(context,
children: [ '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
Expanded(child: Text(item.studentName,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6888FD)),)), },
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.r),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
item.studentName,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6888FD)),
)),
tabIndex == 0?InkWell( widget.page == 'answerTrajectory'?Container(
onTap: (){ height: 20.r,
setState(() { width: 70.r,
isClicking = true; decoration: BoxDecoration(
}); border: Border.all(width: 1.r,color: Color(0xFFFFA41E)),
setJobReadLevel(item.studentGroupDetailId,0); borderRadius: BorderRadius.all(Radius.circular(20.r)),
EasyLoading.show(status: 'loading...');
}, ),
child: Container( child: Center(child: Text('详情',style: TextStyle(fontSize: 10.r,color: Color(0xFFFFA41E))),
height: 20.r, )):widget.page == 'history'?Container(
width: 70.r, height: 20.r,
decoration: BoxDecoration( width: 70.r,
borderRadius: BorderRadius.all(Radius.circular(20.r)), decoration: BoxDecoration(
color: isClicking?Color(0xFFDCE3FF):Color(0xFF6888FD), color: Color(0xFF6888FD),
), borderRadius: BorderRadius.all(Radius.circular(20.r))
child: Center( ),
child:Text('取消优先',style: TextStyle(fontSize: 10.sp,color: Colors.white),), child: Center(child: Text('历史作业',style: TextStyle(fontSize: 10.r,color: Colors.white),)),
), ): item.readLevel == 1
), ?
):InkWell( InkWell(
onTap: (){ onTap: () {
setState(() { setState(() {
isClicking = true; isClicking = true;
}); });
setJobReadLevel(item.studentGroupDetailId,1); setJobReadLevel(
EasyLoading.show(status: 'loading...'); item.studentGroupDetailId, 0);
}, EasyLoading.show(
child: Container( status: 'loading...');
height: 20.r, },
width: 70.r, child:Container(
decoration: BoxDecoration( height: 20.r,
borderRadius: BorderRadius.all(Radius.circular(20.r)), width: 70.r,
color: isClicking?Color(0xFF6888FD):Color(0xFFFFFFFF), decoration: BoxDecoration(
border: Border.all(width: 1.r,color: isClicking?Color(0xFFFFFFFF):Color(0xFF6888FD)), borderRadius: BorderRadius.all(
), Radius.circular(4.r)),
child: Center( color:Color(0xFFB7FFE0),
child:Text('设为优先',style: TextStyle(fontSize: 10.sp,color: isClicking?Color(0xFFFFFFFF):Color(0xFF6888FD)),), ),
), child: Row(
), crossAxisAlignment: CrossAxisAlignment.start,
), children: [
SizedBox(width: 5.r,), Padding(
InkWell( padding: EdgeInsets.only(left: 3.r),
onTap: (){ child: Image.asset('assets/images/youx_icon_active.png',width: 14.r,height: 14.r,),
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); ),
}, Padding(
child: Container( padding: EdgeInsets.only(top: 2.r,left: 4.r),
height: 20.r, child: Text(
width: 70.r, '优先批阅',
decoration: BoxDecoration( style: TextStyle(
borderRadius: BorderRadius.all(Radius.circular(20.r)), fontSize: 10.sp,
color: Colors.white, color: Color(0xFF4CC793)),
border: Border.all(width: 1.r,color: Color(0xFFFCA017)) ),
), ),
child: Center( ],
child: Text('详情',style: TextStyle(fontSize: 10.sp,color: Color(0xFFFCA017)),), ),
), ),
), )
) :InkWell(
], onTap: () {
), setState(() {
); isClicking = true;
}),):ListView.builder(itemBuilder: (context,index){ });
JobStudentLevel item = levelList[index]; setJobReadLevel(
return Container( item.studentGroupDetailId, 1);
padding: EdgeInsets.symmetric(vertical:20.r,horizontal: 15.r), EasyLoading.show(
margin: EdgeInsets.only(bottom: 15.r), status: 'loading...');
decoration: BoxDecoration( },
borderRadius: BorderRadius.all(Radius.circular(10.r)), child: Container(
color: Colors.white, height: 20.r,
), width: 70.r,
child: Row( decoration: BoxDecoration(
mainAxisAlignment: MainAxisAlignment.spaceBetween, borderRadius: BorderRadius.all(
children: [ Radius.circular(4.r)),
Expanded(child: Text(item.studentName,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6888FD)),)), color: Color(0xFFE1E1E1),
tabIndex == 0?InkWell( ),
onTap: (){ child: Row(
setState(() { crossAxisAlignment: CrossAxisAlignment.start,
isClicking = true; children: [
}); Padding(
setJobReadLevel(item.studentGroupDetailId,0); padding: EdgeInsets.only(left: 3.r),
EasyLoading.show(status: 'loading...'); child: Image.asset('assets/images/youx_icon_default.png',width: 14.r,height: 14.r,),
}, ),
child: Container( Padding(
height: 24.r, padding: EdgeInsets.only(top: 2.r,left: 4.r),
width: 82.r, child: Text(
decoration: BoxDecoration( '优先批阅',
borderRadius: BorderRadius.all(Radius.circular(20.r)), style: TextStyle(
color: isClicking?Color(0xFFDCE3FF):Color(0xFF6888FD), fontSize: 10.sp,
), color: Color(0xFF8A9691)),
child: Center( ),
child:Text('取消优先',style: TextStyle(fontSize: 10.sp,color: Colors.white),), ),
), ],
), ),
):InkWell( ),
onTap: (){ ),
setJobReadLevel(item.studentGroupDetailId,1); ],
EasyLoading.show(status: 'loading...'); ),
}, ),
child: Container( );
height: 24.r, }),
width: 82.r, )
decoration: BoxDecoration( : ListView.builder(
borderRadius: BorderRadius.all(Radius.circular(20.r)), itemBuilder: (context, index) {
color: Color(0xFFFFFFFF), JobStudentLevel item = levelList[index];
border: Border.all(width: 1.r,color: Color(0xFF6888FD)), return InkWell(
), onTap: (){
child: Center( RouterManager.router.navigateTo(context,
child:Text('设为优先',style: TextStyle(fontSize: 10.sp,color: Color(0xFF6888FD)),), '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
), },
), child: Container(
), padding: EdgeInsets.symmetric(
SizedBox(width: 5.r,), vertical: 20.r, horizontal: 15.r),
InkWell( margin: EdgeInsets.only(bottom: 15.r),
onTap: (){ decoration: BoxDecoration(
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); borderRadius:
}, BorderRadius.all(Radius.circular(10.r)),
child: Container( color: Colors.white,
height: 20.r, ),
width: 70.r, child: Row(
decoration: BoxDecoration( mainAxisAlignment:
borderRadius: BorderRadius.all(Radius.circular(20.r)), MainAxisAlignment.spaceBetween,
color: Colors.white, children: [
border: Border.all(width: 1.r,color: Color(0xFFFCA017)) Expanded(
), child: Text(
child: Center( item.studentName,
child: Text('详情',style: TextStyle(fontSize: 10.sp,color: Color(0xFFFCA017)),), style: TextStyle(
), fontSize: 12.sp,
), color: Color(0xFF6888FD)),
) )),
], widget.page == 'answerTrajectory'?Container(
), height: 24.r,
); width: 72.r,
},itemCount: levelList.length,):MyEmptyWidget(), decoration: BoxDecoration(
border: Border.all(width: 1.r,color: Color(0xFFFFA41E)),
borderRadius: BorderRadius.all(Radius.circular(20.r)),
),
child: Center(child: Text('详情',style: TextStyle(fontSize: 10.r,color: Color(0xFFFFA41E))),
)):widget.page == 'history'?Container(
height: 24.r,
width: 82.r,
decoration: BoxDecoration(
color: Color(0xFF6888FD),
borderRadius: BorderRadius.all(Radius.circular(20.r))
),
child: Center(child: Text('历史作业',style: TextStyle(fontSize: 10.r,color: Colors.white),)),
):item.readLevel == 1
? InkWell(
onTap: () {
setState(() {
isClicking = true;
});
setJobReadLevel(
item.studentGroupDetailId, 0);
EasyLoading.show(
status: 'loading...');
},
child: Container(
height: 24.r,
width: 82.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.r)),
color:Color(0xFFB7FFE0),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 3.r),
child: Image.asset('assets/images/youx_icon_active.png',width: 14.r,height: 14.r,),
),
Padding(
padding: EdgeInsets.only(top: 2.r,left: 4.r),
child: Text(
'优先批阅',
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF4CC793)),
),
),
],
),
),
)
: InkWell(
onTap: () {
setJobReadLevel(
item.studentGroupDetailId, 1);
EasyLoading.show(
status: 'loading...');
},
child: Container(
height: 24.r,
width: 82.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(4.r)),
color: Color(0xFFE1E1E1),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(left: 3.r),
child: Image.asset('assets/images/youx_icon_default.png',width: 14.r,height: 14.r,),
),
Padding(
padding: EdgeInsets.only(top: 2.r,left: 4.r),
child: Text(
'优先批阅',
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF8A9691)),
),
),
],
),
),
),
],
),
),
);
},
itemCount: levelList.length,
)
: MyEmptyWidget(),
), ),
), ),
) )
@ -309,4 +445,3 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
); );
} }
} }

View File

@ -8,6 +8,7 @@ import 'package:marking_app/common/model/common/base_structure_result.dart';
import 'package:marking_app/common/model/job/job_student_goups.dart'; import 'package:marking_app/common/model/job/job_student_goups.dart';
import 'package:marking_app/common/model/user/user_info.dart'; import 'package:marking_app/common/model/user/user_info.dart';
import 'package:marking_app/components/ReturnToHomepage.dart'; import 'package:marking_app/components/ReturnToHomepage.dart';
import 'package:marking_app/pages/homework_correction/widget/student_group_list.dart';
import 'package:marking_app/routes/RouterManager.dart'; import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart'; import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/fast_data.dart'; import 'package:marking_app/utils/fast_data.dart';
@ -15,7 +16,8 @@ import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/request/rest_client.dart'; import 'package:marking_app/utils/request/rest_client.dart';
class JobStudentGroup extends StatefulWidget { class JobStudentGroup extends StatefulWidget {
const JobStudentGroup({Key? key}) : super(key: key); final String page;
const JobStudentGroup({Key? key,required this.page}) : super(key: key);
@override @override
State<JobStudentGroup> createState() => _JobStudentGroupState(); State<JobStudentGroup> createState() => _JobStudentGroupState();
@ -57,6 +59,10 @@ class _JobStudentGroupState extends State<JobStudentGroup> with CommonMixin {
refreshController.finishRefresh(); refreshController.finishRefresh();
} }
void goNextPage(id,title){
RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=$id&title=${Uri.encodeComponent(title)}&page=${widget.page}',transition: getTransition());
}
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
@ -94,136 +100,7 @@ class _JobStudentGroupState extends State<JobStudentGroup> with CommonMixin {
onRefresh: () async{ onRefresh: () async{
getStudentGroups(); getStudentGroups();
}, },
child: studentGroups != null && studentGroups.length > 0 child: StudentGroupList(studentGroups,goNextPage),
? isPadFlag?GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 10.r,
crossAxisSpacing: 10.r,
childAspectRatio: 556 / 112,
),
children: List.generate(studentGroups.length, (index) {
JobStudentGroups item = studentGroups[index];
String classNames = item.classNames.join(" ");
return InkWell(
onTap: (){
RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=${item.groupId}',transition: getTransition());
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(right: 8.r),
child: Text(
item.groupName,
style: TextStyle(
fontSize: 10.sp, color: Color(0xFF6888FD)),
),
),
Expanded(
child: Text(
classNames,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF999999),
overflow: TextOverflow.ellipsis,
),
textAlign: TextAlign.end,
),
),
Container(
margin: EdgeInsets.only(left: 5.r),
height: 20.r,
width: 55.r,
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(20.r)),
color: Color(0xFF6888FD),
),
child: Center(
child: Text(
'设置',
style: TextStyle(
fontSize: 10.sp, color: Colors.white),
),
),
)
],
),
),
);
}),
):ListView.builder(
itemBuilder: (context,index){
JobStudentGroups item = studentGroups[index];
String classNames = item.classNames.join(" ");
return Container(
padding: EdgeInsets.symmetric(vertical:15.r,horizontal: 10.r),
margin: EdgeInsets.only(bottom: 10.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(right: 8.r),
child: Text(
item.groupName,
style: TextStyle(
fontSize: 14.sp, color: Color(0xFF6888FD)),
),
),
Expanded(
child: Text(
classNames,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF999999),
overflow: TextOverflow.ellipsis,
),
textAlign: TextAlign.end,
),
),
InkWell(
onTap: (){
RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=${item.groupId}',transition: getTransition());
},
child: Container(
margin: EdgeInsets.only(left: 5.r),
height: 24.r,
width: 55.r,
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(20.r)),
color: Color(0xFF6888FD),
),
child: Center(
child: Text(
'设置',
style: TextStyle(
fontSize: 10.sp, color: Colors.white),
),
),
),
)
],
),
);
},
itemCount: studentGroups.length,
)
: Padding(
padding: EdgeInsets.only(top: MediaQuery.of(context).size.height/2 - 200.r),
child: MyEmptyWidget(),
),
), ),
), ),
); );

View File

@ -125,7 +125,7 @@ class _QuickCheckPersonalState extends State<QuickCheckPersonal>
borderRadius: BorderRadius.circular(4.r), borderRadius: BorderRadius.circular(4.r),
), ),
child: Center( child: Center(
child: Text('查看原稿',style: TextStyle(fontSize: 10.r,color: Color(0xFF4CC793)),), child: Text('原稿笔迹',style: TextStyle(fontSize: 10.r,color: Color(0xFF4CC793)),),
), ),
), ),
], ],

View File

@ -0,0 +1,274 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:marking_app/common/model/job/job_task_item.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/my_text.dart';
import '../../../routes/RouterManager.dart';
class AnswerTrajectoryJob extends StatelessWidget {
final List<JobTaskItem> jobList;
const AnswerTrajectoryJob(this.jobList, {Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return jobList != null && jobList.length > 0
? isPad()
? GridView(
shrinkWrap: true,
physics: ClampingScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, //widget
mainAxisSpacing: 10.h,
crossAxisSpacing: 6.w,
childAspectRatio: 2.5 //1widget
),
children: List.generate(jobList.length, (index) {
JobTaskItem item = jobList[index];
return InkWell(
onTap: (){
RouterManager.router.navigateTo(context,
'${RouterManager.answerTrajectoryJobDetailPath}?&jobId=${item.id}&jobName=${Uri.encodeComponent(item.title)}&genderName=${Uri.encodeComponent(item.genderName)}',
transition: getTransition());
},
child: Container(
padding: EdgeInsets.only(top: 10.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
color: Colors.white,
boxShadow: [
BoxShadow(
color: const Color.fromRGBO(210, 216, 241, 1),
offset: Offset.zero, //y轴偏移量
blurRadius: 5.8, //
spreadRadius: 0, //
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
//
Padding(
padding: EdgeInsets.symmetric(horizontal: 6.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 32.w,
height: 18.h,
alignment: Alignment.center,
padding: EdgeInsets.only(left: 2.w),
decoration: BoxDecoration(
color: const Color.fromRGBO(104, 136, 253, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(14.r),
topRight: Radius.circular(3.r),
bottomLeft: Radius.circular(4.r),
bottomRight: Radius.circular(4.r),
),
),
margin: EdgeInsets.only(right: 4.w),
child: quickText(item.markingTypeEnum.name,
color: Colors.white, size: 10.sp),
),
Expanded(
child: quickText(item.title,
size: 12.sp,
color: Color.fromRGBO(70, 70, 70, 1),
maxLines: 2),
),
SizedBox(
width: 5.r,
),
Container(
padding: EdgeInsets.symmetric(
vertical: 1.r, horizontal: 5.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.r),
border: Border.all(
width: 1.r, color: Color(0xFF4CC793)),
),
child: Center(
child: Text(
item.subjectName,
style: TextStyle(
fontSize: 8.r,
color: Color(0xFF4CC793)),
),
),
)
],
),
),
Container(
padding: EdgeInsets.symmetric(vertical: 6.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(6.r),
bottomRight: Radius.circular(6.r)),
color: Colors.white,
boxShadow: [
BoxShadow(
color: const Color.fromRGBO(0, 0, 0, 0.15),
offset: Offset(0, -0.0001), //y轴偏移量
blurRadius: 4, //
spreadRadius: 0, //
)
],
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
alignment: Alignment.center,
child: quickText('详情',
color: Color(0xFFFFA115), size: 10.sp),
),
Image.asset(
'assets/images/icon_back_orange.png',
width: 8.r,
height: 8.r,
),
]),
),
],
),
),
);
}),
)
: ListView.builder(
shrinkWrap: true,
physics: ClampingScrollPhysics(),
itemBuilder: (context, index) {
JobTaskItem item = jobList[index];
return InkWell(
onTap: () {
RouterManager.router.navigateTo(context,
'${RouterManager.answerTrajectoryJobDetailPath}?&jobId=${item.id}&jobName=${Uri.encodeComponent(item.title)}&genderName=${Uri.encodeComponent(item.genderName)}',
transition: getTransition());
},
child: Container(
margin: EdgeInsets.symmetric(vertical: 10.r),
padding: EdgeInsets.only(top: 10.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
color: Colors.white,
boxShadow: [
BoxShadow(
color: const Color.fromRGBO(210, 216, 241, 1),
offset: Offset.zero, //y轴偏移量
blurRadius: 5.8, //
spreadRadius: 0, //
)
],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
//
Padding(
padding: EdgeInsets.symmetric(vertical:14.r,horizontal: 14.r),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 32.w,
height: 18.h,
alignment: Alignment.center,
padding: EdgeInsets.only(left: 2.w),
decoration: BoxDecoration(
color:
const Color.fromRGBO(104, 136, 253, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(14.r),
topRight: Radius.circular(3.r),
bottomLeft: Radius.circular(4.r),
bottomRight: Radius.circular(4.r),
),
),
margin: EdgeInsets.only(right: 4.w),
child: quickText(item.markingTypeEnum.name,
color: Colors.white, size: 10.sp),
),
Expanded(
child: quickText(item.title,
size: 14.sp,
color: Color.fromRGBO(70, 70, 70, 1),
maxLines: 2),
),
SizedBox(
width: 5.r,
),
Container(
padding: EdgeInsets.symmetric(
vertical: 1.r, horizontal: 5.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(4.r),
border: Border.all(
width: 1.r, color: Color(0xFF4CC793)),
),
child: Center(
child: Text(
item.subjectName,
style: TextStyle(
fontSize: 12.r,
color: Color(0xFF4CC793)),
),
),
)
],
),
),
SizedBox(
height: 10.r,
),
Container(height: 1.r,
color: Color(0xFFF5F5F5),),
Container(
padding: EdgeInsets.symmetric(vertical: 10.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(6.r),
bottomRight: Radius.circular(6.r)),
color: Colors.white,
/*boxShadow: [
BoxShadow(
color: const Color.fromRGBO(0, 0, 0, 0.15),
offset: Offset(0, -0.0001), //y轴偏移量
blurRadius: 4, //
spreadRadius: 0, //
)
],*/
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
alignment: Alignment.center,
child: quickText('详情',
color: Color(0xFFFFA115), size: 10.sp),
),
Image.asset(
'assets/images/icon_back_orange.png',
width: 8.r,
height: 8.r,
),
]),
),
],
),
),
);
},
itemCount: jobList.length,
)
: MyEmptyWidget();
}
}

View File

@ -0,0 +1,161 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:marking_app/common/model/job/job_student_goups.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart';
class StudentGroupList extends StatelessWidget {
final List studentGroups;
final Function goNextPage;
final Widget? rightBtn;
const StudentGroupList(this.studentGroups, this.goNextPage,
{Key? key,this.rightBtn})
: super(key: key);
@override
Widget build(BuildContext context) {
return studentGroups != null && studentGroups.length > 0
? isPad()
? GridView(
shrinkWrap: true,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 10.r,
crossAxisSpacing: 10.r,
childAspectRatio: 556 / 112,
),
children: List.generate(studentGroups.length, (index) {
JobStudentGroups item = studentGroups[index];
String classNames = item.classNames.join(" ");
return InkWell(
onTap: () {
goNextPage(item.groupId, item.groupName);
// RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=${item.groupId}',transition: getTransition());
},
child: Container(
padding: EdgeInsets.symmetric(horizontal: 10.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(right: 8.r),
child: Text(
item.groupName,
style: TextStyle(
fontSize: 10.sp, color: Color(0xFF6888FD)),
),
),
Expanded(
child: Text(
classNames,
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF999999),
overflow: TextOverflow.ellipsis,
),
textAlign: TextAlign.end,
),
),
rightBtn != null
? rightBtn!
: Container(
margin: EdgeInsets.only(left: 5.r),
height: 20.r,
width: 55.r,
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(20.r)),
color: Color(0xFF6888FD),
),
child: Center(
child: Text(
'详情',
style: TextStyle(
fontSize: 10.sp, color: Colors.white),
),
),
)
],
),
),
);
}),
)
: ListView.builder(
shrinkWrap: true,
itemBuilder: (context, index) {
JobStudentGroups item = studentGroups[index];
String classNames = item.classNames.join(" ");
return InkWell(
onTap: () {
goNextPage(item.groupId, item.groupName);
// RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=${item.groupId}',transition: getTransition());
},
child: Container(
padding:
EdgeInsets.symmetric(vertical: 15.r, horizontal: 10.r),
margin: EdgeInsets.only(bottom: 10.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Padding(
padding: EdgeInsets.only(right: 8.r),
child: Text(
item.groupName,
style: TextStyle(
fontSize: 14.sp, color: Color(0xFF6888FD)),
),
),
Expanded(
child: Text(
classNames,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF999999),
overflow: TextOverflow.ellipsis,
),
textAlign: TextAlign.end,
),
),
rightBtn != null
? rightBtn!
: Container(
margin: EdgeInsets.only(left: 5.r),
height: 24.r,
width: 55.r,
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(20.r)),
color: Color(0xFF6888FD),
),
child: Center(
child: Text(
'详情',
style: TextStyle(
fontSize: 10.sp, color: Colors.white),
),
),
)
],
),
),
);
},
itemCount: studentGroups.length,
)
: Padding(
padding: EdgeInsets.only(
top: MediaQuery.of(context).size.height / 2 - 200.r),
child: MyEmptyWidget(),
);
}
}

View File

@ -6,25 +6,23 @@ import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart'; import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart'; import 'package:marking_app/utils/index.dart';
part 'top_count.g.dart';
class TopCount extends StatelessWidget { class TopCount extends StatelessWidget {
final JobReportModel data; final JobReportModel data;
final String className; final String className;
final int jobId; final int jobId;
const TopCount(this.data, this.className, this.jobId,{Key? key}) : super(key: key); const TopCount(this.data, this.className, this.jobId, {Key? key}) : super(key: key);
void showStudentListDialog( void showStudentListDialog({required BuildContext context, required String title, required List arr}) {
{required BuildContext context,
required String title,
required List arr}) {
showDialog( showDialog(
context: context, context: context,
builder: (BuildContext context) { builder: (BuildContext context) {
return AlertDialog( return AlertDialog(
// insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r), // insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r),
contentPadding: EdgeInsets.all(20.r), contentPadding: EdgeInsets.all(20.r),
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))),
borderRadius: BorderRadius.all(Radius.circular(15.r))),
content: SizedBox( content: SizedBox(
width: MediaQuery.of(context).size.width * 0.7, width: MediaQuery.of(context).size.width * 0.7,
height: MediaQuery.of(context).size.height * 0.7, height: MediaQuery.of(context).size.height * 0.7,
@ -34,10 +32,7 @@ class TopCount extends StatelessWidget {
Center( Center(
child: Text( child: Text(
className + title, className + title,
style: TextStyle( style: TextStyle(fontSize: 15.sp, color: Color(0xFF3C3C3C), fontWeight: FontWeight.w500),
fontSize: 15.sp,
color: Color(0xFF3C3C3C),
fontWeight: FontWeight.w500),
), ),
), ),
SizedBox( SizedBox(
@ -53,24 +48,19 @@ class TopCount extends StatelessWidget {
itemBuilder: (context, index) { itemBuilder: (context, index) {
AnswerOkStudents item = arr[index]; AnswerOkStudents item = arr[index];
return InkWell( return InkWell(
onTap: (){ onTap: () {
RouterManager.router.navigateTo( RouterManager.router.navigateTo(
context, context,
RouterManager.quickCheckPersonalPath + RouterManager.quickCheckPersonalPath + '?jobId=$jobId&studentId=${item.id}',
'?jobId=$jobId&studentId=${item.id}', transition: getTransition(),
transition: getTransition(),); );
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 15.r),
vertical: 5.r, horizontal: 15.r), color: index.isOdd ? Colors.white : Color(0xFFF0F0F0),
color: index.isOdd
? Colors.white
: Color(0xFFF0F0F0),
child: Text( child: Text(
item.name, item.name,
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)),
fontSize: 12.sp,
color: Color(0xFF323232)),
), ),
), ),
); );
@ -88,8 +78,8 @@ class TopCount extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
double leftWidth = (MediaQuery.of(context).size.width-40.r) * 0.7/3; double leftWidth = (MediaQuery.of(context).size.width - 40.r) * 0.7 / 3;
double rightWidth = (MediaQuery.of(context).size.width-40.r) * 0.3/2; double rightWidth = (MediaQuery.of(context).size.width - 40.r) * 0.3 / 2;
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r), padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r),
margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r), margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r),
@ -104,31 +94,21 @@ class TopCount extends StatelessWidget {
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
showStudentListDialog( showStudentListDialog(context: context, title: '未提交作业学生', arr: data.noAnswerStudents!);
context: context,
title: '未提交作业学生',
arr: data.noAnswerStudents!);
}, },
child:leftContainer(context,count: data.noAnswerCount,name: '未提交',nameColor: Color(0xFFD92F2F),bgColor: Color(0xFFEEEEEE)), child: leftContainer(context, count: data.noAnswerCount, name: '未提交', nameColor: Color(0xFFD92F2F), bgColor: Color(0xFFEEEEEE)),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
showStudentListDialog( showStudentListDialog(context: context, title: '已提交作业学生', arr: data.validStudents!);
context: context,
title: '已提交作业学生',
arr: data.validStudents!);
}, },
child: leftContainer(context,count: data.validCount,name: '已提交',nameColor: Color(0xFF4CC793),bgColor: Color(0xFFF5F5F5)), child: leftContainer(context, count: data.validCount, name: '已提交', nameColor: Color(0xFF4CC793), bgColor: Color(0xFFF5F5F5)),
), ),
InkWell( InkWell(
onTap: () { onTap: () {
showStudentListDialog( showStudentListDialog(context: context, title: '全对作业学生', arr: data.allCorrectStudents!);
context: context,
title: '全对作业学生',
arr: data.allCorrectStudents!);
}, },
child:leftContainer(context,count: data.allCorrect,name: '全对',nameColor: Color(0xFFFF9800),bgColor: Color(0xFFEEEEEE)), child: leftContainer(context, count: data.allCorrect, name: '全对', nameColor: Color(0xFFFF9800), bgColor: Color(0xFFEEEEEE)),
), ),
Container( Container(
height: 92.r, height: 92.r,
@ -138,62 +118,55 @@ class TopCount extends StatelessWidget {
children: [ children: [
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: (){ onTap: () {
showStudentListDialog( showStudentListDialog(context: context, title: '优等作业学生', arr: data.overallInfos['']!.students);
context: context, },
title: '优等作业学生', child: rightContainer(
arr: data.overallInfos['']!.students); count: data.overallInfos['']!.count,
}, bgColor: Color(0xFF56FFB8),
child: rightContainer(count: data.overallInfos['']!.count,bgColor: Color(0xFF56FFB8),nameColor: Color(0xFF009254),name: '',), nameColor: Color(0xFF009254),
) name: '',
), ),
)),
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: (){ onTap: () {
showStudentListDialog( showStudentListDialog(context: context, title: '中等作业学生', arr: data.overallInfos['']!.students);
context: context, },
title: '中等作业学生', child:
arr: data.overallInfos['']!.students); rightContainer(count: data.overallInfos['']!.count, bgColor: Color(0xFFD3FF93), nameColor: Color(0xFF3F6605), name: ''),
}, )),
child: rightContainer(count: data.overallInfos['']!.count,bgColor: Color(0xFFD3FF93),nameColor: Color(0xFF3F6605),name: ''),
)
),
], ],
), ),
), ),
Container( Container(
height: 92.r, height: 92.r,
width:rightWidth, width: rightWidth,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
children: [ children: [
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: (){ onTap: () {
showStudentListDialog( showStudentListDialog(context: context, title: '良等作业学生', arr: data.overallInfos['']!.students);
context: context, },
title: '良等作业学生', child:
arr: data.overallInfos['']!.students); rightContainer(count: data.overallInfos['']!.count, bgColor: Color(0xFFFFC38C), nameColor: Color(0xFFD36500), name: ''),
}, )),
child: rightContainer(count: data.overallInfos['']!.count,bgColor: Color(0xFFFFC38C),nameColor: Color(0xFFD36500),name: '' ),
)
),
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: (){ onTap: () {
showStudentListDialog( showStudentListDialog(context: context, title: '差等作业学生', arr: data.overallInfos['']!.students);
context: context, },
title: '差等作业学生', child:
arr: data.overallInfos['']!.students); rightContainer(count: data.overallInfos['']!.count, bgColor: Color(0xFFFF9D94), nameColor: Color(0xFFD12616), name: ''),
}, )),
child: rightContainer(count: data.overallInfos['']!.count,bgColor: Color(0xFFFF9D94),nameColor: Color(0xFFD12616),name: '' ),
)),
], ],
), ),
) )
], ],
), ),
/* Row( /* Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
InkWell( InkWell(
@ -365,7 +338,7 @@ class TopCount extends StatelessWidget {
), ),
SizedBox( SizedBox(
height: 15.r, height: 15.r,
),*/ ),
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 15.r), padding: EdgeInsets.symmetric(horizontal: 15.r),
child: GridView.builder( child: GridView.builder(
@ -391,10 +364,7 @@ class TopCount extends StatelessWidget {
} }
return InkWell( return InkWell(
onTap: () { onTap: () {
showStudentListDialog( showStudentListDialog(context: context, title: item.title + '等作业学生', arr: item.studentNames);
context: context,
title: item.title + '等作业学生',
arr: item.studentNames);
}, },
child: Container( child: Container(
padding: EdgeInsets.symmetric(vertical: 10.r), padding: EdgeInsets.symmetric(vertical: 10.r),
@ -414,16 +384,12 @@ class TopCount extends StatelessWidget {
height: 28.r, height: 28.r,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
border: Border.all( border: Border.all(color: bgColor, width: 1.r, style: BorderStyle.solid),
color: bgColor,
width: 1.r,
style: BorderStyle.solid),
borderRadius: BorderRadius.circular(14.r)), borderRadius: BorderRadius.circular(14.r)),
child: Center( child: Center(
child: Text( child: Text(
item.title, item.title,
style: style: TextStyle(color: bgColor, fontSize: 12.r),
TextStyle(color: bgColor, fontSize: 12.r),
)), )),
), ),
], ],
@ -434,13 +400,11 @@ class TopCount extends StatelessWidget {
), ),
Text( Text(
item.count.toString(), item.count.toString(),
style: TextStyle( style: TextStyle(fontSize: 20.sp, color: Color(0xFF595959)),
fontSize: 20.sp, color: Color(0xFF595959)),
), ),
Text( Text(
'', '',
style: TextStyle( style: TextStyle(fontSize: 14.sp, color: Color(0xFF595959)),
fontSize: 14.sp, color: Color(0xFF595959)),
), ),
], ],
), ),
@ -448,7 +412,7 @@ class TopCount extends StatelessWidget {
); );
}, },
), ),
), ),*/
], ],
), ),
); );
@ -456,13 +420,12 @@ class TopCount extends StatelessWidget {
} }
@swidget @swidget
Widget leftContainer(context,{required int count,required String name,required Color nameColor,required Color bgColor}){ Widget leftContainer(context, {required int count, required String name, required Color nameColor, required Color bgColor}) {
double leftWidth = (MediaQuery.of(context).size.width-40.r) * 0.7/3; double leftWidth = (MediaQuery.of(context).size.width - 40.r) * 0.7 / 3;
return Container( return Container(
width: leftWidth, width: leftWidth,
height: 92.r, height: 92.r,
padding: padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r),
EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r),
color: bgColor, color: bgColor,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -476,17 +439,11 @@ Widget leftContainer(context,{required int count,required String name,required C
children: [ children: [
Text( Text(
count.toString(), count.toString(),
style: TextStyle( style: TextStyle(fontSize: 18.sp, color: Color(0xFF595959), fontWeight: FontWeight.w600),
fontSize: 18.sp,
color: Color(0xFF595959),
fontWeight: FontWeight.w600),
), ),
Text( Text(
'', '',
style: TextStyle( style: TextStyle(fontSize: 10.sp, color: Color(0xFF595959), fontWeight: FontWeight.w600),
fontSize: 10.sp,
color: Color(0xFF595959),
fontWeight: FontWeight.w600),
), ),
], ],
), ),
@ -495,10 +452,7 @@ Widget leftContainer(context,{required int count,required String name,required C
), ),
Text( Text(
name, name,
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: nameColor, fontWeight: FontWeight.w500),
fontSize: 12.sp,
color: nameColor,
fontWeight: FontWeight.w500),
) )
], ],
), ),
@ -506,9 +460,9 @@ Widget leftContainer(context,{required int count,required String name,required C
} }
@swidget @swidget
Widget rightContainer({required int count,required Color bgColor,required Color nameColor,required String name}){ Widget rightContainer({required int count, required Color bgColor, required Color nameColor, required String name}) {
return Container( return Container(
color:bgColor, color: bgColor,
child: Column( child: Column(
children: [ children: [
SizedBox( SizedBox(
@ -520,17 +474,11 @@ Widget rightContainer({required int count,required Color bgColor,required Color
children: [ children: [
Text( Text(
count.toString(), count.toString(),
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: nameColor, fontWeight: FontWeight.w600),
fontSize: 12.sp,
color: nameColor,
fontWeight: FontWeight.w600),
), ),
Text( Text(
'', '',
style: TextStyle( style: TextStyle(fontSize: 8.sp, color: nameColor, fontWeight: FontWeight.w600),
fontSize: 8.sp,
color: nameColor,
fontWeight: FontWeight.w600),
), ),
], ],
), ),
@ -539,10 +487,7 @@ Widget rightContainer({required int count,required Color bgColor,required Color
), ),
Text( Text(
name, name,
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: nameColor, fontWeight: FontWeight.w500),
fontSize: 12.sp,
color: nameColor,
fontWeight: FontWeight.w500),
) )
], ],
), ),

View File

@ -29,6 +29,7 @@ import 'package:marking_app/common/model/user/user_login.dart';
import 'package:marking_app/common/model/user/user_login_params.dart'; import 'package:marking_app/common/model/user/user_login_params.dart';
import 'package:marking_app/provider/user_provider.dart'; import 'package:marking_app/provider/user_provider.dart';
import 'package:marking_app/routes/RouterManager.dart'; import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/sys_protocol.dart';
class TheLogin extends StatefulHookConsumerWidget { class TheLogin extends StatefulHookConsumerWidget {
const TheLogin({Key? key}) : super(key: key); const TheLogin({Key? key}) : super(key: key);
@ -71,6 +72,7 @@ class _TheLoginState extends ConsumerState<TheLogin> with CommonMixin {
@override @override
void initState() { void initState() {
Future.delayed(Duration(seconds: 2), () => sysProtocol(context));
Future(() { Future(() {
// Provider // Provider
ref.read(userTokenProvider.notifier).clean(); // ref.read(userTokenProvider.notifier).clean(); //
@ -387,8 +389,7 @@ class _TheLoginState extends ConsumerState<TheLogin> with CommonMixin {
EasyLoading.show(status: 'loading...'); EasyLoading.show(status: 'loading...');
try { try {
BaseStructureResult<dynamic> resultData = await client.toLogin(UserLoginParams(userName, userPwdMd5)); BaseStructureResult<dynamic> resultData = await client.toLogin(UserLoginParams(userName, userPwdMd5));
UserLogin? userData = UserLogin? userData = resultData.code == 200 && resultData.data != null ? UserLogin.fromJson(resultData.data) : null;
resultData.code == 200 && resultData.data != null ? UserLogin.fromJson(resultData.data) : null;
if (resultData.code != 200 || userData?.accessToken == null || userData?.accessToken == '') { if (resultData.code != 200 || userData?.accessToken == null || userData?.accessToken == '') {
return toMsg(resultData.message ?? '登录失败,请重试'); return toMsg(resultData.message ?? '登录失败,请重试');
} }

View File

@ -16,11 +16,9 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:marking_app/common/mixin/common.dart'; import 'package:marking_app/common/mixin/common.dart';
import 'package:marking_app/common/model/common/base_structure_result.dart'; import 'package:marking_app/common/model/common/base_structure_result.dart';
import 'package:marking_app/common/model/user/user_info.dart'; import 'package:marking_app/common/model/user/user_info.dart';
import 'package:marking_app/pages/homework_correction/index.dart';
import 'package:marking_app/pages/reports/index.dart'; import 'package:marking_app/pages/reports/index.dart';
import 'package:marking_app/provider/do_marking_provider.dart'; import 'package:marking_app/provider/do_marking_provider.dart';
import 'package:marking_app/provider/upload_file_provider.dart'; import 'package:marking_app/provider/upload_file_provider.dart';
import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/app_upgrade/UpdateDialog.dart'; import 'package:marking_app/utils/app_upgrade/UpdateDialog.dart';
import 'package:marking_app/utils/app_upgrade/model/UpdateAppEvent.dart'; import 'package:marking_app/utils/app_upgrade/model/UpdateAppEvent.dart';
import 'package:marking_app/common/model/sys/system_version.dart'; import 'package:marking_app/common/model/sys/system_version.dart';
@ -31,6 +29,8 @@ import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/request/rest_client.dart'; import 'package:marking_app/utils/request/rest_client.dart';
import 'package:package_info/package_info.dart'; import 'package:package_info/package_info.dart';
import 'homework_correction/job_home.dart';
class TheMainPage extends StatefulHookConsumerWidget { class TheMainPage extends StatefulHookConsumerWidget {
const TheMainPage({Key? key}) : super(key: key); const TheMainPage({Key? key}) : super(key: key);
@ -49,7 +49,8 @@ class TheMainPageState extends ConsumerState<TheMainPage> with CommonMixin {
final List<Widget> _bodyList = [ final List<Widget> _bodyList = [
const TheHomePage(), const TheHomePage(),
const TheMarking(), const TheMarking(),
const HomeworkCorrection(), // const HomeworkCorrection(),
const JobHome(),
const TheReport() const TheReport()
]; ];
int tabIndex = 0; int tabIndex = 0;
@ -130,14 +131,8 @@ class TheMainPageState extends ConsumerState<TheMainPage> with CommonMixin {
// String buildNumber = packageInfo.buildNumber; // // String buildNumber = packageInfo.buildNumber; //
SystemVersion data = result.data!; SystemVersion data = result.data!;
Map json = { Map json = {'downloadPath': data.apkUrl, 'version': data.version, 'systemType': deviceType, 'description': data.description};
'downloadPath': data.apkUrl, UpdateAppEvent updateAppEvent = UpdateAppEvent.fromJson(json, localVersion, deviceInfo, appName, packageName, typeName: 'systemType');
'version': data.version,
'systemType': deviceType,
'description': data.description
};
UpdateAppEvent updateAppEvent =
UpdateAppEvent.fromJson(json, localVersion, deviceInfo, appName, packageName, typeName: 'systemType');
if (updateAppEvent.upgrade) { if (updateAppEvent.upgrade) {
await UpdateDialog.showUpdateDialog(context, updateAppEvent); await UpdateDialog.showUpdateDialog(context, updateAppEvent);
} }
@ -160,7 +155,8 @@ class TheMainPageState extends ConsumerState<TheMainPage> with CommonMixin {
child: Scaffold( child: Scaffold(
body: PageView( body: PageView(
controller: _pageController, controller: _pageController,
physics: const BouncingScrollPhysics(), // physics: const BouncingScrollPhysics(),
physics: NeverScrollableScrollPhysics(),
onPageChanged: (index) => toUpState(setState, () => tabIndex = index, mounted), onPageChanged: (index) => toUpState(setState, () => tabIndex = index, mounted),
children: _bodyList, children: _bodyList,
), ),

View File

@ -13,7 +13,12 @@ import 'package:fluro/fluro.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:marking_app/common/model/enum/marking_list_type.dart'; import 'package:marking_app/common/model/enum/marking_list_type.dart';
import 'package:marking_app/pages/common/startUpPage.dart'; import 'package:marking_app/pages/common/startUpPage.dart';
import 'package:marking_app/pages/homework_correction/answer_trajectory.dart';
import 'package:marking_app/pages/homework_correction/answer_trajectory_job_detail.dart';
import 'package:marking_app/pages/homework_correction/do_papers_job_exam.dart'; import 'package:marking_app/pages/homework_correction/do_papers_job_exam.dart';
import 'package:marking_app/pages/homework_correction/index.dart';
import 'package:marking_app/pages/homework_correction/job_knowledge_points.dart';
import 'package:marking_app/pages/homework_correction/job_knowledge_points_detail.dart';
import 'package:marking_app/pages/homework_correction/job_personal_detail.dart'; import 'package:marking_app/pages/homework_correction/job_personal_detail.dart';
import 'package:marking_app/pages/homework_correction/job_priority_review_set.dart'; import 'package:marking_app/pages/homework_correction/job_priority_review_set.dart';
import 'package:marking_app/pages/homework_correction/job_report.dart'; import 'package:marking_app/pages/homework_correction/job_report.dart';
@ -64,6 +69,8 @@ class RouterManager {
static const String jobListParticipateInClassPath = '/job/list/participateInClass'; static const String jobListParticipateInClassPath = '/job/list/participateInClass';
// ==> // ==>
static const String jobFavoritePagePath = '/job/favorite/index'; static const String jobFavoritePagePath = '/job/favorite/index';
// ==>
static const String jobMainListPagePath = '/job/mainList/index';
static const String reportClassTeacherPath = 'report/details/reportClassTeacher'; static const String reportClassTeacherPath = 'report/details/reportClassTeacher';
static const String reportSubjectTeacherPath = 'report/details/reportSubjectTeacher'; static const String reportSubjectTeacherPath = 'report/details/reportSubjectTeacher';
@ -77,7 +84,10 @@ class RouterManager {
static const String jobPersonalDetailPath = '/homework_correction/job_personal_detail'; static const String jobPersonalDetailPath = '/homework_correction/job_personal_detail';
static const String reportCardDialogPath = '/report_detail/widgets/report_card_dialog'; static const String reportCardDialogPath = '/report_detail/widgets/report_card_dialog';
static const String reportHistoryPath = '/report_detail/report_history'; static const String reportHistoryPath = '/report_detail/report_history';
static const String jobKnowledgePointsPath = '/homework_correction/job_knowledge_points';
static const String jobKnowledgePointsDetailPath = '/homework_correction/job_knowledge_points_detail';
static const String answerTrajectoryPath = '/homework_correction/answer_trajectory';
static const String answerTrajectoryJobDetailPath = '/homework_correction/answer_trajectory_job_detail';
// TheMine // TheMine
static final FluroRouter router = FluroRouter(); static final FluroRouter router = FluroRouter();
@ -309,14 +319,17 @@ class RouterManager {
static final _jobPriorityReviewSetPageHandler = Handler( static final _jobPriorityReviewSetPageHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) { handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
String groupId = params['groupId']![0]; String groupId = params['groupId']![0];
return JobPriorityReviewSet(groupId: groupId); String title = params['title']![0];
String? page = params['page']?[0];
return JobPriorityReviewSet(groupId: groupId,title:title,page:page);
}, },
); );
// //
static final _jobStudentGroupPageHandler = Handler( static final _jobStudentGroupPageHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) { handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
return JobStudentGroup(); String page = params['page']![0];
return JobStudentGroup(page:page);
}, },
); );
// //
@ -346,6 +359,11 @@ class RouterManager {
}, },
); );
//
static final _jobMainListPathHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) => HomeworkCorrection(),
);
// //
static final _reportCardDialogPathHandler = Handler( static final _reportCardDialogPathHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) { handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
@ -362,6 +380,41 @@ class RouterManager {
return ReportHistory(); return ReportHistory();
}, },
); );
//
static final _jobKnowledgePointsPathHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
/* String studentName = params['studentName']![0];
int studentId = int.parse(params['studentId']![0]);*/
return JobKnowledgePoints();
},
);
//
static final _jobKnowledgePointsDetailPathHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
String knowledgeName = params['knowledgeName']![0];
int knowledgeId = int.parse(params['knowledgeId']![0]);
return JobKnowledgePointsDetail(knowledgeName:knowledgeName,knowledgeId:knowledgeId);
},
);
//
static final _answerTrajectoryPathHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
return AnswerTrajectory();
},
);
//
static final _answerTrajectoryJobDetailPathHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
int jobId = int.parse(params['jobId']![0]);
String jobName = params['jobName']![0];
String genderName = params['genderName']![0];
return AnswerTrajectoryJobDetail(jobId:jobId,jobName:jobName,genderName:genderName);
},
);
// //
// static final _doMarkingPapers = Handler(handlerFunc: (BuildContext? context, Map<String, List<String>> params) => MarkingPapers()); // static final _doMarkingPapers = Handler(handlerFunc: (BuildContext? context, Map<String, List<String>> params) => MarkingPapers());
@ -408,6 +461,11 @@ class RouterManager {
router.define(jobPersonalDetailPath, handler: _jobPersonalDetailPathHandler, transitionType: TransitionType.material); router.define(jobPersonalDetailPath, handler: _jobPersonalDetailPathHandler, transitionType: TransitionType.material);
router.define(reportCardDialogPath, handler: _reportCardDialogPathHandler, transitionType: TransitionType.material); router.define(reportCardDialogPath, handler: _reportCardDialogPathHandler, transitionType: TransitionType.material);
router.define(reportHistoryPath, handler: _reportHistoryPathHandler, transitionType: TransitionType.material); router.define(reportHistoryPath, handler: _reportHistoryPathHandler, transitionType: TransitionType.material);
router.define(jobMainListPagePath, handler: _jobMainListPathHandler, transitionType: TransitionType.material);
router.define(jobKnowledgePointsPath, handler: _jobKnowledgePointsPathHandler, transitionType: TransitionType.material);
router.define(jobKnowledgePointsDetailPath, handler: _jobKnowledgePointsDetailPathHandler, transitionType: TransitionType.material);
router.define(answerTrajectoryPath, handler: _answerTrajectoryPathHandler, transitionType: TransitionType.material);
router.define(answerTrajectoryJobDetailPath, handler: _answerTrajectoryJobDetailPathHandler, transitionType: TransitionType.material);
// getTransition() // getTransition()

View File

@ -25,8 +25,8 @@ class CommonUtils {
} }
/// ///
static String second2HMS(int sec, {bool isEasy = false}) { static String second2HMS(int sec, {bool isEasy = false}) {
String hms = "00:00:00"; String hms = "0";
if (!isEasy) hms = "00时00分00"; if (!isEasy) hms = "0";
if (sec > 0) { if (sec > 0) {
int h = sec ~/ 3600; int h = sec ~/ 3600;
int m = (sec % 3600) ~/ 60; int m = (sec % 3600) ~/ 60;
@ -45,4 +45,26 @@ class CommonUtils {
} }
return hms; return hms;
} }
static DateTime getWeekStartDate() {
DateTime now = DateTime.now();
int dayOfWeek = now.weekday; // 17
int diff = dayOfWeek - 1; //
if (diff < 0) {
diff += 7; //
}
return now.subtract(Duration(days: diff)); //
}
static DateTime getWeekEndDate() {
DateTime now = DateTime.now();
int dayOfWeek = now.weekday; //
int diff = 7 - dayOfWeek; //
if (diff == 0) {
diff = 7; //
}
return now.add(Duration(days: diff)); //
}
} }

File diff suppressed because one or more lines are too long

View File

@ -39,6 +39,9 @@ class FastData {
static const String _MARKING_PREFERENCES_WORK = "APP:MARKING:PREFERENCES:WORK"; static const String _MARKING_PREFERENCES_WORK = "APP:MARKING:PREFERENCES:WORK";
// == // ==
static const String _INPUT_KEYBOARD_GUIDE_PAGE_WORK = "APP:MARKING:GUIDE_PAGE:WORK"; static const String _INPUT_KEYBOARD_GUIDE_PAGE_WORK = "APP:MARKING:GUIDE_PAGE:WORK";
//
static const String _SYS_PROTOCOL = "APP:SYS:PROTOCOL";
static const String _SYS_PROTOCOL_SHOW = "APP:SYS:PROTOCOL_SHOW";
static SharedPreferences? _prefs; static SharedPreferences? _prefs;
@ -268,4 +271,35 @@ class FastData {
SharedPreferences thePrefs = await getSharedInstance(); SharedPreferences thePrefs = await getSharedInstance();
thePrefs.remove(_MARKING_ZOOM_SCALE_AND_POSITION); thePrefs.remove(_MARKING_ZOOM_SCALE_AND_POSITION);
} }
/* 阅卷 ==> 缩放组件历史位置 */
Future<bool> setSysProtocol(bool val) async {
SharedPreferences thePrefs = await getSharedInstance();
return await thePrefs.setBool(_SYS_PROTOCOL, val);
}
Future<bool?> getSysProtocol([SharedPreferences? thePrefs]) async {
if (thePrefs == null) thePrefs = await getSharedInstance();
return thePrefs.getBool(_SYS_PROTOCOL);
}
void cleanSysProtocol() async {
SharedPreferences thePrefs = await getSharedInstance();
thePrefs.remove(_SYS_PROTOCOL);
}
Future<bool> setSysProtocolShow(bool val) async {
SharedPreferences thePrefs = await getSharedInstance();
return await thePrefs.setBool(_SYS_PROTOCOL_SHOW, val);
}
Future<bool?> getSysProtocolShow([SharedPreferences? thePrefs]) async {
if (thePrefs == null) thePrefs = await getSharedInstance();
return thePrefs.getBool(_SYS_PROTOCOL_SHOW);
}
void cleanSysProtocolShow() async {
SharedPreferences thePrefs = await getSharedInstance();
thePrefs.remove(_SYS_PROTOCOL_SHOW);
}
} }

View File

@ -18,8 +18,10 @@ import 'package:marking_app/common/model/job/job_concerned_with_student_params.d
import 'package:marking_app/common/model/job/job_data_report.dart'; import 'package:marking_app/common/model/job/job_data_report.dart';
import 'package:marking_app/common/model/job/job_do_marking_status_info.dart'; import 'package:marking_app/common/model/job/job_do_marking_status_info.dart';
import 'package:marking_app/common/model/job/job_fav_student.dart'; import 'package:marking_app/common/model/job/job_fav_student.dart';
import 'package:marking_app/common/model/job/job_favorite_item_model.dart';
import 'package:marking_app/common/model/job/job_favorite_model.dart'; import 'package:marking_app/common/model/job/job_favorite_model.dart';
import 'package:marking_app/common/model/job/job_knowledge_detail_student.dart';
import 'package:marking_app/common/model/job/job_knowledge_points.dart';
import 'package:marking_app/common/model/job/job_knowledge_points_detail.dart';
import 'package:marking_app/common/model/job/job_level_set_params.dart'; import 'package:marking_app/common/model/job/job_level_set_params.dart';
import 'package:marking_app/common/model/job/job_note_taking_trajectory.dart'; import 'package:marking_app/common/model/job/job_note_taking_trajectory.dart';
import 'package:marking_app/common/model/job/job_page_tab.dart'; import 'package:marking_app/common/model/job/job_page_tab.dart';
@ -33,7 +35,6 @@ import 'package:marking_app/common/model/job/job_student_history.dart';
import 'package:marking_app/common/model/job/job_student_level.dart'; import 'package:marking_app/common/model/job/job_student_level.dart';
import 'package:marking_app/common/model/job/job_task_item.dart'; import 'package:marking_app/common/model/job/job_task_item.dart';
import 'package:marking_app/common/model/job/marking_text_question_job.dart'; import 'package:marking_app/common/model/job/marking_text_question_job.dart';
import 'package:marking_app/common/model/job/marking_text_question_job_params.dart';
import 'package:marking_app/common/model/job/marking_text_question_job_tab_params.dart'; import 'package:marking_app/common/model/job/marking_text_question_job_tab_params.dart';
import 'package:marking_app/common/model/job/review_again_list_params.dart'; import 'package:marking_app/common/model/job/review_again_list_params.dart';
import 'package:marking_app/common/model/job/upload_file_interface_config.dart'; import 'package:marking_app/common/model/job/upload_file_interface_config.dart';
@ -357,5 +358,30 @@ abstract class RestClient {
@the_retrofit.Query("PageSize") int pageSize, @the_retrofit.Query("PageSize") int pageSize,
); );
// =>
@the_retrofit.GET("/api/jobs/knowledge-report")
Future<BaseStructureResult<List<KnowledgePoints>>> getKnowledgeReport(
@the_retrofit.Query("dateStart") String? dateStart,
@the_retrofit.Query("dateEnd") String? dateEnd,
@the_retrofit.Query("knowledgeName") String? knowledgeName,
);
// =>
@the_retrofit.GET("/api/jobs/knowledge-detail-report")
Future<BaseStructureResult<List<KnowledgePointsDetail>>> getKnowledgeReportDetail(
@the_retrofit.Query("KnowledgeId") int knowledgeId,
);
// =>
@the_retrofit.GET("/api/jobs/knowledge-question-detail/{questionid}")
Future<BaseStructureResult<List<JobKnowledgeDetailStudent>>> getKnowledgeStudent(
@the_retrofit.Path("questionid") int questionid,
);
// =>
@the_retrofit.GET("/api/jobs/question-paper-img/{sectionid}/{questionno}")
Future<BaseStructureResult<String>> getKnowledgeImg(
@the_retrofit.Path("sectionid") int questionid,
@the_retrofit.Path("questionno") String questionno,
);
} }

View File

@ -0,0 +1,147 @@
import 'dart:io';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/const_text.dart';
import 'index.dart';
import 'my_text.dart';
class Protocol extends Dialog {
final BuildContext context;
const Protocol(this.context);
@override
Widget build(BuildContext context) {
return Center(
child: Container(
width: isPad() ? 200.w : 260.w,
height: 400.h,
padding: EdgeInsets.symmetric(vertical: 16.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(12.r),
),
child: Column(
children: <Widget>[
quickText('用户协议与隐私政策', size: 15.sp, color: Color.fromRGBO(37, 37, 37, 1), fontWeight: FontWeight.bold),
Expanded(
child: ListView(
physics: const BouncingScrollPhysics(),
padding: EdgeInsets.fromLTRB(16.w, 14.h, 16.w, 10.h),
children: [
Text.rich(TextSpan(children: [
TextSpan(
text: '感谢您选择学而有道APP ! 我们非常重视您的个人信息和隐私保护。为了更好地保障您的个人权益,在您使用我们的产品前,请务必审慎阅读',
style: TextStyle(fontSize: 13.sp, color: Color.fromRGBO(51, 51, 51, 1)),
),
TextSpan(
text: '《隐私政策》',
style: TextStyle(fontSize: 13.sp, color: Color.fromRGBO(233, 85, 119, 1)),
recognizer: TapGestureRecognizer()
..onTap = () async {
RouterManager.router.navigateTo(
context,
'${RouterManager.agreementPath}?type=${AGREEMENT_KEY.PRIVACY_GREEMENT.name}',
transition: getTransition(),
);
},
),
TextSpan(
text: '',
style: TextStyle(fontSize: 13.sp, color: Color.fromRGBO(51, 51, 51, 1)),
),
TextSpan(
text: '《用户协议》',
style: TextStyle(fontSize: 13.sp, color: Color.fromRGBO(233, 85, 119, 1)),
recognizer: TapGestureRecognizer()
..onTap = () async {
RouterManager.router.navigateTo(
context,
'${RouterManager.agreementPath}?type=${AGREEMENT_KEY.USER_AGREEMENT.name}',
transition: getTransition(),
);
},
),
TextSpan(
text:
'内的所有条款,尤其是:1.我们对您的个人信息的收集/保存/使用/对外提供/保护等规则条款,以及您的用户权利等条款;2.约定我们的限制责任、免责条款;3.其他以颜色或加粗进行标识的重要条款。如您对以上协议有任何疑问可通过人工客服或发邮件至xrydyj@outlook.com与我们联系。您点击"同意并继续”的行为即表示您已阅读完毕并同意以上协议的全部内容。如您同意以上协议内容,请点击"同意并继续”,开始使用我们的产品和服务!',
style: TextStyle(fontSize: 13.sp, color: Color.fromRGBO(51, 51, 51, 1)),
),
])),
],
),
),
SizedBox(height: 10.h),
Row(
children: [
Expanded(
child: InkWell(
onTap: () {
exit(0);
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.only(top: 15.h),
decoration: BoxDecoration(
border: Border(
top: BorderSide(width: 0.5.r, color: Color.fromRGBO(238, 238, 238, 1)),
right: BorderSide(width: 0.5.r, color: Color.fromRGBO(238, 238, 238, 1)),
),
),
child: quickText('不同意', size: 14.sp),
),
),
),
Expanded(
child: InkWell(
onTap: () {
FastData.getInstance().setSysProtocol(true);
Navigator.of(context).pop(true);
},
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.only(top: 15.h),
decoration: BoxDecoration(
border: Border(
top: BorderSide(width: 0.5.r, color: Color.fromRGBO(238, 238, 238, 1)),
),
),
child: quickText('同意并继续', color: Color.fromRGBO(206, 97, 126, 1), size: 14.sp),
),
),
)
],
),
],
),
),
);
}
}
///
Future<void> sysProtocol(BuildContext context) async {
bool? _sysProtocol = await FastData.getInstance().getSysProtocol();
if (_sysProtocol == null || !_sysProtocol) {
print('进来这里....');
bool? _sysProtocolShow = await FastData.getInstance().getSysProtocolShow();
if (_sysProtocolShow != true) {
try {
await FastData.getInstance().setSysProtocolShow(true);
return showDialog(
context: context,
barrierDismissible: false,
// useRootNavigator: false,
builder: (ctx) => Protocol(ctx),
);
} catch (e) {
FastData.getInstance().cleanSysProtocol();
} finally {
FastData.getInstance().cleanSysProtocolShow();
}
}
}
}

View File

@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion. # In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at # Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.0.102 version: 1.0.104
environment: environment:
sdk: ">=2.17.1 <3.0.0" sdk: ">=2.17.1 <3.0.0"