diff --git a/marking_app/lib/common/model/job/job_fav_student.dart b/marking_app/lib/common/model/job/job_fav_student.dart index 1b7c893..bcb7fad 100644 --- a/marking_app/lib/common/model/job/job_fav_student.dart +++ b/marking_app/lib/common/model/job/job_fav_student.dart @@ -67,10 +67,10 @@ class Items extends Object { String className; @JsonKey(name: 'questionPage') - int questionPage; + int? questionPage; @JsonKey(name: 'questionPicture') - String questionPicture; + String? questionPicture; @JsonKey(name: 'createTime') String createTime; diff --git a/marking_app/lib/pages/homework_correction/pages/favorite_student_dialog.dart b/marking_app/lib/pages/homework_correction/pages/favorite_student_dialog.dart index c4d03ee..d21a0de 100644 --- a/marking_app/lib/pages/homework_correction/pages/favorite_student_dialog.dart +++ b/marking_app/lib/pages/homework_correction/pages/favorite_student_dialog.dart @@ -12,7 +12,10 @@ class FavoriteStudentDialog extends StatefulWidget { final Function deleteFav; const FavoriteStudentDialog( - {Key? key, required this.item, required this.group,required this.deleteFav}) + {Key? key, + required this.item, + required this.group, + required this.deleteFav}) : super(key: key); @override @@ -26,7 +29,6 @@ class _FavoriteStudentDialogState extends State { late Items currentStudent; void initState() { - pageController = PageController(initialPage: defaultIndex); currentStudent = widget.item; List list = []; widget.group.forEach((element) { @@ -38,6 +40,7 @@ class _FavoriteStudentDialogState extends State { imageList = list; defaultIndex = list.indexWhere((element) => element.id == widget.item.id); }); + pageController = PageController(initialPage: defaultIndex); } void dispose() { @@ -66,13 +69,25 @@ class _FavoriteStudentDialogState extends State { style: TextStyle(fontSize: 12.sp, color: Color(0xFF868686)), ), InkWell( - onTap: (){ - widget.deleteFav(currentStudent); - imageList.removeAt(defaultIndex); - setState(() { - - }); + onTap: () { + widget.deleteFav(currentStudent); + imageList.removeAt(defaultIndex); + print('imageList.length=${imageList.length}'); + print('defaultIndex=${defaultIndex}'); + setState(() { + if (imageList.length > 0) { + if (defaultIndex < imageList.length) { + currentStudent = imageList[defaultIndex]; + } else { + currentStudent = imageList[defaultIndex - 1]; + defaultIndex = defaultIndex - 1; + } + } else { + currentStudent.className = ''; + currentStudent.studentName = ''; + } + }); }, child: Padding( padding: EdgeInsets.symmetric(horizontal: 8.r), @@ -98,107 +113,108 @@ class _FavoriteStudentDialogState extends State { SizedBox( height: 10.r, ), - imageList.length>0? - Expanded( - child: Container( - color: Colors.white, - width: MediaQuery.of(context).size.width, - child: PhotoViewGallery.builder( - scrollPhysics: const BouncingScrollPhysics(), - builder: (BuildContext context, int index) { - final Items item = imageList[index]; - return PhotoViewGalleryPageOptions( - imageProvider: NetworkImage(item.questionPicture), - heroAttributes: PhotoViewHeroAttributes(tag: item.id), - ); - }, - itemCount: imageList.length, - pageController: pageController, - onPageChanged: (index) { - setState(() { - defaultIndex = index; - currentStudent = imageList[index]; - }); - }, - scrollDirection: Axis.horizontal, - + imageList.length > 0 + ? Expanded( + child: Container( + color: Colors.white, + width: MediaQuery.of(context).size.width, + child: PhotoViewGallery.builder( + scrollPhysics: const BouncingScrollPhysics(), + builder: (BuildContext context, int index) { + final Items item = imageList[index]; + return PhotoViewGalleryPageOptions( + imageProvider: NetworkImage(item.questionPicture!), + heroAttributes: PhotoViewHeroAttributes(tag: item.id), + ); + }, + itemCount: imageList.length, + pageController: pageController, + onPageChanged: (index) { + setState(() { + defaultIndex = index; + currentStudent = imageList[index]; + }); + }, + scrollDirection: Axis.horizontal, + ), + ), + ) + : Padding( + padding: EdgeInsets.only( + top: MediaQuery.of(context).size.height / 2 - 200.r), + child: MyEmptyWidget(), + ), + if (imageList.length > 0) + Padding( + padding: EdgeInsets.symmetric(vertical: 15.r), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + InkWell( + onTap: () { + if (defaultIndex > 0) { + setState(() { + defaultIndex = defaultIndex - 1; + pageController.jumpToPage(defaultIndex); + }); + } + }, + child: Container( + width: + (MediaQuery.of(context).size.width - 78.r) / 2 - 10.r, + height: 28.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.r)), + border: Border.all( + width: 1.r, + color: Color(0xFFCACACA), + style: BorderStyle.solid), + ), + child: Center( + child: Text( + '上一页', + style: TextStyle( + fontSize: 10.r, + color: defaultIndex == 0 + ? Color(0xFFCACACA) + : Color(0xFF505E6E)), + )), + ), + ), + InkWell( + onTap: () { + if (defaultIndex < imageList.length - 1) { + setState(() { + defaultIndex = defaultIndex + 1; + pageController.jumpToPage(defaultIndex); + }); + } + }, + child: Container( + width: + (MediaQuery.of(context).size.width - 78.r) / 2 - 10.r, + height: 28.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(6.r)), + border: Border.all( + width: 1.r, + color: Color(0xFFCACACA), + style: BorderStyle.solid), + ), + child: Center( + child: Text( + '下一页', + style: TextStyle( + fontSize: 10.r, + color: defaultIndex == imageList.length - 1 + ? Color(0xFFCACACA) + : Color(0xFF505E6E)), + )), + ), + ), + ], ), - ), - ):Padding( - padding: EdgeInsets.only(top: MediaQuery.of(context).size.height/2 - 200.r), - child: MyEmptyWidget(), - ), - if(imageList.length>0) - Padding( - padding: EdgeInsets.symmetric(vertical: 15.r), - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - InkWell( - onTap: () { - if (defaultIndex > 0) { - setState(() { - defaultIndex = defaultIndex - 1; - pageController.jumpToPage(defaultIndex); - }); - } - }, - child: Container( - width: - (MediaQuery.of(context).size.width - 78.r) / 2 - 10.r, - height: 28.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.r)), - border: Border.all( - width: 1.r, - color: Color(0xFFCACACA), - style: BorderStyle.solid), - ), - child: Center( - child: Text( - '上一页', - style: TextStyle( - fontSize: 10.r, - color: defaultIndex == 0 - ? Color(0xFFCACACA) - : Color(0xFF505E6E)), - )), - ), - ), - InkWell( - onTap: () { - if (defaultIndex < imageList.length - 1) { - setState(() { - defaultIndex = defaultIndex + 1; - pageController.jumpToPage(defaultIndex); - }); - } - }, - child: Container( - width: - (MediaQuery.of(context).size.width - 78.r) / 2 - 10.r, - height: 28.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.all(Radius.circular(6.r)), - border: Border.all( - width: 1.r, - color: Color(0xFFCACACA), - style: BorderStyle.solid), - ), - child: Center( - child: Text( - '下一页', - style: TextStyle( - fontSize: 10.r, - color: defaultIndex == imageList.length - 1 - ? Color(0xFFCACACA) - : Color(0xFF505E6E)), - )), - ), - ), - ], - ), - ) + ) ], ), ); diff --git a/marking_app/lib/pages/homework_correction/pages/job_favorite.dart b/marking_app/lib/pages/homework_correction/pages/job_favorite.dart index 113754a..97684cf 100644 --- a/marking_app/lib/pages/homework_correction/pages/job_favorite.dart +++ b/marking_app/lib/pages/homework_correction/pages/job_favorite.dart @@ -19,16 +19,16 @@ part 'job_favorite.g.dart'; /// 作业收藏学生名单列表 class JobFavorite extends StatefulWidget { final int jobId; - final int schoolId; - final int gradeId; - final String className; + final int? schoolId; + final int? gradeId; + final String? className; final String jobName; const JobFavorite({ required this.jobId, - required this.schoolId, - required this.gradeId, - required this.className, + this.schoolId, + this.gradeId, + this.className, required this.jobName, super.key, }); @@ -43,6 +43,7 @@ class _JobFavoriteState extends State with CommonMixin { JobReportJoinClass? classData; late String loginName; final int pageSize = 100; + String className = '-1'; @override void initState() { @@ -55,6 +56,10 @@ class _JobFavoriteState extends State with CommonMixin { loginName = userInfo['loginName']; }); });*/ + if(widget.className != null){ + className = widget.className!; + } + getInvolveClasses(); _future = getData(); } @@ -62,7 +67,7 @@ class _JobFavoriteState extends State with CommonMixin { Future> getData() async { var _client = await getClient(); var result = - await _client.getListOfJobFavorites(widget.jobId, widget.jobName, widget.className, pageSize); + await _client.getListOfJobFavorites(widget.jobId, widget.jobName, className == '全部'?'':className, pageSize); return result.data!.items; } @@ -98,7 +103,7 @@ class _JobFavoriteState extends State with CommonMixin { deleteFav(Items student) async{ RestClient _client = await getClient(); - BaseStructureResult res = await _client.getJobDeFavorites(widget.jobId,student.studentId,student.questionPage); + BaseStructureResult res = await _client.getJobDeFavorites(widget.jobId,student.studentId,student.questionPage!); if(res.success){ _future = getData(); setState(() { @@ -140,15 +145,18 @@ class _JobFavoriteState extends State with CommonMixin { (List? datas) { if (datas == null) return Container( - child: Center( - child: quickText('请求错误'), + child: InkWell( + onTap: (){ + toUpState(setState, () => _future = getData(), mounted); + }, + child: Center( + child: quickText('请求错误,点击再次发起请求'), + ), ), ); List pageList = []; List groupList = []; - String name = ''; if (datas!.length > 0) { - name = datas[0].jobName; for (var item in datas) { pageList.add(item.questionPage); } @@ -169,7 +177,7 @@ class _JobFavoriteState extends State with CommonMixin { mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text( - name, + widget.jobName, style: TextStyle(fontSize: 14.sp, color: Color(0xFF3C3C3C)), ), // 下拉框 @@ -180,6 +188,7 @@ class _JobFavoriteState extends State with CommonMixin { $classSelection(involveClasses, classData, call: (JobReportJoinClass _classData) { classData = _classData; if (_classData.gradeId == -1) classData = null; + className = _classData.className; _future = getData(); toUpState(setState, () {}, mounted); }), @@ -376,6 +385,7 @@ Widget $classSelection(List? involveClasses, JobReportJoinCl onChanged: (String? value) { if (value == null) return; call(involveClasses.firstWhere((element) => element.uniqueId == value)); + }, ), ); 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 6526331..6c640e7 100644 --- a/marking_app/lib/pages/homework_correction/quick_data_check.dart +++ b/marking_app/lib/pages/homework_correction/quick_data_check.dart @@ -7,7 +7,6 @@ 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/common/model/job/job_report_join_class.dart'; import 'package:marking_app/pages/homework_correction/widget/quick_student_data_table.dart'; import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart'; import 'package:marking_app/utils/index.dart'; @@ -17,19 +16,28 @@ import 'package:percent_indicator/linear_percent_indicator.dart'; class QuickDataCheckPage extends StatefulWidget { final int jobId; final String className; + final int? schoolId; + final int? gradeId; - const QuickDataCheckPage({Key? key, required this.jobId,required this.className}) : super(key: key); + const QuickDataCheckPage( + {Key? key, + required this.jobId, + required this.className, + this.schoolId, + this.gradeId}) + : super(key: key); @override State createState() => _QuickDataCheckPageState(); } -class _QuickDataCheckPageState extends State with CommonMixin { +class _QuickDataCheckPageState extends State + with CommonMixin { JobDataReport? jobData; void initState() { super.initState(); - EasyLoading.show(status:'loading...'); + EasyLoading.show(status: 'loading...'); getJobDataReport(); } @@ -37,17 +45,22 @@ class _QuickDataCheckPageState extends State with CommonMixi RestClient _client = await getClient(); Map params = {}; params['jobid'] = widget.jobId; - print(widget.jobId); + params['className'] = widget.className; + if (widget.schoolId != null) { + params['schoolId'] = widget.schoolId; + } + if (widget.gradeId != null) { + params['gradeId'] = widget.gradeId; + } + BaseStructureResult data = await _client.getJobDataCenterReport(params); EasyLoading.dismiss(); - if(data.code == 200){ + if (data.code == 200) { setState(() { jobData = data.data; }); } - - } @override @@ -90,242 +103,287 @@ class _QuickDataCheckPageState extends State with CommonMixi ))), ], ), - SizedBox(height:10.r), - jobData != null? - Expanded(child: SingleChildScrollView( - child: Column( - children: [ - Padding( - padding: EdgeInsets.only(left: 14.r, top: 2.r), - child: Row( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Image.asset( - 'assets/images/job_report_class_icon.png', - width: 22.r, - height: 22.r, - ), - SizedBox( - width: 6.r, - ), - Text( - widget.className, - style: TextStyle(fontSize: 14.r, color: Colors.white), - ) - ], - ), - ), - Container( - padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 15.r), - margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(6.r))), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.center, - children: [ - Container( - width: 14.r, - height: 14.r, - decoration: BoxDecoration( - color: Color(0xFF4CC793), - borderRadius: - BorderRadius.all(Radius.circular(7.r))), - ), - SizedBox( - width: 6.r, - ), - Text( - '已提交', - style: TextStyle( - fontSize: 12.sp, color: Color(0xFF333333)), - ), - SizedBox( - width: 35.r, - ), - Container( - width: 14.r, - height: 14.r, - decoration: BoxDecoration( - color: Color(0xFF6888FD), - borderRadius: - BorderRadius.all(Radius.circular(7.r))), - ), - SizedBox( - width: 6.r, - ), - Text( - '未提交', - style: TextStyle( - fontSize: 12.sp, color: Color(0xFF333333)), - ) - ], - ), - //环形图 - SizedBox( - height: MediaQuery.of(context).size.width * 0.5, - child: PieChart( - PieChartData( - borderData: FlBorderData(show: false), - sectionsSpace: 0, - centerSpaceRadius: MediaQuery.of(context).size.width * 0.1, - sections: [ - PieChartSectionData( - color: Color(0xFF4CC793), - value: jobData!.validCount/(jobData!.validCount+jobData!.noAnswerCount) * 100, - radius: MediaQuery.of(context).size.width * 0.1 + 5, - title: '${jobData!.validCount}人', - titleStyle: TextStyle( - fontSize: 14.sp, - color: Colors.white, - ), - ), - PieChartSectionData( - color: Color(0xFF6888FD), - value: jobData!.noAnswerCount/(jobData!.validCount+jobData!.noAnswerCount) * 100, - radius: MediaQuery.of(context).size.width * 0.1, - title: '${jobData!.noAnswerCount}人', - titleStyle: TextStyle( - fontSize: 14.sp, - color: Colors.white, - ), - ), - ], - ), - ), - ), - // 客观进度条 - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '客观题答题进度', - style: TextStyle( - fontSize: 10.sp, color: Color(0xFF8B8B8B)), - ), - Text('${doubleToStringAsFixed(jobData!.kgValidRate)}%', - style: TextStyle( - fontSize: 10.sp, color: Color(0xFF333333)), - ), - ], - ), - SizedBox(height: 6.r), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 10, - child: LinearPercentIndicator( - padding: EdgeInsets.zero, - animation: true, - lineHeight: 9.h, - animationDuration: 2500, - percent: jobData!.kgValidRate/100, - progressColor: Color(0xFFFF7F22), - backgroundColor: Color(0xFFEAEAEA), - barRadius: Radius.circular(10.r), - )), - ], - ), - SizedBox(height: 20.r), - // 主观进度条 - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Text( - '主观题答题进度', - style: TextStyle( - fontSize: 10.sp, color: Color(0xFF8B8B8B)), - ), - Text( - '${doubleToStringAsFixed(jobData!.zgValidRate)}%', - style: TextStyle( - fontSize: 10.sp, color: Color(0xFF333333)), - ), - ], - ), - SizedBox(height: 6.r), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Expanded( - flex: 10, - child: LinearPercentIndicator( - padding: EdgeInsets.zero, - animation: true, - lineHeight: 9.h, - animationDuration: 2500, - percent: jobData!.zgValidRate/100, - progressColor: Color(0xFFFF7F22), - backgroundColor: Color(0xFFEAEAEA), - barRadius: Radius.circular(10.r), - )), - ], - ), - ], - ), - ), - Container( - padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r), - margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all(Radius.circular(6.r))), + SizedBox(height: 10.r), + jobData != null + ? Expanded( + child: SingleChildScrollView( child: Column( children: [ - InkWell( - onTap: (){ - jobData!.studentDetails.sort((a, b) { - int num1 = a.kgValidRate + a.zgValidRate; - int num2 = b.kgValidRate + b.zgValidRate; - return num2.compareTo(num1); - }); - setState(() { - jobData!.studentDetails; - }); - }, + Padding( + padding: EdgeInsets.only(left: 14.r, top: 2.r), child: Row( - mainAxisAlignment: MainAxisAlignment.end, + crossAxisAlignment: CrossAxisAlignment.center, children: [ - Text( - '未提交排序', - style: TextStyle( - fontSize: 12.sp, color: Color(0xFF6888FD)), + Image.asset( + 'assets/images/job_report_class_icon.png', + width: 22.r, + height: 22.r, ), SizedBox( - width: 10.r, + width: 6.r, ), - Image.asset( - 'assets/images/sort_icon.png', - width: 14.r, - height: 14.r, + Text( + widget.className, + style: TextStyle( + fontSize: 14.r, color: Colors.white), + ) + ], + ), + ), + Container( + padding: EdgeInsets.symmetric( + vertical: 10.r, horizontal: 15.r), + margin: EdgeInsets.symmetric( + vertical: 10.r, horizontal: 14.r), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: + BorderRadius.all(Radius.circular(6.r))), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Container( + width: 14.r, + height: 14.r, + decoration: BoxDecoration( + color: Color(0xFF4CC793), + borderRadius: BorderRadius.all( + Radius.circular(7.r))), + ), + SizedBox( + width: 6.r, + ), + Text( + '已提交', + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF333333)), + ), + SizedBox( + width: 35.r, + ), + Container( + width: 14.r, + height: 14.r, + decoration: BoxDecoration( + color: Color(0xFF6888FD), + borderRadius: BorderRadius.all( + Radius.circular(7.r))), + ), + SizedBox( + width: 6.r, + ), + Text( + '未提交', + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF333333)), + ) + ], + ), + //环形图 + SizedBox( + height: MediaQuery.of(context).size.width * 0.5, + child: PieChart( + PieChartData( + borderData: FlBorderData(show: false), + sectionsSpace: 0, + centerSpaceRadius: + MediaQuery.of(context).size.width * 0.1, + sections: [ + PieChartSectionData( + color: Color(0xFF4CC793), + value: jobData!.validCount / + (jobData!.validCount + + jobData!.noAnswerCount) * + 100, + radius: + MediaQuery.of(context).size.width * + 0.1 + + 5, + title: '${jobData!.validCount}人', + titleStyle: TextStyle( + fontSize: 14.sp, + color: Colors.white, + ), + ), + PieChartSectionData( + color: Color(0xFF6888FD), + value: jobData!.noAnswerCount / + (jobData!.validCount + + jobData!.noAnswerCount) * + 100, + radius: + MediaQuery.of(context).size.width * + 0.1, + title: '${jobData!.noAnswerCount}人', + titleStyle: TextStyle( + fontSize: 14.sp, + color: Colors.white, + ), + ), + ], + ), + ), + ), + // 客观进度条 + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + '客观题答题进度', + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF8B8B8B)), + ), + Text( + '${doubleToStringAsFixed(jobData!.kgValidRate)}%', + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF333333)), + ), + ], + ), + SizedBox(height: 6.r), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 10, + child: LinearPercentIndicator( + padding: EdgeInsets.zero, + animation: true, + lineHeight: 9.h, + animationDuration: 2500, + percent: jobData!.kgValidRate / 100, + progressColor: Color(0xFFFF7F22), + backgroundColor: Color(0xFFEAEAEA), + barRadius: Radius.circular(10.r), + )), + ], + ), + SizedBox(height: 20.r), + // 主观进度条 + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Text( + '主观题答题进度', + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF8B8B8B)), + ), + Text( + '${doubleToStringAsFixed(jobData!.zgValidRate)}%', + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF333333)), + ), + ], + ), + SizedBox(height: 6.r), + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 10, + child: LinearPercentIndicator( + padding: EdgeInsets.zero, + animation: true, + lineHeight: 9.h, + animationDuration: 2500, + percent: jobData!.zgValidRate / 100, + progressColor: Color(0xFFFF7F22), + backgroundColor: Color(0xFFEAEAEA), + barRadius: Radius.circular(10.r), + )), + ], ), ], ), ), - SizedBox(height: 10.r,), - SizedBox( - height: jobData!.studentDetails.length>5?350.r:jobData!.studentDetails.length * 50.r + 40.r, - child: QuickStudentDataTable( - headList: ['学生姓名','客观题','主观题','客观题错题','主观题错题'], - bodyList: jobData!.studentDetails, - jobId: widget.jobId, - fixedRows: 1, - fixedCols: 0, + Container( + padding: EdgeInsets.symmetric( + vertical: 10.r, horizontal: 10.r), + margin: EdgeInsets.symmetric( + vertical: 10.r, horizontal: 14.r), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: + BorderRadius.all(Radius.circular(6.r))), + child: Column( + children: [ + InkWell( + onTap: () { + jobData!.studentDetails.sort((a, b) { + int num1 = a.kgValidRate + a.zgValidRate; + int num2 = b.kgValidRate + b.zgValidRate; + return num2.compareTo(num1); + }); + setState(() { + jobData!.studentDetails; + }); + }, + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + '未提交排序', + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF6888FD)), + ), + SizedBox( + width: 10.r, + ), + Image.asset( + 'assets/images/sort_icon.png', + width: 14.r, + height: 14.r, + ), + ], + ), + ), + SizedBox( + height: 10.r, + ), + SizedBox( + height: jobData!.studentDetails.length > 5 + ? 350.r + : jobData!.studentDetails.length * 50.r + + 40.r, + child: QuickStudentDataTable( + headList: [ + '学生姓名', + '客观题', + '主观题', + '客观题错题', + '主观题错题' + ], + bodyList: jobData!.studentDetails, + jobId: widget.jobId, + fixedRows: 1, + fixedCols: 0, + ), + ) + ], ), - ) + ), ], ), - ), - ], - ), - )):Padding( - padding: EdgeInsets.only(top: MediaQuery.of(context).size.height/2 - 200.r), - child: MyEmptyWidget(), - ) + )) + : Padding( + padding: EdgeInsets.only( + top: MediaQuery.of(context).size.height / 2 - 200.r), + child: MyEmptyWidget(), + ) ], ), ), diff --git a/marking_app/lib/routes/RouterManager.dart b/marking_app/lib/routes/RouterManager.dart index 81b30a0..a0c651c 100644 --- a/marking_app/lib/routes/RouterManager.dart +++ b/marking_app/lib/routes/RouterManager.dart @@ -278,7 +278,15 @@ class RouterManager { handlerFunc: (BuildContext? context, Map> params) { int jobId = int.parse(params['jobId']![0]); String className = params['className']![0]; - return QuickDataCheckPage(jobId: jobId, className: className); + int? schoolId; + if (params['schoolId'] != null && params['schoolId']![0] != null && params['schoolId']![0] != 'null') { + schoolId = int.parse(params['schoolId']![0]); + } + int? gradeId; + if (params['gradeId'] != null && params['gradeId']![0] != null && params['gradeId']![0] != 'null') { + gradeId = int.parse(params['gradeId']![0]); + } + return QuickDataCheckPage(jobId: jobId, className: className,schoolId:schoolId,gradeId:gradeId); }, ); @@ -309,10 +317,16 @@ class RouterManager { static final _jobFavoritePagePathHandler = Handler( handlerFunc: (BuildContext? context, Map> params) { int jobId = int.parse(params['jobId']![0]); - int gradeId = int.parse(params['gradeId']![0]); - int schoolId = int.parse(params['schoolId']![0]); - String className = params['className']![0]; String jobName = params['jobName']![0]; + String? className = params['className']![0]; + int? schoolId; + if (params['schoolId'] != null && params['schoolId']![0] != null && params['schoolId']![0] != 'null') { + schoolId = int.parse(params['schoolId']![0]); + } + int? gradeId; + if (params['gradeId'] != null && params['gradeId']![0] != null && params['gradeId']![0] != 'null') { + gradeId = int.parse(params['gradeId']![0]); + } return JobFavorite(jobId: jobId, gradeId: gradeId, schoolId: schoolId, className: className,jobName:jobName); }, ); diff --git a/marking_app/lib/utils/request/rest_client.dart b/marking_app/lib/utils/request/rest_client.dart index a0f33e7..e4c5c1e 100644 --- a/marking_app/lib/utils/request/rest_client.dart +++ b/marking_app/lib/utils/request/rest_client.dart @@ -308,7 +308,7 @@ abstract class RestClient { Future> getListOfJobFavorites( @the_retrofit.Query("JobId") int jobId, @the_retrofit.Query("JobName") String jobName, - @the_retrofit.Query("className") String className, + @the_retrofit.Query("className") String? className, @the_retrofit.Query("PageSize") int pageSize, );