diff --git a/marking_app/lib/pages/homework_correction/components/new_version_of_homework/favorite_widget.dart b/marking_app/lib/pages/homework_correction/components/new_version_of_homework/favorite_widget.dart index a3f50d0..2689cc6 100644 --- a/marking_app/lib/pages/homework_correction/components/new_version_of_homework/favorite_widget.dart +++ b/marking_app/lib/pages/homework_correction/components/new_version_of_homework/favorite_widget.dart @@ -11,7 +11,8 @@ import 'package:marking_app/utils/request/rest_client.dart'; /// isFavorite 默认是否收藏 /// favoriteNum 默认收藏次数 class FavoriteWidget extends StatefulWidget { - FavoriteWidget({Key? key}) : super(key: key); + final Function call; + FavoriteWidget(this.call, {Key? key}) : super(key: key); @override _FavoriteState createState() => _FavoriteState(); @@ -56,6 +57,7 @@ class _FavoriteState extends State with EventBusMixin res = await _client.toJobFavoriteCancel(favoriteVal); if (res.success) { _future = getData(favoriteVal.taskId, favoriteVal.studentId, _eventModel!.paperId); + widget.call(); toUpState(setState, () {}, mounted); } else { ToastUtils.showError(res.message ?? '操作失败,请重试'); 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 813f985..490325b 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 @@ -170,6 +170,7 @@ Widget $completedHomeworkView(BuildContext context, Padding( padding: EdgeInsets.symmetric(horizontal: 10.w), child: Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( width: isPad() ? 32.w : 36.w, @@ -188,11 +189,14 @@ Widget $completedHomeworkView(BuildContext context, margin: EdgeInsets.only(right: 4.w), child: quickText('作业', color: Colors.white, size: 10.sp), ), - quickText( - jobTaskItem.title, - size: 16.sp, - color: Color.fromRGBO(70, 70, 70, 1), - fontWeight: FontWeight.bold, + Expanded( + child: quickText( + jobTaskItem.title, + maxLines: 2, + size: 16.sp, + color: Color.fromRGBO(70, 70, 70, 1), + fontWeight: FontWeight.bold, + ), ) ], ), @@ -566,6 +570,7 @@ Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskIt mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Row( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Container( width: isPad() ? 32.w : 38.w, @@ -586,11 +591,14 @@ Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskIt margin: EdgeInsets.only(right: 4.w), child: quickText(jobTaskItem.markingTypeEnum.name, color: Colors.white, size: 10.sp), ), - quickText( - jobTaskItem.title, - size: isPad() ? 14.sp : 16.sp, - color: Color.fromRGBO(70, 70, 70, 1), - fontWeight: FontWeight.bold, + Expanded( + child: quickText( + jobTaskItem.title, + maxLines: 2, + size: isPad() ? 14.sp : 16.sp, + color: Color.fromRGBO(70, 70, 70, 1), + fontWeight: FontWeight.bold, + ), ) ], ), diff --git a/marking_app/lib/pages/homework_correction/do_papers_job.dart b/marking_app/lib/pages/homework_correction/do_papers_job.dart index d0e9e1d..8b6ac8b 100644 --- a/marking_app/lib/pages/homework_correction/do_papers_job.dart +++ b/marking_app/lib/pages/homework_correction/do_papers_job.dart @@ -73,7 +73,7 @@ class DoPapersJob extends HookWidget with EventBusMixin { backgroundColor: Colors.white, elevation: 0, actions: [ - FavoriteWidget(), + FavoriteWidget(() => refresh = true), // Container( // padding: EdgeInsets.only(right: 4.w), // alignment: Alignment.center, @@ -156,6 +156,7 @@ class ReviewStatusInfo extends HookWidget with CommonMixin { print('点击了...'); List? students = await getStudents(); if (students == null) return; + students = students..sort((e, e1) => e.studentName.compareTo(e1.studentName)); showModalBottomSheet( context: context, elevation: 10, @@ -189,14 +190,15 @@ class ReviewStatusInfo extends HookWidget with CommonMixin { spacing: 6.0, // 主轴(水平)方向间距 runSpacing: 4.0, // 纵轴(垂直)方向间距 alignment: WrapAlignment.spaceAround, //沿主轴方向居中 - children: students.map((e) { + children: students!.map((e) { return Chip( + labelPadding: EdgeInsets.symmetric(vertical: 1.5.h, horizontal: 5.w), backgroundColor: Color.fromRGBO(239, 242, 255, 1), - avatar: CircleAvatar( - backgroundColor: Colors.white, - child: quickText(e.studentName.substring(0, 1), - size: 12.sp, color: Theme.of(context).primaryColor), - ), + // avatar: CircleAvatar( + // backgroundColor: Colors.white, + // child: quickText(e.studentName.substring(0, 1), + // size: 12.sp, color: Theme.of(context).primaryColor), + // ), label: quickText(e.studentName, color: Color.fromRGBO(80, 94, 110, 1), size: 12.sp), ); }).toList(), 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 4445fec..e697ea0 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 @@ -159,7 +159,7 @@ class _JobListParticipateInClassState extends State w color: Theme.of(context).primaryColor, ).show(context); } - + print('进入页面................'); if (task.isFinish) { return AchievementView( elevation: 0.5, @@ -175,8 +175,10 @@ class _JobListParticipateInClassState extends State w RouterManager.router.navigateTo(context, url, transition: getTransition()).then((value) { if (value == true) { isRefresh = true; - _future = getData(); - toUpState(setState, () {}, mounted); + getListOfJobFavoritesData().then((value) { + _future = getData(); + toUpState(setState, () {}, mounted); + }); } }); } @@ -279,8 +281,11 @@ class _JobListParticipateInClassState extends State w transition: getTransition(), ) .then((value) async { - _future = getData() - ..then((value) => getListOfJobFavoritesData().then((value) => toUpState(setState, () {}, mounted))); + isRefresh = true; + getListOfJobFavoritesData().then((value) { + _future = getData(); + toUpState(setState, () {}, mounted); + }); }); } @@ -321,7 +326,7 @@ class _JobListParticipateInClassState extends State w if (_result.data?.isEmpty ?? true) { return ToastUtils.showError('获取到的学生列表为空'); } - students = _result.data!; + students = _result.data!..sort((e, e1) => e.studentName.compareTo(e1.studentName)); } catch (e) { return ToastUtils.showError('获取学生列表失败'); } finally { @@ -363,11 +368,12 @@ class _JobListParticipateInClassState extends State w children: students.map((e) { return Chip( backgroundColor: Color.fromRGBO(239, 242, 255, 1), - avatar: CircleAvatar( - backgroundColor: Colors.white, - child: quickText(e.studentName.substring(0, 1), - size: 12.sp, color: Theme.of(context).primaryColor), - ), + labelPadding: EdgeInsets.symmetric(vertical: 1.5.h, horizontal: 5.w), + // avatar: CircleAvatar( + // backgroundColor: Colors.white, + // child: quickText(e.studentName.substring(0, 1), + // size: 12.sp, color: Theme.of(context).primaryColor), + // ), label: quickText(e.studentName, color: Color.fromRGBO(80, 94, 110, 1), size: 12.sp), ); }).toList(), @@ -624,19 +630,21 @@ class TabletEndCompleted extends StatelessWidget { Expanded( flex: 4, child: Material( - color: Color.fromRGBO(104, 136, 253, 1), + color: Color.fromRGBO(244, 244, 244, 1), borderRadius: BorderRadius.circular(16.r), child: InkWell( onTap: () => easyThrottle( 'OneClickReview', () => showStudentList([taskItem.id], taskItem.className, 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: Colors.white), + child: quickText('已提交:${taskItem.commitStudentCount}', + size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)), ), ), ), @@ -650,6 +658,7 @@ class TabletEndCompleted extends StatelessWidget { child: InkWell( onTap: () => easyThrottle( 'OneClickReview', () => showStudentList([taskItem.id], taskItem.className)), + splashColor: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(8.r), child: Container( alignment: Alignment.center, @@ -669,6 +678,7 @@ class TabletEndCompleted extends StatelessWidget { borderRadius: BorderRadius.circular(20.r), child: InkWell( onTap: () => bookmarks(taskItem), + splashColor: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(8.r), child: Container( alignment: Alignment.center, @@ -886,49 +896,26 @@ class MobileEndCompleted extends StatelessWidget { ) ], ), - child: Row( - children: task.isFinish - ? [ - Expanded( - child: InkWell( - onTap: () => easyThrottle('go_to_review_homework', () => quickDataCheck(task)), - child: Container( - alignment: Alignment.center, - child: quickText('数据快查', color: Color.fromRGBO(79, 79, 79, 1), size: 13.sp), - ), - ), - ), - 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)), - child: Container( - alignment: Alignment.center, - child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp), - ), - )), - ] - : [ - Expanded( - child: InkWell( - onTap: () => easyThrottle('go_to_review_homework', () {}), - child: Container( - alignment: Alignment.center, - child: quickText('批阅', color: Color.fromRGBO(79, 79, 79, 1), size: 13.sp), - ), - ), - ), - Container(width: 1.w, height: 36.h, color: Color.fromRGBO(221, 221, 221, 1)), - Expanded( - child: InkWell( - onTap: () => easyThrottle('go_to_end_review_homework', () => {}), - child: Container( - alignment: Alignment.center, - child: quickText('结束批阅', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp), - ), - )), - ], - ), + child: Row(children: [ + Expanded( + child: InkWell( + onTap: () => easyThrottle('go_to_review_homework', () => quickDataCheck(task)), + child: Container( + alignment: Alignment.center, + child: quickText('数据快查', color: Color.fromRGBO(79, 79, 79, 1), size: 13.sp), + ), + ), + ), + 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)), + child: Container( + alignment: Alignment.center, + child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp), + ), + )), + ]), ), ], )); @@ -1066,9 +1053,10 @@ Widget $itemDataViewOfPad( Expanded( flex: 4, child: Material( - color: Color.fromRGBO(104, 136, 253, 1), + color: Color.fromRGBO(244, 244, 244, 1), borderRadius: BorderRadius.circular(16.r), child: InkWell( + splashColor: Theme.of(context).primaryColor, onTap: () => easyThrottle('OneClickReview', () { if (!task.canMarking) { return AchievementView( @@ -1085,10 +1073,8 @@ Widget $itemDataViewOfPad( child: Container( alignment: Alignment.center, padding: EdgeInsets.symmetric(vertical: 3.h), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(20.r), - ), - child: quickText('一键批阅', size: 8.sp, color: Colors.white), + decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)), + child: quickText('一键批阅', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)), ), ), ), @@ -1101,6 +1087,7 @@ Widget $itemDataViewOfPad( borderRadius: BorderRadius.circular(20.r), child: InkWell( onTap: () => quickDataCheck(task), + splashColor: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(8.r), child: Container( alignment: Alignment.center, @@ -1118,6 +1105,7 @@ Widget $itemDataViewOfPad( color: Color.fromRGBO(244, 244, 244, 1), borderRadius: BorderRadius.circular(20.r), child: InkWell( + splashColor: Theme.of(context).primaryColor, onTap: () => bookmarks(task), borderRadius: BorderRadius.circular(8.r), child: Container( @@ -1582,7 +1570,7 @@ Widget $completedHomeworkProgressBar( percent: percent, center: Text( percentStr, - style: TextStyle(color: Colors.white, fontSize: 6.sp), + style: TextStyle(color: Colors.white, fontSize: 4.5.sp), ), // linearStrokeCap: LinearStrokeCap.butt, progressColor: color,