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_student_history.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')
List<StudentAnswerInfos> studentAnswerInfos;
@JsonKey(name: 'overallInfos')
Map<String,overallInfo> overallInfos;
@JsonKey(name: 'overallTitles')
List<OverallTitles> overallTitles;
@ -66,6 +69,14 @@ class JobReportModel extends Object {
@JsonKey(name: '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')
@ -98,12 +109,16 @@ class JobReportModel extends Object {
this.knowledgeInfos,
this.questionAnswerInfos,
this.studentAnswerInfos,
this.overallInfos,
this.overallTitles,
this.kgReport,
this.zgReport,
this.noAnswerStudentNames,
this.allCorrectStudentNames,
this.validStudentNames,
this.noAnswerStudents,
this.allCorrectStudents,
this.validStudents,
[
this.allpairsStudents,
this.passStudents,
@ -384,7 +399,20 @@ class Details extends Object {
@JsonKey(name: '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.priorityStudentNames,this.answerNgStudentNames,this.noAnswerStudentNames,this.answerOkStudentNames);
@ -393,3 +421,38 @@ class Details extends Object {
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')
int? studentId;
@JsonKey(name: 'defaultFirst')
bool? isDefaultFirst;
MarkingTextQuestionJobTabParams({
required this.taskId,
required this.pageIndex,
this.isDefaultFirst,
this.paperId,
this.studentId,
this.nextPageIndex,
this.previousPageIndex,
});
factory MarkingTextQuestionJobTabParams.fromJson(Map<String, dynamic> srcJson) =>
_$MarkingTextQuestionJobTabParamsFromJson(srcJson);
factory MarkingTextQuestionJobTabParams.fromJson(Map<String, dynamic> srcJson) => _$MarkingTextQuestionJobTabParamsFromJson(srcJson);
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 {
const ReturnToHomepage({super.key});
final Color? bgColor;
const ReturnToHomepage({super.key,this.bgColor = const Color.fromRGBO(135, 135, 135, 1)});
@override
Widget build(BuildContext context) {
@ -16,7 +17,7 @@ class ReturnToHomepage extends StatelessWidget {
child: Container(
padding: EdgeInsets.only(right: 4.5.w),
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:convert';
import 'package:collection/collection.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/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_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_params.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/eventBus/marking_text_question_job_tab_params_bus.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';
// utils
@ -147,7 +151,6 @@ class ReviewStatusInfo extends HookWidget with CommonMixin {
if (doMarkingInfo.value == null) return Container();
return InkWell(
onTap: () async {
print('点击了...');
List<JobConcernedWithStudent>? students = await getStudents();
if (students == null) return;
students = students..sort((e, e1) => e.studentName.compareTo(e1.studentName));
@ -228,17 +231,18 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
UseSwitchStudentAndType _useSwitchStudentAndType = UseSwitchStudentAndType.use(); //
// 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;
JobDoPapersStudentBus? studentBus = _useSwitchStudentAndType.studentBusInfo.value;
if (studentBus != null && studentBus.pageIndex == thePageIndex) return; //
if (thePageIndex != null) {
_useSwitchStudentAndType.getDataForStudents(taskId: taskId, pageIndex: thePageIndex);
int indexLocated = _useSwitchStudentAndType.tabs.value.indexWhere((element) => element.pageIndex == thePageIndex);
_useSwitchStudentAndType.eventFire(
model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex,
nextPageIndex: _useSwitchStudentAndType.getNextPageIndex(indexLocated),
previousPageIndex: _useSwitchStudentAndType.getPreviousPageIndex(indexLocated)));
_useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex));
}
});
useValueChanged<JobConcernedWithStudent?, String>(_useSwitchStudentAndType.currentStudent.value, (oldData, __) {
@ -247,15 +251,8 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
if (studentBus != null && studentBus.studentId == studentId) return; //
var thePageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex;
if (thePageIndex != null) //
{
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)),
);
if (thePageIndex != null) {
_useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex, studentId: studentId));
}
});
@ -289,6 +286,24 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
_useSwitchStudentAndType.currentTab.value =
_useSwitchStudentAndType.tabs.value.firstWhere((element) => moldeParams.pageIndex == element.pageIndex);
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:
}
},
@ -297,9 +312,6 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
_useSwitchStudentAndType.eventCancel();
};
}, []);
var _currentTab = _useSwitchStudentAndType.currentTab.value;
return Container(
padding: EdgeInsets.only(bottom: 2.r, left: 12.r, right: 12.r),
decoration: BoxDecoration(
@ -348,7 +360,7 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 5,
flex: 4,
child: Container(
padding: EdgeInsets.only(left: 10.w),
decoration: BoxDecoration(
@ -389,7 +401,8 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end,
children: [
if (_useSwitchStudentAndType.isFinish.value && _currentTab?.finishCount != _currentTab?.total)
if (_useSwitchStudentAndType.isFinish.value &&
_useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.finishCount < e.total) != null)
Expanded(
child: Row(
mainAxisSize: MainAxisSize.min,
@ -401,10 +414,10 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
onTap: () => easyThrottle(
'DO_PAPERS_JOB_CONTINUE_TO_REVIEW',
() {
var _pageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex;
if (_pageIndex == null) return;
_useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, _pageIndex));
var _currentTabNew = _useSwitchStudentAndType.tabs.value.firstWhere((e) => e.finishCount < e.total);
_useSwitchStudentAndType.eventFire(
model: MarkingTextQuestionJobTabParamsBus(taskId, _currentTabNew.pageIndex),
);
},
),
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(
alignment: const FractionalOffset(0.52, 0.24),
children: [
@ -429,12 +466,6 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
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(
@ -491,7 +522,9 @@ class ExamPaperAndScoringView extends StatefulHookConsumerWidget {
class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringView> with EventBusMixin, CommonMixin {
final GlobalKey<JobPictureOverviewState> scaffoldKeyPictureOverview = GlobalKey<JobPictureOverviewState>();
Future<MarkingTextQuestionJob?>? _future; //
MarkingTextQuestionJob? theJobData;
bool firstLoading = true;
JobDoSynchroTab? synchroTabs;
late RemoveListener _doJobObtainGradingDataProviderListener; //
@override
@ -505,15 +538,23 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
eventOn(callback: (eventVal) {
switch (eventVal.runtimeType) {
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(
pageIndex: theEventVal.pageIndex,
taskId: theEventVal.taskId,
studentId: theEventVal.studentId,
previousPageIndex: theEventVal.previousPageIndex,
nextPageIndex: theEventVal.nextPageIndex,
isDefaultFirst: isDefaultFirst,
));
break;
case JobDoSynchroTab:
synchroTabs = eventVal as JobDoSynchroTab;
break;
default:
}
});
@ -536,9 +577,10 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
BaseStructureResult<MarkingTextQuestionJob> _result = await _client.getJobTabOfExam(params);
if (_result.success) {
var jobDetails = _result.data;
theJobData = jobDetails;
if (jobDetails != null) {
jobDetails.previousPageIndex = params.previousPageIndex;
jobDetails.nextPageIndex = params.nextPageIndex;
jobDetails.previousPageIndex = synchroTabs?.getPreviousPageIndex(jobDetails.pageIndex - 1);
jobDetails.nextPageIndex = synchroTabs?.getNextPageIndex(jobDetails.pageIndex - 1);
//
try {
//
@ -576,6 +618,7 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
pageIndex: jobData.pageIndex,
nextPageIndex: jobData.nextPageIndex,
previousPageIndex: jobData.previousPageIndex,
isDefaultFirst: true,
);
if (model.paperId == 0 && jobData.nextPageIndex != null) {
//
@ -592,6 +635,7 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
paperId: jobData.prevId,
nextPageIndex: jobData.nextPageIndex,
previousPageIndex: jobData.previousPageIndex,
isDefaultFirst: false,
);
if (model.paperId == 0 && jobData.previousPageIndex != null) {
model.paperId = null;
@ -627,8 +671,6 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
final double containerHeight = constraints.maxHeight; //
if (jobData == null) return Container(); //
// print('容器宽度:${containerWidth};容器高度:${containerHeight}');
return Stack(
children: [
JobPictureOverview(
@ -700,12 +742,10 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
child: (jobData?.questions ?? []).isEmpty
? null
: $ExamPaperAndScoringKeyboardView(
data: jobData!,
data: jobData,
questions: questions,
toNextQuestionCall: () => switchTestQuestions(jobData: jobData),
switchQuestionTypes: () {
eventFire(model: JobCheckSwitchingQuestionTabBus(jobData.pageIndex));
},
switchQuestionTypes: () => eventFire(model: JobCheckSwitchingQuestionTabBus(jobData.pageIndex)),
viewHomeworkNotes: (JobReviewQuestions subJobQuestion) {
var _theBusModel =
JobNotesViewBus(taskId: jobData.taskId, paperId: jobData.paperId, questionNo: subJobQuestion.questionNo);
@ -756,7 +796,8 @@ Widget $examPaperAndScoringKeyboardView(
return;
}
//
toNextQuestionCall();
// toNextQuestionCall();
_useDoScoring.eventFire(model: JobDoPapersSubmitCheckSwitchBus());
});
}
@ -824,7 +865,12 @@ Widget $examPaperAndScoringKeyboardView(
if (question.accuracy > 0)
Padding(
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
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(
color: bgc,
borderRadius: borderRadius,

View File

@ -82,8 +82,8 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
RestClient client = await getClient();
BaseStructureResult<List<JobPageTab>> result = await client.getJobOfTabs(taskId);
if (result.success && result.data != null) {
tabs.value = result.data!;
if (synchronization) {
tabs.value = result.data!;
currentTab.value = tabs.value.firstWhere((e) => e.finishCount < e.total, orElse: () => tabs.value[0]);
}
} else {
@ -121,38 +121,9 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
exitPromptFlag.value = true;
return tabJob; //
}
exitCallback();
} 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;
if (tabJob != null) currentTab.value = tabJob;
if (tabJob == null && exitPromptFlag.value) ToastUtils.showSuccess('最后一题提交成功');
@ -162,20 +133,6 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
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 {
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/model/common/base_structure_result.dart';
import 'package:marking_app/common/model/job/job_student_history.dart';
import 'package:marking_app/components/ReturnToHomepage.dart';
import 'package:marking_app/pages/homework_correction/widget/personal_detail_topbar.dart';
import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/my_text.dart';
import 'package:marking_app/utils/request/rest_client.dart';
import 'package:marking_app/utils/right_home_icon.dart';
import 'package:percent_indicator/percent_indicator.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
@ -88,8 +90,6 @@ class _JobPersonalDetailState extends State<JobPersonalDetail> with CommonMixin,
}
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),
onPressed: () => Navigator.of(context).pop(),
),
actions: [
ReturnToHomepage(),
],
elevation: 0,
),
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_review_submission.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/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart';
@ -14,17 +15,22 @@ import 'package:marking_app/utils/request/rest_client.dart';
class JobPriorityReviewSet extends StatefulWidget {
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
State<JobPriorityReviewSet> createState() => _JobPriorityReviewSetState();
}
class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
with CommonMixin,SingleTickerProviderStateMixin {
with CommonMixin, SingleTickerProviderStateMixin {
late final EasyRefreshController refreshController;
late TabController tabController;
int tabIndex = 0;
List list1 = [];
List list2 = [];
List levelList = [];
bool isClicking = false;
@ -35,32 +41,47 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
refreshController = EasyRefreshController();
tabController =
TabController(initialIndex: tabIndex, length: 2, vsync: this);
getReadLevel();
getList();
}
void getReadLevel() async{
RestClient _client = await getClient();
BaseStructureResult<List<JobStudentLevel>> res = await _client.getJobReadLevel(widget.groupId,tabIndex == 0?1:0);
void getList() async {
await getReadLevel(1);
await getReadLevel(0);
setState(() {
if(res.success){
levelList = res.data!;
isClicking = false;
}else{
levelList = [];
}
levelList = [...list1, ...list2];
isClicking = false;
});
EasyLoading.dismiss();
refreshController.finishRefresh();
}
void setJobReadLevel(int studentId,int level) async{
getReadLevel(int readLevel) async {
RestClient _client = await getClient();
BaseStructureResult<List<JobStudentLevel>> res =
await _client.getJobReadLevel(widget.groupId, readLevel);
if (res.success) {
if (readLevel == 1) {
list1 = res.data!;
} else {
list2 = res.data!;
}
} else {
if (readLevel == 1) {
list1 = [];
} else {
list2 = [];
}
}
}
void setJobReadLevel(int studentId, int level) async {
RestClient _client = await getClient();
JobLevelSetParams params = JobLevelSetParams(studentId, level);
BaseStructureResult res = await _client.getSetJobReadLevel(params);
if(res.code == 200){
getReadLevel();
}
BaseStructureResult res = await _client.getSetJobReadLevel(params);
if (res.code == 200) {
getList();
}
}
@override
@ -78,7 +99,7 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
appBar: AppBar(
backgroundColor: Colors.white,
title: Text(
'优先批阅人配置',
widget.title,
style: TextStyle(fontSize: 14.sp, color: Color(0xFF333333)),
),
centerTitle: true,
@ -86,12 +107,17 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
),
actions: [
ReturnToHomepage(),
],
),
body: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 10.r,),
Container(
SizedBox(
height: 10.r,
),
/* Container(
padding: EdgeInsets.symmetric(horizontal: 14.r),
decoration: BoxDecoration(
border: Border(bottom: BorderSide(width: 1.r,color: Color(0xFFCCCCCC)))
@ -132,171 +158,268 @@ class _JobPriorityReviewSetState extends State<JobPriorityReviewSet>
indicatorSize: TabBarIndicatorSize.label,
labelPadding: const EdgeInsets.all(0),
),
),
),*/
Expanded(
child:Padding(
padding: EdgeInsets.symmetric(vertical:14.r,horizontal: 14.r),
child: Padding(
padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r),
child: EasyRefresh(
firstRefresh: true,
taskIndependence: true,
controller: refreshController,
header: MaterialHeader(),
footer: TaurusFooter(),
onRefresh: () async{
getReadLevel();
onRefresh: () async {
getList();
},
child: levelList.length>0?isPadFlag?GridView(gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 10.r,
crossAxisSpacing: 10.r,
childAspectRatio: 556 / 112,
),children: List.generate(levelList.length, (index) {
JobStudentLevel item = levelList[index];
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Text(item.studentName,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6888FD)),)),
tabIndex == 0?InkWell(
onTap: (){
setState(() {
isClicking = true;
});
setJobReadLevel(item.studentGroupDetailId,0);
EasyLoading.show(status: 'loading...');
},
child: Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)),
color: isClicking?Color(0xFFDCE3FF):Color(0xFF6888FD),
child: levelList.length > 0
? isPadFlag
? GridView(
gridDelegate:
SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2,
mainAxisSpacing: 10.r,
crossAxisSpacing: 10.r,
childAspectRatio: 556 / 112,
),
child: Center(
child:Text('取消优先',style: TextStyle(fontSize: 10.sp,color: Colors.white),),
),
),
):InkWell(
onTap: (){
setState(() {
isClicking = true;
});
setJobReadLevel(item.studentGroupDetailId,1);
EasyLoading.show(status: 'loading...');
},
child: Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)),
color: isClicking?Color(0xFF6888FD):Color(0xFFFFFFFF),
border: Border.all(width: 1.r,color: isClicking?Color(0xFFFFFFFF):Color(0xFF6888FD)),
),
child: Center(
child:Text('设为优先',style: TextStyle(fontSize: 10.sp,color: isClicking?Color(0xFFFFFFFF):Color(0xFF6888FD)),),
),
),
),
SizedBox(width: 5.r,),
InkWell(
onTap: (){
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
},
child: Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)),
color: Colors.white,
border: Border.all(width: 1.r,color: Color(0xFFFCA017))
),
child: Center(
child: Text('详情',style: TextStyle(fontSize: 10.sp,color: Color(0xFFFCA017)),),
),
),
)
],
),
);
}),):ListView.builder(itemBuilder: (context,index){
JobStudentLevel item = levelList[index];
return Container(
padding: EdgeInsets.symmetric(vertical:20.r,horizontal: 15.r),
margin: EdgeInsets.only(bottom: 15.r),
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(child: Text(item.studentName,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6888FD)),)),
tabIndex == 0?InkWell(
onTap: (){
setState(() {
isClicking = true;
});
setJobReadLevel(item.studentGroupDetailId,0);
EasyLoading.show(status: 'loading...');
},
child: Container(
height: 24.r,
width: 82.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)),
color: isClicking?Color(0xFFDCE3FF):Color(0xFF6888FD),
),
child: Center(
child:Text('取消优先',style: TextStyle(fontSize: 10.sp,color: Colors.white),),
),
),
):InkWell(
onTap: (){
setJobReadLevel(item.studentGroupDetailId,1);
EasyLoading.show(status: 'loading...');
},
child: Container(
height: 24.r,
width: 82.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)),
color: Color(0xFFFFFFFF),
border: Border.all(width: 1.r,color: Color(0xFF6888FD)),
),
child: Center(
child:Text('设为优先',style: TextStyle(fontSize: 10.sp,color: Color(0xFF6888FD)),),
),
),
),
SizedBox(width: 5.r,),
InkWell(
onTap: (){
RouterManager.router.navigateTo(context, '${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
},
child: Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(20.r)),
color: Colors.white,
border: Border.all(width: 1.r,color: Color(0xFFFCA017))
),
child: Center(
child: Text('详情',style: TextStyle(fontSize: 10.sp,color: Color(0xFFFCA017)),),
),
),
)
],
),
);
},itemCount: levelList.length,):MyEmptyWidget(),
children: List.generate(levelList.length, (index) {
JobStudentLevel item = levelList[index];
return Container(
padding: EdgeInsets.symmetric(horizontal: 10.r),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
item.studentName,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6888FD)),
)),
item.readLevel == 1
? InkWell(
onTap: () {
setState(() {
isClicking = true;
});
setJobReadLevel(
item.studentGroupDetailId, 0);
EasyLoading.show(
status: 'loading...');
},
child: Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(20.r)),
color: isClicking
? Color(0xFFDCE3FF)
: Color(0xFF6888FD),
),
child: Center(
child: Text(
'取消优先',
style: TextStyle(
fontSize: 10.sp,
color: Colors.white),
),
),
),
)
: InkWell(
onTap: () {
setState(() {
isClicking = true;
});
setJobReadLevel(
item.studentGroupDetailId, 1);
EasyLoading.show(
status: 'loading...');
},
child: Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(20.r)),
color: isClicking
? Color(0xFF6888FD)
: Color(0xFFFFFFFF),
border: Border.all(
width: 1.r,
color: isClicking
? Color(0xFFFFFFFF)
: Color(0xFF6888FD)),
),
child: Center(
child: Text(
'设为优先',
style: TextStyle(
fontSize: 10.sp,
color: isClicking
? Color(0xFFFFFFFF)
: Color(0xFF6888FD)),
),
),
),
),
SizedBox(
width: 5.r,
),
InkWell(
onTap: () {
RouterManager.router.navigateTo(context,
'${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
},
child: Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(20.r)),
color: Colors.white,
border: Border.all(
width: 1.r,
color: Color(0xFFFCA017))),
child: Center(
child: Text(
'详情',
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFFCA017)),
),
),
),
)
],
),
);
}),
)
: ListView.builder(
itemBuilder: (context, index) {
JobStudentLevel item = levelList[index];
return Container(
padding: EdgeInsets.symmetric(
vertical: 20.r, horizontal: 15.r),
margin: EdgeInsets.only(bottom: 15.r),
decoration: BoxDecoration(
borderRadius:
BorderRadius.all(Radius.circular(10.r)),
color: Colors.white,
),
child: Row(
mainAxisAlignment:
MainAxisAlignment.spaceBetween,
children: [
Expanded(
child: Text(
item.studentName,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6888FD)),
)),
item.readLevel == 1
? InkWell(
onTap: () {
setState(() {
isClicking = true;
});
setJobReadLevel(
item.studentGroupDetailId, 0);
EasyLoading.show(
status: 'loading...');
},
child: Container(
height: 24.r,
width: 82.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(20.r)),
color: isClicking
? Color(0xFFDCE3FF)
: Color(0xFF6888FD),
),
child: Center(
child: Text(
'取消优先',
style: TextStyle(
fontSize: 10.sp,
color: Colors.white),
),
),
),
)
: InkWell(
onTap: () {
setJobReadLevel(
item.studentGroupDetailId, 1);
EasyLoading.show(
status: 'loading...');
},
child: Container(
height: 24.r,
width: 82.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(20.r)),
color: Color(0xFFFFFFFF),
border: Border.all(
width: 1.r,
color: Color(0xFF6888FD)),
),
child: Center(
child: Text(
'设为优先',
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF6888FD)),
),
),
),
),
SizedBox(
width: 5.r,
),
InkWell(
onTap: () {
RouterManager.router.navigateTo(context,
'${RouterManager.jobPersonalDetailPath}?studentId=${item.studentId}&studentName=${Uri.encodeComponent(item.studentName)}');
},
child: Container(
height: 20.r,
width: 70.r,
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(20.r)),
color: Colors.white,
border: Border.all(
width: 1.r,
color: Color(0xFFFCA017))),
child: Center(
child: Text(
'详情',
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFFFCA017)),
),
),
),
)
],
),
);
},
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_knowledge_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/top_count.dart';
import 'package:marking_app/pages/mainPage.dart';
import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/my_text.dart';
import 'package: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: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),
onPressed: () => Navigator.of(context).pop(),
),
actions: [
ReturnToHomepage(),
],
/*actions: [
//
$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(
onTap: (){
RouterManager.router.navigateTo(
@ -345,6 +351,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
bodyList: data.kgReport.details,
fixedCols: 1,
fixedRows: 1,
jobId: widget.id,
),
)
],
@ -388,6 +395,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
fixedCols: 1,
fixedRows: 1,
isKG: true,
jobId: widget.id,
),
)
],
@ -400,13 +408,13 @@ class _JobReportState extends State<JobReport> with CommonMixin {
margin: EdgeInsets.symmetric(horizontal: 10.r),
child: $MasterKnowledgePoint(data.knowledgeInfos, detailKnowledgeCall)),
//
Container(
/* Container(
margin: EdgeInsets.symmetric(horizontal: 10.r),
child: $OverallPerformance(data.studentCount, data.overallTitles)),
//
Container(
margin: EdgeInsets.symmetric(horizontal: 10.r),
child: $UnitTimeAnsweringSituation(widget.id, data.questionAnswerInfos)),
child: $UnitTimeAnsweringSituation(widget.id, data.questionAnswerInfos)),*/
//
Container(
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/job/job_student_goups.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/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/fast_data.dart';
@ -56,6 +58,10 @@ class _JobStudentGroupState extends State<JobStudentGroup> with CommonMixin {
refreshController.finishRefresh();
}
void goNextPage(id,title){
RouterManager.router.navigateTo(context, '${RouterManager.jobPriorityReviewSetPath}?&groupId=$id&title=${Uri.encodeComponent(title)}',transition: getTransition());
}
@override
void dispose() {
super.dispose();
@ -78,6 +84,9 @@ class _JobStudentGroupState extends State<JobStudentGroup> with CommonMixin {
icon: Icon(Icons.arrow_back_ios, color: Colors.black),
onPressed: () => Navigator.of(context).pop(),
),
actions: [
ReturnToHomepage(),
],
),
body: Padding(
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{
getStudentGroups();
},
child: studentGroups != null && studentGroups.length > 0
? 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(),
),
child: StudentGroupList(studentGroups,goNextPage),
),
),
);

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_favorite_item_model.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/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart';
@ -199,6 +200,9 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
title: quickText('收藏夹'),
centerTitle: true,
backgroundColor: Colors.white,
actions: [
ReturnToHomepage(),
],
),
body: MyFutureBuilder.buildFutureBuilderOfSingleInstance<List<Items>>(
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_favorite_model.dart';
import 'package:marking_app/common/model/job/job_task_item.dart';
import 'package:marking_app/components/ReturnToHomepage.dart';
import 'package:marking_app/routes/RouterManager.dart';
import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/my_text.dart';
@ -408,6 +409,9 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
alignment: Alignment.center,
),
backgroundColor: Colors.white,
actions: [
ReturnToHomepage(),
],
),
body: RefreshIndicator(
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/model/common/base_structure_result.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_zg_table.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/toast_utils.dart';
@ -71,8 +73,8 @@ class _QuickCheckPersonalState extends State<QuickCheckPersonal>
onPressed: () => Navigator.of(context).pop(),
),
actions: [
Title(
ReturnToHomepage(),
/* Title(
color: Color(0xFF6888FD),
child: Container(
child: InkWell(
@ -86,7 +88,7 @@ class _QuickCheckPersonalState extends State<QuickCheckPersonal>
),
alignment: Alignment.center,
),
),
),*/
],
),
@ -94,6 +96,41 @@ class _QuickCheckPersonalState extends State<QuickCheckPersonal>
body: SingleChildScrollView(
child: Column(
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(
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/model/common/base_structure_result.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_student_data_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/index.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';
class QuickDataCheckPage extends StatefulWidget {
@ -149,9 +151,7 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
style: TextStyle(fontSize: 14.sp, color: Colors.white),
)),
)),
SizedBox(
width: 24.r,
),
ReturnToHomepage(bgColor: Colors.white,),
],
),
SizedBox(height: 10.r),
@ -404,6 +404,7 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
bodyList: jobData!.kgReport.details,
fixedCols: 1,
fixedRows: 1,
jobId: widget.jobId,
),
)
],
@ -447,6 +448,7 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
fixedCols: 1,
fixedRows: 1,
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_screenutil/flutter_screenutil.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/index.dart';
import 'package:marking_app/utils/toast_utils.dart';
@ -13,11 +15,13 @@ class ReportTable extends StatefulWidget {
final int? fixedRows;
final int? fixedCols;
final bool? isKG;
final int jobId;
const ReportTable({
Key? key,
required this.headList,
required this.bodyList,
required this.jobId,
this.fixedCols = 0,
this.fixedRows = 0,
this.isKG = false,
@ -33,7 +37,11 @@ class _ReportTableState extends State<ReportTable> {
bool _sortAscending = true;
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);
showDialog(
context: context,
@ -80,62 +88,143 @@ class _ReportTableState extends State<ReportTable> {
),
],
),
SizedBox(height: 15.r,),
dcList != null?Row(
children: [
Expanded(
flex: 1,
child: Center(child: Text('未作答人',style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),))),
Expanded(
flex: 1,
child: Center(child: Text('答对人数',style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),))),
Expanded(
flex: 1,
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,),
if(dcList != null)
SizedBox(
height: 15.r,
),
dcList != null
? Row(
children: [
Expanded(
flex: 1,
child: Center(
child: Text(
'未作答人',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))),
Expanded(
flex: 1,
child: Center(
child: Text(
'答对人数',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))),
Expanded(
flex: 1,
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,
),
if (dcList != null)
Expanded(
child: ListView.builder(
shrinkWrap: true,
itemBuilder: (context,index){
itemBuilder: (context, index) {
var item = arr[index];
return Container(
padding: EdgeInsets.symmetric(vertical: 5.r),
color: index.isOdd?Colors.white:Color(0xFFF0F0F0),
color:
index.isOdd ? Colors.white : Color(0xFFF0F0F0),
child: Row(
children: [
Expanded(
flex:1,
child: Center(child: Text(item['noAnswerStudentNames'],style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),))),
flex: 1,
child: InkWell(
onTap: () {
goQuickCheckPersonalPath(
item['noAnswerStudents'].id);
},
child: Center(
child: Text(
item['noAnswerStudents'].name,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
)))),
Expanded(
flex:1,
child: Center(child: Text(item['answerOkStudentNames'],style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),))),
flex: 1,
child: InkWell(
onTap: () {
goQuickCheckPersonalPath(
item['answerOkStudents'].id);
},
child: Center(
child: Text(
item['answerOkStudents'].name,
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF323232)),
)))),
Expanded(
flex:1,
child: Center(child: Text(item['answerNgStudentNames'],style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),))),
flex: 1,
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
arr.length>0?Expanded(
child: ListView.builder(
shrinkWrap: true,
itemBuilder: (context,index){
var item = arr[index];
return Container(
padding: EdgeInsets.symmetric(vertical: 5.r,horizontal: 15.r),
color: index.isOdd?Colors.white:Color(0xFFF0F0F0),
child: Text(item,style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),),
);
},itemCount: arr.length,),
):MyEmptyWidget()
arr.length > 0
? Expanded(
child: ListView.builder(
shrinkWrap: true,
itemBuilder: (context, index) {
AnswerOkStudents item = arr[index];
return InkWell(
onTap: () {
goQuickCheckPersonalPath(item.id);
},
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()
],
),
),
@ -143,34 +232,71 @@ class _ReportTableState extends State<ReportTable> {
});
}
void zdHandle( BuildContext context, String title, String questionNo,List noAnswerStudentNames,List answerNgStudentNames, List answerOkStudentNames){
List list = [];
if(noAnswerStudentNames.length>answerNgStudentNames.length && noAnswerStudentNames.length>answerOkStudentNames.length){
for(int i = 0;i<noAnswerStudentNames.length;i++){
var obj = {'noAnswerStudentNames':noAnswerStudentNames[i],'answerNgStudentNames':answerNgStudentNames.length>i?answerNgStudentNames[i]:'-',
'answerOkStudentNames':answerOkStudentNames.length>i?answerOkStudentNames[i]:'-'};
list.add(obj);
}
}else if(answerNgStudentNames.length>noAnswerStudentNames.length && answerNgStudentNames.length>answerOkStudentNames.length){
for(int i = 0;i<answerNgStudentNames.length;i++){
var obj = {'noAnswerStudentNames':noAnswerStudentNames.length>i?noAnswerStudentNames[i]:'-','answerNgStudentNames':answerNgStudentNames[i],
'answerOkStudentNames':answerOkStudentNames.length>i?answerOkStudentNames[i]:'-'};
list.add(obj);
}
}else if(answerOkStudentNames.length>noAnswerStudentNames.length && answerOkStudentNames.length>answerNgStudentNames.length){
for(int i = 0;i<answerOkStudentNames.length;i++){
var obj = {'noAnswerStudentNames':noAnswerStudentNames.length>i?noAnswerStudentNames[i]:'-','answerNgStudentNames':answerNgStudentNames.length>i?answerNgStudentNames[i]:'-',
'answerOkStudentNames':answerOkStudentNames[i]};
list.add(obj);
}
}
showPeopleListDialog(context:context, title:title, questionNo:questionNo,arr:list,dcList:[]);
void goQuickCheckPersonalPath(id) {
if (id != -1) {
RouterManager.router.navigateTo(
context,
RouterManager.quickCheckPersonalPath +
'?jobId=${widget.jobId}&studentId=$id',
transition: getTransition(),
);
}
}
void dcHandle( BuildContext context, String title, String questionNo,List arr){
showPeopleListDialog(context:context, title:title, questionNo:questionNo,arr: arr);
void zdHandle(BuildContext context, String title, String questionNo,
List noAnswerStudents, List answerNgStudents, List answerOkStudents) {
List list = [];
AnswerOkStudents student = AnswerOkStudents(-1, '-');
if (noAnswerStudents.length > answerNgStudents.length &&
noAnswerStudents.length > answerOkStudents.length) {
for (int i = 0; i < noAnswerStudents.length; i++) {
var obj = {
'noAnswerStudents': noAnswerStudents[i],
'answerNgStudents':
answerNgStudents.length > i ? answerNgStudents[i] : student,
'answerOkStudents':
answerOkStudents.length > i ? answerOkStudents[i] : student
};
list.add(obj);
}
} else if (answerNgStudents.length > noAnswerStudents.length &&
answerNgStudents.length > answerOkStudents.length) {
for (int i = 0; i < answerNgStudents.length; i++) {
var obj = {
'noAnswerStudents':
noAnswerStudents.length > i ? noAnswerStudents[i] : student,
'answerNgStudents': answerNgStudents[i],
'answerOkStudents':
answerOkStudents.length > i ? answerOkStudents[i] : student
};
list.add(obj);
}
} else if (answerOkStudents.length > noAnswerStudents.length &&
answerOkStudents.length > answerNgStudents.length) {
for (int i = 0; i < answerOkStudents.length; i++) {
var obj = {
'noAnswerStudents':
noAnswerStudents.length > i ? noAnswerStudents[i] : student,
'answerNgStudents':
answerNgStudents.length > i ? answerNgStudents[i] : student,
'answerOkStudents': answerOkStudents[i]
};
list.add(obj);
}
}
showPeopleListDialog(
context: context,
title: title,
questionNo: questionNo,
arr: list,
dcList: []);
}
void dcHandle(
BuildContext context, String title, String questionNo, List arr) {
showPeopleListDialog(
context: context, title: title, questionNo: questionNo, arr: arr);
}
DataRow _getRow(int index, [Color? color]) {
@ -196,8 +322,8 @@ class _ReportTableState extends State<ReportTable> {
)),
DataCell(InkWell(
onTap: () {
zdHandle(context, '作答人数', item.questionNo,item.noAnswerStudentNames,item.answerNgStudentNames,item.answerOkStudentNames);
zdHandle(context, '作答人数', item.questionNo, item.noAnswerStudents,
item.answerNgStudents, item.answerOkStudents);
},
child: Center(
child: Padding(
@ -261,9 +387,10 @@ class _ReportTableState extends State<ReportTable> {
),
)),
DataCell(InkWell(
onTap: (){
onTap: () {
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: Padding(
@ -322,7 +449,9 @@ class _ReportTableState extends State<ReportTable> {
fixedCornerColor: Colors.grey[400],
minWidth: widget.headList.length > 6
? 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!,
fixedLeftColumns: widget.fixedCols!,
sortColumnIndex: _sortColumnIndex,
@ -340,8 +469,10 @@ class _ReportTableState extends State<ReportTable> {
? 40.r
: widget.headList.length > 6
? 80.r
: isPadFlag?(MediaQuery.of(context).size.width - 8.r) /
widget.headList.length:85.r,
: isPadFlag
? (MediaQuery.of(context).size.width - 8.r) /
widget.headList.length
: 85.r,
);
}),
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_screenutil/flutter_screenutil.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:photo_view/photo_view.dart';
@ -80,7 +81,7 @@ class _StudentZgTableState extends State<StudentZgTable> {
DataCell(Center(
child: Padding(
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))),
),
)),

View File

@ -1,24 +1,28 @@
import 'package:flutter/material.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/routes/RouterManager.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart';
part 'top_count.g.dart';
class TopCount extends StatelessWidget {
final JobReportModel data;
final String className;
const TopCount(this.data,this.className,{Key? key}) : super(key: key);
final int jobId;
void showStudentListDialog(
{required BuildContext context, required String title,required List arr}) {
const TopCount(this.data, this.className, this.jobId, {Key? key}) : super(key: key);
void showStudentListDialog({required BuildContext context, required String title, required List arr}) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
// insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r),
contentPadding: EdgeInsets.all(20.r),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(15.r))),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))),
content: SizedBox(
width: MediaQuery.of(context).size.width * 0.7,
height: MediaQuery.of(context).size.height * 0.7,
@ -28,29 +32,43 @@ class TopCount extends StatelessWidget {
Center(
child: Text(
className + title,
style: TextStyle(
fontSize: 15.sp,
color: Color(0xFF3C3C3C),
fontWeight: FontWeight.w500),
style: TextStyle(fontSize: 15.sp, color: Color(0xFF3C3C3C), fontWeight: FontWeight.w500),
),
),
SizedBox(
height: 5.r,
),
SizedBox(height: 15.r,),
arr.length>0?Expanded(
child: ListView.builder(
shrinkWrap: true,
itemBuilder: (context,index){
var item = arr[index];
return Container(
padding: EdgeInsets.symmetric(vertical: 5.r,horizontal: 15.r),
color: index.isOdd?Colors.white:Color(0xFFF0F0F0),
child: Text(item,style: TextStyle(fontSize: 12.sp,color: Color(0xFF323232)),),
);
},itemCount: arr.length,),
):MyEmptyWidget()
SizedBox(
height: 15.r,
),
arr.length > 0
? Expanded(
child: ListView.builder(
shrinkWrap: true,
itemBuilder: (context, index) {
AnswerOkStudents item = arr[index];
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),
color: index.isOdd ? Colors.white : Color(0xFFF0F0F0),
child: Text(
item.name,
style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)),
),
),
);
},
itemCount: arr.length,
),
)
: MyEmptyWidget()
],
),
),
@ -58,11 +76,12 @@ class TopCount extends StatelessWidget {
});
}
@override
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(
padding: EdgeInsets.symmetric(vertical: 20.r),
padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r),
margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r),
decoration: BoxDecoration(
color: Colors.white,
@ -71,16 +90,96 @@ class TopCount extends StatelessWidget {
child: Column(
children: [
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,
children: [
InkWell(
onTap: (){
showStudentListDialog(context:context,title: '未提交作业学生',arr: data.noAnswerStudentNames);
onTap: () {
showStudentListDialog(
context: context,
title: '未提交作业学生',
arr: data.noAnswerStudentNames);
},
child: Container(
width: 81.r,
padding: EdgeInsets.symmetric(
vertical: 10.r, horizontal: 6.r),
padding:
EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r),
decoration: BoxDecoration(
border: Border.all(
width: 1.r,
@ -91,7 +190,9 @@ class TopCount extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 5.r,),
SizedBox(
height: 5.r,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
@ -124,13 +225,16 @@ class TopCount extends StatelessWidget {
),
),
InkWell(
onTap: (){
showStudentListDialog(context:context,title: '已提交作业学生',arr: data.validStudentNames);
onTap: () {
showStudentListDialog(
context: context,
title: '已提交作业学生',
arr: data.validStudentNames);
},
child: Container(
width: 81.r,
padding: EdgeInsets.symmetric(
vertical: 10.r, horizontal: 6.r),
padding:
EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r),
decoration: BoxDecoration(
border: Border.all(
width: 1.r,
@ -141,7 +245,9 @@ class TopCount extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 5.r,),
SizedBox(
height: 5.r,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
@ -174,13 +280,16 @@ class TopCount extends StatelessWidget {
),
),
InkWell(
onTap: (){
showStudentListDialog(context:context,title: '全对作业学生',arr: data.allCorrectStudentNames);
onTap: () {
showStudentListDialog(
context: context,
title: '全对作业学生',
arr: data.allCorrectStudentNames);
},
child: Container(
width: 81.r,
padding: EdgeInsets.symmetric(
vertical: 10.r, horizontal: 6.r),
padding:
EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r),
decoration: BoxDecoration(
border: Border.all(
width: 1.r,
@ -191,7 +300,9 @@ class TopCount extends StatelessWidget {
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SizedBox(height: 5.r,),
SizedBox(
height: 5.r,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
@ -227,91 +338,158 @@ class TopCount extends StatelessWidget {
),
SizedBox(
height: 15.r,
),
),*/
Padding(
padding: EdgeInsets.symmetric(horizontal: 15.r),
child: GridView.builder(
shrinkWrap: true,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
childAspectRatio: 150 / 46,
crossAxisSpacing: 2.r, // Widget
mainAxisSpacing: 2.r, // Widget
crossAxisCount: 2, // Widget
),
itemCount: data.overallTitles.length,
itemBuilder: (BuildContext context, index){
var item = data.overallTitles[index];
Color bgColor = Color(0xFF4CC793);
if(item.title == ''){
bgColor = Color(0xFF4CC793);
}else if(item.title == ''){
bgColor = Color(0xFFF8700D);
}else if(item.title == ''){
bgColor = Color(0xFF4CC7B8);
}else if(item.title == ''){
bgColor = Color(0xFFFF6F6F);
}
return InkWell(
onTap: (){
showStudentListDialog(context:context,title:item.title+'等作业学生',arr: item.studentNames);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 10.r),
width: (MediaQuery.of(context).size.width - 55.r) / 2,
color: Color(0xFFF5F5F5),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: (MediaQuery.of(context).size.width - 55.r)/4 ,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
width: 28.r,
height: 28.r,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(
color: bgColor,
width: 1.r,
style: BorderStyle.solid),
borderRadius: BorderRadius.circular(14.r)),
child: Center(
child: Text(
item.title,
style: TextStyle(
color: bgColor, fontSize: 12.r),
)),
),
],
),
),
SizedBox(
width: 10.r,
),
Text(
item.count.toString(),
style: TextStyle(
fontSize: 20.sp,
color: Color(0xFF595959)),
),
Text(
'',
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF595959)),
),
],
),
),
);
},
padding: EdgeInsets.symmetric(horizontal: 15.r),
child: GridView.builder(
shrinkWrap: true,
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
childAspectRatio: 150 / 46,
crossAxisSpacing: 2.r, // Widget
mainAxisSpacing: 2.r, // Widget
crossAxisCount: 2, // Widget
),
itemCount: data.overallTitles.length,
itemBuilder: (BuildContext context, index) {
var item = data.overallTitles[index];
Color bgColor = Color(0xFF4CC793);
if (item.title == '') {
bgColor = Color(0xFF4CC793);
} else if (item.title == '') {
bgColor = Color(0xFFF8700D);
} else if (item.title == '') {
bgColor = Color(0xFF4CC7B8);
} else if (item.title == '') {
bgColor = Color(0xFFFF6F6F);
}
return InkWell(
onTap: () {
showStudentListDialog(context: context, title: item.title + '等作业学生', arr: item.studentNames);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 10.r),
width: (MediaQuery.of(context).size.width - 55.r) / 2,
color: Color(0xFFF5F5F5),
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
width: (MediaQuery.of(context).size.width - 55.r) / 4,
child: Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
Container(
width: 28.r,
height: 28.r,
decoration: BoxDecoration(
color: Colors.white,
border: Border.all(color: bgColor, width: 1.r, style: BorderStyle.solid),
borderRadius: BorderRadius.circular(14.r)),
child: Center(
child: Text(
item.title,
style: TextStyle(color: bgColor, fontSize: 12.r),
)),
),
],
),
),
SizedBox(
width: 10.r,
),
Text(
item.count.toString(),
style: TextStyle(fontSize: 20.sp, color: Color(0xFF595959)),
),
Text(
'',
style: TextStyle(fontSize: 14.sp, color: Color(0xFF595959)),
),
],
),
),
);
},
),
),
],
),
);
}
}
@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/other/agreement_page.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_personal_subject.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 jobStudentGroupPath = '/homework_correction/job_student_group';
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
@ -306,7 +309,8 @@ class RouterManager {
static final _jobPriorityReviewSetPageHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
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);
},
);
//
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());
@ -386,6 +407,8 @@ class RouterManager {
router.define(jobStudentGroupPath, handler: _jobStudentGroupPageHandler, transitionType: TransitionType.material);
router.define(jobFavoritePagePath, handler: _jobFavoritePagePathHandler, 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()

View File

@ -18,4 +18,31 @@ class CommonUtils {
// digest.toString()
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,),
);
}