Compare commits

..

8 Commits

Author SHA1 Message Date
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
machuanyu d7ad4912eb 个人详情用时转时分秒显示 2024-04-10 10:00:33 +08:00
machuanyu e4c00bf8d8 作业子页面增加去首页按钮 2024-04-10 09:41:42 +08:00
machuanyu 76b15038c6 Merge branch 'mcy_revision' into main 2024-04-10 09:18:29 +08:00
machuanyu 25e95b44e0 作业报告 2024-04-10 09:17:58 +08:00
28 changed files with 1394 additions and 607 deletions

3
.gitignore vendored
View File

@ -211,3 +211,6 @@ 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

Binary file not shown.

After

Width:  |  Height:  |  Size: 537 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 371 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 983 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 997 B

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,27 @@
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? indexLocated]) {
if (indexLocated == null) return null;
return indexLocated == tabs.length - 1 ? null : tabs[indexLocated + 1].pageIndex;
}
/// tab上一个tab的pageIndex
int? getPreviousPageIndex([int? indexLocated]) {
if (indexLocated == null) return null;
return indexLocated == 0 ? null : tabs[indexLocated - 1].pageIndex;
}
}

View File

@ -48,6 +48,9 @@ class JobReportModel extends Object {
@JsonKey(name: 'studentAnswerInfos') @JsonKey(name: 'studentAnswerInfos')
List<StudentAnswerInfos> studentAnswerInfos; List<StudentAnswerInfos> studentAnswerInfos;
@JsonKey(name: 'overallInfos')
Map<String,overallInfo> overallInfos;
@JsonKey(name: 'overallTitles') @JsonKey(name: 'overallTitles')
List<OverallTitles> overallTitles; List<OverallTitles> overallTitles;
@ -66,6 +69,14 @@ class JobReportModel extends Object {
@JsonKey(name: 'validStudentNames') @JsonKey(name: 'validStudentNames')
List<String> validStudentNames; List<String> validStudentNames;
@JsonKey(name: 'noAnswerStudents')
List<AnswerOkStudents>? noAnswerStudents;
@JsonKey(name: 'allCorrectStudents')
List<AnswerOkStudents>? allCorrectStudents;
@JsonKey(name: 'validStudents')
List<AnswerOkStudents>? validStudents;
// -- // --
@JsonKey(name: 'allpairsStudents') @JsonKey(name: 'allpairsStudents')
@ -98,12 +109,16 @@ class JobReportModel extends Object {
this.knowledgeInfos, this.knowledgeInfos,
this.questionAnswerInfos, this.questionAnswerInfos,
this.studentAnswerInfos, this.studentAnswerInfos,
this.overallInfos,
this.overallTitles, this.overallTitles,
this.kgReport, this.kgReport,
this.zgReport, this.zgReport,
this.noAnswerStudentNames, this.noAnswerStudentNames,
this.allCorrectStudentNames, this.allCorrectStudentNames,
this.validStudentNames, this.validStudentNames,
this.noAnswerStudents,
this.allCorrectStudents,
this.validStudents,
[ [
this.allpairsStudents, this.allpairsStudents,
this.passStudents, this.passStudents,
@ -384,7 +399,20 @@ class Details extends Object {
@JsonKey(name: 'answerOkStudentNames') @JsonKey(name: 'answerOkStudentNames')
List<String> answerOkStudentNames; List<String> answerOkStudentNames;
Details(this.questionNo,this.questionId,this.partName,this.questionType,this.validRate, @JsonKey(name: 'noAnswerStudents')
List<AnswerOkStudents>? noAnswerStudents;
@JsonKey(name: 'answerOkStudents')
List<AnswerOkStudents>? answerOkStudents;
@JsonKey(name: 'answerNgStudents')
List<AnswerOkStudents>? answerNgStudents;
@JsonKey(name: 'priorityStudents')
List<AnswerOkStudents>? priorityStudents;
Details(this.questionNo,this.questionId,this.partName,this.questionType,this.validRate, this.noAnswerStudents,
this.answerOkStudents,this.answerNgStudents,this.priorityStudents,
this.validCount,this.correctRate,this.questionAnswer,this.questionPicture,this.priorityGeneral, this.validCount,this.correctRate,this.questionAnswer,this.questionPicture,this.priorityGeneral,
this.priorityStudentNames,this.answerNgStudentNames,this.noAnswerStudentNames,this.answerOkStudentNames); this.priorityStudentNames,this.answerNgStudentNames,this.noAnswerStudentNames,this.answerOkStudentNames);
@ -393,3 +421,38 @@ class Details extends Object {
Map<String, dynamic> toJson() => _$DetailsToJson(this); Map<String, dynamic> toJson() => _$DetailsToJson(this);
} }
@JsonSerializable()
class overallInfo extends Object {
@JsonKey(name: 'count')
int count;
@JsonKey(name: 'students')
List<AnswerOkStudents> students;
overallInfo(this.count,this.students,);
factory overallInfo.fromJson(Map<String, dynamic> srcJson) => _$overallInfoFromJson(srcJson);
Map<String, dynamic> toJson() => _$overallInfoToJson(this);
}
@JsonSerializable()
class AnswerOkStudents extends Object {
@JsonKey(name: 'id')
int id;
@JsonKey(name: 'name')
String name;
AnswerOkStudents(this.id,this.name,);
factory AnswerOkStudents.fromJson(Map<String, dynamic> srcJson) => _$AnswerOkStudentsFromJson(srcJson);
Map<String, dynamic> toJson() => _$AnswerOkStudentsToJson(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

@ -5,7 +5,8 @@ import 'package:marking_app/utils/anti_shake_throttling.dart';
// //
class ReturnToHomepage extends StatelessWidget { class ReturnToHomepage extends StatelessWidget {
const ReturnToHomepage({super.key}); final Color? bgColor;
const ReturnToHomepage({super.key,this.bgColor = const Color.fromRGBO(135, 135, 135, 1)});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -16,7 +17,7 @@ class ReturnToHomepage extends StatelessWidget {
child: Container( child: Container(
padding: EdgeInsets.only(right: 4.5.w), padding: EdgeInsets.only(right: 4.5.w),
alignment: Alignment.center, alignment: Alignment.center,
child: Icon(Icons.home_rounded, size: 22.sp, color: Color.fromRGBO(135, 135, 135, 1)), child: Icon(Icons.home_rounded, size: 22.sp, color: bgColor),
), ),
); );
} }

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,24 @@ 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;
var params = MarkingTextQuestionJobTabParamsBus(taskId, _pageIndex);
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 +312,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 +360,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(
@ -389,7 +401,8 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
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 +414,10 @@ 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 +431,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,12 +466,6 @@ 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( // InkWell(
@ -491,7 +522,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 +538,23 @@ 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;
}
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 +577,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 - 1);
jobDetails.nextPageIndex = params.nextPageIndex; jobDetails.nextPageIndex = synchroTabs?.getNextPageIndex(jobDetails.pageIndex - 1);
// //
try { try {
// //
@ -576,6 +618,7 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
pageIndex: jobData.pageIndex, pageIndex: jobData.pageIndex,
nextPageIndex: jobData.nextPageIndex, nextPageIndex: jobData.nextPageIndex,
previousPageIndex: jobData.previousPageIndex, previousPageIndex: jobData.previousPageIndex,
isDefaultFirst: true,
); );
if (model.paperId == 0 && jobData.nextPageIndex != null) { if (model.paperId == 0 && jobData.nextPageIndex != null) {
// //
@ -592,6 +635,7 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
paperId: jobData.prevId, paperId: jobData.prevId,
nextPageIndex: jobData.nextPageIndex, nextPageIndex: jobData.nextPageIndex,
previousPageIndex: jobData.previousPageIndex, previousPageIndex: jobData.previousPageIndex,
isDefaultFirst: false,
); );
if (model.paperId == 0 && jobData.previousPageIndex != null) { if (model.paperId == 0 && jobData.previousPageIndex != null) {
model.paperId = null; model.paperId = null;
@ -627,8 +671,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 +742,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 +796,8 @@ Widget $examPaperAndScoringKeyboardView(
return; return;
} }
// //
toNextQuestionCall(); // toNextQuestionCall();
_useDoScoring.eventFire(model: JobDoPapersSubmitCheckSwitchBus());
}); });
} }
@ -824,7 +865,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 +1073,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) {
if (synchronization) {
tabs.value = result.data!; tabs.value = result.data!;
if (synchronization) {
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 {
@ -121,38 +121,9 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
exitPromptFlag.value = true; exitPromptFlag.value = true;
return tabJob; // return tabJob; //
} }
exitCallback(); exitCallback();
} else { } else {
// //
/**
*
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) ToastUtils.showSuccess('最后一题提交成功');
@ -162,20 +133,6 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
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,12 +7,14 @@ import 'package:functional_widget_annotation/functional_widget_annotation.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/job/job_student_history.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/pages/homework_correction/widget/personal_detail_topbar.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/index.dart'; import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/my_text.dart'; import 'package:marking_app/utils/my_text.dart';
import 'package:marking_app/utils/request/rest_client.dart'; import 'package:marking_app/utils/request/rest_client.dart';
import 'package:marking_app/utils/right_home_icon.dart';
import 'package:percent_indicator/percent_indicator.dart'; import 'package:percent_indicator/percent_indicator.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart'; import 'package:syncfusion_flutter_datepicker/datepicker.dart';
@ -88,8 +90,6 @@ class _JobPersonalDetailState extends State<JobPersonalDetail> with CommonMixin,
} }
totalPages = res.data!.pagedList.totalPages; totalPages = res.data!.pagedList.totalPages;
print('dataLists=${dataList.length}');
print('totalpages=$totalPages');
}); });
} }
@ -110,6 +110,9 @@ class _JobPersonalDetailState extends State<JobPersonalDetail> with CommonMixin,
icon: Icon(Icons.arrow_back_ios, color: Colors.black), icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
), ),
actions: [
ReturnToHomepage(),
],
elevation: 0, elevation: 0,
), ),
body: Column( body: Column(

View File

@ -7,6 +7,7 @@ import 'package:marking_app/common/model/common/base_structure_result.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_review_submission.dart'; import 'package:marking_app/common/model/job/job_review_submission.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/components/ReturnToHomepage.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/index.dart'; import 'package:marking_app/utils/index.dart';
@ -14,7 +15,10 @@ 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;
const JobPriorityReviewSet({Key? key, required this.groupId,required this.title})
: super(key: key);
@override @override
State<JobPriorityReviewSet> createState() => _JobPriorityReviewSetState(); State<JobPriorityReviewSet> createState() => _JobPriorityReviewSetState();
@ -25,6 +29,8 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
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;
@ -35,31 +41,46 @@ 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();
} }
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 { 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();
} }
} }
@ -78,7 +99,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,
@ -86,12 +107,17 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
icon: Icon(Icons.arrow_back_ios, color: Colors.black), icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
), ),
actions: [
ReturnToHomepage(),
],
), ),
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)))
@ -132,7 +158,7 @@ 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(
@ -144,159 +170,256 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
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
? isPadFlag
? GridView(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, crossAxisCount: 2,
mainAxisSpacing: 10.r, mainAxisSpacing: 10.r,
crossAxisSpacing: 10.r, crossAxisSpacing: 10.r,
childAspectRatio: 556 / 112, childAspectRatio: 556 / 112,
),children: List.generate(levelList.length, (index) { ),
children: List.generate(levelList.length, (index) {
JobStudentLevel item = levelList[index]; JobStudentLevel item = levelList[index];
return Container( return Container(
padding: EdgeInsets.symmetric(horizontal: 10.r), padding: EdgeInsets.symmetric(horizontal: 10.r),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.r)), borderRadius:
BorderRadius.all(Radius.circular(10.r)),
color: Colors.white, color: Colors.white,
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded(child: Text(item.studentName,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6888FD)),)), Expanded(
child: Text(
tabIndex == 0?InkWell( item.studentName,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6888FD)),
)),
item.readLevel == 1
? InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isClicking = true; isClicking = true;
}); });
setJobReadLevel(item.studentGroupDetailId,0); setJobReadLevel(
EasyLoading.show(status: 'loading...'); item.studentGroupDetailId, 0);
EasyLoading.show(
status: 'loading...');
}, },
child: Container( child: Container(
height: 20.r, height: 20.r,
width: 70.r, width: 70.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)), borderRadius: BorderRadius.all(
color: isClicking?Color(0xFFDCE3FF):Color(0xFF6888FD), Radius.circular(20.r)),
color: isClicking
? Color(0xFFDCE3FF)
: Color(0xFF6888FD),
), ),
child: Center( child: Center(
child:Text('取消优先',style: TextStyle(fontSize: 10.sp,color: Colors.white),), child: Text(
'取消优先',
style: TextStyle(
fontSize: 10.sp,
color: Colors.white),
), ),
), ),
):InkWell( ),
)
: InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isClicking = true; isClicking = true;
}); });
setJobReadLevel(item.studentGroupDetailId,1); setJobReadLevel(
EasyLoading.show(status: 'loading...'); item.studentGroupDetailId, 1);
EasyLoading.show(
status: 'loading...');
}, },
child: Container( child: Container(
height: 20.r, height: 20.r,
width: 70.r, width: 70.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)), borderRadius: BorderRadius.all(
color: isClicking?Color(0xFF6888FD):Color(0xFFFFFFFF), Radius.circular(20.r)),
border: Border.all(width: 1.r,color: isClicking?Color(0xFFFFFFFF):Color(0xFF6888FD)), color: isClicking
? Color(0xFF6888FD)
: Color(0xFFFFFFFF),
border: Border.all(
width: 1.r,
color: isClicking
? Color(0xFFFFFFFF)
: Color(0xFF6888FD)),
), ),
child: Center( child: Center(
child:Text('设为优先',style: TextStyle(fontSize: 10.sp,color: isClicking?Color(0xFFFFFFFF):Color(0xFF6888FD)),), child: Text(
'设为优先',
style: TextStyle(
fontSize: 10.sp,
color: isClicking
? Color(0xFFFFFFFF)
: Color(0xFF6888FD)),
), ),
), ),
), ),
SizedBox(width: 5.r,), ),
SizedBox(
width: 5.r,
),
InkWell( InkWell(
onTap: () { onTap: () {
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); RouterManager.router.navigateTo(context,
'${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
}, },
child: Container( child: Container(
height: 20.r, height: 20.r,
width: 70.r, width: 70.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)), borderRadius: BorderRadius.all(
Radius.circular(20.r)),
color: Colors.white, color: Colors.white,
border: Border.all(width: 1.r,color: Color(0xFFFCA017)) border: Border.all(
), width: 1.r,
color: Color(0xFFFCA017))),
child: Center( child: Center(
child: Text('详情',style: TextStyle(fontSize: 10.sp,color: Color(0xFFFCA017)),), child: Text(
'详情',
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFFCA017)),
),
), ),
), ),
) )
], ],
), ),
); );
}),):ListView.builder(itemBuilder: (context,index){ }),
)
: ListView.builder(
itemBuilder: (context, index) {
JobStudentLevel item = levelList[index]; JobStudentLevel item = levelList[index];
return Container( return Container(
padding: EdgeInsets.symmetric(vertical:20.r,horizontal: 15.r), padding: EdgeInsets.symmetric(
vertical: 20.r, horizontal: 15.r),
margin: EdgeInsets.only(bottom: 15.r), margin: EdgeInsets.only(bottom: 15.r),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.r)), borderRadius:
BorderRadius.all(Radius.circular(10.r)),
color: Colors.white, color: Colors.white,
), ),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded(child: Text(item.studentName,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6888FD)),)), Expanded(
tabIndex == 0?InkWell( child: Text(
item.studentName,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6888FD)),
)),
item.readLevel == 1
? InkWell(
onTap: () { onTap: () {
setState(() { setState(() {
isClicking = true; isClicking = true;
}); });
setJobReadLevel(item.studentGroupDetailId,0); setJobReadLevel(
EasyLoading.show(status: 'loading...'); item.studentGroupDetailId, 0);
EasyLoading.show(
status: 'loading...');
}, },
child: Container( child: Container(
height: 24.r, height: 24.r,
width: 82.r, width: 82.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)), borderRadius: BorderRadius.all(
color: isClicking?Color(0xFFDCE3FF):Color(0xFF6888FD), Radius.circular(20.r)),
color: isClicking
? Color(0xFFDCE3FF)
: Color(0xFF6888FD),
), ),
child: Center( child: Center(
child:Text('取消优先',style: TextStyle(fontSize: 10.sp,color: Colors.white),), child: Text(
'取消优先',
style: TextStyle(
fontSize: 10.sp,
color: Colors.white),
), ),
), ),
):InkWell( ),
)
: InkWell(
onTap: () { onTap: () {
setJobReadLevel(item.studentGroupDetailId,1); setJobReadLevel(
EasyLoading.show(status: 'loading...'); item.studentGroupDetailId, 1);
EasyLoading.show(
status: 'loading...');
}, },
child: Container( child: Container(
height: 24.r, height: 24.r,
width: 82.r, width: 82.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)), borderRadius: BorderRadius.all(
Radius.circular(20.r)),
color: Color(0xFFFFFFFF), color: Color(0xFFFFFFFF),
border: Border.all(width: 1.r,color: Color(0xFF6888FD)), border: Border.all(
width: 1.r,
color: Color(0xFF6888FD)),
), ),
child: Center( child: Center(
child:Text('设为优先',style: TextStyle(fontSize: 10.sp,color: Color(0xFF6888FD)),), child: Text(
'设为优先',
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF6888FD)),
), ),
), ),
), ),
SizedBox(width: 5.r,), ),
SizedBox(
width: 5.r,
),
InkWell( InkWell(
onTap: () { onTap: () {
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}'); RouterManager.router.navigateTo(context,
'${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
}, },
child: Container( child: Container(
height: 20.r, height: 20.r,
width: 70.r, width: 70.r,
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)), borderRadius: BorderRadius.all(
Radius.circular(20.r)),
color: Colors.white, color: Colors.white,
border: Border.all(width: 1.r,color: Color(0xFFFCA017)) border: Border.all(
), width: 1.r,
color: Color(0xFFFCA017))),
child: Center( child: Center(
child: Text('详情',style: TextStyle(fontSize: 10.sp,color: Color(0xFFFCA017)),), child: Text(
'详情',
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFFCA017)),
),
), ),
), ),
) )
], ],
), ),
); );
},itemCount: levelList.length,):MyEmptyWidget(), },
itemCount: levelList.length,
)
: MyEmptyWidget(),
), ),
), ),
) )
@ -305,4 +428,3 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
); );
} }
} }

View File

@ -8,12 +8,15 @@ import 'package:marking_app/common/model/common/base_structure_result.dart';
import 'package:marking_app/common/model/job/job_report_join_class.dart'; import 'package:marking_app/common/model/job/job_report_join_class.dart';
import 'package:marking_app/common/model/job/job_report_knowledge_model.dart'; import 'package:marking_app/common/model/job/job_report_knowledge_model.dart';
import 'package:marking_app/common/model/job/job_report_model.dart'; import 'package:marking_app/common/model/job/job_report_model.dart';
import 'package:marking_app/components/ReturnToHomepage.dart';
import 'package:marking_app/pages/homework_correction/widget/report_table.dart'; import 'package:marking_app/pages/homework_correction/widget/report_table.dart';
import 'package:marking_app/pages/homework_correction/widget/top_count.dart'; import 'package:marking_app/pages/homework_correction/widget/top_count.dart';
import 'package:marking_app/pages/mainPage.dart';
import 'package:marking_app/routes/RouterManager.dart'; import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/index.dart'; import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/my_text.dart'; import 'package:marking_app/utils/my_text.dart';
import 'package:marking_app/utils/request/rest_client.dart'; import 'package:marking_app/utils/request/rest_client.dart';
import 'package:marking_app/utils/right_home_icon.dart';
import 'package:percent_indicator/linear_percent_indicator.dart'; import 'package:percent_indicator/linear_percent_indicator.dart';
import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view.dart';
@ -252,6 +255,9 @@ class _JobReportState extends State<JobReport> with CommonMixin {
icon: Icon(Icons.arrow_back_ios, color: Colors.black), icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
), ),
actions: [
ReturnToHomepage(),
],
/*actions: [ /*actions: [
// //
$DropdownSelection(involveClasses, classData, call: (JobReportJoinClass _classData) { $DropdownSelection(involveClasses, classData, call: (JobReportJoinClass _classData) {
@ -296,7 +302,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
), ),
), ),
// //
TopCount(data,classData == null?'':classData!.className), TopCount(data,classData == null?'':classData!.className,widget.id),
/* InkWell( /* InkWell(
onTap: (){ onTap: (){
RouterManager.router.navigateTo( RouterManager.router.navigateTo(
@ -345,6 +351,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
bodyList: data.kgReport.details, bodyList: data.kgReport.details,
fixedCols: 1, fixedCols: 1,
fixedRows: 1, fixedRows: 1,
jobId: widget.id,
), ),
) )
], ],
@ -388,6 +395,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
fixedCols: 1, fixedCols: 1,
fixedRows: 1, fixedRows: 1,
isKG: true, isKG: true,
jobId: widget.id,
), ),
) )
], ],
@ -400,13 +408,13 @@ class _JobReportState extends State<JobReport> with CommonMixin {
margin: EdgeInsets.symmetric(horizontal: 10.r), margin: EdgeInsets.symmetric(horizontal: 10.r),
child: $MasterKnowledgePoint(data.knowledgeInfos, detailKnowledgeCall)), child: $MasterKnowledgePoint(data.knowledgeInfos, detailKnowledgeCall)),
// //
Container( /* Container(
margin: EdgeInsets.symmetric(horizontal: 10.r), margin: EdgeInsets.symmetric(horizontal: 10.r),
child: $OverallPerformance(data.studentCount, data.overallTitles)), child: $OverallPerformance(data.studentCount, data.overallTitles)),
// //
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 10.r), margin: EdgeInsets.symmetric(horizontal: 10.r),
child: $UnitTimeAnsweringSituation(widget.id, data.questionAnswerInfos)), child: $UnitTimeAnsweringSituation(widget.id, data.questionAnswerInfos)),*/
// //
Container( Container(
margin: EdgeInsets.symmetric(horizontal: 10.r), child: $PersonnelDataOverview(data.studentAnswerInfos)), margin: EdgeInsets.symmetric(horizontal: 10.r), child: $PersonnelDataOverview(data.studentAnswerInfos)),

View File

@ -7,6 +7,8 @@ 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/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/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';
@ -56,6 +58,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)}',transition: getTransition());
}
@override @override
void dispose() { void dispose() {
super.dispose(); super.dispose();
@ -78,6 +84,9 @@ class _JobStudentGroupState extends State<JobStudentGroup> with CommonMixin {
icon: Icon(Icons.arrow_back_ios, color: Colors.black), icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
), ),
actions: [
ReturnToHomepage(),
],
), ),
body: Padding( body: Padding(
padding: EdgeInsets.only(top: 15.r, left: 14.r, right: 14.r), padding: EdgeInsets.only(top: 15.r, left: 14.r, right: 14.r),
@ -90,136 +99,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

@ -8,6 +8,7 @@ import 'package:marking_app/common/model/common/base_structure_result.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_item_model.dart';
import 'package:marking_app/common/model/job/job_report_join_class.dart'; import 'package:marking_app/common/model/job/job_report_join_class.dart';
import 'package:marking_app/components/ReturnToHomepage.dart';
import 'package:marking_app/pages/homework_correction/pages/favorite_student_dialog.dart'; import 'package:marking_app/pages/homework_correction/pages/favorite_student_dialog.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';
@ -199,6 +200,9 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
title: quickText('收藏夹'), title: quickText('收藏夹'),
centerTitle: true, centerTitle: true,
backgroundColor: Colors.white, backgroundColor: Colors.white,
actions: [
ReturnToHomepage(),
],
), ),
body: MyFutureBuilder.buildFutureBuilderOfSingleInstance<List<Items>>( body: MyFutureBuilder.buildFutureBuilderOfSingleInstance<List<Items>>(
context, context,

View File

@ -9,6 +9,7 @@ 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_favorite_model.dart'; import 'package:marking_app/common/model/job/job_favorite_model.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/components/ReturnToHomepage.dart';
import 'package:marking_app/routes/RouterManager.dart'; import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/index.dart'; import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/my_text.dart'; import 'package:marking_app/utils/my_text.dart';
@ -408,6 +409,9 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
alignment: Alignment.center, alignment: Alignment.center,
), ),
backgroundColor: Colors.white, backgroundColor: Colors.white,
actions: [
ReturnToHomepage(),
],
), ),
body: RefreshIndicator( body: RefreshIndicator(
onRefresh: () async { onRefresh: () async {

View File

@ -4,9 +4,11 @@ import 'package:flutter_screenutil/flutter_screenutil.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/job/job_data_report.dart'; import 'package:marking_app/common/model/job/job_data_report.dart';
import 'package:marking_app/components/ReturnToHomepage.dart';
import 'package:marking_app/pages/homework_correction/widget/student_kg_table.dart'; import 'package:marking_app/pages/homework_correction/widget/student_kg_table.dart';
import 'package:marking_app/pages/homework_correction/widget/student_zg_table.dart'; import 'package:marking_app/pages/homework_correction/widget/student_zg_table.dart';
import 'package:marking_app/routes/RouterManager.dart'; import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/common_utils.dart';
import 'package:marking_app/utils/request/rest_client.dart'; import 'package:marking_app/utils/request/rest_client.dart';
import 'package:marking_app/utils/toast_utils.dart'; import 'package:marking_app/utils/toast_utils.dart';
@ -71,8 +73,8 @@ class _QuickCheckPersonalState extends State<QuickCheckPersonal>
onPressed: () => Navigator.of(context).pop(), onPressed: () => Navigator.of(context).pop(),
), ),
actions: [ actions: [
Title( ReturnToHomepage(),
/* Title(
color: Color(0xFF6888FD), color: Color(0xFF6888FD),
child: Container( child: Container(
child: InkWell( child: InkWell(
@ -86,7 +88,7 @@ class _QuickCheckPersonalState extends State<QuickCheckPersonal>
), ),
alignment: Alignment.center, alignment: Alignment.center,
), ),
), ),*/
], ],
), ),
@ -94,6 +96,41 @@ class _QuickCheckPersonalState extends State<QuickCheckPersonal>
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
children: [ children: [
Padding(
padding: EdgeInsets.only(top: 14.r,left: 14.r),
child: Row(
children: [
InkWell(
onTap: (){
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${widget.studentId}&studentName=${Uri.encodeComponent(studentInfo!.studentName!)}');
},
child: Container(
width: 93.r,
height: 28.r,
decoration: BoxDecoration(
color: Color(0xFFEAF3FF),
borderRadius: BorderRadius.circular(4.r),
),
child: Center(
child: Text('历史查询',style: TextStyle(fontSize: 10.r,color: Color(0xFF2080F7)),),
),
),
),
SizedBox(width: 10.r,),
Container(
width: 93.r,
height: 28.r,
decoration: BoxDecoration(
color: Color(0xFFEDFFF7),
borderRadius: BorderRadius.circular(4.r),
),
child: Center(
child: Text('查看原稿',style: TextStyle(fontSize: 10.r,color: Color(0xFF4CC793)),),
),
),
],
),
),
// //
Container( Container(
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r), padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 10.r),

View File

@ -7,12 +7,14 @@ import 'package:flutter_screenutil/flutter_screenutil.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/job/job_data_report.dart'; import 'package:marking_app/common/model/job/job_data_report.dart';
import 'package:marking_app/components/ReturnToHomepage.dart';
import 'package:marking_app/pages/homework_correction/widget/quick_data_check_bottom.dart'; import 'package:marking_app/pages/homework_correction/widget/quick_data_check_bottom.dart';
import 'package:marking_app/pages/homework_correction/widget/quick_student_data_table.dart'; import 'package:marking_app/pages/homework_correction/widget/quick_student_data_table.dart';
import 'package:marking_app/pages/homework_correction/widget/report_table.dart'; import 'package:marking_app/pages/homework_correction/widget/report_table.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';
import 'package:marking_app/utils/request/rest_client.dart'; import 'package:marking_app/utils/request/rest_client.dart';
import 'package:marking_app/utils/right_home_icon.dart';
import 'package:percent_indicator/linear_percent_indicator.dart'; import 'package:percent_indicator/linear_percent_indicator.dart';
class QuickDataCheckPage extends StatefulWidget { class QuickDataCheckPage extends StatefulWidget {
@ -149,9 +151,7 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
style: TextStyle(fontSize: 14.sp, color: Colors.white), style: TextStyle(fontSize: 14.sp, color: Colors.white),
)), )),
)), )),
SizedBox( ReturnToHomepage(bgColor: Colors.white,),
width: 24.r,
),
], ],
), ),
SizedBox(height: 10.r), SizedBox(height: 10.r),
@ -404,6 +404,7 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
bodyList: jobData!.kgReport.details, bodyList: jobData!.kgReport.details,
fixedCols: 1, fixedCols: 1,
fixedRows: 1, fixedRows: 1,
jobId: widget.jobId,
), ),
) )
], ],
@ -447,6 +448,7 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
fixedCols: 1, fixedCols: 1,
fixedRows: 1, fixedRows: 1,
isKG: true, isKG: true,
jobId: widget.jobId,
), ),
) )
], ],

View File

@ -2,6 +2,8 @@ import 'package:data_table_2/data_table_2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart'; import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:marking_app/common/model/job/job_report_model.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/index.dart'; import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/toast_utils.dart'; import 'package:marking_app/utils/toast_utils.dart';
@ -13,11 +15,13 @@ class ReportTable extends StatefulWidget {
final int? fixedRows; final int? fixedRows;
final int? fixedCols; final int? fixedCols;
final bool? isKG; final bool? isKG;
final int jobId;
const ReportTable({ const ReportTable({
Key? key, Key? key,
required this.headList, required this.headList,
required this.bodyList, required this.bodyList,
required this.jobId,
this.fixedCols = 0, this.fixedCols = 0,
this.fixedRows = 0, this.fixedRows = 0,
this.isKG = false, this.isKG = false,
@ -33,7 +37,11 @@ class _ReportTableState extends State<ReportTable> {
bool _sortAscending = true; bool _sortAscending = true;
void showPeopleListDialog( void showPeopleListDialog(
{required BuildContext context, required String title, required String questionNo,required List arr,List? dcList}) { {required BuildContext context,
required String title,
required String questionNo,
required List arr,
List? dcList}) {
print(dcList); print(dcList);
showDialog( showDialog(
context: context, context: context,
@ -80,21 +88,52 @@ class _ReportTableState extends State<ReportTable> {
), ),
], ],
), ),
SizedBox(height: 15.r,), SizedBox(
dcList != null?Row( height: 15.r,
),
dcList != null
? Row(
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: Center(child: Text('未作答人',style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),))), child: Center(
child: Text(
'未作答人',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))),
Expanded( Expanded(
flex: 1, flex: 1,
child: Center(child: Text('答对人数',style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),))), child: Center(
child: Text(
'答对人数',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))),
Expanded( Expanded(
flex: 1, flex: 1,
child: Center(child: Text('答错人',style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),))), child: Center(
child: Text(
'答错人',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))),
], ],
):Padding(padding: EdgeInsets.only(left: 15.r),child: Text(title,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),),), )
SizedBox(height: 5.r,), : Padding(
padding: EdgeInsets.only(left: 15.r),
child: Text(
title,
style: TextStyle(
fontSize: 12.sp, color: Color(0xFF6A6A6A)),
),
),
SizedBox(
height: 5.r,
),
if (dcList != null) if (dcList != null)
Expanded( Expanded(
child: ListView.builder( child: ListView.builder(
@ -103,39 +142,89 @@ class _ReportTableState extends State<ReportTable> {
var item = arr[index]; var item = arr[index];
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 5.r), padding: EdgeInsets.symmetric(vertical: 5.r),
color: index.isOdd?Colors.white:Color(0xFFF0F0F0), color:
index.isOdd ? Colors.white : Color(0xFFF0F0F0),
child: Row( child: Row(
children: [ children: [
Expanded( Expanded(
flex: 1, flex: 1,
child: Center(child: Text(item['noAnswerStudentNames'],style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),))), child: InkWell(
onTap: () {
goQuickCheckPersonalPath(
item['noAnswerStudents'].id);
},
child: Center(
child: Text(
item['noAnswerStudents'].name,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
)))),
Expanded( Expanded(
flex: 1, flex: 1,
child: Center(child: Text(item['answerOkStudentNames'],style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),))), child: InkWell(
onTap: () {
goQuickCheckPersonalPath(
item['answerOkStudents'].id);
},
child: Center(
child: Text(
item['answerOkStudents'].name,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
)))),
Expanded( Expanded(
flex: 1, flex: 1,
child: Center(child: Text(item['answerNgStudentNames'],style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),))), child: InkWell(
onTap: () {
goQuickCheckPersonalPath(
item['answerNgStudents'].id);
},
child: Center(
child: Text(
item['answerNgStudents'].name,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
)))),
], ],
), ),
); );
},itemCount: arr.length,), },
itemCount: arr.length,
),
) )
else else
arr.length>0?Expanded( arr.length > 0
? Expanded(
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
var item = arr[index]; AnswerOkStudents item = arr[index];
return Container( return InkWell(
padding: EdgeInsets.symmetric(vertical: 5.r,horizontal: 15.r), onTap: () {
color: index.isOdd?Colors.white:Color(0xFFF0F0F0), goQuickCheckPersonalPath(item.id);
child: Text(item,style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),), },
child: Container(
padding: EdgeInsets.symmetric(
vertical: 5.r, horizontal: 15.r),
color: index.isOdd
? Colors.white
: Color(0xFFF0F0F0),
child: Text(
item.name,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
),
),
); );
},itemCount: arr.length,), },
):MyEmptyWidget() itemCount: arr.length,
),
)
: MyEmptyWidget()
], ],
), ),
), ),
@ -143,34 +232,71 @@ class _ReportTableState extends State<ReportTable> {
}); });
} }
void zdHandle( BuildContext context, String title, String questionNo,List noAnswerStudentNames,List answerNgStudentNames, List answerOkStudentNames){ void goQuickCheckPersonalPath(id) {
if (id != -1) {
RouterManager.router.navigateTo(
context,
RouterManager.quickCheckPersonalPath +
'?jobId=${widget.jobId}&studentId=$id',
transition: getTransition(),
);
}
}
void zdHandle(BuildContext context, String title, String questionNo,
List noAnswerStudents, List answerNgStudents, List answerOkStudents) {
List list = []; List list = [];
AnswerOkStudents student = AnswerOkStudents(-1, '-');
if(noAnswerStudentNames.length>answerNgStudentNames.length && noAnswerStudentNames.length>answerOkStudentNames.length){ if (noAnswerStudents.length > answerNgStudents.length &&
for(int i = 0;i<noAnswerStudentNames.length;i++){ noAnswerStudents.length > answerOkStudents.length) {
var obj = {'noAnswerStudentNames':noAnswerStudentNames[i],'answerNgStudentNames':answerNgStudentNames.length>i?answerNgStudentNames[i]:'-', for (int i = 0; i < noAnswerStudents.length; i++) {
'answerOkStudentNames':answerOkStudentNames.length>i?answerOkStudentNames[i]:'-'}; var obj = {
'noAnswerStudents': noAnswerStudents[i],
'answerNgStudents':
answerNgStudents.length > i ? answerNgStudents[i] : student,
'answerOkStudents':
answerOkStudents.length > i ? answerOkStudents[i] : student
};
list.add(obj); list.add(obj);
} }
}else if(answerNgStudentNames.length>noAnswerStudentNames.length && answerNgStudentNames.length>answerOkStudentNames.length){ } else if (answerNgStudents.length > noAnswerStudents.length &&
for(int i = 0;i<answerNgStudentNames.length;i++){ answerNgStudents.length > answerOkStudents.length) {
var obj = {'noAnswerStudentNames':noAnswerStudentNames.length>i?noAnswerStudentNames[i]:'-','answerNgStudentNames':answerNgStudentNames[i], for (int i = 0; i < answerNgStudents.length; i++) {
'answerOkStudentNames':answerOkStudentNames.length>i?answerOkStudentNames[i]:'-'}; var obj = {
'noAnswerStudents':
noAnswerStudents.length > i ? noAnswerStudents[i] : student,
'answerNgStudents': answerNgStudents[i],
'answerOkStudents':
answerOkStudents.length > i ? answerOkStudents[i] : student
};
list.add(obj); list.add(obj);
} }
}else if(answerOkStudentNames.length>noAnswerStudentNames.length && answerOkStudentNames.length>answerNgStudentNames.length){ } else if (answerOkStudents.length > noAnswerStudents.length &&
for(int i = 0;i<answerOkStudentNames.length;i++){ answerOkStudents.length > answerNgStudents.length) {
var obj = {'noAnswerStudentNames':noAnswerStudentNames.length>i?noAnswerStudentNames[i]:'-','answerNgStudentNames':answerNgStudentNames.length>i?answerNgStudentNames[i]:'-', for (int i = 0; i < answerOkStudents.length; i++) {
'answerOkStudentNames':answerOkStudentNames[i]}; var obj = {
'noAnswerStudents':
noAnswerStudents.length > i ? noAnswerStudents[i] : student,
'answerNgStudents':
answerNgStudents.length > i ? answerNgStudents[i] : student,
'answerOkStudents': answerOkStudents[i]
};
list.add(obj); list.add(obj);
} }
} }
showPeopleListDialog(context:context, title:title, questionNo:questionNo,arr:list,dcList:[]); showPeopleListDialog(
context: context,
title: title,
questionNo: questionNo,
arr: list,
dcList: []);
} }
void dcHandle( BuildContext context, String title, String questionNo,List arr){ void dcHandle(
showPeopleListDialog(context:context, title:title, questionNo:questionNo,arr: arr); BuildContext context, String title, String questionNo, List arr) {
showPeopleListDialog(
context: context, title: title, questionNo: questionNo, arr: arr);
} }
DataRow _getRow(int index, [Color? color]) { DataRow _getRow(int index, [Color? color]) {
@ -196,8 +322,8 @@ class _ReportTableState extends State<ReportTable> {
)), )),
DataCell(InkWell( DataCell(InkWell(
onTap: () { onTap: () {
zdHandle(context, '作答人数', item.questionNo,item.noAnswerStudentNames,item.answerNgStudentNames,item.answerOkStudentNames); zdHandle(context, '作答人数', item.questionNo, item.noAnswerStudents,
item.answerNgStudents, item.answerOkStudents);
}, },
child: Center( child: Center(
child: Padding( child: Padding(
@ -263,7 +389,8 @@ class _ReportTableState extends State<ReportTable> {
DataCell(InkWell( DataCell(InkWell(
onTap: () { onTap: () {
List<String> parts = item.priorityGeneral.split(''); List<String> parts = item.priorityGeneral.split('');
dcHandle(context, '${parts[1]}', item.questionNo,item.priorityStudentNames); dcHandle(context, '${parts[1]}', item.questionNo,
item.priorityStudents);
}, },
child: Center( child: Center(
child: Padding( child: Padding(
@ -322,7 +449,9 @@ class _ReportTableState extends State<ReportTable> {
fixedCornerColor: Colors.grey[400], fixedCornerColor: Colors.grey[400],
minWidth: widget.headList.length > 6 minWidth: widget.headList.length > 6
? 80.r * widget.headList.length ? 80.r * widget.headList.length
: isPadFlag?MediaQuery.of(context).size.width:85.r * widget.headList.length, : isPadFlag
? MediaQuery.of(context).size.width
: 85.r * widget.headList.length,
fixedTopRows: widget.fixedRows!, fixedTopRows: widget.fixedRows!,
fixedLeftColumns: widget.fixedCols!, fixedLeftColumns: widget.fixedCols!,
sortColumnIndex: _sortColumnIndex, sortColumnIndex: _sortColumnIndex,
@ -340,8 +469,10 @@ class _ReportTableState extends State<ReportTable> {
? 40.r ? 40.r
: widget.headList.length > 6 : widget.headList.length > 6
? 80.r ? 80.r
: isPadFlag?(MediaQuery.of(context).size.width - 8.r) / : isPadFlag
widget.headList.length:85.r, ? (MediaQuery.of(context).size.width - 8.r) /
widget.headList.length
: 85.r,
); );
}), }),
rows: List<DataRow>.generate(widget.bodyList.length, rows: List<DataRow>.generate(widget.bodyList.length,

View File

@ -0,0 +1,149 @@
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;
const StudentGroupList(this.studentGroups,this.goNextPage,{Key? key}) : 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,
),
),
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 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: (){
goNextPage(item.groupId,item.groupName);
// 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

@ -2,6 +2,7 @@ import 'package:data_table_2/data_table_2.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
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/utils/common_utils.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart'; import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view.dart';
@ -80,7 +81,7 @@ class _StudentZgTableState extends State<StudentZgTable> {
DataCell(Center( DataCell(Center(
child: Padding( child: Padding(
padding: EdgeInsets.symmetric(horizontal: 5.r), padding: EdgeInsets.symmetric(horizontal: 5.r),
child: Text(item.useTime.toString(), child: Text(CommonUtils.second2HMS(item.useTime!),
style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))), style: TextStyle(fontSize: 12.sp, color: Color(0xFF525252))),
), ),
)), )),

View File

@ -1,24 +1,28 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
import 'package:marking_app/common/model/job/job_report_model.dart'; import 'package:marking_app/common/model/job/job_report_model.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/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;
const TopCount(this.data,this.className,{Key? key}) : super(key: key); final int jobId;
void showStudentListDialog( const TopCount(this.data, this.className, this.jobId, {Key? key}) : super(key: key);
{required BuildContext context, required String title,required List arr}) {
void showStudentListDialog({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,
@ -28,29 +32,43 @@ 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(
height: 5.r, height: 5.r,
), ),
SizedBox(height: 15.r,), SizedBox(
arr.length>0?Expanded( height: 15.r,
),
arr.length > 0
? Expanded(
child: ListView.builder( child: ListView.builder(
shrinkWrap: true, shrinkWrap: true,
itemBuilder: (context, index) { itemBuilder: (context, index) {
var item = arr[index]; AnswerOkStudents item = arr[index];
return Container( return InkWell(
onTap: () {
RouterManager.router.navigateTo(
context,
RouterManager.quickCheckPersonalPath + '?jobId=$jobId&studentId=${item.id}',
transition: getTransition(),
);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 15.r), padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 15.r),
color: index.isOdd ? Colors.white : Color(0xFFF0F0F0), color: index.isOdd ? Colors.white : Color(0xFFF0F0F0),
child: Text(item,style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),), child: Text(
item.name,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)),
),
),
); );
},itemCount: arr.length,), },
):MyEmptyWidget() itemCount: arr.length,
),
)
: MyEmptyWidget()
], ],
), ),
), ),
@ -58,11 +76,12 @@ 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 rightWidth = (MediaQuery.of(context).size.width - 40.r) * 0.3 / 2;
return Container( return Container(
padding: EdgeInsets.symmetric(vertical: 20.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),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white, color: Colors.white,
@ -71,16 +90,96 @@ class TopCount extends StatelessWidget {
child: Column( child: Column(
children: [ children: [
Row( Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
InkWell(
onTap: () {
showStudentListDialog(context: context, title: '未提交作业学生', arr: data.noAnswerStudents!);
},
child: leftContainer(context, count: data.noAnswerCount, name: '未提交', nameColor: Color(0xFFD92F2F), bgColor: Color(0xFFEEEEEE)),
),
InkWell(
onTap: () {
showStudentListDialog(context: context, title: '已提交作业学生', arr: data.validStudents!);
},
child: leftContainer(context, count: data.validCount, name: '已提交', nameColor: Color(0xFF4CC793), bgColor: Color(0xFFF5F5F5)),
),
InkWell(
onTap: () {
showStudentListDialog(context: context, title: '全对作业学生', arr: data.allCorrectStudents!);
},
child: leftContainer(context, count: data.allCorrect, name: '全对', nameColor: Color(0xFFFF9800), bgColor: Color(0xFFEEEEEE)),
),
Container(
height: 92.r,
width: rightWidth,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: InkWell(
onTap: () {
showStudentListDialog(context: context, title: '优等作业学生', arr: data.overallInfos['']!.students);
},
child: rightContainer(
count: data.overallInfos['']!.count,
bgColor: Color(0xFF56FFB8),
nameColor: Color(0xFF009254),
name: '',
),
)),
Expanded(
child: InkWell(
onTap: () {
showStudentListDialog(context: context, title: '中等作业学生', arr: data.overallInfos['']!.students);
},
child:
rightContainer(count: data.overallInfos['']!.count, bgColor: Color(0xFFD3FF93), nameColor: Color(0xFF3F6605), name: ''),
)),
],
),
),
Container(
height: 92.r,
width: rightWidth,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(
child: InkWell(
onTap: () {
showStudentListDialog(context: context, title: '良等作业学生', arr: data.overallInfos['']!.students);
},
child:
rightContainer(count: data.overallInfos['']!.count, bgColor: Color(0xFFFFC38C), nameColor: Color(0xFFD36500), name: ''),
)),
Expanded(
child: InkWell(
onTap: () {
showStudentListDialog(context: context, title: '差等作业学生', arr: data.overallInfos['']!.students);
},
child:
rightContainer(count: data.overallInfos['']!.count, bgColor: Color(0xFFFF9D94), nameColor: Color(0xFFD12616), name: ''),
)),
],
),
)
],
),
/* Row(
mainAxisAlignment: MainAxisAlignment.spaceEvenly, mainAxisAlignment: MainAxisAlignment.spaceEvenly,
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
showStudentListDialog(context:context,title: '未提交作业学生',arr: data.noAnswerStudentNames); showStudentListDialog(
context: context,
title: '未提交作业学生',
arr: data.noAnswerStudentNames);
}, },
child: Container( child: Container(
width: 81.r, width: 81.r,
padding: EdgeInsets.symmetric( padding:
vertical: 10.r, horizontal: 6.r), EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 1.r, width: 1.r,
@ -91,7 +190,9 @@ class TopCount extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 5.r,), SizedBox(
height: 5.r,
),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
@ -125,12 +226,15 @@ class TopCount extends StatelessWidget {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
showStudentListDialog(context:context,title: '已提交作业学生',arr: data.validStudentNames); showStudentListDialog(
context: context,
title: '已提交作业学生',
arr: data.validStudentNames);
}, },
child: Container( child: Container(
width: 81.r, width: 81.r,
padding: EdgeInsets.symmetric( padding:
vertical: 10.r, horizontal: 6.r), EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 1.r, width: 1.r,
@ -141,7 +245,9 @@ class TopCount extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 5.r,), SizedBox(
height: 5.r,
),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
@ -175,12 +281,15 @@ class TopCount extends StatelessWidget {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
showStudentListDialog(context:context,title: '全对作业学生',arr: data.allCorrectStudentNames); showStudentListDialog(
context: context,
title: '全对作业学生',
arr: data.allCorrectStudentNames);
}, },
child: Container( child: Container(
width: 81.r, width: 81.r,
padding: EdgeInsets.symmetric( padding:
vertical: 10.r, horizontal: 6.r), EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
width: 1.r, width: 1.r,
@ -191,7 +300,9 @@ class TopCount extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 5.r,), SizedBox(
height: 5.r,
),
Row( Row(
crossAxisAlignment: CrossAxisAlignment.end, crossAxisAlignment: CrossAxisAlignment.end,
children: [ children: [
@ -227,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(
@ -273,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: TextStyle( style: TextStyle(color: bgColor, fontSize: 12.r),
color: bgColor, fontSize: 12.r),
)), )),
), ),
], ],
@ -293,15 +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)),
), ),
], ],
), ),
@ -315,3 +418,78 @@ class TopCount extends StatelessWidget {
); );
} }
} }
@swidget
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;
return Container(
width: leftWidth,
height: 92.r,
padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r),
color: bgColor,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 5.r,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
count.toString(),
style: TextStyle(fontSize: 18.sp, color: Color(0xFF595959), fontWeight: FontWeight.w600),
),
Text(
'',
style: TextStyle(fontSize: 10.sp, color: Color(0xFF595959), fontWeight: FontWeight.w600),
),
],
),
SizedBox(
height: 20.r,
),
Text(
name,
style: TextStyle(fontSize: 12.sp, color: nameColor, fontWeight: FontWeight.w500),
)
],
),
);
}
@swidget
Widget rightContainer({required int count, required Color bgColor, required Color nameColor, required String name}) {
return Container(
color: bgColor,
child: Column(
children: [
SizedBox(
height: 5.r,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
count.toString(),
style: TextStyle(fontSize: 12.sp, color: nameColor, fontWeight: FontWeight.w600),
),
Text(
'',
style: TextStyle(fontSize: 8.sp, color: nameColor, fontWeight: FontWeight.w600),
),
],
),
SizedBox(
height: 5.r,
),
Text(
name,
style: TextStyle(fontSize: 12.sp, color: nameColor, fontWeight: FontWeight.w500),
)
],
),
);
}

View File

@ -0,0 +1,97 @@
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
class ReportHistory extends StatefulWidget {
const ReportHistory({Key? key}) : super(key: key);
@override
State<ReportHistory> createState() => _ReportHistoryState();
}
class _ReportHistoryState extends State<ReportHistory> {
bool isWork = true;
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Color(0xFFEDF0FF),
appBar: AppBar(
backgroundColor: Colors.white,
title: Text(
'已完成报告',
style: TextStyle(fontSize: 14.r, color: Color(0xFF000000)),
),
centerTitle: true,
leading: IconButton(
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
),
),
body: Column(
children: [
Container(
width: MediaQuery.of(context).size.width * 0.8,
height: 40.r,
margin: EdgeInsets.only(
top: 10.r, left: MediaQuery.of(context).size.width * 0.2 / 2),
padding: EdgeInsets.all(2.r),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.circular(8.r),
),
child: Row(
children: [
Expanded(
child: InkWell(
onTap: (){
isWork = true;
setState(() {
});
},
child: Container(
decoration: BoxDecoration(
color: isWork ? Color(0xFF6988FD) : Colors.white,
borderRadius: BorderRadius.circular(8.r),
),
child: Center(
child: Text(
'作业',
style: TextStyle(
fontSize: 14.r,
color: isWork ? Colors.white : Color(0xFF505E6E)),
),
),
),
)),
Expanded(
child: InkWell(
onTap: (){
isWork = false;
setState(() {
});
},
child: Container(
decoration: BoxDecoration(
color: !isWork ? Color(0xFF6988FD) : Colors.white,
borderRadius: BorderRadius.circular(8.r),
),
child: Center(
child: Text(
'考试',
style: TextStyle(
fontSize: 14.r,
color: !isWork ? Colors.white : Color(0xFF505E6E)),
),
),
),
)),
],
),
)
],
),
);
}
}

View File

@ -34,6 +34,7 @@ import 'package:marking_app/pages/mine/index.dart';
import 'package:marking_app/pages/mine/other_pages/index.dart'; import 'package:marking_app/pages/mine/other_pages/index.dart';
import 'package:marking_app/pages/other/agreement_page.dart'; import 'package:marking_app/pages/other/agreement_page.dart';
import 'package:marking_app/pages/report_detail/index.dart'; import 'package:marking_app/pages/report_detail/index.dart';
import 'package:marking_app/pages/report_detail/report_history.dart';
import 'package:marking_app/pages/reports/report_class_teacher.dart'; import 'package:marking_app/pages/reports/report_class_teacher.dart';
import 'package:marking_app/pages/reports/report_personal_subject.dart'; import 'package:marking_app/pages/reports/report_personal_subject.dart';
import 'package:marking_app/pages/reports/report_subject_teacher.dart'; import 'package:marking_app/pages/reports/report_subject_teacher.dart';
@ -74,6 +75,8 @@ class RouterManager {
static const String jobPriorityReviewSetPath = '/homework_correction/job_priority_review_set'; static const String jobPriorityReviewSetPath = '/homework_correction/job_priority_review_set';
static const String jobStudentGroupPath = '/homework_correction/job_student_group'; static const String jobStudentGroupPath = '/homework_correction/job_student_group';
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 reportHistoryPath = '/report_detail/report_history';
// TheMine // TheMine
@ -306,7 +309,8 @@ 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];
return JobPriorityReviewSet(groupId: groupId,title:title);
}, },
); );
@ -342,6 +346,23 @@ class RouterManager {
return JobPersonalDetail(studentId: studentId,studentName:studentName); return JobPersonalDetail(studentId: studentId,studentName:studentName);
}, },
); );
//
static final _reportCardDialogPathHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
/* String studentName = params['studentName']![0];
int studentId = int.parse(params['studentId']![0]);
return ReportCardDialog(studentId: studentId,studentName:studentName);*/
},
);
//
static final _reportHistoryPathHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
/* String studentName = params['studentName']![0];
int studentId = int.parse(params['studentId']![0]);*/
return ReportHistory();
},
);
// //
// 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());
@ -386,6 +407,8 @@ class RouterManager {
router.define(jobStudentGroupPath, handler: _jobStudentGroupPageHandler, transitionType: TransitionType.material); router.define(jobStudentGroupPath, handler: _jobStudentGroupPageHandler, transitionType: TransitionType.material);
router.define(jobFavoritePagePath, handler: _jobFavoritePagePathHandler, transitionType: TransitionType.material); router.define(jobFavoritePagePath, handler: _jobFavoritePagePathHandler, transitionType: TransitionType.material);
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(reportHistoryPath, handler: _reportHistoryPathHandler, transitionType: TransitionType.material);
// getTransition() // getTransition()

View File

@ -18,4 +18,31 @@ class CommonUtils {
// digest.toString() // digest.toString()
return hex.encode(digest.bytes); return hex.encode(digest.bytes);
} }
///
static String zeroFill(int i) {
return i >= 10 ? "$i" : "0$i";
}
///
static String second2HMS(int sec, {bool isEasy = false}) {
String hms = "0";
if (!isEasy) hms = "0秒";
if (sec > 0) {
int h = sec ~/ 3600;
int m = (sec % 3600) ~/ 60;
int s = sec % 60;
/* hms = "${zeroFill(h)}:${zeroFill(m)}:${zeroFill(s)}";
if (!isEasy) hms = "${zeroFill(h)}${zeroFill(m)}${zeroFill(s)}";*/
if(h>0){
hms = "$h时$m分$s秒";
}else{
if(m>0){
hms = "$m分$s秒";
}else{
hms = "$s秒";
}
}
}
return hms;
}
} }

View File

@ -0,0 +1,9 @@
import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
Padding homeIcon({double? top = 5,double? right = 8,String? color = 'black'}){
return Padding(
padding: EdgeInsets.only(top:top!.r,right: right!.r),
child: Image.asset('assets/images/home_icon_$color.png',width: 18.r,height: 18.r,),
);
}