diff --git a/marking_app/assets/images/home_icon_black.png b/marking_app/assets/images/home_icon_black.png new file mode 100644 index 0000000..f0f9eda Binary files /dev/null and b/marking_app/assets/images/home_icon_black.png differ diff --git a/marking_app/assets/images/home_icon_white.png b/marking_app/assets/images/home_icon_white.png new file mode 100644 index 0000000..6341d71 Binary files /dev/null and b/marking_app/assets/images/home_icon_white.png differ diff --git a/marking_app/assets/images/report_left_icon.png b/marking_app/assets/images/report_left_icon.png new file mode 100644 index 0000000..e44c977 Binary files /dev/null and b/marking_app/assets/images/report_left_icon.png differ diff --git a/marking_app/assets/images/report_right_icon.png b/marking_app/assets/images/report_right_icon.png new file mode 100644 index 0000000..c50d2c4 Binary files /dev/null and b/marking_app/assets/images/report_right_icon.png differ diff --git a/marking_app/lib/common/model/job/job_report_model.dart b/marking_app/lib/common/model/job/job_report_model.dart index 9167527..1329517 100644 --- a/marking_app/lib/common/model/job/job_report_model.dart +++ b/marking_app/lib/common/model/job/job_report_model.dart @@ -48,6 +48,9 @@ class JobReportModel extends Object { @JsonKey(name: 'studentAnswerInfos') List studentAnswerInfos; + @JsonKey(name: 'overallInfos') + Map overallInfos; + @JsonKey(name: 'overallTitles') List overallTitles; @@ -66,6 +69,14 @@ class JobReportModel extends Object { @JsonKey(name: 'validStudentNames') List validStudentNames; + @JsonKey(name: 'noAnswerStudents') + List? noAnswerStudents; + + @JsonKey(name: 'allCorrectStudents') + List? allCorrectStudents; + + @JsonKey(name: 'validStudents') + List? 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 answerOkStudentNames; - Details(this.questionNo,this.questionId,this.partName,this.questionType,this.validRate, + @JsonKey(name: 'noAnswerStudents') + List? noAnswerStudents; + + @JsonKey(name: 'answerOkStudents') + List? answerOkStudents; + + @JsonKey(name: 'answerNgStudents') + List? answerNgStudents; + + @JsonKey(name: 'priorityStudents') + List? 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); @@ -392,4 +420,39 @@ class Details extends Object { Map toJson() => _$DetailsToJson(this); -} \ No newline at end of file +} + + +@JsonSerializable() +class overallInfo extends Object { + + @JsonKey(name: 'count') + int count; + + @JsonKey(name: 'students') + List students; + + overallInfo(this.count,this.students,); + + factory overallInfo.fromJson(Map srcJson) => _$overallInfoFromJson(srcJson); + + Map 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 srcJson) => _$AnswerOkStudentsFromJson(srcJson); + + Map toJson() => _$AnswerOkStudentsToJson(this); + +} diff --git a/marking_app/lib/pages/homework_correction/job_personal_detail.dart b/marking_app/lib/pages/homework_correction/job_personal_detail.dart index 4f867a5..18cdbf1 100644 --- a/marking_app/lib/pages/homework_correction/job_personal_detail.dart +++ b/marking_app/lib/pages/homework_correction/job_personal_detail.dart @@ -13,6 +13,7 @@ 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'; @@ -110,6 +111,14 @@ class _JobPersonalDetailState extends State with CommonMixin, icon: Icon(Icons.arrow_back_ios, color: Colors.black), onPressed: () => Navigator.of(context).pop(), ), + actions: [ + InkWell( + onTap: (){ + CommonUtils.JumpPage('job', 2); + }, + child: homeIcon(), + ) + ], elevation: 0, ), body: Column( diff --git a/marking_app/lib/pages/homework_correction/job_report.dart b/marking_app/lib/pages/homework_correction/job_report.dart index 0cabc85..4c8b150 100644 --- a/marking_app/lib/pages/homework_correction/job_report.dart +++ b/marking_app/lib/pages/homework_correction/job_report.dart @@ -10,10 +10,12 @@ 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/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 +254,14 @@ class _JobReportState extends State with CommonMixin { icon: Icon(Icons.arrow_back_ios, color: Colors.black), onPressed: () => Navigator.of(context).pop(), ), + actions: [ + InkWell( + onTap: (){ + CommonUtils.JumpPage('job', 2); + }, + child: homeIcon(), + ) + ], /*actions: [ // 下拉框 $DropdownSelection(involveClasses, classData, call: (JobReportJoinClass _classData) { @@ -296,7 +306,7 @@ class _JobReportState extends State with CommonMixin { ), ), //完成率、正确率 - TopCount(data,classData == null?'':classData!.className), + TopCount(data,classData == null?'':classData!.className,widget.id), /* InkWell( onTap: (){ RouterManager.router.navigateTo( @@ -345,6 +355,7 @@ class _JobReportState extends State with CommonMixin { bodyList: data.kgReport.details, fixedCols: 1, fixedRows: 1, + jobId: widget.id, ), ) ], @@ -388,6 +399,7 @@ class _JobReportState extends State with CommonMixin { fixedCols: 1, fixedRows: 1, isKG: true, + jobId: widget.id, ), ) ], @@ -400,13 +412,13 @@ class _JobReportState extends State 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)), diff --git a/marking_app/lib/pages/homework_correction/quick_check_personal.dart b/marking_app/lib/pages/homework_correction/quick_check_personal.dart index e514672..f53fe44 100644 --- a/marking_app/lib/pages/homework_correction/quick_check_personal.dart +++ b/marking_app/lib/pages/homework_correction/quick_check_personal.dart @@ -7,6 +7,7 @@ import 'package:marking_app/common/model/job/job_data_report.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 +72,16 @@ class _QuickCheckPersonalState extends State onPressed: () => Navigator.of(context).pop(), ), actions: [ - Title( - + InkWell( + onTap: (){ + CommonUtils.JumpPage('job', 2); + }, + child: Padding( + padding: EdgeInsets.only(top:5.r,right: 8.r), + child: Image.asset('assets/images/home_icon_black.png',width: 18.r,height: 18.r,), + ), + ), + /* Title( color: Color(0xFF6888FD), child: Container( child: InkWell( @@ -86,7 +95,7 @@ class _QuickCheckPersonalState extends State ), alignment: Alignment.center, ), - ), + ),*/ ], ), @@ -94,6 +103,41 @@ class _QuickCheckPersonalState extends State 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), diff --git a/marking_app/lib/pages/homework_correction/quick_data_check.dart b/marking_app/lib/pages/homework_correction/quick_data_check.dart index 88b9404..5cf1b9e 100644 --- a/marking_app/lib/pages/homework_correction/quick_data_check.dart +++ b/marking_app/lib/pages/homework_correction/quick_data_check.dart @@ -13,6 +13,7 @@ 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,8 +150,11 @@ class _QuickDataCheckPageState extends State style: TextStyle(fontSize: 14.sp, color: Colors.white), )), )), - SizedBox( - width: 24.r, + InkWell( + onTap: (){ + CommonUtils.JumpPage('job', 2); + }, + child: homeIcon(color: 'white'), ), ], ), @@ -404,6 +408,7 @@ class _QuickDataCheckPageState extends State bodyList: jobData!.kgReport.details, fixedCols: 1, fixedRows: 1, + jobId: widget.jobId, ), ) ], @@ -447,6 +452,7 @@ class _QuickDataCheckPageState extends State fixedCols: 1, fixedRows: 1, isKG: true, + jobId: widget.jobId, ), ) ], diff --git a/marking_app/lib/pages/homework_correction/widget/report_table.dart b/marking_app/lib/pages/homework_correction/widget/report_table.dart index 6c76fdf..cab74d0 100644 --- a/marking_app/lib/pages/homework_correction/widget/report_table.dart +++ b/marking_app/lib/pages/homework_correction/widget/report_table.dart @@ -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 { 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 { ), ], ), - 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 { }); } - 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;ii?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;ii?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;ii?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 { )), 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 { ), )), DataCell(InkWell( - onTap: (){ + onTap: () { List 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 { 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 { ? 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.generate(widget.bodyList.length, diff --git a/marking_app/lib/pages/homework_correction/widget/top_count.dart b/marking_app/lib/pages/homework_correction/widget/top_count.dart index 4d0be82..5e43378 100644 --- a/marking_app/lib/pages/homework_correction/widget/top_count.dart +++ b/marking_app/lib/pages/homework_correction/widget/top_count.dart @@ -1,16 +1,22 @@ 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'; class TopCount extends StatelessWidget { final JobReportModel data; final String className; - const TopCount(this.data,this.className,{Key? key}) : super(key: key); + final int jobId; + + const TopCount(this.data, this.className, this.jobId,{Key? key}) : super(key: key); void showStudentListDialog( - {required BuildContext context, required String title,required List arr}) { + {required BuildContext context, + required String title, + required List arr}) { showDialog( context: context, builder: (BuildContext context) { @@ -37,20 +43,42 @@ class TopCount extends StatelessWidget { 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 +86,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 +100,113 @@ 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 +217,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 +252,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 +272,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 +307,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 +327,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 +365,186 @@ 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), + ) + ], + ), + ); +} diff --git a/marking_app/lib/pages/report_detail/report_history.dart b/marking_app/lib/pages/report_detail/report_history.dart new file mode 100644 index 0000000..34ec256 --- /dev/null +++ b/marking_app/lib/pages/report_detail/report_history.dart @@ -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 createState() => _ReportHistoryState(); +} + +class _ReportHistoryState extends State { + 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)), + ), + ), + ), + )), + ], + ), + ) + ], + ), + ); + } +} diff --git a/marking_app/lib/routes/RouterManager.dart b/marking_app/lib/routes/RouterManager.dart index 986c0a4..409bad8 100644 --- a/marking_app/lib/routes/RouterManager.dart +++ b/marking_app/lib/routes/RouterManager.dart @@ -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 @@ -342,6 +345,23 @@ class RouterManager { return JobPersonalDetail(studentId: studentId,studentName:studentName); }, ); + +// 学生报告详情 + static final _reportCardDialogPathHandler = Handler( + handlerFunc: (BuildContext? context, Map> 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> params) { + /* String studentName = params['studentName']![0]; + int studentId = int.parse(params['studentId']![0]);*/ + return ReportHistory(); + }, + ); // 开始阅卷页面 // static final _doMarkingPapers = Handler(handlerFunc: (BuildContext? context, Map> params) => MarkingPapers()); @@ -386,6 +406,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() diff --git a/marking_app/lib/utils/common_utils.dart b/marking_app/lib/utils/common_utils.dart index e7bb2a8..e795daa 100644 --- a/marking_app/lib/utils/common_utils.dart +++ b/marking_app/lib/utils/common_utils.dart @@ -18,4 +18,6 @@ class CommonUtils { // 这里其实就是 digest.toString() return hex.encode(digest.bytes); } + + static JumpPage(name,index) {} } diff --git a/marking_app/lib/utils/right_home_icon.dart b/marking_app/lib/utils/right_home_icon.dart new file mode 100644 index 0000000..e34528e --- /dev/null +++ b/marking_app/lib/utils/right_home_icon.dart @@ -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,), + ); +} \ No newline at end of file