From c12976ded8ea3c8b6f051bf0c9e26da8ef856e58 Mon Sep 17 00:00:00 2001 From: "1147192855@qq.com" <1147192855@qq.com> Date: Wed, 13 Mar 2024 18:27:16 +0800 Subject: [PATCH] no message --- .../homework_tasks_view_item.dart | 4 +- .../pages/job_list_participate_in_class.dart | 107 +++++++++++++----- .../lib/utils/request/rest_client.dart | 2 +- marking_app/pubspec.yaml | 1 + 4 files changed, 80 insertions(+), 34 deletions(-) diff --git a/marking_app/lib/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart b/marking_app/lib/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart index 4afc93f..0ac78a6 100644 --- a/marking_app/lib/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart +++ b/marking_app/lib/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart @@ -233,7 +233,7 @@ Widget $completedHomeworkView(BuildContext context, SizedBox(height: 20.h), Container( - padding: EdgeInsets.symmetric(vertical: 8.h), + padding: EdgeInsets.symmetric(vertical: 10.h), decoration: BoxDecoration( borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)), color: Colors.white, @@ -259,7 +259,7 @@ Widget $completedHomeworkView(BuildContext context, }), child: Container( alignment: Alignment.center, - child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp), + child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 13.sp), ), )), ]), diff --git a/marking_app/lib/pages/homework_correction/pages/job_list_participate_in_class.dart b/marking_app/lib/pages/homework_correction/pages/job_list_participate_in_class.dart index 688909d..18b19dc 100644 --- a/marking_app/lib/pages/homework_correction/pages/job_list_participate_in_class.dart +++ b/marking_app/lib/pages/homework_correction/pages/job_list_participate_in_class.dart @@ -1,6 +1,7 @@ import 'package:achievement_view/achievement_view.dart'; import 'package:flutter/material.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart'; +import 'package:flutter_staggered_grid_view/flutter_staggered_grid_view.dart'; import 'package:functional_widget_annotation/functional_widget_annotation.dart'; import 'package:marking_app/common/mixin/common.dart'; import 'package:marking_app/common/model/common/base_structure_result.dart'; @@ -40,10 +41,10 @@ class _JobListParticipateInClassState extends State w getListOfJobFavoritesData(); _future = getData(); - Future.delayed(Duration.zero, () { - print(ScreenUtil().scaleWidth); - print(MediaQuery.of(context).devicePixelRatio); - }); + // Future.delayed(Duration.zero, () { + // print(ScreenUtil().scaleWidth); + // print(MediaQuery.of(context).devicePixelRatio); + // }); } @override @@ -428,6 +429,7 @@ class _JobListParticipateInClassState extends State w jobViewReport: jobViewReport, quickDataCheck: quickDataCheck, oneClickReview: oneClickReview, + showStudentList: showStudentList, ); return MobileEnd( @@ -439,6 +441,7 @@ class _JobListParticipateInClassState extends State w jobViewReport: jobViewReport, quickDataCheck: quickDataCheck, oneClickReview: oneClickReview, + showStudentList: showStudentList, ); }), ); @@ -456,6 +459,7 @@ class TabletEnd extends StatelessWidget { final JobViewReport jobViewReport; final OneClickReview oneClickReview; // 一键批阅 final QuickDataCheck quickDataCheck; // 数据快查 + final ShowStudentList showStudentList; const TabletEnd({ required this.genderName, required this.data, @@ -467,6 +471,7 @@ class TabletEnd extends StatelessWidget { required this.jobViewReport, required this.oneClickReview, required this.quickDataCheck, + required this.showStudentList, super.key, }); @@ -475,22 +480,43 @@ class TabletEnd extends StatelessWidget { return Container( width: ScreenUtil().screenWidth, padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 16.h), - child: Wrap( - spacing: 8.0.w, // 子元素之间的间距 - runSpacing: 10.h, // 主轴方向上不同行之间的间距 - children: data - .map((e) => $ItemDataViewOfPad( - task: e, - bookmarks: bookmarks, - endReview: endReview, - genderName: genderName, - goToReview: goToReview, - jobViewReport: jobViewReport, - quickDataCheck: quickDataCheck, - oneClickReview: oneClickReview, - )) - .toList(), + child: MasonryGridView.count( + crossAxisCount: 2, //几列 + mainAxisSpacing: 4.w, // 间距 + crossAxisSpacing: 4.h, // 纵向间距? + itemCount: data.length, + itemBuilder: (context, index) { + var e = data[index]; + return $ItemDataViewOfPad( + task: e, + bookmarks: bookmarks, + endReview: endReview, + genderName: genderName, + goToReview: goToReview, + jobViewReport: jobViewReport, + quickDataCheck: quickDataCheck, + oneClickReview: oneClickReview, + showStudentList: showStudentList, + ); + }, ), + // Wrap( + // spacing: 8.0.w, // 子元素之间的间距 + // runSpacing: 10.h, // 主轴方向上不同行之间的间距 + // children: [...data, ...data] + // .map((e) => $ItemDataViewOfPad( + // task: e, + // bookmarks: bookmarks, + // endReview: endReview, + // genderName: genderName, + // goToReview: goToReview, + // jobViewReport: jobViewReport, + // quickDataCheck: quickDataCheck, + // oneClickReview: oneClickReview, + // showStudentList: showStudentList, + // )) + // .toList(), + // ), ); } } @@ -858,7 +884,7 @@ class MobileEndCompleted extends StatelessWidget { ), ), ), - Container(width: 1.w, height: 34.h, color: Color.fromRGBO(221, 221, 221, 1)), + Container(width: 1.w, height: 36.h, color: Color.fromRGBO(221, 221, 221, 1)), Expanded( child: InkWell( onTap: () => easyThrottle('go_to_end_review_homework', () => jobViewReport(task)), @@ -878,7 +904,7 @@ class MobileEndCompleted extends StatelessWidget { ), ), ), - Container(width: 1.w, height: 32.h, color: Color.fromRGBO(221, 221, 221, 1)), + Container(width: 1.w, height: 36.h, color: Color.fromRGBO(221, 221, 221, 1)), Expanded( child: InkWell( onTap: () => easyThrottle('go_to_end_review_homework', () => {}), @@ -908,6 +934,7 @@ class MobileEnd extends StatelessWidget { final JobViewReport jobViewReport; final OneClickReview oneClickReview; // 一键批阅 final QuickDataCheck quickDataCheck; // 数据快查 + final ShowStudentList showStudentList; // 数据快查 const MobileEnd({ required this.genderName, @@ -920,6 +947,7 @@ class MobileEnd extends StatelessWidget { required this.jobViewReport, required this.oneClickReview, required this.quickDataCheck, + required this.showStudentList, super.key, }); @@ -937,6 +965,7 @@ class MobileEnd extends StatelessWidget { jobViewReport: jobViewReport, quickDataCheck: quickDataCheck, oneClickReview: oneClickReview, + showStudentList: showStudentList, ); }).toList(), ); @@ -957,6 +986,7 @@ Widget $itemDataViewOfPad( required JobViewReport jobViewReport, required OneClickReview oneClickReview, required QuickDataCheck quickDataCheck, + required ShowStudentList showStudentList, }) { EdgeInsets edgins = EdgeInsets.only(left: 8.w, right: 8.w); return Container( @@ -976,10 +1006,16 @@ Widget $itemDataViewOfPad( children: [ quickText(genderName + task.className, color: Color.fromRGBO(0, 0, 0, 1), size: 10.sp), Expanded(child: SizedBox()), - quickText('已交:${task.commitStudentCount}', color: Color.fromRGBO(104, 136, 253, 1), size: 8.sp), + InkWell( + onTap: () => easyThrottle('OneClickReview', () => showStudentList([task.id], task.className, true)), + child: quickText('已交:${task.commitStudentCount}', color: Color.fromRGBO(104, 136, 253, 1), size: 8.sp), + ), SizedBox(width: 10.w), - quickText('未交:${task.studentCount - task.commitStudentCount}', - color: Color.fromRGBO(255, 86, 86, 1), size: 8.sp), + InkWell( + onTap: () => easyThrottle('OneClickReview', () => showStudentList([task.id], task.className)), + child: quickText('未交:${task.studentCount - task.commitStudentCount}', + color: Color.fromRGBO(255, 86, 86, 1), size: 8.sp), + ), ], ), ), @@ -1159,7 +1195,7 @@ Widget $itemDataViewOfPad( ), ), ), - Container(width: 1.w, height: 32.h, color: Color.fromRGBO(221, 221, 221, 1)), + Container(width: 1.w, height: 30.h, color: Color.fromRGBO(221, 221, 221, 1)), Expanded( child: InkWell( onTap: () => easyThrottle('go_to_end_review_homework', () => jobViewReport(task)), @@ -1179,7 +1215,7 @@ Widget $itemDataViewOfPad( ), ), ), - Container(width: 0.3.w, height: 24.h, color: Color.fromRGBO(221, 221, 221, 1)), + Container(width: 0.3.w, height: 30.h, color: Color.fromRGBO(221, 221, 221, 1)), Expanded( child: InkWell( onTap: () => easyThrottle('go_to_end_review_homework', () => endReview(task)), @@ -1210,10 +1246,12 @@ Widget $itemDataView( required OneClickReview oneClickReview, required QuickDataCheck quickDataCheck, required JobViewReport jobViewReport, + required ShowStudentList showStudentList, }) { var padingEdg = EdgeInsets.only(left: 10.w, right: 10.w); return Container( padding: EdgeInsets.only(top: 11.h), + margin: EdgeInsets.only(bottom: 12.h), decoration: BoxDecoration( color: Colors.white, borderRadius: BorderRadiusDirectional.circular(10.r), @@ -1228,10 +1266,17 @@ Widget $itemDataView( children: [ quickText(genderName + task.className, color: Color.fromRGBO(0, 0, 0, 1), size: 14.sp), Expanded(child: SizedBox()), - quickText('已交:${task.commitStudentCount}', color: Color.fromRGBO(104, 136, 253, 1), size: 12.sp), + InkWell( + onTap: () => easyThrottle('OneClickReview', () => showStudentList([task.id], task.className, true)), + child: + quickText('已交:${task.commitStudentCount}', color: Color.fromRGBO(104, 136, 253, 1), size: 12.sp), + ), SizedBox(width: 16.w), - quickText('未交:${task.studentCount - task.commitStudentCount}', - color: Color.fromRGBO(255, 86, 86, 1), size: 12.sp), + InkWell( + onTap: () => easyThrottle('OneClickReview', () => showStudentList([task.id], task.className)), + child: quickText('未交:${task.studentCount - task.commitStudentCount}', + color: Color.fromRGBO(255, 86, 86, 1), size: 12.sp), + ), ], ), ), @@ -1415,7 +1460,7 @@ Widget $itemDataView( ), ), ), - Container(width: 1.w, height: 32.h, color: Color.fromRGBO(221, 221, 221, 1)), + Container(width: 1.w, height: 36.h, color: Color.fromRGBO(221, 221, 221, 1)), Expanded( child: InkWell( onTap: () => easyThrottle('go_to_end_review_homework', () => jobViewReport(task)), @@ -1435,7 +1480,7 @@ Widget $itemDataView( ), ), ), - Container(width: 1.w, height: 32.h, color: Color.fromRGBO(221, 221, 221, 1)), + Container(width: 1.w, height: 36.h, color: Color.fromRGBO(221, 221, 221, 1)), Expanded( child: InkWell( onTap: () => easyThrottle('go_to_end_review_homework', () => endReview(task)), diff --git a/marking_app/lib/utils/request/rest_client.dart b/marking_app/lib/utils/request/rest_client.dart index 87f2218..83b5905 100644 --- a/marking_app/lib/utils/request/rest_client.dart +++ b/marking_app/lib/utils/request/rest_client.dart @@ -299,7 +299,7 @@ abstract class RestClient { @the_retrofit.Query("markingId") int jobId); // 作业 => 作业收藏数量 - @the_retrofit.GET("${RequestConfig.hwProxyKeywords}/dpc-api/api/read/job-favorite-count-by-class") + @the_retrofit.GET("/dpc-api/api/read/job-favorite-count-by-class") Future>> getListOfJobFavoriteNumber( @the_retrofit.Query("jobid") int jobId); diff --git a/marking_app/pubspec.yaml b/marking_app/pubspec.yaml index d6116a6..439bee6 100644 --- a/marking_app/pubspec.yaml +++ b/marking_app/pubspec.yaml @@ -111,6 +111,7 @@ dependencies: horizontal_data_table: ^4.1.1 data_table_2: ^2.5.10 syncfusion_flutter_datepicker: ^21.2.10 + flutter_staggered_grid_view: ^0.6.2 dev_dependencies: flutter_test: