From c63fb86ea350eb3a22daba353597fddc9ddddbca Mon Sep 17 00:00:00 2001 From: machuanyu <840649825@qq.com> Date: Fri, 9 Aug 2024 18:02:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/common/config/request_config.dart | 4 +- .../lib/common/job/annotated_class.dart | 2 +- .../do_paper_details_result.dart | 2 +- .../job/marking_models/favor_param.dart | 2 +- .../review_submission_params.dart | 2 +- .../lib/common/mixins/event_bus_mixin.dart | 4 +- .../lib/common/utils/utils.dart | 4 +- .../annotate_class/annotate_class_logic.dart | 45 ++++++++++++------- .../widget/favorite_student_dialog.dart | 2 +- .../configuration_files/index.dart | 3 ++ .../job_report/widget/knowledge_point.dart | 10 ++--- .../widget/quick_student_data_table.dart | 10 ++--- 12 files changed, 55 insertions(+), 35 deletions(-) diff --git a/making_school_asignment_app/lib/common/config/request_config.dart b/making_school_asignment_app/lib/common/config/request_config.dart index 66ba00f..a101124 100644 --- a/making_school_asignment_app/lib/common/config/request_config.dart +++ b/making_school_asignment_app/lib/common/config/request_config.dart @@ -9,8 +9,8 @@ import 'package:making_school_asignment_app/common/job/common/base_page.dart'; class RequestConfig { - static const _devBaseUrl = "http://192.168.2.119:1091"; // 开发 - // static const _devBaseUrl = "https://dpc-teacher-api.23544.com"; // 开发 + // static const _devBaseUrl = "http://192.168.2.119:1091"; // 开发 + static const _devBaseUrl = "https://dpc-teacher-api.23544.com"; // 开发 // static const _proBaseUrl = "http://192.168.2.119:1091"; // 生产 static const _proBaseUrl = "https://dpc-teacher-api.23544.com"; // 生产 static const imgUrl = 'https://dpc-job-oss.23544.com/'; diff --git a/making_school_asignment_app/lib/common/job/annotated_class.dart b/making_school_asignment_app/lib/common/job/annotated_class.dart index 1fe56e2..528a8d0 100644 --- a/making_school_asignment_app/lib/common/job/annotated_class.dart +++ b/making_school_asignment_app/lib/common/job/annotated_class.dart @@ -144,7 +144,7 @@ class HomeworkFavs extends Object { int templateId; @JsonKey(name: 'questionNo') - int? questionNo; + String? questionNo; @JsonKey(name: 'subjectiveAnswer') String? subjectiveAnswer; diff --git a/making_school_asignment_app/lib/common/job/marking_models/do_paper_details_result.dart b/making_school_asignment_app/lib/common/job/marking_models/do_paper_details_result.dart index 19cd2ee..369bbf2 100644 --- a/making_school_asignment_app/lib/common/job/marking_models/do_paper_details_result.dart +++ b/making_school_asignment_app/lib/common/job/marking_models/do_paper_details_result.dart @@ -152,7 +152,7 @@ class PaperStudents extends Object { @JsonSerializable() class StudentQuestions extends Object { @JsonKey(name: 'questionNo') - int questionNo; + String questionNo; // 总分 @JsonKey(name: 'score') diff --git a/making_school_asignment_app/lib/common/job/marking_models/favor_param.dart b/making_school_asignment_app/lib/common/job/marking_models/favor_param.dart index 6049f4d..d81a41b 100644 --- a/making_school_asignment_app/lib/common/job/marking_models/favor_param.dart +++ b/making_school_asignment_app/lib/common/job/marking_models/favor_param.dart @@ -14,7 +14,7 @@ class FavorParam extends Object { int templateId; @JsonKey(name: 'questionNo') - int questionNo; + String questionNo; @JsonKey(name: 'isFav') bool isFav; diff --git a/making_school_asignment_app/lib/common/job/marking_models/review_submission_params.dart b/making_school_asignment_app/lib/common/job/marking_models/review_submission_params.dart index 33611a2..97dd4fc 100644 --- a/making_school_asignment_app/lib/common/job/marking_models/review_submission_params.dart +++ b/making_school_asignment_app/lib/common/job/marking_models/review_submission_params.dart @@ -35,7 +35,7 @@ class ReviewSubmissionParams extends Object { @JsonSerializable() class StudentScores extends Object { @JsonKey(name: 'questionNo') - int questionNo; + String questionNo; @JsonKey(name: 'studentScore') int studentScore; diff --git a/making_school_asignment_app/lib/common/mixins/event_bus_mixin.dart b/making_school_asignment_app/lib/common/mixins/event_bus_mixin.dart index 3052c81..9aeb50e 100644 --- a/making_school_asignment_app/lib/common/mixins/event_bus_mixin.dart +++ b/making_school_asignment_app/lib/common/mixins/event_bus_mixin.dart @@ -26,6 +26,8 @@ mixin EventBusMixin { // 关闭监听总线事件 void eventCancel() { - _subscription?.cancel(); + try{ + _subscription?.cancel(); + }catch(_){} } } diff --git a/making_school_asignment_app/lib/common/utils/utils.dart b/making_school_asignment_app/lib/common/utils/utils.dart index d59af4e..223db1c 100644 --- a/making_school_asignment_app/lib/common/utils/utils.dart +++ b/making_school_asignment_app/lib/common/utils/utils.dart @@ -113,13 +113,13 @@ class Utils { for (var stu in data.students) { stu.kgtStu = kgt.where((w) => w.studentId == stu.studentId).toList(); - stu.kgtStu!.sort((a, b) => a.questionNo.compareTo(b.questionNo)); + stu.kgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo))); stu.kgtOkCount = stu.kgtStu!.where((w) => w.state == 3).length; stu.kgtErrorCount = stu.kgtStu!.where((w) => w.state == 2).length; stu.kgtAnswerCount = stu.kgtStu!.where((w) => w.state != 0).length; stu.zgtStu = zgt.where((w) => w.studentId == stu.studentId).toList(); - stu.zgtStu!.sort((a, b) => a.questionNo.compareTo(b.questionNo)); + stu.zgtStu!.sort((a, b) => num.parse(a.questionNo).compareTo(num.parse(b.questionNo))); stu.zgtOkCount = stu.zgtStu!.where((w) => w.state == 3).length; stu.zgtErrorCount = stu.zgtStu!.where((w) => w.state == 2).length; stu.zgtUnrated = stu.zgtStu!.where((w) => w.state == 1).length; diff --git a/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_logic.dart b/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_logic.dart index efab5f5..e34e171 100644 --- a/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/annotate_class/annotate_class_logic.dart @@ -14,13 +14,13 @@ class AnnotateClassLogic extends GetxController with RequestToolMixin { final AnnotateClassState state = AnnotateClassState(); late final EasyRefreshController refreshController; final HomeLogic homeController = Get.find(); - late ReadOverLogic readOverController ; + late ReadOverLogic readOverController; @override void onInit() { super.onInit(); state.preIndex = Get.arguments['tabIndex'] ?? 3; - if(state.preIndex != 3){ + if (state.preIndex != 3) { // readOverController = Get.find(); } refreshController = EasyRefreshController(); @@ -35,9 +35,11 @@ class AnnotateClassLogic extends GetxController with RequestToolMixin { } void getList() async { - List data = await getClient().getAnnotatedClassList(state.homeworkId.value); + List data = + await getClient().getAnnotatedClassList(state.homeworkId.value); state.classList.value = data; - + print('state.classList[0]=${state.classList[0].finishTime}'); + print('state.classList[1]=${state.classList[1].finishTime}'); for (var element in state.classList.value) { int commitStudentCount = 0; int noCommitStudentCount = 0; @@ -54,23 +56,29 @@ class AnnotateClassLogic extends GetxController with RequestToolMixin { EasyLoading.dismiss(); } + //一键批阅 - void getAllCorrect(classId) async{ + void getAllCorrect(classId) async { EasyLoading.show(status: 'loading...'); try { - await getClient().getAllCorrect(state.homeworkId.value,classId); - getList(); + await getClient() + .getAllCorrect(state.homeworkId.value, classId) + .then((e) { + getList(); + }); } catch (e) { EasyLoading.dismiss(); ToastUtils.showError('操作失败,请重试'); } } + //结束批阅 - void getOverAnnotate(classId) async{ + void getOverAnnotate(classId) async { EasyLoading.show(status: 'loading...'); try { - await getClient().overAnnotate(state.homeworkId.value,classId); - getList(); + await getClient().overAnnotate(state.homeworkId.value, classId).then((e) { + getList(); + }); } catch (e) { EasyLoading.dismiss(); ToastUtils.showError('操作失败,请重试'); @@ -78,19 +86,26 @@ class AnnotateClassLogic extends GetxController with RequestToolMixin { } void goQuickDataCheck(item) { - Get.toNamed(Routes.quickDataCheckPage, - arguments: {'homeworkId': state.homeworkId.value, 'classId': item.classId, 'grade': state.grade, 'className': item.className}); + 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}); + Get.toNamed(Routes.jobReportPage, arguments: { + 'title': state.name.value, + 'homeworkId': state.homeworkId.value, + 'grade': state.grade, + 'className': item.className + }); } @override void dispose() { super.dispose(); refreshController.dispose(); - } } diff --git a/making_school_asignment_app/lib/page/home_page/children/fav_student/widget/favorite_student_dialog.dart b/making_school_asignment_app/lib/page/home_page/children/fav_student/widget/favorite_student_dialog.dart index c77e10f..5675a8c 100644 --- a/making_school_asignment_app/lib/page/home_page/children/fav_student/widget/favorite_student_dialog.dart +++ b/making_school_asignment_app/lib/page/home_page/children/fav_student/widget/favorite_student_dialog.dart @@ -30,7 +30,7 @@ class _FavoriteStudentDialogState extends State { RxInt defaultIndex = 0.obs; RxList imageList = RxList(); late PageController pageController; - late Rx currentStudent = Rx(HomeworkFavs('','','',-1,-1,'','',-1,'',-1,-1,'','')); + late Rx currentStudent = Rx(HomeworkFavs('','','',-1,-1,'','',-1,'',-1,'-1','','')); @override void initState() { diff --git a/making_school_asignment_app/lib/page/home_page/children/homework_review/configuration_files/index.dart b/making_school_asignment_app/lib/page/home_page/children/homework_review/configuration_files/index.dart index 7df5595..ebcd9d7 100644 --- a/making_school_asignment_app/lib/page/home_page/children/homework_review/configuration_files/index.dart +++ b/making_school_asignment_app/lib/page/home_page/children/homework_review/configuration_files/index.dart @@ -107,6 +107,8 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin { state.data.value = data; state.handwritings = []; state.studentQuestions.value = data.studentQuestions; + + } catch (e) { print('获取数据报错了:$e'); ToastUtils.showError('获取试题数据出错,请重试'); @@ -116,6 +118,7 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin { ToastUtils.dismiss(); } + } // 取消全部评分 diff --git a/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart b/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart index 413593f..d391bea 100644 --- a/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart +++ b/making_school_asignment_app/lib/page/home_page/children/job_report/widget/knowledge_point.dart @@ -157,8 +157,8 @@ class _KnowledgePointState extends State { children: List.generate(item.queDtls!.length, (index) { Dtls kgInfo = item.queDtls![index]; return Container( - width: 14.r, - height: 14.r, + width: 20.r, + height: 20.r, decoration: BoxDecoration( color: kgInfo.state == 0 ? const Color(0xFFD3D3D3) @@ -167,7 +167,7 @@ class _KnowledgePointState extends State { : kgInfo.state == 2 ? const Color(0xFFFF7474) : const Color(0xFF4CC793), - borderRadius: BorderRadius.all(Radius.circular(7.r))), + borderRadius: BorderRadius.all(Radius.circular(10.r))), child: Center( child: Text( kgInfo.questionNo.toString(), @@ -264,8 +264,8 @@ class _KnowledgePointState extends State { int ttlCount = stu.queDtls!.length; stu.okRate = Utils.calcRate(okCount, ttlCount); stu.queDtls!.sort((a, b) { - String num1 = a.questionNo; - String num2 = b.questionNo; + num num1 = num.parse(a.questionNo); + num num2 = num.parse(b.questionNo); return num1.compareTo(num2); }); } diff --git a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart index c8ca47a..51f4f7f 100644 --- a/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart +++ b/making_school_asignment_app/lib/page/home_page/children/quick_data_check/widget/quick_student_data_table.dart @@ -43,8 +43,8 @@ class _QuickStudentDataTableState extends State { index: index, color: color != null ? item.allNotDone! - ? MaterialStateProperty.all(Color(0xFFFFD79C)) - : MaterialStateProperty.all(color) + ? WidgetStateProperty.all(const Color(0xFFFFD79C)) + : WidgetStateProperty.all(color) : null, cells: [ DataCell(InkWell( @@ -143,8 +143,8 @@ class _QuickStudentDataTableState extends State { children: List.generate(item.zgtStu!.length, (index) { Dtls kgInfo = item.zgtStu![index]; return Container( - width: 14.r, - height: 14.r, + width: 20.r, + height: 20.r, decoration: BoxDecoration( color: kgInfo.state == 0 ? const Color(0xFFD3D3D3) @@ -153,7 +153,7 @@ class _QuickStudentDataTableState extends State { : kgInfo.state == 2 ? const Color(0xFFFF7474) : const Color(0xFF4CC793), - borderRadius: BorderRadius.all(Radius.circular(7.r))), + borderRadius: BorderRadius.all(Radius.circular(10.r))), child: Center( child: Text( kgInfo.questionNo.toString(),