From e349922528085ab836c8a059e7f879b07179f578 Mon Sep 17 00:00:00 2001 From: machuanyu <840649825@qq.com> Date: Mon, 27 May 2024 17:42:22 +0800 Subject: [PATCH] =?UTF-8?q?=E7=9F=A5=E8=AF=86=E7=82=B9=E6=8E=8C=E6=8F=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- assets/images/icon_back_green.png | Bin 0 -> 303 bytes assets/images/right_icon_blue.png | Bin 0 -> 293 bytes lib/common/api/retrofit_client.dart | 14 ++ lib/common/job/annotated_class.dart | 13 +- lib/common/job/homework_details.dart | 2 +- lib/common/job/knowledge_points_grasp.dart | 29 +++ lib/common/job/knowledge_report_detail.dart | 41 ++++ lib/common/utils/utils.dart | 2 +- lib/page/global_widget/show_student_list.dart | 74 +++++++ .../annotate_class/annotate_class_logic.dart | 18 +- .../annotate_class/annotate_class_state.dart | 1 + .../annotate_class/annotate_class_view.dart | 23 +- .../annotate_class/widget/annotate_item.dart | 16 +- .../widget/completed_annotate_item.dart | 197 ++++++++++++++++++ .../children/job_report/job_report_state.dart | 2 +- .../children/job_report/job_report_view.dart | 2 +- .../job_report/widget/knowledge_point.dart | 16 +- .../widget/quick_data_check_bottom.dart | 2 +- .../widget/quick_student_data_table.dart | 6 - .../quick_data_check/widget/report_table.dart | 19 +- .../children/read_over/read_over_view.dart | 6 +- .../read_over/widget/task_list_item.dart | 4 +- .../widget/job_condition_filter.dart | 4 +- lib/page/home_page/home_view.dart | 2 +- lib/routes/app_pages.dart | 6 + lib/routes/app_routes.dart | 2 + 26 files changed, 453 insertions(+), 48 deletions(-) create mode 100644 assets/images/icon_back_green.png create mode 100644 assets/images/right_icon_blue.png create mode 100644 lib/common/job/knowledge_points_grasp.dart create mode 100644 lib/common/job/knowledge_report_detail.dart create mode 100644 lib/page/global_widget/show_student_list.dart create mode 100644 lib/page/home_page/children/annotate_class/widget/completed_annotate_item.dart diff --git a/assets/images/icon_back_green.png b/assets/images/icon_back_green.png new file mode 100644 index 0000000000000000000000000000000000000000..3df3757fc00634d06f467ce833ea95771764721d GIT binary patch literal 303 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9E$svykh8Km+7D9BhG z0Y z&LwIq8zu?PVA$m_^+NLzwl9pGk~bK<0!}3E=GpdGcz@Bu|0SPJa!fmtI_*lst8IcOL- zQ?$WCwdIk;jO958S~f7q9%7s2@ml#+liVb$D<4w)1-g9&8gKR75#Y|4cGcwnl(~$- wH#s*zopr00>NWRR910 literal 0 HcmV?d00001 diff --git a/assets/images/right_icon_blue.png b/assets/images/right_icon_blue.png new file mode 100644 index 0000000000000000000000000000000000000000..87bb071aec1b626ebed808d8a9ef746f83d6abcc GIT binary patch literal 293 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9E$svykh8Km+7D9BhG zh($ literal 0 HcmV?d00001 diff --git a/lib/common/api/retrofit_client.dart b/lib/common/api/retrofit_client.dart index 393bfba..63144ff 100644 --- a/lib/common/api/retrofit_client.dart +++ b/lib/common/api/retrofit_client.dart @@ -7,6 +7,8 @@ import 'package:school_asignment_app/common/job/common/base_app_version.dart'; import 'package:school_asignment_app/common/job/common/base_page_data.dart'; import 'package:school_asignment_app/common/job/enum_subject.dart'; import 'package:school_asignment_app/common/job/homework_details.dart'; +import 'package:school_asignment_app/common/job/knowledge_points_grasp.dart'; +import 'package:school_asignment_app/common/job/knowledge_report_detail.dart'; import 'package:school_asignment_app/common/job/student_history.dart'; import 'package:school_asignment_app/common/job/student_history_params.dart'; import 'package:school_asignment_app/common/job/student_item.dart'; @@ -78,4 +80,16 @@ abstract class RetrofitClient { @GET("/api/hms/HmsReport/GetStudentHomework") Future getStudentHomework(@Query('HomeworkId') String homeworkId,@Query('StudentId') int studentId); + //知识点掌握 + @GET("/api/hms/HmsReport/GetKnowledgeReport") + Future> getKnowledgeReport(@Query('DateStart') String dateStart,@Query('DateEnd') String dateEnd,@Query('KnowledgeName') String knowledgeName); + + //知识点掌握详情 + @GET("/api/hms/HmsReport/GetKnowledgeReportDetail") + Future> getKnowledgeReportDetail(@Query('DateStart') String dateStart,@Query('DateEnd') String dateEnd,@Query('KnowledgeId') int knowledgeId); + + //学生 + @GET("/api/hms/HmsReport/GetQuestionStudentState") + Future> getQuestionStudentState(@Query('HomeworkId') String homeworkId,@Query('TemplateId') int templateId,@Query('QuestionNo') int questionNo); + } diff --git a/lib/common/job/annotated_class.dart b/lib/common/job/annotated_class.dart index 5df2396..2483b53 100644 --- a/lib/common/job/annotated_class.dart +++ b/lib/common/job/annotated_class.dart @@ -57,7 +57,18 @@ class AnnotatedClass extends Object { @JsonKey(name: 'noCommitStudentCount') int? noCommitStudentCount; - AnnotatedClass(this.schoolName,this.grade,this.classId,this.className,this.finishTime,this.questionCount,this.answerCount,this.answerRate,this.unAnnotateCount,this.annotateRate,this.students,this.homeworkFavs,this.kgtCorrectRate,this.zgtCorrectRate,this.correctRate,this.commitStudentCount,this.noCommitStudentCount); + @JsonKey(name: 'commitStudent') + List? commitStudent; + + @JsonKey(name: 'noCommitStudent') + List? noCommitStudent; + + AnnotatedClass(this.schoolName,this.grade,this.classId,this.className,this.finishTime,this.questionCount,this.answerCount,this.answerRate,this.unAnnotateCount,this.annotateRate,this.students,this.homeworkFavs,this.kgtCorrectRate,this.zgtCorrectRate,this.correctRate,this.commitStudentCount,this.noCommitStudentCount,this.commitStudent,this.noCommitStudent){ + commitStudent = []; + noCommitStudent = []; + commitStudent = students.where((w) => w.state != 0).toList(); + noCommitStudent = students.where((w) => w.state == 0).toList(); + } factory AnnotatedClass.fromJson(Map srcJson) => _$AnnotatedClassFromJson(srcJson); diff --git a/lib/common/job/homework_details.dart b/lib/common/job/homework_details.dart index 7a2d135..c7c1908 100644 --- a/lib/common/job/homework_details.dart +++ b/lib/common/job/homework_details.dart @@ -131,7 +131,7 @@ class Students extends Object { int state; @JsonKey(name: 'priorityAnnotate') - bool priorityAnnotate; + bool? priorityAnnotate; @JsonKey(name: 'kgtStu') List? kgtStu; diff --git a/lib/common/job/knowledge_points_grasp.dart b/lib/common/job/knowledge_points_grasp.dart new file mode 100644 index 0000000..85e12bb --- /dev/null +++ b/lib/common/job/knowledge_points_grasp.dart @@ -0,0 +1,29 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'knowledge_points_grasp.g.dart'; + + +@JsonSerializable() +class KnowledgePointsGrasp extends Object { + + @JsonKey(name: 'knowledgeId') + int knowledgeId; + + @JsonKey(name: 'knowledgeName') + String knowledgeName; + + @JsonKey(name: 'correctRate') + int correctRate; + + @JsonKey(name: 'count') + int count; + + KnowledgePointsGrasp(this.knowledgeId,this.knowledgeName,this.correctRate,this.count,); + + factory KnowledgePointsGrasp.fromJson(Map srcJson) => _$KnowledgePointsGraspFromJson(srcJson); + + Map toJson() => _$KnowledgePointsGraspToJson(this); + +} + + diff --git a/lib/common/job/knowledge_report_detail.dart b/lib/common/job/knowledge_report_detail.dart new file mode 100644 index 0000000..aa06f5c --- /dev/null +++ b/lib/common/job/knowledge_report_detail.dart @@ -0,0 +1,41 @@ +import 'package:json_annotation/json_annotation.dart'; + +part 'knowledge_report_detail.g.dart'; + + +@JsonSerializable() +class KnowledgeReportDetail extends Object { + + @JsonKey(name: 'homeworkId') + String homeworkId; + + @JsonKey(name: 'homeworkName') + String homeworkName; + + @JsonKey(name: 'publishTime') + String publishTime; + + @JsonKey(name: 'templateId') + int templateId; + + @JsonKey(name: 'questionNo') + int questionNo; + + @JsonKey(name: 'questionType') + int questionType; + + @JsonKey(name: 'questionPicture') + String? questionPicture; + + @JsonKey(name: 'correctRate') + int correctRate; + + KnowledgeReportDetail(this.homeworkId,this.homeworkName,this.publishTime,this.templateId,this.questionNo,this.questionType,this.correctRate,this.questionPicture); + + factory KnowledgeReportDetail.fromJson(Map srcJson) => _$KnowledgeReportDetailFromJson(srcJson); + + Map toJson() => _$KnowledgeReportDetailToJson(this); + +} + + diff --git a/lib/common/utils/utils.dart b/lib/common/utils/utils.dart index afa7987..5e4d237 100644 --- a/lib/common/utils/utils.dart +++ b/lib/common/utils/utils.dart @@ -94,7 +94,7 @@ class Utils{ dataCount.zgtOkRate = Utils.calcRate(dataCount.zgtOkCount!, dataCount.zgtDtlCount!); dataCount.zgtCount = data.questions.where((w) => w.questionType == 2).length; dataCount.studentCount = data.students.length; - dataCount.priorityStudents = data.students.where((w) => w.priorityAnnotate).toList(); + dataCount.priorityStudents = data.students.where((w) => w.priorityAnnotate!).toList(); for(var que in data.questions){ diff --git a/lib/page/global_widget/show_student_list.dart b/lib/page/global_widget/show_student_list.dart new file mode 100644 index 0000000..f4bbe4e --- /dev/null +++ b/lib/page/global_widget/show_student_list.dart @@ -0,0 +1,74 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:school_asignment_app/common/job/homework_details.dart'; +import 'package:school_asignment_app/page/global_widget/my_text.dart'; +import 'package:school_asignment_app/routes/app_pages.dart'; + +class ShowStudentList extends StatelessWidget { + final String title; + final String homeworkId; + final List studentList; + const ShowStudentList({Key? key,required this.title,required this.studentList,required this.homeworkId}) : super(key: key); + + @override + Widget build(BuildContext context) { + return AlertDialog( + backgroundColor: Colors.white, + shape: RoundedRectangleBorder( + borderRadius: BorderRadius.all(Radius.circular(20.r)), + ), + content: Container( + width: Get.width * 0.8, + height: Get.height * 0.7, + padding: EdgeInsets.symmetric(horizontal: 2.w), + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 14.h), + child: quickText( + title, + size: 18.sp, + fontWeight: FontWeight.bold, + color: Color.fromRGBO(60, 60, 60, 1), + ), + ), + Expanded( + child: ListView( + padding: EdgeInsets.symmetric(vertical: 8.h, horizontal: 4.w), + children: [ + Wrap( + spacing: 6.r, // 主轴(水平)方向间距 + runSpacing: 4.r, // 纵轴(垂直)方向间距 + alignment: WrapAlignment.spaceAround, //沿主轴方向居中 + children: studentList.map((e) { + return InkWell( + onTap: (){ + Get.toNamed(Routes.studentPersonalPage,arguments: {'studentId':e.studentId,'homeworkId':homeworkId}); + }, + child: Container( + padding: EdgeInsets.symmetric( + vertical: 4.r, horizontal: 8.r), + decoration: BoxDecoration( + color: e.state == 3 + ? Color(0xFF4CC793) + : Color(0xFFE2E2E2), + borderRadius: BorderRadius.circular(4.r), + ), + child: quickText(e.studentName, + color: + e.state == 3 ? Colors.white : Color(0xFF505E6E), + size: 10.sp), + ), + ); + }).toList(), + ), + ], + ), + ) + ], + ), + ), + ); + } +} diff --git a/lib/page/home_page/children/annotate_class/annotate_class_logic.dart b/lib/page/home_page/children/annotate_class/annotate_class_logic.dart index 98ac37b..6f2b47c 100644 --- a/lib/page/home_page/children/annotate_class/annotate_class_logic.dart +++ b/lib/page/home_page/children/annotate_class/annotate_class_logic.dart @@ -1,6 +1,9 @@ +import 'package:flutter_easyloading/flutter_easyloading.dart'; import 'package:get/get.dart'; +import 'package:get_storage/get_storage.dart'; import 'package:school_asignment_app/common/job/annotated_class.dart'; import 'package:school_asignment_app/common/mixins/request_tool_mixin.dart'; +import 'package:school_asignment_app/routes/app_pages.dart'; import 'annotate_class_state.dart'; @@ -13,7 +16,8 @@ class AnnotateClassLogic extends GetxController with RequestToolMixin{ state.homeworkId.value = Get.arguments['id']??''; state.name.value = Get.arguments['name']??''; state.grade = Get.arguments['grade']; - + state.completed.value = Get.arguments['completed']??false; + EasyLoading.show(status: 'loading...'); getList(); } @@ -35,7 +39,17 @@ class AnnotateClassLogic extends GetxController with RequestToolMixin{ element.noCommitStudentCount = noCommitStudentCount; } - +EasyLoading.dismiss(); } + void goQuickDataCheck(item){ + Get.toNamed(Routes.quickDataCheckPage,arguments: {'homeworkId':state.homeworkId.value,'classId':item.classId,'grade':state.grade,'className':item.className + }); + } + + void gojobReport(item){ + Get.toNamed(Routes.jobReportPage,arguments: {'title':state.name.value,'homeworkId':state.homeworkId.value,'grade':state.grade,'className':item.className}); + } + + } diff --git a/lib/page/home_page/children/annotate_class/annotate_class_state.dart b/lib/page/home_page/children/annotate_class/annotate_class_state.dart index fcd49b2..1b079ae 100644 --- a/lib/page/home_page/children/annotate_class/annotate_class_state.dart +++ b/lib/page/home_page/children/annotate_class/annotate_class_state.dart @@ -9,5 +9,6 @@ class AnnotateClassState { late RxString name = ''.obs; late RxList classList = RxList(); late RxString homeworkId = ''.obs; + late RxBool completed = false.obs; late int grade; } diff --git a/lib/page/home_page/children/annotate_class/annotate_class_view.dart b/lib/page/home_page/children/annotate_class/annotate_class_view.dart index 465113e..afa3aa3 100644 --- a/lib/page/home_page/children/annotate_class/annotate_class_view.dart +++ b/lib/page/home_page/children/annotate_class/annotate_class_view.dart @@ -11,6 +11,7 @@ import 'package:school_asignment_app/page/home_page/children/annotate_class/widg import 'package:school_asignment_app/page/home_page/widget/progress_bar.dart'; import 'package:school_asignment_app/routes/app_pages.dart'; import 'annotate_class_logic.dart'; +import 'widget/completed_annotate_item.dart'; class AnnotateClassPage extends StatefulWidget { const AnnotateClassPage({Key? key}) : super(key: key); @@ -25,6 +26,7 @@ class _AnnotateClassPageState extends State { @override Widget build(BuildContext context) { + return Scaffold( backgroundColor: const Color.fromRGBO(245, 245, 245, 1), appBar: AppBar( @@ -47,6 +49,23 @@ class _AnnotateClassPageState extends State { padding: EdgeInsets.symmetric(vertical: 14.r, horizontal: 14.r), child: Obx(() { return + state.completed.value? Utils.isPad()?GridView( + gridDelegate: SliverGridDelegateWithFixedCrossAxisCount( + crossAxisCount: 2, //横轴三个子widget + mainAxisSpacing: 10.h, + crossAxisSpacing: 6.w, + childAspectRatio: 1.48 //宽高比为1时,子widget + ), + children: state.classList.map((taskItem) { + return CompletedAnnotateItem(taskItem:taskItem,logic: logic,); + }).toList(), + ):ListView.builder( + itemCount: state.classList.length, + itemBuilder: (context, index) { + AnnotatedClass taskItem = state.classList[index]; + return CompletedAnnotateItem(taskItem:taskItem,logic: logic,); + }): + Utils.isPad()?MasonryGridView.count( crossAxisCount: 2, //几列 mainAxisSpacing: 4.w, // 间距 @@ -54,14 +73,14 @@ class _AnnotateClassPageState extends State { itemCount: state.classList.length, itemBuilder: (context, index) { AnnotatedClass item = state.classList[index]; - return AnnotateItem(item: item,font: 8.sp,state: state,name: state.name.value,); + return AnnotateItem(item: item,font: 8.sp,name: state.name.value,logic: logic,); }, ): ListView.builder( itemCount: state.classList.length, itemBuilder: (context, index) { AnnotatedClass item = state.classList[index]; - return AnnotateItem(item: item,font: 12.sp,state: state,name: state.name.value,); + return AnnotateItem(item: item,font: 12.sp,name: state.name.value,logic: logic,); }); }), ), diff --git a/lib/page/home_page/children/annotate_class/widget/annotate_item.dart b/lib/page/home_page/children/annotate_class/widget/annotate_item.dart index 9a6cafd..17658fa 100644 --- a/lib/page/home_page/children/annotate_class/widget/annotate_item.dart +++ b/lib/page/home_page/children/annotate_class/widget/annotate_item.dart @@ -5,6 +5,7 @@ import 'package:percent_indicator/percent_indicator.dart'; import 'package:school_asignment_app/common/job/annotated_class.dart'; import 'package:school_asignment_app/common/utils/enum_untils.dart'; import 'package:school_asignment_app/page/global_widget/my_text.dart'; +import 'package:school_asignment_app/page/home_page/children/annotate_class/annotate_class_logic.dart'; import 'package:school_asignment_app/page/home_page/children/annotate_class/annotate_class_state.dart'; import 'package:school_asignment_app/page/home_page/children/annotate_class/widget/item_btn.dart'; import 'package:school_asignment_app/page/home_page/widget/progress_bar.dart'; @@ -13,9 +14,9 @@ import 'package:school_asignment_app/routes/app_pages.dart'; class AnnotateItem extends StatefulWidget { final AnnotatedClass item; final double font; -final AnnotateClassState state; final String name; - const AnnotateItem({Key? key, required this.item,required this.font,required this.state,required this.name}) : super(key: key); +final AnnotateClassLogic logic; + const AnnotateItem({Key? key, required this.item,required this.font,required this.name,required this.logic}) : super(key: key); @override State createState() => _AnnotateItemState(); @@ -97,8 +98,7 @@ class _AnnotateItemState extends State { Expanded( flex:4, child: ItemBtn(title: "数据快查",font: widget.font - 2.sp,clickFunction: (){ - Get.toNamed(Routes.quickDataCheckPage,arguments: {'homeworkId':widget.state.homeworkId.value,'classId':widget.item.classId,'grade':widget.state.grade,'className':widget.item.className - }); + widget.logic.goQuickDataCheck(widget.item); },), ), const Expanded(flex: 1,child: Text(''),), @@ -190,7 +190,9 @@ class _AnnotateItemState extends State { [ Expanded( child: InkWell( - onTap: () {}, + onTap: () { + widget.logic.goQuickDataCheck(widget.item); + }, child: Container( alignment: Alignment.center, child: quickText('数据快查', color: Color.fromRGBO(118, 118, 118, 1), size: widget.font), @@ -200,7 +202,9 @@ class _AnnotateItemState extends State { Container(width: 1.w, height: 30.h, color: const Color.fromRGBO(221, 221, 221, 1)), Expanded( child: InkWell( - onTap: () {}, + onTap: () { + widget.logic.gojobReport(widget.item); + }, child: Container( alignment: Alignment.center, child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: widget.font), diff --git a/lib/page/home_page/children/annotate_class/widget/completed_annotate_item.dart b/lib/page/home_page/children/annotate_class/widget/completed_annotate_item.dart new file mode 100644 index 0000000..c657bb7 --- /dev/null +++ b/lib/page/home_page/children/annotate_class/widget/completed_annotate_item.dart @@ -0,0 +1,197 @@ +import 'package:flutter/material.dart'; +import 'package:flutter_easyloading/flutter_easyloading.dart'; +import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; +import 'package:school_asignment_app/common/job/annotated_class.dart'; +import 'package:school_asignment_app/common/utils/utils.dart'; +import 'package:school_asignment_app/page/global_widget/my_text.dart'; +import 'package:school_asignment_app/page/global_widget/show_student_list.dart'; +import 'package:school_asignment_app/page/home_page/children/annotate_class/annotate_class_logic.dart'; +import 'package:school_asignment_app/page/home_page/widget/progress_bar.dart'; + +class CompletedAnnotateItem extends StatelessWidget { + final AnnotatedClass taskItem; + final AnnotateClassLogic logic; + const CompletedAnnotateItem({Key? key,required this.taskItem,required this.logic}) : super(key: key); + + void showStudentList(context,List students,[bool submitted = false]) async { + showDialog( + context: context, + builder: (BuildContext context) { + return ShowStudentList(title:'${taskItem.className ?? ''} ${submitted ? '已提交' : '未提交'}作业学生',studentList:students,homeworkId: logic.state.homeworkId.value,); + }, + ); + EasyLoading.dismiss(); + } + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(6.r)), + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Container( + padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 6.h), + alignment: Alignment.centerLeft, + decoration: BoxDecoration( + border: Border(bottom: BorderSide(color: Color.fromRGBO(238, 238, 238, 1), width: 0.5.r)), + ), + child: quickText(taskItem.className, color: Color.fromRGBO(104, 136, 253, 1), size: 12.sp), + ), + Column( + mainAxisSize: MainAxisSize.min, + children: [ + ProgressBar( + color: Color.fromRGBO(76, 199, 147, 1), + percent: taskItem.kgtCorrectRate/100, + title: '客观题正确率:', + padingEdg: EdgeInsets.only(left: 10.w, right: 10.w), + fontSize: 8.sp, + lineHeight: 5.h, + marginEdg: EdgeInsets.only(top: 5.h), + ), + ProgressBar( + color: Color.fromRGBO(76, 199, 147, 1), + percent: taskItem.zgtCorrectRate / 100, + title: '主观题正确率:', + fontSize: 8.sp, + lineHeight: 5.h, + padingEdg: EdgeInsets.only(left: 10.w, right: 10.w), + marginEdg: EdgeInsets.only(top: 5.h), + ), + ProgressBar( + color: Color.fromRGBO(76, 199, 147, 1), + percent: taskItem.correctRate / 100, + title: '总正确率:', + fontSize: 8.sp, + lineHeight: 5.h, + padingEdg: EdgeInsets.only(left: 10.w, right: 10.w), + marginEdg: EdgeInsets.only(top: 5.h), + ), + ], + ), + SizedBox(height: Utils.isPad()?4.h:10.h), + Padding( + padding: EdgeInsets.only(left: 10.w, right: 10.w), + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: [ + Expanded( + flex: 4, + child: Material( + color: Color.fromRGBO(244, 244, 244, 1), + borderRadius: BorderRadius.circular(16.r), + child: InkWell( + onTap: (){ + EasyLoading.show(status: 'loading...'); + showStudentList(context,taskItem.commitStudent!,true); + }, + borderRadius: BorderRadius.circular(8.r), + splashColor: Theme.of(context).primaryColor, + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 4.h), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(20.r), + ), + child: quickText('已提交:${taskItem.commitStudentCount}', + size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)), + ), + ), + ), + ), + const Expanded(flex: 1, child: SizedBox()), + Expanded( + flex: 4, + child: Material( + color: Color.fromRGBO(244, 244, 244, 1), + borderRadius: BorderRadius.circular(20.r), + child: InkWell( + onTap: () { + EasyLoading.show(status: 'loading...'); + showStudentList(context,taskItem.noCommitStudent!); + }, + splashColor: Theme.of(context).primaryColor, + borderRadius: BorderRadius.circular(8.r), + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 4.h), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)), + child: quickText('未提交:${taskItem.noCommitStudentCount}', + size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)), + ), + ), + ), + ), + const Expanded(flex: 1, child: SizedBox()), + Expanded( + flex: 4, + child: Material( + color: Color.fromRGBO(244, 244, 244, 1), + borderRadius: BorderRadius.circular(20.r), + child: InkWell( + onTap: () { + + }, + splashColor: Theme.of(context).primaryColor, + borderRadius: BorderRadius.circular(8.r), + child: Container( + alignment: Alignment.center, + padding: EdgeInsets.symmetric(vertical: 4.h), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)), + child: quickText('收藏夹', + size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)), + ), + ), + )), + ], + ), + ), + SizedBox(height: Utils.isPad()?4.h:10.h), + Container( + decoration: BoxDecoration( + borderRadius: BorderRadius.only( + bottomLeft: Radius.circular(10.r), + bottomRight: Radius.circular(10.r), + ), + color: Colors.white, + boxShadow: const [ + BoxShadow( + color: Color.fromRGBO(0, 0, 0, 0.15), + offset: Offset(0, -0.0001), //阴影y轴偏移量 + blurRadius: 5, //阴影模糊程度 + spreadRadius: 0, //阴影扩散程度 + ) + ], + ), + child: Row(children: [ + Expanded( + child: InkWell( + onTap: () { + logic.goQuickDataCheck(taskItem); + }, + child: Container( + alignment: Alignment.center, + child: quickText('数据快查', color: Color.fromRGBO(118, 118, 118, 1), size: 11.sp), + ), + ), + ), + Container(width: 1.w, height: 26.h, color: Color.fromRGBO(221, 221, 221, 1)), + Expanded( + child: InkWell( + onTap: (){ + logic.gojobReport(taskItem); + }, + child: Container( + alignment: Alignment.center, + child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 10.sp), + ), + )), + ]), + ), + ], + ), + ); + } +} diff --git a/lib/page/home_page/children/job_report/job_report_state.dart b/lib/page/home_page/children/job_report/job_report_state.dart index 8f35fca..cb642c9 100644 --- a/lib/page/home_page/children/job_report/job_report_state.dart +++ b/lib/page/home_page/children/job_report/job_report_state.dart @@ -21,6 +21,6 @@ class JobReportState { late RxList knowsList = RxList(); late HomeworkDetails homeData; late RxList involveClasses = RxList(); - late AnnotatedClass defaultClass = AnnotatedClass('',-1,'-1','','',-1,-1,-1,-1,-1,[],[],-1,-1,-1,-1,-1); + late AnnotatedClass defaultClass = AnnotatedClass('',-1,'-1','','',-1,-1,-1,-1,-1,[],[],-1,-1,-1,-1,-1,[],[]); late Rx classData = defaultClass.obs; } diff --git a/lib/page/home_page/children/job_report/job_report_view.dart b/lib/page/home_page/children/job_report/job_report_view.dart index 900192b..21e53b1 100644 --- a/lib/page/home_page/children/job_report/job_report_view.dart +++ b/lib/page/home_page/children/job_report/job_report_view.dart @@ -91,7 +91,7 @@ class _JobReportPageState extends State { Container( margin: EdgeInsets.symmetric(horizontal: 10.r), child: KnowledgePoint( - knowsList:state.knowsList,data:state.homeData,className: state.className.value,)), + knowsList:state.knowsList,data:state.homeData,className: state.classData.value.className,homeworkId:state.homeworkId.value)), // 掌握知识点的情况 /* Container( margin: EdgeInsets.symmetric(horizontal: 10.r), diff --git a/lib/page/home_page/children/job_report/widget/knowledge_point.dart b/lib/page/home_page/children/job_report/widget/knowledge_point.dart index 0ae6e0e..a81c401 100644 --- a/lib/page/home_page/children/job_report/widget/knowledge_point.dart +++ b/lib/page/home_page/children/job_report/widget/knowledge_point.dart @@ -6,12 +6,14 @@ import 'package:school_asignment_app/common/job/homework_details.dart'; import 'package:school_asignment_app/common/utils/utils.dart'; import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; import 'package:school_asignment_app/page/global_widget/my_text.dart'; +import 'package:school_asignment_app/routes/app_pages.dart'; class KnowledgePoint extends StatefulWidget { final RxList knowsList; final HomeworkDetails data; final String className; - KnowledgePoint({Key? key,required this.knowsList,required this.data,required this.className}) : super(key: key); + final String homeworkId; + KnowledgePoint({Key? key,required this.knowsList,required this.data,required this.className,required this.homeworkId}) : super(key: key); @override State createState() => _KnowledgePointState(); @@ -19,6 +21,12 @@ class KnowledgePoint extends StatefulWidget { class _KnowledgePointState extends State { + void goQuickCheckPersonalPath(studentId) { + if (studentId != null) { + Get.toNamed(Routes.studentPersonalPage,arguments: {'studentId':studentId,'homeworkId':widget.homeworkId}); + } + } + void showPeopleListDialog( {required BuildContext context, required String title, @@ -112,8 +120,8 @@ class _KnowledgePointState extends State { flex: 2, child: InkWell( onTap: () { - /* goQuickCheckPersonalPath( - item['noAnswerStudents'].id);*/ + goQuickCheckPersonalPath( + item.studentId); }, child: Center( child: Text( @@ -127,7 +135,7 @@ class _KnowledgePointState extends State { flex: 1, child: Center( child: Text( - widget.className, + widget.className == ''?'全部': widget.className, style: TextStyle( fontSize: 12.sp, color: Color(0xFF323232)), diff --git a/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart b/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart index 25ecdd5..563d5af 100644 --- a/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart +++ b/lib/page/home_page/children/quick_data_check/widget/quick_data_check_bottom.dart @@ -29,7 +29,7 @@ class _QuickDataCheckBottomState extends State { super.initState(); showList.value = widget.jobData!; for (var e in widget.jobData!) { - if(e.priorityAnnotate){ + if(e.priorityAnnotate!){ followList.add(e); } } diff --git a/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart b/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart index c3da0ea..72042b0 100644 --- a/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart +++ b/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart @@ -50,12 +50,6 @@ class _QuickStudentDataTableState extends State { cells: [ DataCell(InkWell( onTap: () { - /*RouterManager.router.navigateTo( - context, - RouterManager.quickCheckPersonalPath + - '?jobId=${widget.jobId}&studentId=${item.studentId}', - transition: getTransition(), - );*/ Get.toNamed(Routes.studentPersonalPage,arguments: {'studentId':item.studentId,'homeworkId':widget.jobId}); }, child: Center( diff --git a/lib/page/home_page/children/quick_data_check/widget/report_table.dart b/lib/page/home_page/children/quick_data_check/widget/report_table.dart index 000ad22..15487e0 100644 --- a/lib/page/home_page/children/quick_data_check/widget/report_table.dart +++ b/lib/page/home_page/children/quick_data_check/widget/report_table.dart @@ -1,12 +1,14 @@ import 'package:data_table_2/data_table_2.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:get/get.dart'; import 'package:school_asignment_app/common/job/annotated_class.dart'; import 'package:school_asignment_app/common/job/homework_details.dart'; import 'package:school_asignment_app/common/utils/toast_utils.dart'; import 'package:school_asignment_app/common/utils/utils.dart'; import 'package:school_asignment_app/page/global_widget/MyEmptyWidget.dart'; import 'package:school_asignment_app/page/global_widget/imgDialog.dart'; +import 'package:school_asignment_app/routes/app_pages.dart'; class ReportTable extends StatefulWidget { @@ -152,7 +154,7 @@ class _ReportTableState extends State { child: InkWell( onTap: () { goQuickCheckPersonalPath( - item['noAnswerStudents'].id); + item['noAnswerStudents'].studentId); }, child: Center( child: Text( @@ -166,7 +168,7 @@ class _ReportTableState extends State { child: InkWell( onTap: () { goQuickCheckPersonalPath( - item['answerOkStudents'].id); + item['answerOkStudents'].studentId); }, child: Center( child: Text( @@ -180,7 +182,7 @@ class _ReportTableState extends State { child: InkWell( onTap: () { goQuickCheckPersonalPath( - item['answerNgStudents'].id); + item['answerNgStudents'].studentId); }, child: Center( child: Text( @@ -205,7 +207,7 @@ class _ReportTableState extends State { Dtls item = arr[index]; return InkWell( onTap: () { - goQuickCheckPersonalPath(item.id); + goQuickCheckPersonalPath(item.studentId); }, child: Container( padding: EdgeInsets.symmetric( @@ -234,13 +236,8 @@ class _ReportTableState extends State { } void goQuickCheckPersonalPath(id) { - if (id) { - /*RouterManager.router.navigateTo( - context, - RouterManager.quickCheckPersonalPath + - '?jobId=${widget.jobId}&studentId=$id', - transition: getTransition(), - );*/ + if (id != null) { + Get.toNamed(Routes.studentPersonalPage,arguments: {'studentId':id,'homeworkId':widget.jobId}); } } diff --git a/lib/page/home_page/children/read_over/read_over_view.dart b/lib/page/home_page/children/read_over/read_over_view.dart index 43fefb4..d4a48d1 100644 --- a/lib/page/home_page/children/read_over/read_over_view.dart +++ b/lib/page/home_page/children/read_over/read_over_view.dart @@ -345,10 +345,7 @@ Widget $reviewedItem( return InkWell( onTap: () { - /* String url = - '${RouterManager.jobListParticipateInClassPath}?&jobId=${jobTaskItem.id}&genderName=${Uri.encodeComponent(jobTaskItem.genderName)}&jobName=${Uri.encodeComponent(jobTaskItem.title)}&completed=${true}'; - RouterManager.router.navigateTo(context, url, transition: getTransition());*/ - Get.toNamed(Routes.annotateClassPage,arguments: {'id':jobTaskItem.id,'name':jobTaskItem.name,'grade':jobTaskItem.grade}); + Get.toNamed(Routes.annotateClassPage,arguments: {'id':jobTaskItem.id,'name':jobTaskItem.name,'grade':jobTaskItem.grade,'completed':true}); }, child: Container( padding: EdgeInsets.only(top: 10.h), @@ -449,7 +446,6 @@ Widget $reviewedItem( GestureDetector( onTap: () { Get.toNamed(Routes.jobReportPage,arguments: {'title':jobTaskItem.name,'homeworkId':jobTaskItem.id,'grade':jobTaskItem.grade}); - }, child: Container( padding: EdgeInsets.symmetric(vertical: 6.h), diff --git a/lib/page/home_page/children/read_over/widget/task_list_item.dart b/lib/page/home_page/children/read_over/widget/task_list_item.dart index abba774..a01f1f4 100644 --- a/lib/page/home_page/children/read_over/widget/task_list_item.dart +++ b/lib/page/home_page/children/read_over/widget/task_list_item.dart @@ -27,9 +27,7 @@ class _TaskListItemState extends State { return widget.completed ? InkWell( onTap: () { - /*String url = - '${RouterManager.jobListParticipateInClassPath}?&jobId=${jobTaskItem.id}&genderName=${Uri.encodeComponent(jobTaskItem.genderName)}&jobName=${Uri.encodeComponent(jobTaskItem.title)}&completed=${true}'; - RouterManager.router.navigateTo(context, url, transition: getTransition());*/ + Get.toNamed(Routes.annotateClassPage,arguments: {'id': widget.jobTaskItem.id,'name': widget.jobTaskItem.name,'grade': widget.jobTaskItem.grade,'completed':true}); }, child: Container( width: double.infinity, diff --git a/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart b/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart index 4f90466..3b2a7a4 100644 --- a/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart +++ b/lib/page/home_page/children/student_work_detail/widget/job_condition_filter.dart @@ -75,12 +75,12 @@ class _JobConditionFilterState extends State { onTap: (int val) async { if(val == 0 && widget.hasAll == true){ widget.onTimeFilter(null, null); - }else if(val == 1 || (val == 0 && widget.hasAll == false)){ + }else if((val == 1 && widget.hasAll == true) || (val == 0 && widget.hasAll == false)){ widget.onTimeFilter( Utils.getWeekStartDate().toString().substring(0, 10), Utils.getWeekEndDate().toString().substring(0, 10), ); - }else if(val == 2 || (val == 1 && widget.hasAll == false)){ + }else if((val == 2 && widget.hasAll == true) || (val == 1 && widget.hasAll == false)){ widget.onTimeFilter( getMonthStartDate().toString().substring(0, 10), getMonthEndDate().toString().substring(0, 10), diff --git a/lib/page/home_page/home_view.dart b/lib/page/home_page/home_view.dart index d2996de..bfc59fb 100644 --- a/lib/page/home_page/home_view.dart +++ b/lib/page/home_page/home_view.dart @@ -73,7 +73,7 @@ class _HomePageState extends State EntranceModel( title: '知识点点掌握', image: 'assets/images/job_home_knowledge.png', - navigationUrl: '') + navigationUrl: Routes.knowledgePointsGraspPage) ], state.readOver.value); }), diff --git a/lib/routes/app_pages.dart b/lib/routes/app_pages.dart index 7fe3d41..8923402 100644 --- a/lib/routes/app_pages.dart +++ b/lib/routes/app_pages.dart @@ -7,6 +7,10 @@ import 'package:school_asignment_app/page/home_page/children/class_student/class import 'package:school_asignment_app/page/home_page/children/class_student/class_student_view.dart'; import 'package:school_asignment_app/page/home_page/children/job_report/job_report_binding.dart'; import 'package:school_asignment_app/page/home_page/children/job_report/job_report_view.dart'; +import 'package:school_asignment_app/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_binding.dart'; +import 'package:school_asignment_app/page/home_page/children/knowledge_points_grasp/knowledge_points_grasp_view.dart'; +import 'package:school_asignment_app/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_binding.dart'; +import 'package:school_asignment_app/page/home_page/children/knowledge_points_grasp_detail/knowledge_points_grasp_detail_view.dart'; import 'package:school_asignment_app/page/home_page/children/my_info.dart'; import 'package:school_asignment_app/page/home_page/children/quick_data_check/quick_data_check_binding.dart'; import 'package:school_asignment_app/page/home_page/children/quick_data_check/quick_data_check_view.dart'; @@ -44,6 +48,8 @@ abstract class AppPages { GetPage(name: Routes.jobReportPage, page: () => const JobReportPage(), binding: JobReportBinding(), transition: Transition.noTransition), GetPage(name: Routes.studentPersonalPage, page: () => const StudentPersonalPage(), binding: StudentPersonalBinding(), transition: Transition.noTransition), GetPage(name: Routes.studentWorkDetailPage, page: () => const StudentWorkDetailPage(), binding: StudentWorkDetailBinding(), transition: Transition.noTransition), + GetPage(name: Routes.knowledgePointsGraspPage, page: () => const KnowledgePointsGraspPage(), binding: KnowledgePointsGraspBinding(), transition: Transition.noTransition), + GetPage(name: Routes.knowledgePointsGraspDetailPage, page: () => const KnowledgePointsGraspDetailPage(), binding: KnowledgePointsGraspDetailBinding(), transition: Transition.noTransition), ]; } diff --git a/lib/routes/app_routes.dart b/lib/routes/app_routes.dart index d9124ef..d83db38 100644 --- a/lib/routes/app_routes.dart +++ b/lib/routes/app_routes.dart @@ -16,4 +16,6 @@ abstract class Routes { static const jobReportPage = '/jobReportPage'; static const studentPersonalPage = '/studentPersonalPage'; static const studentWorkDetailPage = '/studentWorkDetailPage'; + static const knowledgePointsGraspPage = '/knowledgePointsGraspPage'; + static const knowledgePointsGraspDetailPage = '/knowledgePointsGraspDetailPage'; } \ No newline at end of file