no message

This commit is contained in:
1147192855@qq.com 2024-03-15 19:33:53 +08:00
parent 7bb6072a75
commit d793161d67
6 changed files with 285 additions and 193 deletions

View File

@ -2,10 +2,8 @@ import 'package:json_annotation/json_annotation.dart';
part 'job_data_report.g.dart'; part 'job_data_report.g.dart';
@JsonSerializable() @JsonSerializable()
class JobDataReport extends Object { class JobDataReport extends Object {
@JsonKey(name: 'jobId') @JsonKey(name: 'jobId')
int jobId; int jobId;
@ -36,21 +34,28 @@ class JobDataReport extends Object {
@JsonKey(name: 'zgQuestionCount') @JsonKey(name: 'zgQuestionCount')
int zgQuestionCount; int zgQuestionCount;
bool sortType; // true false
@JsonKey(name: 'studentDetails') @JsonKey(name: 'studentDetails')
List<StudentDetails> studentDetails; List<StudentDetails> studentDetails;
JobDataReport(this.jobId,this.jobName,this.gradeName,this.className,this.validCount,this.noAnswerCount,this.kgValidRate,this.kgQuestionCount,this.zgValidRate,this.zgQuestionCount,this.studentDetails,); JobDataReport(this.jobId, this.jobName, this.gradeName, this.className, this.validCount, this.noAnswerCount,
this.kgValidRate, this.kgQuestionCount, this.zgValidRate, this.zgQuestionCount, this.studentDetails,
[this.sortType = true]) {
this.studentDetails.sort((a, b) {
int num1 = a.kgValidRate + a.zgValidRate;
int num2 = b.kgValidRate + b.zgValidRate;
return num2.compareTo(num1);
});
}
factory JobDataReport.fromJson(Map<String, dynamic> srcJson) => _$JobDataReportFromJson(srcJson); factory JobDataReport.fromJson(Map<String, dynamic> srcJson) => _$JobDataReportFromJson(srcJson);
Map<String, dynamic> toJson() => _$JobDataReportToJson(this); Map<String, dynamic> toJson() => _$JobDataReportToJson(this);
} }
@JsonSerializable() @JsonSerializable()
class StudentDetails extends Object { class StudentDetails extends Object {
@JsonKey(name: 'studentId') @JsonKey(name: 'studentId')
int? studentId; int? studentId;
@ -75,18 +80,24 @@ class StudentDetails extends Object {
@JsonKey(name: 'zgDetails') @JsonKey(name: 'zgDetails')
List<KgDetails> zgDetails; List<KgDetails> zgDetails;
StudentDetails(this.studentId,this.studentName,this.kgValidCount,this.kgValidRate,this.zgValidCount,this.zgValidRate,this.kgDetails,this.zgDetails,); StudentDetails(
this.studentId,
this.studentName,
this.kgValidCount,
this.kgValidRate,
this.zgValidCount,
this.zgValidRate,
this.kgDetails,
this.zgDetails,
);
factory StudentDetails.fromJson(Map<String, dynamic> srcJson) => _$StudentDetailsFromJson(srcJson); factory StudentDetails.fromJson(Map<String, dynamic> srcJson) => _$StudentDetailsFromJson(srcJson);
Map<String, dynamic> toJson() => _$StudentDetailsToJson(this); Map<String, dynamic> toJson() => _$StudentDetailsToJson(this);
} }
@JsonSerializable() @JsonSerializable()
class KgDetails extends Object { class KgDetails extends Object {
@JsonKey(name: 'questionNo') @JsonKey(name: 'questionNo')
String questionNo; String questionNo;
@ -114,12 +125,19 @@ class KgDetails extends Object {
@JsonKey(name: 'score') @JsonKey(name: 'score')
double? score; double? score;
KgDetails(this.questionNo,this.questionId,this.partName,this.state,this.studentAnswer,this.questionAnswer,this.useTime,this.annotateAnswers,this.score,); KgDetails(
this.questionNo,
this.questionId,
this.partName,
this.state,
this.studentAnswer,
this.questionAnswer,
this.useTime,
this.annotateAnswers,
this.score,
);
factory KgDetails.fromJson(Map<String, dynamic> srcJson) => _$KgDetailsFromJson(srcJson); factory KgDetails.fromJson(Map<String, dynamic> srcJson) => _$KgDetailsFromJson(srcJson);
Map<String, dynamic> toJson() => _$KgDetailsToJson(this); Map<String, dynamic> toJson() => _$KgDetailsToJson(this);
} }

View File

@ -680,18 +680,25 @@ typedef ShowStudentsCall = Future<void> Function(
String? className, String? className,
]); ]);
/// class FavoriteButton extends StatefulWidget {
class FavoriteButton extends HookWidget with CommonMixin {
final int jobId; final int jobId;
final String jobName; final String jobName;
EdgeInsets? margin;
final bool isRow; final bool isRow;
FavoriteButton(this.jobId, this.jobName, {this.margin, this.isRow = true, super.key}); final EdgeInsets? margin;
const FavoriteButton(this.jobId, this.jobName, {this.margin, this.isRow = true, super.key});
@override
State<FavoriteButton> createState() => _FavoriteButtonState();
}
class _FavoriteButtonState extends State<FavoriteButton> with CommonMixin {
late Future<int> _future; //
Future<int> getInvolveClasses() async { Future<int> getInvolveClasses() async {
print('我的收藏请求数据');
try { try {
RestClient _client = await getClient(); RestClient _client = await getClient();
var result = await _client.getListOfJobFavoriteNumber(jobId); var result = await _client.getListOfJobFavoriteNumber(widget.jobId);
if (result.success && (result.data?.isNotEmpty ?? false)) { if (result.success && (result.data?.isNotEmpty ?? false)) {
return result.data!.map((e) => e.count).reduce((value, element) => value + element); return result.data!.map((e) => e.count).reduce((value, element) => value + element);
@ -704,26 +711,37 @@ class FavoriteButton extends HookWidget with CommonMixin {
// //
void bookmarks(BuildContext context) { void bookmarks(BuildContext context) {
RouterManager.router.navigateTo( RouterManager.router
.navigateTo(
context, context,
RouterManager.jobFavoritePagePath + '?jobId=$jobId&jobName=${Uri.encodeComponent(jobName)}', RouterManager.jobFavoritePagePath + '?jobId=${widget.jobId}&jobName=${Uri.encodeComponent(widget.jobName)}',
transition: getTransition(), transition: getTransition(),
); )
.then((value) {
toUpState(setState, () {}, mounted);
});
}
@override
void initState() {
super.initState();
// _future = getInvolveClasses();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var favoriteNumber = useState(0); var margin = widget.margin ?? EdgeInsets.only(top: 15.h);
useEffect(() { return FutureBuilder<int>(
getInvolveClasses().then((value) { builder: (context, AsyncSnapshot<int> async) {
var favoriteCount = favoriteNumber.value; //widget
if (favoriteCount != value) favoriteNumber.value = value; if (async.connectionState == ConnectionState.active || async.connectionState == ConnectionState.waiting) {
}); return Container();
return () {}; }
}, []); if (async.connectionState == ConnectionState.done) {
if (favoriteNumber.value <= 0) return Container(); var favoriteNumber = async.data;
margin ??= EdgeInsets.only(top: 15.h); if (favoriteNumber == null || favoriteNumber <= 0) return Container();
return isRow
return widget.isRow
? Row( ? Row(
children: [ children: [
Container( Container(
@ -738,8 +756,8 @@ class FavoriteButton extends HookWidget with CommonMixin {
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 17.w), padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 17.w),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)), decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
child: quickText('收藏夹(${favoriteNumber.value})', child:
size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)), quickText('收藏夹($favoriteNumber)', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
), ),
), ),
), ),
@ -759,11 +777,105 @@ class FavoriteButton extends HookWidget with CommonMixin {
alignment: Alignment.center, alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 17.w), padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 17.w),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)), decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
child: child: quickText('收藏夹($favoriteNumber)', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
quickText('收藏夹(${favoriteNumber.value})', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
), ),
), ),
), ),
); );
} }
return Container();
},
future: getInvolveClasses(),
);
} }
}
///
// class FavoriteButton extends HookWidget with CommonMixin {
// final int jobId;
// final String jobName;
// EdgeInsets? margin;
// final bool isRow;
// FavoriteButton(this.jobId, this.jobName, {this.margin, this.isRow = true, super.key});
// Future<int> getInvolveClasses() async {
// print('我的收藏请求数据');
// try {
// RestClient _client = await getClient();
// var result = await _client.getListOfJobFavoriteNumber(jobId);
// if (result.success && (result.data?.isNotEmpty ?? false)) {
// return result.data!.map((e) => e.count).reduce((value, element) => value + element);
// }
// } catch (e) {
// print(e);
// }
// return 0;
// }
// //
// void bookmarks(BuildContext context) {
// RouterManager.router.navigateTo(
// context,
// RouterManager.jobFavoritePagePath + '?jobId=$jobId&jobName=${Uri.encodeComponent(jobName)}',
// transition: getTransition(),
// );
// }
// @override
// Widget build(BuildContext context) {
// var favoriteNumber = useState(0);
// useEffect(() {
// getInvolveClasses().then((value) {
// var favoriteCount = favoriteNumber.value;
// if (favoriteCount != value) favoriteNumber.value = value;
// });
// return () {};
// }, []);
// if (favoriteNumber.value <= 0) return Container();
// margin ??= EdgeInsets.only(top: 15.h);
// return isRow
// ? Row(
// children: [
// Container(
// margin: margin,
// child: Material(
// color: Color.fromRGBO(244, 244, 244, 1),
// borderRadius: BorderRadius.circular(20.r),
// child: InkWell(
// onTap: () => bookmarks(context),
// borderRadius: BorderRadius.circular(8.r),
// child: Container(
// alignment: Alignment.center,
// padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 17.w),
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
// child: quickText('收藏夹(${favoriteNumber.value})',
// size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
// ),
// ),
// ),
// ),
// Expanded(child: SizedBox())
// ],
// )
// : Container(
// margin: margin,
// child: Material(
// color: Color.fromRGBO(244, 244, 244, 1),
// borderRadius: BorderRadius.circular(20.r),
// child: InkWell(
// onTap: () => bookmarks(context),
// borderRadius: BorderRadius.circular(8.r),
// child: Container(
// alignment: Alignment.center,
// padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 17.w),
// decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
// child:
// quickText('收藏夹(${favoriteNumber.value})', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
// ),
// ),
// ),
// );
// }
// }

View File

@ -356,7 +356,7 @@ Widget $easyRefresh({
crossAxisCount: 2, //widget crossAxisCount: 2, //widget
mainAxisSpacing: 10.h, mainAxisSpacing: 10.h,
crossAxisSpacing: 6.w, crossAxisSpacing: 6.w,
childAspectRatio: 2.0 //1widget childAspectRatio: 1.81 //1widget
), ),
children: data.map((e) => $ReviewedItem(jobTaskItem: e)).toList(), children: data.map((e) => $ReviewedItem(jobTaskItem: e)).toList(),
) )
@ -428,8 +428,7 @@ Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
child: quickText(jobTaskItem.markingTypeEnum.name, color: Colors.white, size: 10.sp), child: quickText(jobTaskItem.markingTypeEnum.name, color: Colors.white, size: 10.sp),
), ),
Expanded( Expanded(
child: quickText(jobTaskItem.title, child: quickText(jobTaskItem.title, size: 14.sp, color: Color.fromRGBO(70, 70, 70, 1), maxLines: 2),
size: 14.sp, color: Color.fromRGBO(70, 70, 70, 1), maxLines: 2, fontWeight: FontWeight.w500),
) )
], ],
), ),

View File

@ -1494,7 +1494,7 @@ Widget $personnelDataOverview(BuildContext context, List<StudentAnswerInfos> stu
return Container( return Container(
width: double.infinity, width: double.infinity,
height: isPad() ? 290 : 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)),

View File

@ -57,11 +57,14 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
RestClient _client = await getClient(); RestClient _client = await getClient();
BaseStructureResult<List<JobFavoriteModel>> result = await _client.getListOfJobFavoriteNumber(widget.jobId); BaseStructureResult<List<JobFavoriteModel>> result = await _client.getListOfJobFavoriteNumber(widget.jobId);
if (result.success) { if (result.success) {
if (result.data?.isEmpty ?? true) {
favoriteMap = {};
}
result.data?.forEach((e) { result.data?.forEach((e) {
favoriteMap['${e.schoolId}+${e.gradeId}+${e.className}'] = e.count; favoriteMap['${e.schoolId}+${e.gradeId}+${e.className}'] = e.count;
}); });
toUpState(setState, () {}, mounted); toUpState(setState, () {}, mounted);
} } else {}
} }
Future<List<MarkingTasks>?> getData() async { Future<List<MarkingTasks>?> getData() async {
@ -268,12 +271,17 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
// //
void bookmarks(MarkingTasks task) { void bookmarks(MarkingTasks task) {
RouterManager.router.navigateTo( RouterManager.router
.navigateTo(
context, context,
RouterManager.jobFavoritePagePath + RouterManager.jobFavoritePagePath +
'?className=${Uri.encodeComponent(task.className)}&jobId=${widget.jobId}&schoolId=${task.dpcSchoolId}&gradeId=${task.dpcGradeId}&jobName=${Uri.encodeComponent(widget.jobName)}', '?className=${Uri.encodeComponent(task.className)}&jobId=${widget.jobId}&schoolId=${task.dpcSchoolId}&gradeId=${task.dpcGradeId}&jobName=${Uri.encodeComponent(widget.jobName)}',
transition: getTransition(), transition: getTransition(),
); )
.then((value) async {
_future = getData()
..then((value) => getListOfJobFavoritesData().then((value) => toUpState(setState, () {}, mounted)));
});
} }
// //

View File

@ -19,20 +19,14 @@ class QuickDataCheckPage extends StatefulWidget {
final int? schoolId; final int? schoolId;
final int? gradeId; final int? gradeId;
const QuickDataCheckPage( const QuickDataCheckPage({Key? key, required this.jobId, required this.className, this.schoolId, this.gradeId})
{Key? key,
required this.jobId,
required this.className,
this.schoolId,
this.gradeId})
: super(key: key); : super(key: key);
@override @override
State<QuickDataCheckPage> createState() => _QuickDataCheckPageState(); State<QuickDataCheckPage> createState() => _QuickDataCheckPageState();
} }
class _QuickDataCheckPageState extends State<QuickDataCheckPage> class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixin {
with CommonMixin {
JobDataReport? jobData; JobDataReport? jobData;
void initState() { void initState() {
@ -53,8 +47,7 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
params['gradeId'] = widget.gradeId; params['gradeId'] = widget.gradeId;
} }
BaseStructureResult<JobDataReport?> data = BaseStructureResult<JobDataReport?> data = await _client.getJobDataCenterReport(params);
await _client.getJobDataCenterReport(params);
EasyLoading.dismiss(); EasyLoading.dismiss();
if (data.code == 200) { if (data.code == 200) {
setState(() { setState(() {
@ -76,14 +69,10 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top), padding: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
height: MediaQuery.of(context).size.height, height: MediaQuery.of(context).size.height,
decoration: BoxDecoration( decoration: BoxDecoration(
gradient: LinearGradient( gradient: LinearGradient(begin: Alignment.topCenter, end: Alignment.bottomCenter, colors: [
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: [
Color(0xFF6889FD), Color(0xFF6889FD),
Color(0xFFF5F5F5), Color(0xFFF5F5F5),
], ], stops: [
stops: [
0.09, 0.09,
0.3 0.3
])), ])),
@ -105,7 +94,9 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
style: TextStyle(fontSize: 14.sp, color: Colors.white), style: TextStyle(fontSize: 14.sp, color: Colors.white),
)), )),
)), )),
SizedBox(width: 24.r,), SizedBox(
width: 24.r,
),
], ],
), ),
SizedBox(height: 10.r), SizedBox(height: 10.r),
@ -129,25 +120,22 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
), ),
Text( Text(
widget.className, widget.className,
style: TextStyle( style: TextStyle(fontSize: 14.r, color: Colors.white),
fontSize: 14.r, color: Colors.white),
) )
], ],
), ),
), ),
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 15.r, horizontal: 15.r),
vertical: 15.r, horizontal: 15.r), margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r),
margin: EdgeInsets.symmetric( decoration:
vertical: 10.r, horizontal: 14.r), BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(6.r))),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.all(Radius.circular(6.r))),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
SizedBox(height: 10.r,), SizedBox(
height: 10.r,
),
Row( Row(
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: [ children: [
@ -155,18 +143,14 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
width: 12.r, width: 12.r,
height: 12.r, height: 12.r,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF4CC793), color: Color(0xFF4CC793), borderRadius: BorderRadius.all(Radius.circular(7.r))),
borderRadius: BorderRadius.all(
Radius.circular(7.r))),
), ),
SizedBox( SizedBox(
width: 6.r, width: 6.r,
), ),
Text( Text(
'已提交', '已提交',
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF333333)),
fontSize: 12.sp,
color: Color(0xFF333333)),
), ),
SizedBox( SizedBox(
width: 35.r, width: 35.r,
@ -175,18 +159,14 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
width: 12.r, width: 12.r,
height: 12.r, height: 12.r,
decoration: BoxDecoration( decoration: BoxDecoration(
color: Color(0xFF6888FD), color: Color(0xFF6888FD), borderRadius: BorderRadius.all(Radius.circular(7.r))),
borderRadius: BorderRadius.all(
Radius.circular(7.r))),
), ),
SizedBox( SizedBox(
width: 6.r, width: 6.r,
), ),
Text( Text(
'未提交', '未提交',
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF333333)),
fontSize: 12.sp,
color: Color(0xFF333333)),
) )
], ],
), ),
@ -197,19 +177,13 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
PieChartData( PieChartData(
borderData: FlBorderData(show: false), borderData: FlBorderData(show: false),
sectionsSpace: 0, sectionsSpace: 0,
centerSpaceRadius: centerSpaceRadius: MediaQuery.of(context).size.width * 0.1,
MediaQuery.of(context).size.width * 0.1,
sections: [ sections: [
PieChartSectionData( PieChartSectionData(
color: Color(0xFF4CC793), color: Color(0xFF4CC793),
value: jobData!.validCount / value:
(jobData!.validCount + jobData!.validCount / (jobData!.validCount + jobData!.noAnswerCount) * 100,
jobData!.noAnswerCount) * radius: MediaQuery.of(context).size.width * 0.1 + 5,
100,
radius:
MediaQuery.of(context).size.width *
0.1 +
5,
title: '${jobData!.validCount}', title: '${jobData!.validCount}',
titleStyle: TextStyle( titleStyle: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
@ -219,12 +193,9 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
PieChartSectionData( PieChartSectionData(
color: Color(0xFF6888FD), color: Color(0xFF6888FD),
value: jobData!.noAnswerCount / value: jobData!.noAnswerCount /
(jobData!.validCount + (jobData!.validCount + jobData!.noAnswerCount) *
jobData!.noAnswerCount) *
100, 100,
radius: radius: MediaQuery.of(context).size.width * 0.1,
MediaQuery.of(context).size.width *
0.1,
title: '${jobData!.noAnswerCount}', title: '${jobData!.noAnswerCount}',
titleStyle: TextStyle( titleStyle: TextStyle(
fontSize: 14.sp, fontSize: 14.sp,
@ -237,27 +208,21 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
), ),
// //
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'客观题答题进度', '客观题答题进度',
style: TextStyle( style: TextStyle(fontSize: 10.sp, color: Color(0xFF8B8B8B)),
fontSize: 10.sp,
color: Color(0xFF8B8B8B)),
), ),
Text( Text(
'${doubleToStringAsFixed(jobData!.kgValidRate)}%', '${doubleToStringAsFixed(jobData!.kgValidRate)}%',
style: TextStyle( style: TextStyle(fontSize: 10.sp, color: Color(0xFF333333)),
fontSize: 10.sp,
color: Color(0xFF333333)),
), ),
], ],
), ),
SizedBox(height: 6.r), SizedBox(height: 6.r),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
flex: 10, flex: 10,
@ -276,27 +241,21 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
SizedBox(height: 20.r), SizedBox(height: 20.r),
// //
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Text( Text(
'主观题答题进度', '主观题答题进度',
style: TextStyle( style: TextStyle(fontSize: 10.sp, color: Color(0xFF8B8B8B)),
fontSize: 10.sp,
color: Color(0xFF8B8B8B)),
), ),
Text( Text(
'${doubleToStringAsFixed(jobData!.zgValidRate)}%', '${doubleToStringAsFixed(jobData!.zgValidRate)}%',
style: TextStyle( style: TextStyle(fontSize: 10.sp, color: Color(0xFF333333)),
fontSize: 10.sp,
color: Color(0xFF333333)),
), ),
], ],
), ),
SizedBox(height: 6.r), SizedBox(height: 6.r),
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Expanded( Expanded(
flex: 10, flex: 10,
@ -316,23 +275,29 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
), ),
), ),
Container( Container(
padding: EdgeInsets.symmetric( padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r),
vertical: 10.r, horizontal: 10.r), margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 14.r),
margin: EdgeInsets.symmetric( decoration:
vertical: 10.r, horizontal: 14.r), BoxDecoration(color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(6.r))),
decoration: BoxDecoration(
color: Colors.white,
borderRadius:
BorderRadius.all(Radius.circular(6.r))),
child: Column( child: Column(
children: [ children: [
InkWell( InkWell(
onTap: () { onTap: () {
if (jobData == null) return;
if (!jobData!.sortType) {
jobData!.studentDetails.sort((a, b) { jobData!.studentDetails.sort((a, b) {
int num1 = a.kgValidRate + a.zgValidRate; int num1 = a.kgValidRate + a.zgValidRate;
int num2 = b.kgValidRate + b.zgValidRate; int num2 = b.kgValidRate + b.zgValidRate;
return num2.compareTo(num1); return num2.compareTo(num1);
}); });
} else {
jobData!.studentDetails.sort((a, b) {
int num1 = a.kgValidRate + a.zgValidRate;
int num2 = b.kgValidRate + b.zgValidRate;
return num1.compareTo(num2);
});
}
jobData!.sortType = !jobData!.sortType;
setState(() { setState(() {
jobData!.studentDetails; jobData!.studentDetails;
}); });
@ -341,10 +306,8 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,
children: [ children: [
Text( Text(
'未提交排序', (jobData?.sortType ?? true) ? '未提交置顶' : '已提交置顶',
style: TextStyle( style: TextStyle(fontSize: 12.sp, color: Color(0xFF6888FD)),
fontSize: 12.sp,
color: Color(0xFF6888FD)),
), ),
SizedBox( SizedBox(
width: 10.r, width: 10.r,
@ -363,16 +326,9 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
SizedBox( SizedBox(
height: jobData!.studentDetails.length > 5 height: jobData!.studentDetails.length > 5
? 350.r ? 350.r
: jobData!.studentDetails.length * 50.r + : jobData!.studentDetails.length * 50.r + 40.r,
40.r,
child: QuickStudentDataTable( child: QuickStudentDataTable(
headList: [ headList: ['学生姓名', '客观题', '主观题', '客观题错题', '主观题错题'],
'学生姓名',
'客观题',
'主观题',
'客观题错题',
'主观题错题'
],
bodyList: jobData!.studentDetails, bodyList: jobData!.studentDetails,
jobId: widget.jobId, jobId: widget.jobId,
fixedRows: 1, fixedRows: 1,
@ -386,8 +342,7 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
), ),
)) ))
: Padding( : Padding(
padding: EdgeInsets.only( padding: EdgeInsets.only(top: MediaQuery.of(context).size.height / 2 - 200.r),
top: MediaQuery.of(context).size.height / 2 - 200.r),
child: MyEmptyWidget(), child: MyEmptyWidget(),
) )
], ],