Compare commits

..

2 Commits

Author SHA1 Message Date
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
15 changed files with 825 additions and 197 deletions

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

@ -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

@ -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<JobPersonalDetail> 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(

View File

@ -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<JobReport> 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<JobReport> 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<JobReport> with CommonMixin {
bodyList: data.kgReport.details,
fixedCols: 1,
fixedRows: 1,
jobId: widget.id,
),
)
],
@ -388,6 +399,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
fixedCols: 1,
fixedRows: 1,
isKG: true,
jobId: widget.id,
),
)
],
@ -400,13 +412,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,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<QuickCheckPersonal>
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<QuickCheckPersonal>
),
alignment: Alignment.center,
),
),
),*/
],
),
@ -94,6 +103,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

@ -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<QuickDataCheckPage>
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<QuickDataCheckPage>
bodyList: jobData!.kgReport.details,
fixedCols: 1,
fixedRows: 1,
jobId: widget.jobId,
),
)
],
@ -447,6 +452,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,21 +88,52 @@ class _ReportTableState extends State<ReportTable> {
),
],
),
SizedBox(height: 15.r,),
dcList != null?Row(
SizedBox(
height: 15.r,
),
dcList != null
? Row(
children: [
Expanded(
flex: 1,
child: Center(child: Text('未作答人',style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),))),
child: Center(
child: Text(
'未作答人',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))),
Expanded(
flex: 1,
child: Center(child: Text('答对人数',style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),))),
child: Center(
child: Text(
'答对人数',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))),
Expanded(
flex: 1,
child: Center(child: Text('答错人',style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),))),
child: Center(
child: Text(
'答错人',
style: TextStyle(
fontSize: 12.sp,
color: Color(0xFF6A6A6A)),
))),
],
):Padding(padding: EdgeInsets.only(left: 15.r),child: Text(title,style: TextStyle(fontSize: 12.sp,color: Color(0xFF6A6A6A)),),),
SizedBox(height: 5.r,),
)
: Padding(
padding: EdgeInsets.only(left: 15.r),
child: Text(
title,
style: TextStyle(
fontSize: 12.sp, color: Color(0xFF6A6A6A)),
),
),
SizedBox(
height: 5.r,
),
if (dcList != null)
Expanded(
child: ListView.builder(
@ -103,39 +142,89 @@ class _ReportTableState extends State<ReportTable> {
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)),))),
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)),))),
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)),))),
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(
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)),),
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()
},
itemCount: arr.length,
),
)
: MyEmptyWidget()
],
),
),
@ -143,34 +232,71 @@ class _ReportTableState extends State<ReportTable> {
});
}
void zdHandle( BuildContext context, String title, String questionNo,List noAnswerStudentNames,List answerNgStudentNames, List answerOkStudentNames){
void goQuickCheckPersonalPath(id) {
if (id != -1) {
RouterManager.router.navigateTo(
context,
RouterManager.quickCheckPersonalPath +
'?jobId=${widget.jobId}&studentId=$id',
transition: getTransition(),
);
}
}
void zdHandle(BuildContext context, String title, String questionNo,
List noAnswerStudents, List answerNgStudents, List answerOkStudents) {
List list = [];
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]:'-'};
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(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]:'-'};
} 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(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]};
} 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:[]);
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);
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(
@ -263,7 +389,8 @@ class _ReportTableState extends State<ReportTable> {
DataCell(InkWell(
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

@ -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(
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)),),
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()
},
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);
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: [
@ -125,12 +253,15 @@ class TopCount extends StatelessWidget {
),
InkWell(
onTap: () {
showStudentListDialog(context:context,title: '已提交作业学生',arr: data.validStudentNames);
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: [
@ -175,12 +308,15 @@ class TopCount extends StatelessWidget {
),
InkWell(
onTap: () {
showStudentListDialog(context:context,title: '全对作业学生',arr: data.allCorrectStudentNames);
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,7 +365,7 @@ class TopCount extends StatelessWidget {
),
SizedBox(
height: 15.r,
),
),*/
Padding(
padding: EdgeInsets.symmetric(horizontal: 15.r),
child: GridView.builder(
@ -253,7 +391,10 @@ class TopCount extends StatelessWidget {
}
return InkWell(
onTap: () {
showStudentListDialog(context:context,title:item.title+'等作业学生',arr: item.studentNames);
showStudentListDialog(
context: context,
title: item.title + '等作业学生',
arr: item.studentNames);
},
child: Container(
padding: EdgeInsets.symmetric(vertical: 10.r),
@ -281,8 +422,8 @@ class TopCount extends StatelessWidget {
child: Center(
child: Text(
item.title,
style: TextStyle(
color: bgColor, fontSize: 12.r),
style:
TextStyle(color: bgColor, fontSize: 12.r),
)),
),
],
@ -294,14 +435,12 @@ class TopCount extends StatelessWidget {
Text(
item.count.toString(),
style: TextStyle(
fontSize: 20.sp,
color: Color(0xFF595959)),
fontSize: 20.sp, color: Color(0xFF595959)),
),
Text(
'',
style: TextStyle(
fontSize: 14.sp,
color: Color(0xFF595959)),
fontSize: 14.sp, color: Color(0xFF595959)),
),
],
),
@ -315,3 +454,97 @@ class TopCount extends StatelessWidget {
);
}
}
@swidget
Widget leftContainer(context,{required int count,required String name,required Color nameColor,required Color bgColor}){
double leftWidth = (MediaQuery.of(context).size.width-40.r) * 0.7/3;
return Container(
width: leftWidth,
height: 92.r,
padding:
EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r),
color: bgColor,
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
SizedBox(
height: 5.r,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
count.toString(),
style: TextStyle(
fontSize: 18.sp,
color: Color(0xFF595959),
fontWeight: FontWeight.w600),
),
Text(
'',
style: TextStyle(
fontSize: 10.sp,
color: Color(0xFF595959),
fontWeight: FontWeight.w600),
),
],
),
SizedBox(
height: 20.r,
),
Text(
name,
style: TextStyle(
fontSize: 12.sp,
color: nameColor,
fontWeight: FontWeight.w500),
)
],
),
);
}
@swidget
Widget rightContainer({required int count,required Color bgColor,required Color nameColor,required String name}){
return Container(
color:bgColor,
child: Column(
children: [
SizedBox(
height: 5.r,
),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text(
count.toString(),
style: TextStyle(
fontSize: 12.sp,
color: nameColor,
fontWeight: FontWeight.w600),
),
Text(
'',
style: TextStyle(
fontSize: 8.sp,
color: nameColor,
fontWeight: FontWeight.w600),
),
],
),
SizedBox(
height: 5.r,
),
Text(
name,
style: TextStyle(
fontSize: 12.sp,
color: nameColor,
fontWeight: FontWeight.w500),
)
],
),
);
}

View File

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

View File

@ -34,6 +34,7 @@ import 'package:marking_app/pages/mine/index.dart';
import 'package:marking_app/pages/mine/other_pages/index.dart';
import 'package:marking_app/pages/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<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 +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()

View File

@ -18,4 +18,6 @@ class CommonUtils {
// digest.toString()
return hex.encode(digest.bytes);
}
static JumpPage(name,index) {}
}

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,),
);
}