Compare commits

...

3 Commits

Author SHA1 Message Date
machuanyu b2f50b10a6 报告饼图修改 2024-03-20 17:02:15 +08:00
1147192855@qq.com 047965aede no message 2024-03-20 15:02:29 +08:00
1147192855@qq.com 6a963c20e2 no message 2024-03-20 14:41:44 +08:00
7 changed files with 304 additions and 268 deletions

View File

@ -11,7 +11,8 @@ import 'package:marking_app/utils/request/rest_client.dart';
/// isFavorite /// isFavorite
/// favoriteNum /// favoriteNum
class FavoriteWidget extends StatefulWidget { class FavoriteWidget extends StatefulWidget {
FavoriteWidget({Key? key}) : super(key: key); final Function call;
FavoriteWidget(this.call, {Key? key}) : super(key: key);
@override @override
_FavoriteState createState() => _FavoriteState(); _FavoriteState createState() => _FavoriteState();
@ -56,6 +57,7 @@ class _FavoriteState extends State<FavoriteWidget> with EventBusMixin<JobQuestio
BaseStructureResult<bool> res = await _client.toJobFavoriteCancel(favoriteVal); BaseStructureResult<bool> res = await _client.toJobFavoriteCancel(favoriteVal);
if (res.success) { if (res.success) {
_future = getData(favoriteVal.taskId, favoriteVal.studentId, _eventModel!.paperId); _future = getData(favoriteVal.taskId, favoriteVal.studentId, _eventModel!.paperId);
widget.call();
toUpState(setState, () {}, mounted); toUpState(setState, () {}, mounted);
} else { } else {
ToastUtils.showError(res.message ?? '操作失败,请重试'); ToastUtils.showError(res.message ?? '操作失败,请重试');

View File

@ -170,6 +170,7 @@ Widget $completedHomeworkView(BuildContext context,
Padding( Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w), padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: isPad() ? 32.w : 36.w, width: isPad() ? 32.w : 36.w,
@ -188,11 +189,14 @@ Widget $completedHomeworkView(BuildContext context,
margin: EdgeInsets.only(right: 4.w), margin: EdgeInsets.only(right: 4.w),
child: quickText('作业', color: Colors.white, size: 10.sp), child: quickText('作业', color: Colors.white, size: 10.sp),
), ),
quickText( Expanded(
jobTaskItem.title, child: quickText(
size: 16.sp, jobTaskItem.title,
color: Color.fromRGBO(70, 70, 70, 1), maxLines: 2,
fontWeight: FontWeight.bold, 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, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
Row( Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: isPad() ? 32.w : 38.w, width: isPad() ? 32.w : 38.w,
@ -586,11 +591,14 @@ Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskIt
margin: EdgeInsets.only(right: 4.w), margin: EdgeInsets.only(right: 4.w),
child: quickText(jobTaskItem.markingTypeEnum.name, color: Colors.white, size: 10.sp), child: quickText(jobTaskItem.markingTypeEnum.name, color: Colors.white, size: 10.sp),
), ),
quickText( Expanded(
jobTaskItem.title, child: quickText(
size: isPad() ? 14.sp : 16.sp, jobTaskItem.title,
color: Color.fromRGBO(70, 70, 70, 1), maxLines: 2,
fontWeight: FontWeight.bold, size: isPad() ? 14.sp : 16.sp,
color: Color.fromRGBO(70, 70, 70, 1),
fontWeight: FontWeight.bold,
),
) )
], ],
), ),

View File

@ -73,7 +73,7 @@ class DoPapersJob extends HookWidget with EventBusMixin<DoPapersJobRefreshBus> {
backgroundColor: Colors.white, backgroundColor: Colors.white,
elevation: 0, elevation: 0,
actions: [ actions: [
FavoriteWidget(), FavoriteWidget(() => refresh = true),
// Container( // Container(
// padding: EdgeInsets.only(right: 4.w), // padding: EdgeInsets.only(right: 4.w),
// alignment: Alignment.center, // alignment: Alignment.center,
@ -156,6 +156,7 @@ class ReviewStatusInfo extends HookWidget with CommonMixin {
print('点击了...'); print('点击了...');
List<JobConcernedWithStudent>? students = await getStudents(); List<JobConcernedWithStudent>? students = await getStudents();
if (students == null) return; if (students == null) return;
students = students..sort((e, e1) => e.studentName.compareTo(e1.studentName));
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
elevation: 10, elevation: 10,
@ -189,14 +190,15 @@ class ReviewStatusInfo extends HookWidget with CommonMixin {
spacing: 6.0, // () spacing: 6.0, // ()
runSpacing: 4.0, // runSpacing: 4.0, //
alignment: WrapAlignment.spaceAround, //沿 alignment: WrapAlignment.spaceAround, //沿
children: students.map((e) { children: students!.map((e) {
return Chip( return Chip(
labelPadding: EdgeInsets.symmetric(vertical: 1.5.h, horizontal: 5.w),
backgroundColor: Color.fromRGBO(239, 242, 255, 1), backgroundColor: Color.fromRGBO(239, 242, 255, 1),
avatar: CircleAvatar( // avatar: CircleAvatar(
backgroundColor: Colors.white, // backgroundColor: Colors.white,
child: quickText(e.studentName.substring(0, 1), // child: quickText(e.studentName.substring(0, 1),
size: 12.sp, color: Theme.of(context).primaryColor), // size: 12.sp, color: Theme.of(context).primaryColor),
), // ),
label: quickText(e.studentName, color: Color.fromRGBO(80, 94, 110, 1), size: 12.sp), label: quickText(e.studentName, color: Color.fromRGBO(80, 94, 110, 1), size: 12.sp),
); );
}).toList(), }).toList(),

View File

@ -1,5 +1,6 @@
import 'package:fl_chart/fl_chart.dart'; import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_echart/flutter_echart.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart'; import 'package:functional_widget_annotation/functional_widget_annotation.dart';
import 'package:marking_app/common/mixin/common.dart'; import 'package:marking_app/common/mixin/common.dart';
@ -235,6 +236,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isPadFlag = isPad();
return Scaffold( return Scaffold(
backgroundColor: Color.fromRGBO(245, 245, 245, 1), backgroundColor: Color.fromRGBO(245, 245, 245, 1),
appBar: AppBar( appBar: AppBar(
@ -337,7 +339,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
height: 6.r, height: 6.r,
), ),
SizedBox( SizedBox(
height: data.kgReport.details.length > 10 ? 300.r : data.kgReport.details.length * 50.r + 20.r, height: data.kgReport.details.length > 10 ? 300.r : data.kgReport.details.length * 50.r + (isPadFlag == true ?40.r:65.r),
child: ReportTable( child: ReportTable(
headList: ['', '作答率', '作答人数', '正确率', '标准答案', '优先批阅概况'], headList: ['', '作答率', '作答人数', '正确率', '标准答案', '优先批阅概况'],
bodyList: data.kgReport.details, bodyList: data.kgReport.details,
@ -379,7 +381,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
height: 10.r, height: 10.r,
), ),
SizedBox( SizedBox(
height: data.zgReport.details.length > 10 ? 300.r : data.zgReport.details.length * 50.r + 20.r, height: data.zgReport.details.length > 10 ? 300.r : data.zgReport.details.length * 50.r + 50.r,
child: ReportTable( child: ReportTable(
headList: ['', '作答率', '作答人数', '正确率', '查看原题', '优先批阅概况'], headList: ['', '作答率', '作答人数', '正确率', '查看原题', '优先批阅概况'],
bodyList: data.zgReport.details, bodyList: data.zgReport.details,
@ -1196,7 +1198,7 @@ Widget $overallPerformance(int totalNumber, List<OverallTitles> overallTitles) {
Color.fromRGBO(104, 136, 253, 1), Color.fromRGBO(104, 136, 253, 1),
Color.fromRGBO(255, 186, 33, 1), Color.fromRGBO(255, 186, 33, 1),
Color.fromRGBO(243, 163, 44, 1), Color.fromRGBO(243, 163, 44, 1),
Color.fromRGBO(211, 211, 211, 1).withOpacity(0.5), Color.fromRGBO(201, 201, 201, 1),
Color.fromRGBO(211, 211, 211, 1), Color.fromRGBO(211, 211, 211, 1),
]; ];
return Container( return Container(
@ -1216,7 +1218,36 @@ Widget $overallPerformance(int totalNumber, List<OverallTitles> overallTitles) {
margin: EdgeInsets.only(bottom: 20.h), margin: EdgeInsets.only(bottom: 20.h),
), ),
Expanded( Expanded(
child: PieChart( child: PieChatWidget(
dataList: overallTitles.asMap().keys.map((index) {
var e = overallTitles[index];
return EChartPieBean(
title: e.title,
number: e.count,
color: colorMap[index]);
}).toList(),
//
isBackground: true,
//线
isLineText: true,
//
bgColor: Colors.white,
//
isFrontgText: false,
//
initSelect: 1,
//
openType: OpenType.ANI,
//
loopType: LoopType.DOWN_LOOP,
//
clickCallBack: (int value) {
print("当前点击显示 $value");
},
),
/* PieChart(
PieChartData( PieChartData(
borderData: FlBorderData(show: false), borderData: FlBorderData(show: false),
sectionsSpace: 0, sectionsSpace: 0,
@ -1232,7 +1263,7 @@ Widget $overallPerformance(int totalNumber, List<OverallTitles> overallTitles) {
); );
}).toList(), }).toList(),
), ),
), ),*/
) )
], ],
), ),
@ -1309,10 +1340,9 @@ Widget $unitTimeAnsweringSituation(BuildContext context, int jobid, List<Questio
return false; // return false; //
} }
return Container( return Container(
width: double.infinity, width: double.infinity,
height: isPad() ? 520.h : 460.h, // height: isPad() ? 520.h : 460.h,
margin: EdgeInsets.only(top: 20.h), margin: EdgeInsets.only(top: 20.h),
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 12.w), padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 12.w),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.r)), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.r)),
@ -1323,137 +1353,135 @@ Widget $unitTimeAnsweringSituation(BuildContext context, int jobid, List<Questio
child: quickText('整体表现', color: Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold), child: quickText('整体表现', color: Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold),
margin: EdgeInsets.only(bottom: 20.h), margin: EdgeInsets.only(bottom: 20.h),
), ),
Expanded( Scrollbar(
child: Scrollbar( thickness: 8.w,
thickness: 8.w, thumbVisibility: true,
thumbVisibility: true, trackVisibility: true,
trackVisibility: true, radius: Radius.circular(10.r),
radius: Radius.circular(10.r), child: SingleChildScrollView(
child: SingleChildScrollView( scrollDirection: Axis.horizontal,
scrollDirection: Axis.horizontal, child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ ...mapData.entries.map((entrie) {
...mapData.entries.map((entrie) { bool isViewButton = ['查看原题', '操作'].contains(entrie.key); //
bool isViewButton = ['查看原题', '操作'].contains(entrie.key); // bool isRatio = ['正确率', '错误率', '未做'].contains(entrie.key);
bool isRatio = ['正确率', '错误率', '未做'].contains(entrie.key); bool isQuestionNo = entrie.key == '题号';
bool isQuestionNo = entrie.key == '题号'; return Row(
return Row( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ Container(
Container( width: 94.r,
width: 94.r, alignment: Alignment.center,
margin: EdgeInsets.only(bottom: 1.h, right: 1.w),
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 8.w),
color: Color.fromRGBO(230, 230, 230, 1),
child: quickText(entrie.key, color: Color.fromRGBO(24, 35, 77, 1), size: 12.sp, maxLines: 2),
),
...entrie.value.map((e) {
bool noHasChineseCharacter = isQuestionNo && !containsChinese(e);
return Container(
width: 96.r,
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(bottom: 1.h, right: 1.w), margin: EdgeInsets.only(bottom: 1.h, right: 1.w),
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 8.w), padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 8.w),
color: Color.fromRGBO(230, 230, 230, 1), color: Color.fromRGBO(245, 245, 245, 1),
child: quickText(entrie.key, color: Color.fromRGBO(24, 35, 77, 1), size: 12.sp, maxLines: 2), child: isViewButton
), ? InkWell(
...entrie.value.map((e) { onTap: () {
bool noHasChineseCharacter = isQuestionNo && !containsChinese(e); // e
return Container( var _qpm = e as QuestionPictureModel;
width: 96.r, // if (entrie.key == '操作') {
alignment: Alignment.center, // showDialog(
margin: EdgeInsets.only(bottom: 1.h, right: 1.w), // context: context,
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 8.w), // builder: (BuildContext context1) {
color: Color.fromRGBO(245, 245, 245, 1), // return Container(
child: isViewButton // margin: EdgeInsets.symmetric(vertical: 150.h, horizontal: 24.w),
? InkWell( // padding: EdgeInsets.symmetric(vertical: 15.h),
onTap: () { // decoration: BoxDecoration(
// e // color: Colors.white,
var _qpm = e as QuestionPictureModel; // borderRadius: BorderRadius.circular(18.sp),
// if (entrie.key == '操作') { // ),
// showDialog( // child: Column(
// context: context, // children: [
// builder: (BuildContext context1) { // Container(
// return Container( // child: quickText('${_qpm.questionNo}',
// margin: EdgeInsets.symmetric(vertical: 150.h, horizontal: 24.w), // color: Color.fromRGBO(60, 60, 60, 1), size: 15.sp)),
// padding: EdgeInsets.symmetric(vertical: 15.h), // Expanded(
// decoration: BoxDecoration( // child: ListView(
// color: Colors.white, // padding: EdgeInsets.symmetric(horizontal: 12.w),
// borderRadius: BorderRadius.circular(18.sp), // children: [
// ), // DataTable(
// child: Column( // sortAscending: false,
// children: [ // columns: [
// Container( // DataColumn(
// child: quickText('${_qpm.questionNo}', // label: quickText('姓名',
// color: Color.fromRGBO(60, 60, 60, 1), size: 15.sp)), // color: Color.fromRGBO(114, 114, 114, 1),
// Expanded( // size: 14.sp,
// child: ListView( // fontWeight: FontWeight.bold),
// padding: EdgeInsets.symmetric(horizontal: 12.w), // ),
// children: [ // ],
// DataTable( // rows: [],
// sortAscending: false, // ),
// columns: [ // ]),
// DataColumn( // )
// label: quickText('姓名', // ],
// color: Color.fromRGBO(114, 114, 114, 1), // ),
// size: 14.sp, // );
// fontWeight: FontWeight.bold), // },
// ), // );
// ], // return;
// rows: [], // }
// ), if (_qpm.questionPicture == null) return ToastUtils.showInfo('当前试题没有原题');
// ]), Navigator.push(
// ) context,
// ], MaterialPageRoute(builder: (_) {
// ), return Scaffold(
// ); appBar: AppBar(),
// }, body: PhotoView(imageProvider: NetworkImage(_qpm.questionPicture!)),
// ); );
// return; }),
// } );
if (_qpm.questionPicture == null) return ToastUtils.showInfo('当前试题没有原题'); },
Navigator.push( child: Row(
context, mainAxisSize: MainAxisSize.min,
MaterialPageRoute(builder: (_) { crossAxisAlignment: CrossAxisAlignment.center,
return Scaffold( children: [
appBar: AppBar(), quickText('查看', color: Color.fromRGBO(239, 135, 20, 1), size: 12.sp),
body: PhotoView(imageProvider: NetworkImage(_qpm.questionPicture!)), Container(
); padding: EdgeInsets.only(top: 1.h),
}), child: Icon(
); Icons.arrow_forward_ios,
}, size: 10.sp,
child: Row( color: Color.fromRGBO(239, 135, 20, 1),
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.center,
children: [
quickText('查看', color: Color.fromRGBO(239, 135, 20, 1), size: 12.sp),
Container(
padding: EdgeInsets.only(top: 1.h),
child: Icon(
Icons.arrow_forward_ios,
size: 10.sp,
color: Color.fromRGBO(239, 135, 20, 1),
),
), ),
),
],
),
)
: RegExp(r'^\d+$').hasMatch(e) || (e.contains('%') && e.length < 4)
? Row(
mainAxisSize: MainAxisSize.min,
children: [
quickText(e,
color: isRatio
? Theme.of(context).primaryColor
: Color.fromRGBO(82, 82, 82, 1),
size: isRatio || noHasChineseCharacter ? 12.sp : 12.sp,
maxLines: 2),
quickText('', color: Colors.transparent, size: 12.sp),
], ],
), )
) : quickText(e,
: RegExp(r'^\d+$').hasMatch(e) || (e.contains('%') && e.length < 4) color: isRatio ? Theme.of(context).primaryColor : Color.fromRGBO(82, 82, 82, 1),
? Row( size: isRatio || noHasChineseCharacter ? 12.sp : 12.sp,
mainAxisSize: MainAxisSize.min, maxLines: 2),
children: [ );
quickText(e, }).toList(),
color: isRatio ],
? Theme.of(context).primaryColor );
: Color.fromRGBO(82, 82, 82, 1), }).toList(),
size: isRatio || noHasChineseCharacter ? 12.sp : 12.sp, ],
maxLines: 2),
quickText('', color: Colors.transparent, size: 12.sp),
],
)
: quickText(e,
color: isRatio ? Theme.of(context).primaryColor : Color.fromRGBO(82, 82, 82, 1),
size: isRatio || noHasChineseCharacter ? 12.sp : 12.sp,
maxLines: 2),
);
}).toList(),
],
);
}).toList(),
],
),
), ),
), ),
), ),
@ -1494,7 +1522,7 @@ Widget $personnelDataOverview(BuildContext context, List<StudentAnswerInfos> stu
return Container( return Container(
width: double.infinity, width: double.infinity,
height: isPad() ? 290.h : 264.h, // height: isPad() ? 290.h : 264.h,
margin: EdgeInsets.only(top: 20.h), margin: EdgeInsets.only(top: 20.h),
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 12.w), padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 12.w),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.r)), decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.r)),
@ -1505,57 +1533,55 @@ Widget $personnelDataOverview(BuildContext context, List<StudentAnswerInfos> stu
child: quickText('人员数据概况', color: Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold), child: quickText('人员数据概况', color: Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold),
margin: EdgeInsets.only(bottom: 20.h), margin: EdgeInsets.only(bottom: 20.h),
), ),
Expanded( Scrollbar(
child: Scrollbar( thickness: 8.w,
thickness: 8.w, thumbVisibility: true,
thumbVisibility: true, trackVisibility: true,
trackVisibility: true, radius: Radius.circular(10.r),
radius: Radius.circular(10.r), child: SingleChildScrollView(
child: SingleChildScrollView( scrollDirection: Axis.horizontal,
scrollDirection: Axis.horizontal, child: Column(
child: Column( crossAxisAlignment: CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start, children: [
children: [ ...mapData.entries.map((entrie) {
...mapData.entries.map((entrie) { bool isTransparentChinese = ['答题时长', '正确率', '未答题数'].contains(entrie.key); //
bool isTransparentChinese = ['答题时长', '正确率', '未答题数'].contains(entrie.key); //
return Row( return Row(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
width: 94.r, width: 94.r,
alignment: Alignment.center,
color: Color.fromRGBO(230, 230, 230, 1),
margin: EdgeInsets.only(bottom: 1.h, right: 1.w),
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 8.w),
child: quickText(entrie.key, color: Color.fromRGBO(24, 35, 77, 1), size: 12.sp, maxLines: 2),
),
...entrie.value.map((e) {
bool isTransparentChineseNew = isTransparentChinese && (e?.length ?? 0) == 0;
return Container(
width: 100.r,
alignment: Alignment.center, alignment: Alignment.center,
color: Color.fromRGBO(230, 230, 230, 1),
margin: EdgeInsets.only(bottom: 1.h, right: 1.w), margin: EdgeInsets.only(bottom: 1.h, right: 1.w),
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 8.w), padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 8.w),
child: quickText(entrie.key, color: Color.fromRGBO(24, 35, 77, 1), size: 12.sp, maxLines: 2), color: Color.fromRGBO(245, 245, 245, 1),
), child: isTransparentChineseNew
...entrie.value.map((e) { ? quickText('透明', color: Colors.transparent, size: 12.sp)
bool isTransparentChineseNew = isTransparentChinese && (e?.length ?? 0) == 0; : RegExp(r'^\d+$').hasMatch(e) || e.contains('%')
return Container( ? Row(
width: 100.r, mainAxisSize: MainAxisSize.min,
alignment: Alignment.center, children: [
margin: EdgeInsets.only(bottom: 1.h, right: 1.w), quickText(e, color: Color.fromRGBO(82, 82, 82, 1), size: 12.sp, maxLines: 2),
padding: EdgeInsets.symmetric(vertical: 10.h, horizontal: 8.w), quickText('', color: Colors.transparent, size: 12.sp),
color: Color.fromRGBO(245, 245, 245, 1), ],
child: isTransparentChineseNew )
? quickText('透明', color: Colors.transparent, size: 12.sp) : quickText(e, color: Color.fromRGBO(82, 82, 82, 1), size: 12.sp, maxLines: 2),
: RegExp(r'^\d+$').hasMatch(e) || e.contains('%') );
? Row( }).toList(),
mainAxisSize: MainAxisSize.min, ],
children: [ );
quickText(e, color: Color.fromRGBO(82, 82, 82, 1), size: 12.sp, maxLines: 2), }).toList(),
quickText('', color: Colors.transparent, size: 12.sp), ],
],
)
: quickText(e, color: Color.fromRGBO(82, 82, 82, 1), size: 12.sp, maxLines: 2),
);
}).toList(),
],
);
}).toList(),
],
),
), ),
), ),
), ),

View File

@ -159,7 +159,7 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
).show(context); ).show(context);
} }
print('进入页面................');
if (task.isFinish) { if (task.isFinish) {
return AchievementView( return AchievementView(
elevation: 0.5, elevation: 0.5,
@ -175,8 +175,10 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
RouterManager.router.navigateTo(context, url, transition: getTransition()).then((value) { RouterManager.router.navigateTo(context, url, transition: getTransition()).then((value) {
if (value == true) { if (value == true) {
isRefresh = true; isRefresh = true;
_future = getData(); getListOfJobFavoritesData().then((value) {
toUpState(setState, () {}, mounted); _future = getData();
toUpState(setState, () {}, mounted);
});
} }
}); });
} }
@ -279,8 +281,11 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
transition: getTransition(), transition: getTransition(),
) )
.then((value) async { .then((value) async {
_future = getData() isRefresh = true;
..then((value) => getListOfJobFavoritesData().then((value) => toUpState(setState, () {}, mounted))); getListOfJobFavoritesData().then((value) {
_future = getData();
toUpState(setState, () {}, mounted);
});
}); });
} }
@ -321,7 +326,7 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
if (_result.data?.isEmpty ?? true) { if (_result.data?.isEmpty ?? true) {
return ToastUtils.showError('获取到的学生列表为空'); return ToastUtils.showError('获取到的学生列表为空');
} }
students = _result.data!; students = _result.data!..sort((e, e1) => e.studentName.compareTo(e1.studentName));
} catch (e) { } catch (e) {
return ToastUtils.showError('获取学生列表失败'); return ToastUtils.showError('获取学生列表失败');
} finally { } finally {
@ -363,11 +368,12 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
children: students.map((e) { children: students.map((e) {
return Chip( return Chip(
backgroundColor: Color.fromRGBO(239, 242, 255, 1), backgroundColor: Color.fromRGBO(239, 242, 255, 1),
avatar: CircleAvatar( labelPadding: EdgeInsets.symmetric(vertical: 1.5.h, horizontal: 5.w),
backgroundColor: Colors.white, // avatar: CircleAvatar(
child: quickText(e.studentName.substring(0, 1), // backgroundColor: Colors.white,
size: 12.sp, color: Theme.of(context).primaryColor), // 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), label: quickText(e.studentName, color: Color.fromRGBO(80, 94, 110, 1), size: 12.sp),
); );
}).toList(), }).toList(),
@ -624,19 +630,21 @@ class TabletEndCompleted extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Material( child: Material(
color: Color.fromRGBO(104, 136, 253, 1), color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(16.r), borderRadius: BorderRadius.circular(16.r),
child: InkWell( child: InkWell(
onTap: () => easyThrottle( onTap: () => easyThrottle(
'OneClickReview', () => showStudentList([taskItem.id], taskItem.className, true)), 'OneClickReview', () => showStudentList([taskItem.id], taskItem.className, true)),
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
splashColor: Theme.of(context).primaryColor,
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 4.h), padding: EdgeInsets.symmetric(vertical: 4.h),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r), 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( child: InkWell(
onTap: () => easyThrottle( onTap: () => easyThrottle(
'OneClickReview', () => showStudentList([taskItem.id], taskItem.className)), 'OneClickReview', () => showStudentList([taskItem.id], taskItem.className)),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -669,6 +678,7 @@ class TabletEndCompleted extends StatelessWidget {
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
child: InkWell( child: InkWell(
onTap: () => bookmarks(taskItem), onTap: () => bookmarks(taskItem),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -811,11 +821,12 @@ class MobileEndCompleted extends StatelessWidget {
Expanded( Expanded(
flex: 4, flex: 4,
child: Material( child: Material(
color: Color.fromRGBO(104, 136, 253, 1), color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(16.r), borderRadius: BorderRadius.circular(16.r),
child: InkWell( child: InkWell(
onTap: () => onTap: () =>
easyThrottle('OneClickReview', () => showStudentList([task.id], task.className, true)), easyThrottle('OneClickReview', () => showStudentList([task.id], task.className, true)),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -823,7 +834,8 @@ class MobileEndCompleted extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
), ),
child: quickText('已提交:${task.commitStudentCount}', size: 10.sp, color: Colors.white), child: quickText('已提交:${task.commitStudentCount}',
size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
), ),
), ),
), ),
@ -886,49 +898,26 @@ class MobileEndCompleted extends StatelessWidget {
) )
], ],
), ),
child: Row( child: Row(children: [
children: task.isFinish Expanded(
? [ child: InkWell(
Expanded( onTap: () => easyThrottle('go_to_review_homework', () => quickDataCheck(task)),
child: InkWell( child: Container(
onTap: () => easyThrottle('go_to_review_homework', () => quickDataCheck(task)), alignment: Alignment.center,
child: Container( child: quickText('数据快查', color: Color.fromRGBO(79, 79, 79, 1), size: 13.sp),
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(
Container(width: 1.w, height: 36.h, color: Color.fromRGBO(221, 221, 221, 1)), child: InkWell(
Expanded( onTap: () => easyThrottle('go_to_end_review_homework', () => jobViewReport(task)),
child: InkWell( child: Container(
onTap: () => easyThrottle('go_to_end_review_homework', () => jobViewReport(task)), alignment: Alignment.center,
child: Container( child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp),
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),
),
)),
],
),
), ),
], ],
)); ));
@ -1066,9 +1055,10 @@ Widget $itemDataViewOfPad(
Expanded( Expanded(
flex: 4, flex: 4,
child: Material( child: Material(
color: Color.fromRGBO(104, 136, 253, 1), color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(16.r), borderRadius: BorderRadius.circular(16.r),
child: InkWell( child: InkWell(
splashColor: Theme.of(context).primaryColor,
onTap: () => easyThrottle('OneClickReview', () { onTap: () => easyThrottle('OneClickReview', () {
if (!task.canMarking) { if (!task.canMarking) {
return AchievementView( return AchievementView(
@ -1085,10 +1075,8 @@ Widget $itemDataViewOfPad(
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 3.h), padding: EdgeInsets.symmetric(vertical: 3.h),
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
borderRadius: BorderRadius.circular(20.r), child: quickText('一键批阅', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)),
),
child: quickText('一键批阅', size: 8.sp, color: Colors.white),
), ),
), ),
), ),
@ -1101,6 +1089,7 @@ Widget $itemDataViewOfPad(
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
child: InkWell( child: InkWell(
onTap: () => quickDataCheck(task), onTap: () => quickDataCheck(task),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -1118,6 +1107,7 @@ Widget $itemDataViewOfPad(
color: Color.fromRGBO(244, 244, 244, 1), color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
child: InkWell( child: InkWell(
splashColor: Theme.of(context).primaryColor,
onTap: () => bookmarks(task), onTap: () => bookmarks(task),
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
child: Container( child: Container(
@ -1338,9 +1328,10 @@ Widget $itemDataView(
Expanded( Expanded(
flex: 4, flex: 4,
child: Material( child: Material(
color: Color.fromRGBO(104, 136, 253, 1), color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(16.r), borderRadius: BorderRadius.circular(16.r),
child: InkWell( child: InkWell(
splashColor: Theme.of(context).primaryColor,
onTap: () => easyThrottle('OneClickReview', () { onTap: () => easyThrottle('OneClickReview', () {
if (!task.canMarking) { if (!task.canMarking) {
return AchievementView( return AchievementView(
@ -1360,7 +1351,7 @@ Widget $itemDataView(
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
), ),
child: quickText('一键批阅', size: 10.sp, color: Colors.white), child: quickText('一键批阅', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
), ),
), ),
), ),
@ -1372,6 +1363,7 @@ Widget $itemDataView(
color: Color.fromRGBO(244, 244, 244, 1), color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
child: InkWell( child: InkWell(
splashColor: Theme.of(context).primaryColor,
onTap: () => quickDataCheck(task), onTap: () => quickDataCheck(task),
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
child: Container( child: Container(
@ -1391,6 +1383,7 @@ Widget $itemDataView(
borderRadius: BorderRadius.circular(20.r), borderRadius: BorderRadius.circular(20.r),
child: InkWell( child: InkWell(
onTap: () => bookmarks(task), onTap: () => bookmarks(task),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r), borderRadius: BorderRadius.circular(8.r),
child: Container( child: Container(
alignment: Alignment.center, alignment: Alignment.center,
@ -1582,7 +1575,7 @@ Widget $completedHomeworkProgressBar(
percent: percent, percent: percent,
center: Text( center: Text(
percentStr, percentStr,
style: TextStyle(color: Colors.white, fontSize: 6.sp), style: TextStyle(color: Colors.white, fontSize: 4.5.sp),
), ),
// linearStrokeCap: LinearStrokeCap.butt, // linearStrokeCap: LinearStrokeCap.butt,
progressColor: color, progressColor: color,

View File

@ -3,6 +3,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart'; import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart'; import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/toast_utils.dart'; import 'package:marking_app/utils/toast_utils.dart';
import 'package:photo_view/photo_view.dart'; import 'package:photo_view/photo_view.dart';
@ -283,6 +284,7 @@ class _ReportTableState extends State<ReportTable> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
bool isPadFlag = isPad();
return DataTable2( return DataTable2(
dividerThickness: 0, dividerThickness: 0,
scrollController: _controller, scrollController: _controller,
@ -314,7 +316,7 @@ class _ReportTableState extends State<ReportTable> {
fixedCornerColor: Colors.grey[400], fixedCornerColor: Colors.grey[400],
minWidth: widget.headList.length > 6 minWidth: widget.headList.length > 6
? 80.r * widget.headList.length ? 80.r * widget.headList.length
: MediaQuery.of(context).size.width, : isPadFlag?MediaQuery.of(context).size.width:85.r * widget.headList.length,
fixedTopRows: widget.fixedRows!, fixedTopRows: widget.fixedRows!,
fixedLeftColumns: widget.fixedCols!, fixedLeftColumns: widget.fixedCols!,
sortColumnIndex: _sortColumnIndex, sortColumnIndex: _sortColumnIndex,
@ -332,8 +334,8 @@ class _ReportTableState extends State<ReportTable> {
? 40.r ? 40.r
: widget.headList.length > 6 : widget.headList.length > 6
? 80.r ? 80.r
: (MediaQuery.of(context).size.width - 8.r) / : isPadFlag?(MediaQuery.of(context).size.width - 8.r) /
widget.headList.length, widget.headList.length:85.r,
); );
}), }),
rows: List<DataRow>.generate(widget.bodyList.length, rows: List<DataRow>.generate(widget.bodyList.length,

View File

@ -112,6 +112,9 @@ dependencies:
data_table_2: ^2.5.10 data_table_2: ^2.5.10
syncfusion_flutter_datepicker: ^21.2.10 syncfusion_flutter_datepicker: ^21.2.10
flutter_staggered_grid_view: ^0.6.2 flutter_staggered_grid_view: ^0.6.2
# 饼图
flutter_echart: ^2.0.0
dev_dependencies: dev_dependencies:
flutter_test: flutter_test: