From 9c66503154bde5898e0035d270ab03e0c89b5337 Mon Sep 17 00:00:00 2001 From: machuanyu <840649825@qq.com> Date: Fri, 29 Mar 2024 11:37:35 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=86=E5=8F=B2=E4=BD=9C=E4=B8=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/model/job/job_student_history.dart | 8 +- .../job_personal_detail.dart | 618 +++++++++++------- 2 files changed, 375 insertions(+), 251 deletions(-) diff --git a/marking_app/lib/common/model/job/job_student_history.dart b/marking_app/lib/common/model/job/job_student_history.dart index 15d50e9..3381730 100644 --- a/marking_app/lib/common/model/job/job_student_history.dart +++ b/marking_app/lib/common/model/job/job_student_history.dart @@ -99,11 +99,17 @@ class Items extends Object { @JsonKey(name: 'subjectiveDtls') List subjectiveDtls; + @JsonKey(name: 'gradeName') + String gradeName; + + @JsonKey(name: 'className') + String className; + //全部未做 @JsonKey(name: 'allNotDone') bool allNotDone; - Items(this.id,this.name,this.subject,this.subjectName,this.publishTime,this.isPaper,this.studentJobId,this.correctRate,this.objectiveCorrectRate,this.objectiveDtls,this.subjectiveCorrectRate,this.subjectiveDtls,[this.allNotDone = false,]); + Items(this.id,this.name,this.subject,this.subjectName,this.publishTime,this.gradeName,this.className,this.isPaper,this.studentJobId,this.correctRate,this.objectiveCorrectRate,this.objectiveDtls,this.subjectiveCorrectRate,this.subjectiveDtls,[this.allNotDone = false,]); factory Items.fromJson(Map srcJson) => _$ItemsFromJson(srcJson); 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 4cde8f7..c1cb298 100644 --- a/marking_app/lib/pages/homework_correction/job_personal_detail.dart +++ b/marking_app/lib/pages/homework_correction/job_personal_detail.dart @@ -7,6 +7,7 @@ import 'package:marking_app/common/mixin/common.dart'; import 'package:marking_app/common/model/common/base_structure_result.dart'; import 'package:marking_app/common/model/job/job_student_history.dart'; import 'package:marking_app/pages/homework_correction/widget/personal_detail_topbar.dart'; +import 'package:marking_app/routes/RouterManager.dart'; import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart'; import 'package:marking_app/utils/index.dart'; import 'package:marking_app/utils/my_text.dart'; @@ -179,27 +180,43 @@ class _JobPersonalDetailState extends State ], ), ), - progressBar(context, - title: '客观题正确率:', - color: Color(0xFFB8C7FF), - percent: studentData!.objectiveCorrectRate / 100, - padingEdg: EdgeInsets.symmetric(horizontal: 14.r), - marginEdg: EdgeInsets.only(top: 8.h)), - progressBar(context, - title: '主观题正确率:', - color: Color(0xFFB8C7FF), - percent: studentData!.subjectiveCorrectRate / 100, - padingEdg: EdgeInsets.symmetric(horizontal: 14.r), - marginEdg: EdgeInsets.only(top: 8.h)), - progressBar(context, - title: '总正确率:', - color: Color(0xFFB8C7FF), - percent: studentData!.correctRate / 100, - padingEdg: EdgeInsets.symmetric(horizontal: 14.r), - marginEdg: EdgeInsets.only(top: 8.h)), - SizedBox( - height: 10.r, + Container( + margin: EdgeInsets.symmetric( + vertical: 10.r, horizontal: 14.r), + padding: EdgeInsets.only(top: 10.r,left: 10.r,right: 10.r,bottom: 10.r), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(10.r)), + color: Colors.white), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text('总览:',style: TextStyle(fontSize: 12.sp,color: Color(0xFF7491FD),fontWeight: FontWeight.w600),), + progressBar(context, + title: '客观题正确率:', + color: Color(0xFFB8C7FF), + percent: studentData!.objectiveCorrectRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + progressBar(context, + title: '主观题正确率:', + color: Color(0xFFB8C7FF), + percent: studentData!.subjectiveCorrectRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + progressBar(context, + title: '总正确率:', + color: Color(0xFFB8C7FF), + percent: studentData!.correctRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + ], + ), ), + + /* SizedBox( + height: 5.r, + ),*/ jobConditionFilter(context, controller: tabController, jobType: isJob ? 1 : 2, @@ -252,6 +269,91 @@ class _JobPersonalDetailState extends State } } }), + Padding( + padding: EdgeInsets.only(top: 14.r,right: 14.r), + child: Row( + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Text( + '注:', + style: TextStyle( + fontSize: 8.sp, color: Color(0xFF8B8B8B)), + ), + Container( + width:10.r, + height: 10.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(5.r)), + // color: Color(0xFF4CC793), + border: Border.all(width: 1.r,color: Color(0xFF4CC793)), + ), + ), + SizedBox(width: 2.r,), + Text( + '正确', + style: TextStyle( + fontSize: 8.sp, color: Color(0xFF8B8B8B)), + ), + SizedBox(width: 15.r,), + Container( + width:10.r, + height: 10.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(5.r)), + // color: Color(0xFFFF7474), + border: Border.all(width: 1.r,color: Color(0xFFFF7474)), + ), + ), + SizedBox(width: 2.r,), + Text( + '错误', + style: TextStyle( + fontSize: 8.sp, color: Color(0xFF8B8B8B)), + ), + SizedBox(width: 15.r,), + Container( + width:10.r, + height: 10.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(5.r)), + // color: Color(0xFF666666), + border: Border.all(width: 1.r,color: Color(0xFF666666)), + // border: Border.all(width: 1.r,color: Colors.grey), + /* boxShadow: [ + BoxShadow( + color: Colors.grey, + offset: Offset(1.w, 1.h), //阴影y轴偏移量 + blurRadius: 4, //阴影模糊程度 + spreadRadius: 0.1, //阴影扩散程度 + ) + ],*/ + ), + ), + SizedBox(width: 2.r,), + Text( + '已作答未批阅', + style: TextStyle( + fontSize: 8.sp, color: Color(0xFF8B8B8B)), + ), + SizedBox(width: 15.r,), + Container( + width:10.r, + height: 10.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all(Radius.circular(5.r)), + border: Border.all(width: 1.r,color: Color(0xFFDDDDDD)), + // color: Color(0xFFDDDDDD), + ), + ), + SizedBox(width: 2.r,), + Text( + '未做', + style: TextStyle( + fontSize: 8.sp, color: Color(0xFF8B8B8B)), + ), + ], + ), + ), Expanded( child: Padding( padding: EdgeInsets.symmetric(vertical: 10.r), @@ -280,119 +382,157 @@ class _JobPersonalDetailState extends State itemCount: dataList.length, itemBuilder: (context, index) { Items item = dataList[index]; - return Container( - margin: EdgeInsets.symmetric( - vertical: 5.r, horizontal: 14.r), - padding: EdgeInsets.symmetric( - vertical: 14.r, horizontal: 10.r), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(10.r)), - color: item.allNotDone - ? Color(0xFFFFEDD3) - : Colors.white), - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Container( - width: 32.w, - height: 18.h, - alignment: Alignment.center, - padding: EdgeInsets.only(left: 2.w), - decoration: BoxDecoration( - color: isJob - ? const Color.fromRGBO( - 104, 136, 253, 1) - : Color(0xFFFFA116), - borderRadius: BorderRadius.only( - topLeft: Radius.circular(14.r), - topRight: Radius.circular(3.r), - bottomLeft: Radius.circular(4.r), - bottomRight: Radius.circular(4.r), + return InkWell( + onTap: (){ + /* RouterManager.router.navigateTo( + context, + RouterManager.quickDataCheckPath + + '?gradeName=${Uri.encodeComponent(item.gradeName)}&className=${Uri.encodeComponent(item.className)}&jobId=${item.id}', + transition: getTransition(), + );*/ + RouterManager.router.navigateTo( + context, + RouterManager.quickCheckPersonalPath + + '?jobId=${item.id}&studentId=${widget.studentId}', + transition: getTransition(), + ); + }, + child: Container( + margin: EdgeInsets.symmetric( + vertical: 5.r, horizontal: 14.r), + padding: EdgeInsets.symmetric( + vertical: 14.r, horizontal: 10.r), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(10.r)), + color: item.allNotDone + ? Color(0xFFFFEDD3) + : Colors.white), + child: Column( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Row( + mainAxisAlignment: MainAxisAlignment.start, + crossAxisAlignment: CrossAxisAlignment.end, + children: [ + Container( + width: 32.w, + height: 18.h, + alignment: Alignment.center, + padding: EdgeInsets.only(left: 2.w), + decoration: BoxDecoration( + color: isJob + ? const Color.fromRGBO( + 104, 136, 253, 1) + : Color(0xFFFFA116), + borderRadius: BorderRadius.only( + topLeft: Radius.circular(14.r), + topRight: Radius.circular(3.r), + bottomLeft: Radius.circular(4.r), + bottomRight: Radius.circular(4.r), + ), + ), + margin: EdgeInsets.only(right: 4.w), + child: Text( + isJob ? '作业' : '考试', + style: TextStyle( + fontSize: 10.sp, + color: Colors.white), ), ), - margin: EdgeInsets.only(right: 4.w), - child: Text( - isJob ? '作业' : '考试', - style: TextStyle( - fontSize: 10.sp, - color: Colors.white), - ), - ), - Expanded( - child: Text( - item.name, - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF464646)), - )), - // SizedBox(width: 5.r,), - // Text('2024.1',style: TextStyle(fontSize: 12.sp,color: Color(0xFF5B5B5B)),), - - Container( - width: 40.r, - height: 20.r, - decoration: BoxDecoration( - borderRadius: BorderRadius.all( - Radius.circular(4.r)), - border: Border.all( - width: 1.r, - color: Color(0xFF4CC793)), - ), - child: Center( + Expanded( child: Text( - item.subjectName, + item.name, style: TextStyle( - fontSize: 10.sp, - color: Color(0xFF4CC793)), + fontSize: 12.sp, + color: Color(0xFF464646)), )), - ), - ], - ), - SizedBox( - height: 10.r, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '客:', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF5B5B5B)), - ), - SizedBox( - width: 5.r, - ), - item.objectiveDtls.length > 0 - ? Expanded( - child: Wrap( - direction: Axis.horizontal, - alignment: WrapAlignment.start, - spacing: 8, - runSpacing: 5, - children: List.generate( - item.objectiveDtls.length, - (i) { - SubjectiveDtls subjective = - item.objectiveDtls[i]; - return Container( - width: 20.r, - height: 20.r, - decoration: BoxDecoration( - color: Colors.transparent, - border: Border.all( - width: 1.r, + // SizedBox(width: 5.r,), + // Text('2024.1',style: TextStyle(fontSize: 12.sp,color: Color(0xFF5B5B5B)),), + + Container( + width: 40.r, + height: 20.r, + decoration: BoxDecoration( + borderRadius: BorderRadius.all( + Radius.circular(4.r)), + border: Border.all( + width: 1.r, + color: Color(0xFF4CC793)), + ), + child: Center( + child: Text( + item.subjectName, + style: TextStyle( + fontSize: 10.sp, + color: Color(0xFF4CC793)), + )), + ), + ], + ), + SizedBox( + height: 10.r, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '客:', + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF5B5B5B)), + ), + SizedBox( + width: 5.r, + ), + item.objectiveDtls.length > 0 + ? Expanded( + child: Wrap( + direction: Axis.horizontal, + alignment: WrapAlignment.start, + spacing: 8, + runSpacing: 5, + children: List.generate( + item.objectiveDtls.length, + (i) { + SubjectiveDtls subjective = + item.objectiveDtls[i]; + return Container( + width: 20.r, + height: 20.r, + decoration: BoxDecoration( + color: Colors.transparent, + border: Border.all( + width: 1.r, + color: subjective + .state == + 0 + ? Color( + 0xFFDDDDDD) + : subjective.state == + 3 + ? Color( + 0xFF666666) + : subjective.state == + 1 + ? Color( + 0xFFFF7474) + : Color( + 0xFF4CC793)), + borderRadius: + BorderRadius.all( + Radius.circular( + 10.r))), + child: Center( + child: Text( + subjective.questionNo, + style: TextStyle( + fontSize: 10.r, color: subjective .state == 0 - ? Color( - 0xFFDDDDDD) + ? Color(0xFFDDDDDD) : subjective.state == 3 ? Color( @@ -403,81 +543,81 @@ class _JobPersonalDetailState extends State 0xFFFF7474) : Color( 0xFF4CC793)), - borderRadius: - BorderRadius.all( - Radius.circular( - 10.r))), - child: Center( - child: Text( - subjective.questionNo, - style: TextStyle( - fontSize: 10.r, - color: subjective - .state == - 0 - ? Color(0xFFDDDDDD) - : subjective.state == - 3 - ? Color( - 0xFF666666) - : subjective.state == - 1 - ? Color( - 0xFFFF7474) - : Color( - 0xFF4CC793)), - )), - ); - }), + )), + ); + }), + ), + ) + : Text( + '无', + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF5B5B5B)), ), - ) - : Text( - '无', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF5B5B5B)), - ), - ], - ), - SizedBox( - height: 10.r, - ), - Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - '主:', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF5B5B5B)), - ), - SizedBox( - width: 5.r, - ), - item.subjectiveDtls.length > 0 - ? Expanded( - child: Wrap( - direction: Axis.horizontal, - alignment: WrapAlignment.start, - spacing: 8, - runSpacing: 5, - children: List.generate( - item.subjectiveDtls.length, - (i) { - SubjectiveDtls subjective = - item.subjectiveDtls[i]; - return Container( - width: 20.r, - height: 20.r, - decoration: BoxDecoration( - color: Colors.transparent, - border: Border.all( - width: 1.r, + ], + ), + SizedBox( + height: 10.r, + ), + Row( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + '主:', + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF5B5B5B)), + ), + SizedBox( + width: 5.r, + ), + item.subjectiveDtls.length > 0 + ? Expanded( + child: Wrap( + direction: Axis.horizontal, + alignment: WrapAlignment.start, + spacing: 8, + runSpacing: 5, + children: List.generate( + item.subjectiveDtls.length, + (i) { + SubjectiveDtls subjective = + item.subjectiveDtls[i]; + return Container( + width: 20.r, + height: 20.r, + decoration: BoxDecoration( + color: Colors.transparent, + border: Border.all( + width: 1.r, + color: subjective + .state == + 0 + ? Color( + 0xFFDDDDDD) + : subjective.state == + 3 + ? Color( + 0xFF666666) + : subjective.state == + 1 + ? Color( + 0xFFFF7474) + : Color( + 0xFF4CC793)), + borderRadius: + BorderRadius.all( + Radius.circular( + 10.r))), + child: Center( + child: Text( + subjective.questionNo, + style: TextStyle( + fontSize: 10.r, color: subjective .state == 0 - ? Color( - 0xFFDDDDDD) + ? Color(0xFFDDDDDD) : subjective.state == 3 ? Color( @@ -488,61 +628,39 @@ class _JobPersonalDetailState extends State 0xFFFF7474) : Color( 0xFF4CC793)), - borderRadius: - BorderRadius.all( - Radius.circular( - 10.r))), - child: Center( - child: Text( - subjective.questionNo, - style: TextStyle( - fontSize: 10.r, - color: subjective - .state == - 0 - ? Color(0xFFDDDDDD) - : subjective.state == - 3 - ? Color( - 0xFF666666) - : subjective.state == - 1 - ? Color( - 0xFFFF7474) - : Color( - 0xFF4CC793)), - )), - ); - }), + )), + ); + }), + ), + ) + : Text( + '无', + style: TextStyle( + fontSize: 12.sp, + color: Color(0xFF5B5B5B)), ), - ) - : Text( - '无', - style: TextStyle( - fontSize: 12.sp, - color: Color(0xFF5B5B5B)), - ), - ], - ), - progressBar(context, - title: '客观题正确率:', - color: Color(0xFF90E0BE), - percent: item.objectiveCorrectRate / 100, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h)), - progressBar(context, - title: '主观题正确率:', - color: Color(0xFF90E0BE), - percent: item.subjectiveCorrectRate / 100, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h)), - progressBar(context, - title: '总正确率:', - color: Color(0xFF90E0BE), - percent: item.correctRate / 100, - padingEdg: EdgeInsets.zero, - marginEdg: EdgeInsets.only(top: 8.h)), - ], + ], + ), + progressBar(context, + title: '客观题正确率:', + color: Color(0xFF90E0BE), + percent: item.objectiveCorrectRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + progressBar(context, + title: '主观题正确率:', + color: Color(0xFF90E0BE), + percent: item.subjectiveCorrectRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + progressBar(context, + title: '总正确率:', + color: Color(0xFF90E0BE), + percent: item.correctRate / 100, + padingEdg: EdgeInsets.zero, + marginEdg: EdgeInsets.only(top: 8.h)), + ], + ), ), ); })