处理列表
This commit is contained in:
parent
046f8cda4d
commit
02a7b748e1
|
|
@ -0,0 +1,91 @@
|
||||||
|
// GENERATED CODE - DO NOT MODIFY BY HAND
|
||||||
|
|
||||||
|
part of 'job_data_report.dart';
|
||||||
|
|
||||||
|
// **************************************************************************
|
||||||
|
// JsonSerializableGenerator
|
||||||
|
// **************************************************************************
|
||||||
|
|
||||||
|
JobDataReport _$JobDataReportFromJson(Map<String, dynamic> json) =>
|
||||||
|
JobDataReport(
|
||||||
|
json['jobId'] as int,
|
||||||
|
json['jobName'] as String,
|
||||||
|
json['gradeName'] as String,
|
||||||
|
json['className'] as String?,
|
||||||
|
json['validCount'] as int,
|
||||||
|
json['noAnswerCount'] as int,
|
||||||
|
(json['kgValidRate'] as num).toDouble(),
|
||||||
|
json['kgQuestionCount'] as int,
|
||||||
|
(json['zgValidRate'] as num).toDouble(),
|
||||||
|
json['zgQuestionCount'] as int,
|
||||||
|
(json['studentDetails'] as List<dynamic>)
|
||||||
|
.map((e) => StudentDetails.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$JobDataReportToJson(JobDataReport instance) =>
|
||||||
|
<String, dynamic>{
|
||||||
|
'jobId': instance.jobId,
|
||||||
|
'jobName': instance.jobName,
|
||||||
|
'gradeName': instance.gradeName,
|
||||||
|
'className': instance.className,
|
||||||
|
'validCount': instance.validCount,
|
||||||
|
'noAnswerCount': instance.noAnswerCount,
|
||||||
|
'kgValidRate': instance.kgValidRate,
|
||||||
|
'kgQuestionCount': instance.kgQuestionCount,
|
||||||
|
'zgValidRate': instance.zgValidRate,
|
||||||
|
'zgQuestionCount': instance.zgQuestionCount,
|
||||||
|
'studentDetails': instance.studentDetails,
|
||||||
|
};
|
||||||
|
|
||||||
|
StudentDetails _$StudentDetailsFromJson(Map<String, dynamic> json) =>
|
||||||
|
StudentDetails(
|
||||||
|
json['studentId'] as int,
|
||||||
|
json['studentName'] as String,
|
||||||
|
json['kgValidCount'] as int,
|
||||||
|
json['kgValidRate'] as int,
|
||||||
|
json['zgValidCount'] as int,
|
||||||
|
json['zgValidRate'] as int,
|
||||||
|
(json['kgDetails'] as List<dynamic>)
|
||||||
|
.map((e) => KgDetails.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
(json['zgDetails'] as List<dynamic>)
|
||||||
|
.map((e) => KgDetails.fromJson(e as Map<String, dynamic>))
|
||||||
|
.toList(),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$StudentDetailsToJson(StudentDetails instance) =>
|
||||||
|
<String, dynamic>{
|
||||||
|
'studentId': instance.studentId,
|
||||||
|
'studentName': instance.studentName,
|
||||||
|
'kgValidCount': instance.kgValidCount,
|
||||||
|
'kgValidRate': instance.kgValidRate,
|
||||||
|
'zgValidCount': instance.zgValidCount,
|
||||||
|
'zgValidRate': instance.zgValidRate,
|
||||||
|
'kgDetails': instance.kgDetails,
|
||||||
|
'zgDetails': instance.zgDetails,
|
||||||
|
};
|
||||||
|
|
||||||
|
KgDetails _$KgDetailsFromJson(Map<String, dynamic> json) => KgDetails(
|
||||||
|
json['questionNo'] as String,
|
||||||
|
json['questionId'] as int,
|
||||||
|
json['partName'] as String,
|
||||||
|
json['state'] as int,
|
||||||
|
json['studentAnswer'] as String?,
|
||||||
|
json['questionAnswer'] as String?,
|
||||||
|
json['useTime'] as int?,
|
||||||
|
json['annotateAnswers'] as String?,
|
||||||
|
(json['score'] as num?)?.toDouble(),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> _$KgDetailsToJson(KgDetails instance) => <String, dynamic>{
|
||||||
|
'questionNo': instance.questionNo,
|
||||||
|
'questionId': instance.questionId,
|
||||||
|
'partName': instance.partName,
|
||||||
|
'state': instance.state,
|
||||||
|
'studentAnswer': instance.studentAnswer,
|
||||||
|
'questionAnswer': instance.questionAnswer,
|
||||||
|
'useTime': instance.useTime,
|
||||||
|
'annotateAnswers': instance.annotateAnswers,
|
||||||
|
'score': instance.score,
|
||||||
|
};
|
||||||
|
|
@ -56,6 +56,8 @@ class JobTaskItem extends Object {
|
||||||
@JsonKey(name: 'markingTypeEnum')
|
@JsonKey(name: 'markingTypeEnum')
|
||||||
JobMarkingTypeEnum markingTypeEnum; // 考试类型
|
JobMarkingTypeEnum markingTypeEnum; // 考试类型
|
||||||
|
|
||||||
|
int taskCount; // 参与班级数量
|
||||||
|
|
||||||
JobTaskItem(
|
JobTaskItem(
|
||||||
this.id,
|
this.id,
|
||||||
this.title,
|
this.title,
|
||||||
|
|
@ -72,6 +74,7 @@ class JobTaskItem extends Object {
|
||||||
// this.markingTasks,
|
// this.markingTasks,
|
||||||
this.createTime,
|
this.createTime,
|
||||||
this.markingType,
|
this.markingType,
|
||||||
|
this.taskCount,
|
||||||
{this.progressPercentage = 0,
|
{this.progressPercentage = 0,
|
||||||
this.markingTypeEnum = JobMarkingTypeEnum.UNUSED}) {
|
this.markingTypeEnum = JobMarkingTypeEnum.UNUSED}) {
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
|
|
@ -21,12 +21,22 @@ class MarkingListParams extends BasePage {
|
||||||
@JsonKey(name: 'PageType')
|
@JsonKey(name: 'PageType')
|
||||||
int pageType;
|
int pageType;
|
||||||
|
|
||||||
|
String? startTime;
|
||||||
|
String? endTime;
|
||||||
|
|
||||||
|
int? markingType; // 1 作业 2考试
|
||||||
|
|
||||||
MarkingListParams({
|
MarkingListParams({
|
||||||
required this.isFinish,
|
required this.isFinish,
|
||||||
required this.pageType,
|
required this.pageType,
|
||||||
required page,
|
required page,
|
||||||
required limit,
|
required limit,
|
||||||
}) : super(page, limit);
|
this.markingType,
|
||||||
|
this.startTime,
|
||||||
|
this.endTime,
|
||||||
|
}) : super(page, limit) {
|
||||||
|
this.markingType ??= 1;
|
||||||
|
}
|
||||||
|
|
||||||
factory MarkingListParams.fromJson(Map<String, dynamic> srcJson) => _$MarkingListParamsFromJson(srcJson);
|
factory MarkingListParams.fromJson(Map<String, dynamic> srcJson) => _$MarkingListParamsFromJson(srcJson);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ import 'dart:async';
|
||||||
|
|
||||||
import 'package:connectivity_plus/connectivity_plus.dart';
|
import 'package:connectivity_plus/connectivity_plus.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
||||||
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
||||||
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
|
@ -83,6 +84,28 @@ class _MyAppState extends State<MyApp> {
|
||||||
title: '远轩阅卷系统',
|
title: '远轩阅卷系统',
|
||||||
navigatorKey: TheGlobal.navigatorKey,
|
navigatorKey: TheGlobal.navigatorKey,
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
|
// locale: const Locale('zh', 'CN'), // 中文简体 ,
|
||||||
|
// supportedLocales: [
|
||||||
|
// const Locale('zh', 'CN'), // 中文简体
|
||||||
|
// // 其他支持的locale可以在这里添加
|
||||||
|
// ],
|
||||||
|
// 这里是国际化支持,确保添加flutter_localizations依赖
|
||||||
|
supportedLocales: [
|
||||||
|
const Locale('zh', 'CN'), // 中文简体
|
||||||
|
// 其他支持的locale可以在这里添加
|
||||||
|
],
|
||||||
|
localizationsDelegates: [
|
||||||
|
// ...其他delegates
|
||||||
|
GlobalMaterialLocalizations.delegate,
|
||||||
|
GlobalWidgetsLocalizations.delegate,
|
||||||
|
GlobalCupertinoLocalizations.delegate, // 如果你使用了Cupertino风格的组件
|
||||||
|
// ...添加其他必要的delegates
|
||||||
|
],
|
||||||
|
localeResolutionCallback: (locale, supportedLocales) {
|
||||||
|
// 在这里可以实现自定义的locale解析逻辑
|
||||||
|
// 如果需要,返回你想要的Locale对象
|
||||||
|
return locale;
|
||||||
|
},
|
||||||
theme: ThemeData(
|
theme: ThemeData(
|
||||||
primarySwatch: createMaterialColor(const Color.fromRGBO(46, 91, 255, 1)),
|
primarySwatch: createMaterialColor(const Color.fromRGBO(46, 91, 255, 1)),
|
||||||
// textTheme: Typography.englishLike2018.apply(fontSizeFactor: 1.sp,),
|
// textTheme: Typography.englishLike2018.apply(fontSizeFactor: 1.sp,),
|
||||||
|
|
|
||||||
|
|
@ -357,29 +357,6 @@ Widget $theTabBar({required TabController controller, ValueChanged<int>? onTap})
|
||||||
isScrollable: true,
|
isScrollable: true,
|
||||||
labelColor: const Color.fromRGBO(45, 56, 76, 1),
|
labelColor: const Color.fromRGBO(45, 56, 76, 1),
|
||||||
indicatorSize: TabBarIndicatorSize.label, // 设置指示器高度和标签一样高
|
indicatorSize: TabBarIndicatorSize.label, // 设置指示器高度和标签一样高
|
||||||
// labelPadding: EdgeInsets.symmetric(vertical: 0), // 设置标签的内边距
|
|
||||||
// background: linear-gradient(270deg, #2E5BFF 30.23%, rgba(46, 91, 255, 0.00) 96.59%);
|
|
||||||
// indicatorColor: RectangleIndicator(),
|
|
||||||
// indicator: BoxDecoration(
|
|
||||||
// gradient: LinearGradient(
|
|
||||||
// begin: Alignment.centerLeft,
|
|
||||||
// end: Alignment.centerRight,
|
|
||||||
// colors: [
|
|
||||||
// Color.fromRGBO(46, 91, 255, 0.00),
|
|
||||||
// Color(0xFF2E5BFF),
|
|
||||||
// ],
|
|
||||||
// stops: [0.3023, 0.9659],
|
|
||||||
// // transform: GradientRotation(3.14 / 2), //将270度转换为弧度
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// indicator: BoxDecoration(
|
|
||||||
// // 设置指示器样式
|
|
||||||
// gradient: LinearGradient(
|
|
||||||
// colors: [Colors.yellow, Colors.green], // 设置渐变色
|
|
||||||
// begin: Alignment.centerLeft,
|
|
||||||
// end: Alignment.centerRight,
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
onTap: onTap,
|
onTap: onTap,
|
||||||
tabs: const <Widget>[Tab(text: '阅卷'), Tab(text: '作业')],
|
tabs: const <Widget>[Tab(text: '阅卷'), Tab(text: '作业')],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -145,154 +145,161 @@ class HomeworkTasksViewItem extends StatelessWidget with CommonMixin {
|
||||||
@hwidget
|
@hwidget
|
||||||
Widget $completedHomeworkView(BuildContext context,
|
Widget $completedHomeworkView(BuildContext context,
|
||||||
{required JobTaskItem jobTaskItem, required ShowStudentsCall showStudentsCall}) {
|
{required JobTaskItem jobTaskItem, required ShowStudentsCall showStudentsCall}) {
|
||||||
return Container(
|
return InkWell(
|
||||||
width: double.infinity,
|
onTap: () {
|
||||||
padding: EdgeInsets.only(top: 20.h),
|
String url =
|
||||||
margin: EdgeInsets.only(bottom: 12.h),
|
'${RouterManager.jobListParticipateInClassPath}?&jobId=${jobTaskItem.id}&genderName=${Uri.encodeComponent(jobTaskItem.genderName)}&jobName=${Uri.encodeComponent(jobTaskItem.title)}&completed=${true}';
|
||||||
decoration: BoxDecoration(
|
RouterManager.router.navigateTo(context, url, transition: getTransition());
|
||||||
borderRadius: BorderRadius.circular(6.r),
|
},
|
||||||
color: const Color.fromRGBO(255, 255, 255, 1),
|
child: Container(
|
||||||
boxShadow: [
|
width: double.infinity,
|
||||||
BoxShadow(
|
padding: EdgeInsets.only(top: 20.h),
|
||||||
color: const Color.fromRGBO(210, 216, 241, 1),
|
margin: EdgeInsets.only(bottom: 12.h),
|
||||||
offset: Offset.zero, //阴影y轴偏移量
|
decoration: BoxDecoration(
|
||||||
blurRadius: 5.8, //阴影模糊程度
|
borderRadius: BorderRadius.circular(6.r),
|
||||||
spreadRadius: 0, //阴影扩散程度
|
color: const Color.fromRGBO(255, 255, 255, 1),
|
||||||
)
|
boxShadow: [
|
||||||
],
|
BoxShadow(
|
||||||
),
|
color: const Color.fromRGBO(210, 216, 241, 1),
|
||||||
child: Column(
|
offset: Offset.zero, //阴影y轴偏移量
|
||||||
children: [
|
blurRadius: 5.8, //阴影模糊程度
|
||||||
// 顶部任务名称
|
spreadRadius: 0, //阴影扩散程度
|
||||||
Padding(
|
)
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
],
|
||||||
child: Row(
|
),
|
||||||
children: [
|
child: Column(
|
||||||
Container(
|
children: [
|
||||||
width: 32.w,
|
// 顶部任务名称
|
||||||
height: 18.h,
|
Padding(
|
||||||
alignment: Alignment.center,
|
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||||
padding: EdgeInsets.only(left: 2.w),
|
child: Row(
|
||||||
decoration: BoxDecoration(
|
children: [
|
||||||
color: Color.fromRGBO(104, 136, 253, 1),
|
Container(
|
||||||
borderRadius: BorderRadius.only(
|
width: 32.w,
|
||||||
topLeft: Radius.circular(18.r),
|
height: 18.h,
|
||||||
topRight: Radius.circular(3.r),
|
alignment: Alignment.center,
|
||||||
bottomLeft: Radius.circular(4.r),
|
padding: EdgeInsets.only(left: 2.w),
|
||||||
bottomRight: Radius.circular(4.r),
|
decoration: BoxDecoration(
|
||||||
|
color: Color.fromRGBO(104, 136, 253, 1),
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(18.r),
|
||||||
|
topRight: Radius.circular(3.r),
|
||||||
|
bottomLeft: Radius.circular(4.r),
|
||||||
|
bottomRight: Radius.circular(4.r),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
|
margin: EdgeInsets.only(right: 4.w),
|
||||||
|
child: quickText('作业', color: Colors.white, size: 10.sp),
|
||||||
),
|
),
|
||||||
margin: EdgeInsets.only(right: 4.w),
|
quickText(
|
||||||
child: quickText('作业', color: Colors.white, size: 10.sp),
|
jobTaskItem.title,
|
||||||
),
|
size: 16.sp,
|
||||||
quickText(
|
color: Color.fromRGBO(70, 70, 70, 1),
|
||||||
jobTaskItem.title,
|
fontWeight: FontWeight.bold,
|
||||||
size: 16.sp,
|
)
|
||||||
color: Color.fromRGBO(70, 70, 70, 1),
|
],
|
||||||
fontWeight: FontWeight.bold,
|
),
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 12.h),
|
SizedBox(height: 12.h),
|
||||||
Padding(
|
Padding(
|
||||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
quickText(
|
quickText(
|
||||||
jobTaskItem.createTime.substring(0, 10),
|
jobTaskItem.createTime.substring(0, 10),
|
||||||
color: Color.fromRGBO(97, 97, 97, 1),
|
color: Color.fromRGBO(97, 97, 97, 1),
|
||||||
size: 14.sp,
|
size: 14.sp,
|
||||||
fontWeight: FontWeight.w500,
|
fontWeight: FontWeight.w500,
|
||||||
),
|
),
|
||||||
quickText(' / ', color: Color.fromRGBO(76, 199, 147, 1), size: 12.sp, fontWeight: FontWeight.w500),
|
quickText(' / ', color: Color.fromRGBO(76, 199, 147, 1), size: 12.sp, fontWeight: FontWeight.w500),
|
||||||
quickText(
|
quickText(
|
||||||
'参与班级:字段待定',
|
'参与班级:${jobTaskItem.taskCount}',
|
||||||
color: Color.fromRGBO(76, 199, 147, 1),
|
color: Color.fromRGBO(76, 199, 147, 1),
|
||||||
size: 12.sp,
|
size: 12.sp,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
quickText(' / ', color: Color.fromRGBO(116, 145, 253, 1), size: 12.sp, fontWeight: FontWeight.w500),
|
quickText(' / ', color: Color.fromRGBO(116, 145, 253, 1), size: 12.sp, fontWeight: FontWeight.w500),
|
||||||
quickText(
|
quickText(
|
||||||
'科目:' + jobTaskItem.subjectName,
|
'科目:' + jobTaskItem.subjectName,
|
||||||
color: Color.fromRGBO(116, 145, 253, 1),
|
color: Color.fromRGBO(116, 145, 253, 1),
|
||||||
size: 12.sp,
|
size: 12.sp,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
|
||||||
|
|
||||||
SizedBox(height: 20.h),
|
SizedBox(height: 20.h),
|
||||||
Container(
|
Container(
|
||||||
padding: EdgeInsets.symmetric(vertical: 8.h),
|
padding: EdgeInsets.symmetric(vertical: 8.h),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)),
|
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)),
|
||||||
color: Colors.white,
|
color: Colors.white,
|
||||||
boxShadow: [
|
boxShadow: [
|
||||||
BoxShadow(
|
BoxShadow(
|
||||||
color: const Color.fromRGBO(0, 0, 0, 0.15),
|
color: const Color.fromRGBO(0, 0, 0, 0.15),
|
||||||
offset: Offset(0, -0.0001), //阴影y轴偏移量
|
offset: Offset(0, -0.0001), //阴影y轴偏移量
|
||||||
blurRadius: 4, //阴影模糊程度
|
blurRadius: 4, //阴影模糊程度
|
||||||
spreadRadius: 0, //阴影扩散程度
|
spreadRadius: 0, //阴影扩散程度
|
||||||
)
|
)
|
||||||
],
|
],
|
||||||
|
),
|
||||||
|
child: Row(children: [
|
||||||
|
Expanded(
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => easyThrottle('go_to_homework_report', () => {}),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
]),
|
||||||
),
|
),
|
||||||
child: Row(children: [
|
// $CompletedHomeworkInfoBox(
|
||||||
Expanded(
|
// segmentation: false,
|
||||||
child: InkWell(
|
// showStudentsCall: showStudentsCall,
|
||||||
onTap: () => easyThrottle('go_to_homework_report', () => {}),
|
// unsubmittedQuantity: jobTaskItem.studentCount - jobTaskItem.commitStudentCount,
|
||||||
child: Container(
|
// submittedQuantity: jobTaskItem.commitStudentCount,
|
||||||
alignment: Alignment.center,
|
// precision: jobTaskItem.precision / 100,
|
||||||
child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp),
|
// objectivePrecision: jobTaskItem.objectivePrecision / 100,
|
||||||
),
|
// subjectivePrecision: jobTaskItem.subjectivePrecision / 100,
|
||||||
)),
|
// ),
|
||||||
]),
|
// InkWell(
|
||||||
),
|
// onTap: () {
|
||||||
// $CompletedHomeworkInfoBox(
|
// RouterManager.router.navigateTo(
|
||||||
// segmentation: false,
|
// context,
|
||||||
// showStudentsCall: showStudentsCall,
|
// RouterManager.jobReportPagePath + '?title=${Uri.encodeComponent(jobTaskItem.title)}&id=${jobTaskItem.id}',
|
||||||
// unsubmittedQuantity: jobTaskItem.studentCount - jobTaskItem.commitStudentCount,
|
// transition: getTransition(),
|
||||||
// submittedQuantity: jobTaskItem.commitStudentCount,
|
// );
|
||||||
// precision: jobTaskItem.precision / 100,
|
// },
|
||||||
// objectivePrecision: jobTaskItem.objectivePrecision / 100,
|
// child: Row(
|
||||||
// subjectivePrecision: jobTaskItem.subjectivePrecision / 100,
|
// children: [
|
||||||
// ),
|
// Expanded(flex: 1, child: SizedBox()),
|
||||||
// InkWell(
|
// Expanded(
|
||||||
// onTap: () {
|
// flex: 9,
|
||||||
// RouterManager.router.navigateTo(
|
// child: Container(
|
||||||
// context,
|
// alignment: Alignment.center,
|
||||||
// RouterManager.jobReportPagePath + '?title=${Uri.encodeComponent(jobTaskItem.title)}&id=${jobTaskItem.id}',
|
// margin: EdgeInsets.only(top: 20.h),
|
||||||
// transition: getTransition(),
|
// padding: EdgeInsets.symmetric(vertical: 7.h),
|
||||||
// );
|
// decoration: BoxDecoration(
|
||||||
// },
|
// borderRadius: BorderRadius.circular(20),
|
||||||
// child: Row(
|
// gradient: LinearGradient(
|
||||||
// children: [
|
// begin: Alignment.centerLeft,
|
||||||
// Expanded(flex: 1, child: SizedBox()),
|
// end: Alignment.centerRight,
|
||||||
// Expanded(
|
// colors: [Color.fromRGBO(95, 197, 255, 1), Color.fromRGBO(61, 68, 255, 0.82)],
|
||||||
// flex: 9,
|
// ),
|
||||||
// child: Container(
|
// ),
|
||||||
// alignment: Alignment.center,
|
// child: quickText('查看报告', color: Colors.white, size: 12.sp),
|
||||||
// margin: EdgeInsets.only(top: 20.h),
|
// ),
|
||||||
// padding: EdgeInsets.symmetric(vertical: 7.h),
|
// ),
|
||||||
// decoration: BoxDecoration(
|
// Expanded(flex: 1, child: SizedBox()),
|
||||||
// borderRadius: BorderRadius.circular(20),
|
// ],
|
||||||
// gradient: LinearGradient(
|
// ),
|
||||||
// begin: Alignment.centerLeft,
|
// )
|
||||||
// end: Alignment.centerRight,
|
],
|
||||||
// colors: [Color.fromRGBO(95, 197, 255, 1), Color.fromRGBO(61, 68, 255, 0.82)],
|
),
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// child: quickText('查看报告', color: Colors.white, size: 12.sp),
|
|
||||||
// ),
|
|
||||||
// ),
|
|
||||||
// Expanded(flex: 1, child: SizedBox()),
|
|
||||||
// ],
|
|
||||||
// ),
|
|
||||||
// )
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
@ -654,13 +661,6 @@ Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskIt
|
||||||
),
|
),
|
||||||
backgroundColor: Color.fromRGBO(244, 244, 244, 1),
|
backgroundColor: Color.fromRGBO(244, 244, 244, 1),
|
||||||
),
|
),
|
||||||
// Container(
|
|
||||||
// child: Container(
|
|
||||||
// color: Colors.red,
|
|
||||||
// height: 40.r,
|
|
||||||
// width: 40.r,
|
|
||||||
// )
|
|
||||||
// ),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
|
import 'package:flutter_hooks/flutter_hooks.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';
|
||||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||||
|
|
@ -18,6 +19,7 @@ import 'package:marking_app/common/config/request_config.dart';
|
||||||
import 'package:marking_app/common/model/job/job_task_item.dart';
|
import 'package:marking_app/common/model/job/job_task_item.dart';
|
||||||
import 'package:marking_app/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart';
|
import 'package:marking_app/pages/homework_correction/components/new_version_of_homework/homework_tasks_view_item.dart';
|
||||||
import 'package:marking_app/provider/review_provider.dart';
|
import 'package:marking_app/provider/review_provider.dart';
|
||||||
|
import 'package:marking_app/routes/RouterManager.dart';
|
||||||
import 'package:marking_app/utils/index.dart';
|
import 'package:marking_app/utils/index.dart';
|
||||||
import 'package:marking_app/utils/my_text.dart';
|
import 'package:marking_app/utils/my_text.dart';
|
||||||
import 'package:marking_app/utils/request/rest_client.dart';
|
import 'package:marking_app/utils/request/rest_client.dart';
|
||||||
|
|
@ -25,6 +27,7 @@ import 'package:marking_app/common/model/common/base_page_data.dart';
|
||||||
import 'package:marking_app/common/model/marking/marking_list_params.dart';
|
import 'package:marking_app/common/model/marking/marking_list_params.dart';
|
||||||
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
|
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
|
||||||
import 'package:marking_app/utils/easy_refresh/mixin/refresh_data_handle.dart';
|
import 'package:marking_app/utils/easy_refresh/mixin/refresh_data_handle.dart';
|
||||||
|
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
|
||||||
|
|
||||||
part 'index.g.dart';
|
part 'index.g.dart';
|
||||||
|
|
||||||
|
|
@ -39,7 +42,7 @@ class HomeworkCorrection extends StatefulHookConsumerWidget {
|
||||||
class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
|
class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
|
||||||
with
|
with
|
||||||
CommonMixin,
|
CommonMixin,
|
||||||
SingleTickerProviderStateMixin,
|
TickerProviderStateMixin,
|
||||||
RefreshDataHandle<JobTaskItem, MarkingListParams>,
|
RefreshDataHandle<JobTaskItem, MarkingListParams>,
|
||||||
AutomaticKeepAliveClientMixin {
|
AutomaticKeepAliveClientMixin {
|
||||||
@override
|
@override
|
||||||
|
|
@ -47,6 +50,8 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
|
||||||
|
|
||||||
/* Tab控制器 */
|
/* Tab控制器 */
|
||||||
late TabController _tabController;
|
late TabController _tabController;
|
||||||
|
late TabController _tabController2;
|
||||||
|
|
||||||
int _tabIndex = 0;
|
int _tabIndex = 0;
|
||||||
bool completedToRefresh = true;
|
bool completedToRefresh = true;
|
||||||
|
|
||||||
|
|
@ -95,6 +100,7 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
|
||||||
length: 2,
|
length: 2,
|
||||||
vsync: this,
|
vsync: this,
|
||||||
);
|
);
|
||||||
|
_tabController2 = TabController(length: 4, vsync: this);
|
||||||
_refreshController1 = EasyRefreshController();
|
_refreshController1 = EasyRefreshController();
|
||||||
_refreshController2 = EasyRefreshController();
|
_refreshController2 = EasyRefreshController();
|
||||||
|
|
||||||
|
|
@ -117,6 +123,7 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
|
||||||
if (_currentTaskIdListener != null) {
|
if (_currentTaskIdListener != null) {
|
||||||
_currentTaskIdListener!();
|
_currentTaskIdListener!();
|
||||||
}
|
}
|
||||||
|
_tabController2.dispose();
|
||||||
_tabController.dispose();
|
_tabController.dispose();
|
||||||
_refreshController1.dispose();
|
_refreshController1.dispose();
|
||||||
_refreshController2.dispose();
|
_refreshController2.dispose();
|
||||||
|
|
@ -169,10 +176,7 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
|
||||||
child: Row(
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(flex: 1, child: SizedBox()),
|
||||||
flex: 1,
|
|
||||||
child: SizedBox(),
|
|
||||||
),
|
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 4,
|
flex: 4,
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
@ -263,6 +267,29 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
if (_tabIndex == 1)
|
||||||
|
$CompletedJobConditionFilter(
|
||||||
|
controller: _tabController2,
|
||||||
|
jobType: params2.markingType ?? 1,
|
||||||
|
customTime: _tabController2.index != 3 || (params2.startTime == null && params2.endTime == null)
|
||||||
|
? null
|
||||||
|
: PickerDateRange(
|
||||||
|
params2.startTime == null ? null : DateTime.parse(params2.startTime!),
|
||||||
|
params2.endTime == null ? null : DateTime.parse(params2.endTime!),
|
||||||
|
),
|
||||||
|
onJobTypeTap: (int jobTypeVal) {
|
||||||
|
params2.markingType = jobTypeVal;
|
||||||
|
_refreshController2.callRefresh();
|
||||||
|
},
|
||||||
|
onTimeFilter: (String? startTime, String? endTime) {
|
||||||
|
if (startTime == null && endTime == null && _tabController2.index == 3) {
|
||||||
|
_tabController2.animateTo(0);
|
||||||
|
}
|
||||||
|
params2.endTime = endTime;
|
||||||
|
params2.startTime = startTime;
|
||||||
|
_refreshController2.callRefresh();
|
||||||
|
},
|
||||||
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
child: IndexedStack(
|
child: IndexedStack(
|
||||||
index: _tabIndex,
|
index: _tabIndex,
|
||||||
|
|
@ -350,111 +377,336 @@ Widget $easyRefresh({
|
||||||
@swidget
|
@swidget
|
||||||
Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
|
Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
|
||||||
EdgeInsets padEdg = EdgeInsets.symmetric(horizontal: 10.w);
|
EdgeInsets padEdg = EdgeInsets.symmetric(horizontal: 10.w);
|
||||||
return Container(
|
return InkWell(
|
||||||
padding: EdgeInsets.only(top: 10.h),
|
onTap: () {
|
||||||
decoration: BoxDecoration(
|
String url =
|
||||||
borderRadius: BorderRadius.circular(6.r),
|
'${RouterManager.jobListParticipateInClassPath}?&jobId=${jobTaskItem.id}&genderName=${Uri.encodeComponent(jobTaskItem.genderName)}&jobName=${Uri.encodeComponent(jobTaskItem.title)}&completed=${true}';
|
||||||
color: Colors.white,
|
RouterManager.router.navigateTo(context, url, transition: getTransition());
|
||||||
boxShadow: [
|
},
|
||||||
BoxShadow(
|
child: Container(
|
||||||
color: const Color.fromRGBO(210, 216, 241, 1),
|
padding: EdgeInsets.only(top: 10.h),
|
||||||
offset: Offset.zero, //阴影y轴偏移量
|
decoration: BoxDecoration(
|
||||||
blurRadius: 5.8, //阴影模糊程度
|
borderRadius: BorderRadius.circular(6.r),
|
||||||
spreadRadius: 0, //阴影扩散程度
|
color: Colors.white,
|
||||||
)
|
boxShadow: [
|
||||||
],
|
BoxShadow(
|
||||||
),
|
color: const Color.fromRGBO(210, 216, 241, 1),
|
||||||
child: Column(
|
offset: Offset.zero, //阴影y轴偏移量
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
blurRadius: 5.8, //阴影模糊程度
|
||||||
children: [
|
spreadRadius: 0, //阴影扩散程度
|
||||||
// 顶部任务名称
|
)
|
||||||
Padding(
|
],
|
||||||
padding: padEdg,
|
),
|
||||||
child: Row(
|
child: Column(
|
||||||
children: [
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
Container(
|
children: [
|
||||||
width: 32.w,
|
// 顶部任务名称
|
||||||
height: 18.h,
|
Padding(
|
||||||
alignment: Alignment.center,
|
padding: padEdg,
|
||||||
padding: EdgeInsets.only(left: 2.w),
|
child: Row(
|
||||||
decoration: BoxDecoration(
|
children: [
|
||||||
color: jobTaskItem.markingTypeEnum.name == '作业'
|
Container(
|
||||||
? const Color.fromRGBO(104, 136, 253, 1)
|
width: 32.w,
|
||||||
: const Color.fromRGBO(255, 175, 56, 1),
|
height: 18.h,
|
||||||
borderRadius: BorderRadius.only(
|
alignment: Alignment.center,
|
||||||
topLeft: Radius.circular(18.r),
|
padding: EdgeInsets.only(left: 2.w),
|
||||||
topRight: Radius.circular(3.r),
|
decoration: BoxDecoration(
|
||||||
bottomLeft: Radius.circular(4.r),
|
color: jobTaskItem.markingTypeEnum.name == '作业'
|
||||||
bottomRight: Radius.circular(4.r),
|
? const Color.fromRGBO(104, 136, 253, 1)
|
||||||
|
: const Color.fromRGBO(255, 175, 56, 1),
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(18.r),
|
||||||
|
topRight: Radius.circular(3.r),
|
||||||
|
bottomLeft: Radius.circular(4.r),
|
||||||
|
bottomRight: Radius.circular(4.r),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
margin: EdgeInsets.only(right: 4.w),
|
||||||
|
child: quickText(jobTaskItem.markingTypeEnum.name, color: Colors.white, size: 10.sp),
|
||||||
|
),
|
||||||
|
quickText(
|
||||||
|
jobTaskItem.title,
|
||||||
|
size: 16.sp,
|
||||||
|
color: Color.fromRGBO(70, 70, 70, 1),
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Padding(
|
||||||
|
padding: padEdg,
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
quickText(
|
||||||
|
jobTaskItem.createTime.substring(0, 10),
|
||||||
|
color: Color.fromRGBO(97, 97, 97, 1),
|
||||||
|
size: 10.sp,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
quickText(' / ', color: Color.fromRGBO(76, 199, 147, 1), size: 10.sp, fontWeight: FontWeight.w500),
|
||||||
|
quickText(
|
||||||
|
'参与班级:${jobTaskItem.taskCount}',
|
||||||
|
color: Color.fromRGBO(76, 199, 147, 1),
|
||||||
|
size: 10.sp,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
quickText(' / ', color: Color.fromRGBO(116, 145, 253, 1), size: 10.sp, fontWeight: FontWeight.w500),
|
||||||
|
quickText(
|
||||||
|
'科目:' + jobTaskItem.subjectName,
|
||||||
|
color: Color.fromRGBO(116, 145, 253, 1),
|
||||||
|
size: 10.sp,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () => easyThrottle('go_to_homework_report', () {
|
||||||
|
print('子级点击方法');
|
||||||
|
}),
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 6.h),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)),
|
||||||
|
color: Colors.white,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: const Color.fromRGBO(0, 0, 0, 0.15),
|
||||||
|
offset: Offset(0, -0.0001), //阴影y轴偏移量
|
||||||
|
blurRadius: 4, //阴影模糊程度
|
||||||
|
spreadRadius: 0, //阴影扩散程度
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Row(children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 11.sp),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
margin: EdgeInsets.only(right: 4.w),
|
]),
|
||||||
child: quickText(jobTaskItem.markingTypeEnum.name, color: Colors.white, size: 10.sp),
|
),
|
||||||
),
|
|
||||||
quickText(
|
|
||||||
jobTaskItem.title,
|
|
||||||
size: 16.sp,
|
|
||||||
color: Color.fromRGBO(70, 70, 70, 1),
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
Padding(
|
// 筛选时间
|
||||||
padding: padEdg,
|
@swidget
|
||||||
child: Row(
|
Widget $theTabBar({required TabController controller, ValueChanged<int>? onTap, PickerDateRange? customTime}) {
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
var customTimeStr = '自定义';
|
||||||
children: [
|
if (customTime != null) {
|
||||||
quickText(
|
customTimeStr = customTime.startDate?.toString().substring(0, 10) ?? '';
|
||||||
jobTaskItem.createTime.substring(0, 10),
|
if (customTime.endDate != null) {
|
||||||
color: Color.fromRGBO(97, 97, 97, 1),
|
print(customTime.startDate!.year == customTime.endDate!.year);
|
||||||
size: 10.sp,
|
if (!isPad() && customTime.startDate!.year == customTime.endDate!.year) {
|
||||||
fontWeight: FontWeight.w500,
|
customTimeStr =
|
||||||
),
|
customTime.startDate.toString().substring(5, 10) + '~${customTime.endDate.toString().substring(5, 10)}';
|
||||||
quickText(' / ', color: Color.fromRGBO(76, 199, 147, 1), size: 10.sp, fontWeight: FontWeight.w500),
|
} else {
|
||||||
quickText(
|
customTimeStr += '~${customTime.endDate?.toString().substring(0, 10)}';
|
||||||
'参与班级:2',
|
}
|
||||||
color: Color.fromRGBO(76, 199, 147, 1),
|
}
|
||||||
size: 10.sp,
|
}
|
||||||
fontWeight: FontWeight.w600,
|
return Container(
|
||||||
),
|
alignment: Alignment.centerLeft,
|
||||||
quickText(' / ', color: Color.fromRGBO(116, 145, 253, 1), size: 10.sp, fontWeight: FontWeight.w500),
|
child: TabBar(
|
||||||
quickText(
|
controller: controller,
|
||||||
'科目:' + jobTaskItem.subjectName,
|
unselectedLabelStyle: TextStyle(fontSize: 12.sp, color: const Color.fromRGBO(102, 102, 102, 1)),
|
||||||
color: Color.fromRGBO(116, 145, 253, 1),
|
labelStyle: TextStyle(
|
||||||
size: 10.sp,
|
fontSize: 12.sp,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.bold,
|
||||||
),
|
color: Color.fromRGBO(116, 145, 253, 1),
|
||||||
],
|
),
|
||||||
),
|
isScrollable: true,
|
||||||
),
|
labelColor: const Color.fromRGBO(45, 56, 76, 1),
|
||||||
|
indicatorSize: TabBarIndicatorSize.label, // 设置指示器高度和标签一样高
|
||||||
Container(
|
onTap: onTap,
|
||||||
padding: EdgeInsets.symmetric(vertical: 6.h),
|
tabs: <Widget>[
|
||||||
decoration: BoxDecoration(
|
const Tab(text: '全部'),
|
||||||
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)),
|
const Tab(text: '近一周'),
|
||||||
color: Colors.white,
|
const Tab(text: '近一月'),
|
||||||
boxShadow: [
|
Tab(text: customTimeStr),
|
||||||
BoxShadow(
|
],
|
||||||
color: const Color.fromRGBO(0, 0, 0, 0.15),
|
),
|
||||||
offset: Offset(0, -0.0001), //阴影y轴偏移量
|
);
|
||||||
blurRadius: 4, //阴影模糊程度
|
}
|
||||||
spreadRadius: 0, //阴影扩散程度
|
|
||||||
)
|
/// 已完成作业条件筛选栏
|
||||||
],
|
@hwidget
|
||||||
),
|
Widget $completedJobConditionFilter(BuildContext context,
|
||||||
child: Row(children: [
|
{required TabController controller,
|
||||||
Expanded(
|
required int jobType,
|
||||||
child: InkWell(
|
PickerDateRange? customTime,
|
||||||
onTap: () => easyThrottle('go_to_homework_report', () => {}),
|
required ValueChanged<int> onJobTypeTap,
|
||||||
child: Container(
|
required Function(String? startTime, String? endTime) onTimeFilter}) {
|
||||||
alignment: Alignment.center,
|
List<Map<String, dynamic>> jobTypes = [
|
||||||
child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 11.sp),
|
{'type': 1, 'name': '作业'},
|
||||||
),
|
{'type': 2, 'name': '考试'}
|
||||||
)),
|
];
|
||||||
]),
|
var jobTypeState = useState(0);
|
||||||
),
|
var customTimeState = useState<PickerDateRange?>(null);
|
||||||
|
|
||||||
|
useEffect(() {
|
||||||
|
if (jobTypeState.value != jobType) jobTypeState.value = jobType;
|
||||||
|
if (customTimeState.value != customTime) customTimeState.value = customTime;
|
||||||
|
|
||||||
|
return () {};
|
||||||
|
}, []);
|
||||||
|
|
||||||
|
DateTime getWeekStartDate() {
|
||||||
|
DateTime now = DateTime.now();
|
||||||
|
int dayOfWeek = now.weekday; // 获取今天是周几(1代表周一,7代表周日)
|
||||||
|
int diff = dayOfWeek - 1; // 计算今天距离周一的天数差
|
||||||
|
if (diff < 0) {
|
||||||
|
diff += 7; // 如果是周日,则需要加上一周的天数
|
||||||
|
}
|
||||||
|
return now.subtract(Duration(days: diff)); // 减去天数差,得到本周一的时间
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime getWeekEndDate() {
|
||||||
|
DateTime now = DateTime.now();
|
||||||
|
int dayOfWeek = now.weekday; // 获取今天是周几
|
||||||
|
int diff = 7 - dayOfWeek; // 计算今天距离周日的天数差
|
||||||
|
if (diff == 0) {
|
||||||
|
diff = 7; // 如果是周日,则加上一周的天数
|
||||||
|
}
|
||||||
|
return now.add(Duration(days: diff)); // 加上天数差减一,得到本周日的时间
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime getMonthStartDate() {
|
||||||
|
DateTime now = DateTime.now();
|
||||||
|
return DateTime(now.year, now.month, 1); // 获取当前月份的第一天
|
||||||
|
}
|
||||||
|
|
||||||
|
DateTime getMonthEndDate() {
|
||||||
|
DateTime now = DateTime.now();
|
||||||
|
int nextMonth = now.month + 1;
|
||||||
|
if (nextMonth > 12) {
|
||||||
|
nextMonth = 1;
|
||||||
|
now = now.add(Duration(days: 31 - now.day)); // 跨年了,所以加到当前月的最后一天
|
||||||
|
} else {
|
||||||
|
now = now.add(Duration(days: DateTime(now.year, nextMonth, 0).day - now.day)); // 加到下个月的第一天的前一天,即本月最后一天
|
||||||
|
}
|
||||||
|
return now;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Container(
|
||||||
|
height: 36.h,
|
||||||
|
padding: EdgeInsets.only(left: 4.w, right: 12.w),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color.fromRGBO(244, 244, 244, 1),
|
||||||
|
border: Border(bottom: BorderSide(color: Color.fromRGBO(204, 204, 204, 1), width: 1)),
|
||||||
|
),
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
$TheTabBar(
|
||||||
|
controller: controller,
|
||||||
|
customTime: customTimeState.value,
|
||||||
|
onTap: (int val) async {
|
||||||
|
switch (val) {
|
||||||
|
case 0: // 全部
|
||||||
|
onTimeFilter(null, null);
|
||||||
|
break;
|
||||||
|
case 1: // 近一周
|
||||||
|
onTimeFilter(
|
||||||
|
getWeekStartDate().toString().substring(0, 10),
|
||||||
|
getWeekEndDate().toString().substring(0, 10),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case 2: // 近一个月
|
||||||
|
onTimeFilter(
|
||||||
|
getMonthStartDate().toString().substring(0, 10),
|
||||||
|
getMonthEndDate().toString().substring(0, 10),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default: // 自定义
|
||||||
|
// DateTimeRange? range = await showDateRangePicker(
|
||||||
|
// // locale: const Locale('zh', 'CN'),
|
||||||
|
// locale: const Locale('zh', 'CN'),
|
||||||
|
// context: context,
|
||||||
|
// confirmText: '搜索',
|
||||||
|
// initialEntryMode: DatePickerEntryMode.calendarOnly,
|
||||||
|
// currentDate: DateTime.now(),
|
||||||
|
// firstDate: DateTime.now().subtract(const Duration(days: 4)),
|
||||||
|
// lastDate: DateTime.now().add(const Duration(days: 3)),
|
||||||
|
// );
|
||||||
|
|
||||||
|
var dialogData = await showDialog<PickerDateRange?>(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context1) {
|
||||||
|
return Center(
|
||||||
|
child: Container(
|
||||||
|
color: Colors.white,
|
||||||
|
width: isPad() ? ScreenUtil().screenWidth / 2 : ScreenUtil().screenWidth / 1.3,
|
||||||
|
height: ScreenUtil().screenHeight / 2,
|
||||||
|
child: SfDateRangePicker(
|
||||||
|
showActionButtons: true,
|
||||||
|
confirmText: '确定',
|
||||||
|
cancelText: '取消',
|
||||||
|
onSubmit: (p0) {
|
||||||
|
print(p0);
|
||||||
|
Navigator.of(context1).pop(p0);
|
||||||
|
},
|
||||||
|
onCancel: () {
|
||||||
|
Navigator.of(context1).pop();
|
||||||
|
},
|
||||||
|
selectionMode: DateRangePickerSelectionMode.range,
|
||||||
|
initialSelectedRange: customTimeState.value,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
// startDate: 2024-03-04 18:47:00.117958, endDate: 2024-03-11 18:47:00.117986
|
||||||
|
// if (dialogData != null && (dialogData.startDate != null || dialogData.endDate != null)) {}
|
||||||
|
onTimeFilter(
|
||||||
|
dialogData?.startDate?.toString().substring(0, 10),
|
||||||
|
dialogData?.endDate?.toString().substring(0, 10),
|
||||||
|
);
|
||||||
|
customTimeState.value = dialogData;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Expanded(child: SizedBox()),
|
||||||
|
Container(
|
||||||
|
width: 74.r,
|
||||||
|
margin: EdgeInsets.symmetric(vertical: 5.h),
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 10.r),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadius.vertical(
|
||||||
|
top: Radius.elliptical(6, 6),
|
||||||
|
bottom: Radius.elliptical(6, 6),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: DropdownButton(
|
||||||
|
icon: Icon(Icons.expand_more_outlined),
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
// value: params2.jobType ?? 1,
|
||||||
|
value: jobType,
|
||||||
|
style: TextStyle(color: Color.fromRGBO(89, 89, 89, 1), fontSize: 12.sp),
|
||||||
|
underline: Container(),
|
||||||
|
isExpanded: true,
|
||||||
|
items: jobTypes.map((e) {
|
||||||
|
return DropdownMenuItem(
|
||||||
|
value: e['type'],
|
||||||
|
child: quickText(e['name'], size: 12.sp, color: Colors.black),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
onChanged: (dynamic value) {
|
||||||
|
if (value != null) {
|
||||||
|
jobTypeState.value = value;
|
||||||
|
onJobTypeTap(value as int);
|
||||||
|
}
|
||||||
|
// jobTypeState
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,9 @@ class JobListParticipateInClass extends StatefulWidget {
|
||||||
final int jobId;
|
final int jobId;
|
||||||
final String jobName;
|
final String jobName;
|
||||||
final String genderName;
|
final String genderName;
|
||||||
const JobListParticipateInClass({required this.jobId, required this.jobName, required this.genderName, super.key});
|
final bool completed;
|
||||||
|
const JobListParticipateInClass(
|
||||||
|
{required this.jobId, required this.jobName, required this.genderName, this.completed = false, super.key});
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<JobListParticipateInClass> createState() => _JobListParticipateInClassState();
|
State<JobListParticipateInClass> createState() => _JobListParticipateInClassState();
|
||||||
|
|
@ -254,6 +256,9 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
|
||||||
|
|
||||||
// 查看作业报告
|
// 查看作业报告
|
||||||
void jobViewReport(MarkingTasks task) {}
|
void jobViewReport(MarkingTasks task) {}
|
||||||
|
|
||||||
|
/// 查看学生名单
|
||||||
|
void showStudentList([bool submitted = false]) {}
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return Scaffold(
|
return Scaffold(
|
||||||
|
|
@ -271,8 +276,31 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
|
||||||
),
|
),
|
||||||
body: MyFutureBuilder.buildFutureBuilderOfSingleInstance<List<MarkingTasks>?>(context, _future, (value) {
|
body: MyFutureBuilder.buildFutureBuilderOfSingleInstance<List<MarkingTasks>?>(context, _future, (value) {
|
||||||
if (value == null) return Container();
|
if (value == null) return Container();
|
||||||
|
bool thePadTerminal = isPad();
|
||||||
|
if (widget.completed) {
|
||||||
|
// 已完成
|
||||||
|
if (thePadTerminal)
|
||||||
|
return TabletEndCompleted(
|
||||||
|
data: value,
|
||||||
|
genderName: widget.genderName,
|
||||||
|
bookmarks: bookmarks,
|
||||||
|
jobViewReport: jobViewReport,
|
||||||
|
quickDataCheck: quickDataCheck,
|
||||||
|
);
|
||||||
|
|
||||||
if (isPad())
|
// 已完成手机端
|
||||||
|
return MobileEndCompleted(
|
||||||
|
data: value,
|
||||||
|
genderName: widget.genderName,
|
||||||
|
bookmarks: bookmarks,
|
||||||
|
jobViewReport: jobViewReport,
|
||||||
|
quickDataCheck: quickDataCheck,
|
||||||
|
showStudentList: showStudentList,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 未完成页面
|
||||||
|
if (thePadTerminal)
|
||||||
return TabletEnd(
|
return TabletEnd(
|
||||||
data: value,
|
data: value,
|
||||||
genderName: widget.genderName,
|
genderName: widget.genderName,
|
||||||
|
|
@ -299,7 +327,7 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 平板电脑端
|
/// 平板电脑端(未完成)
|
||||||
class TabletEnd extends StatelessWidget {
|
class TabletEnd extends StatelessWidget {
|
||||||
final String genderName;
|
final String genderName;
|
||||||
final List<MarkingTasks> data;
|
final List<MarkingTasks> data;
|
||||||
|
|
@ -332,7 +360,7 @@ class TabletEnd extends StatelessWidget {
|
||||||
child: Wrap(
|
child: Wrap(
|
||||||
spacing: 8.0.w, // 子元素之间的间距
|
spacing: 8.0.w, // 子元素之间的间距
|
||||||
runSpacing: 10.h, // 主轴方向上不同行之间的间距
|
runSpacing: 10.h, // 主轴方向上不同行之间的间距
|
||||||
children: [...data, ...data, ...data]
|
children: data
|
||||||
.map((e) => $ItemDataViewOfPad(
|
.map((e) => $ItemDataViewOfPad(
|
||||||
task: e,
|
task: e,
|
||||||
bookmarks: bookmarks,
|
bookmarks: bookmarks,
|
||||||
|
|
@ -349,6 +377,462 @@ class TabletEnd extends StatelessWidget {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 平板展示(已完成)
|
||||||
|
class TabletEndCompleted extends StatelessWidget {
|
||||||
|
final String genderName;
|
||||||
|
final List<MarkingTasks> data;
|
||||||
|
|
||||||
|
final Bookmarks bookmarks; // 收藏夹
|
||||||
|
final JobViewReport jobViewReport;
|
||||||
|
final QuickDataCheck quickDataCheck; // 数据快查
|
||||||
|
const TabletEndCompleted({
|
||||||
|
required this.genderName,
|
||||||
|
required this.data,
|
||||||
|
|
||||||
|
/// 方法
|
||||||
|
required this.bookmarks,
|
||||||
|
required this.jobViewReport,
|
||||||
|
required this.quickDataCheck,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var padingEdg = EdgeInsets.only(left: 10.w, right: 10.w);
|
||||||
|
return Container(
|
||||||
|
width: ScreenUtil().screenWidth,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 16.h),
|
||||||
|
child: GridView(
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 2, //横轴三个子widget
|
||||||
|
mainAxisSpacing: 10.h,
|
||||||
|
crossAxisSpacing: 6.w,
|
||||||
|
childAspectRatio: 1.48 //宽高比为1时,子widget
|
||||||
|
),
|
||||||
|
children: data.map((taskItem) {
|
||||||
|
return Container(
|
||||||
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(6.r)),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 6.h),
|
||||||
|
alignment: Alignment.centerLeft,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
border: Border(bottom: BorderSide(color: Color.fromRGBO(238, 238, 238, 1), width: 0.5.r)),
|
||||||
|
),
|
||||||
|
child: quickText(taskItem.className, color: Color.fromRGBO(104, 136, 253, 1), size: 12.sp),
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
$CompletedHomeworkProgressBar(
|
||||||
|
color: Color.fromRGBO(76, 199, 147, 1),
|
||||||
|
percent: taskItem.objectivePrecision,
|
||||||
|
title: '客观题正确率:',
|
||||||
|
padingEdg: padingEdg,
|
||||||
|
fontSize: 8.sp,
|
||||||
|
lineHeight: 5.h,
|
||||||
|
marginEdg: EdgeInsets.only(top: 5.h),
|
||||||
|
),
|
||||||
|
$CompletedHomeworkProgressBar(
|
||||||
|
color: Color.fromRGBO(255, 190, 91, 1),
|
||||||
|
percent: taskItem.subjectivePrecision,
|
||||||
|
title: '主观题正确率:',
|
||||||
|
fontSize: 8.sp,
|
||||||
|
lineHeight: 5.h,
|
||||||
|
padingEdg: padingEdg,
|
||||||
|
marginEdg: EdgeInsets.only(top: 5.h),
|
||||||
|
),
|
||||||
|
$CompletedHomeworkProgressBar(
|
||||||
|
color: Color.fromRGBO(166, 139, 242, 1),
|
||||||
|
percent: taskItem.precision,
|
||||||
|
title: '总正确率:',
|
||||||
|
fontSize: 8.sp,
|
||||||
|
lineHeight: 5.h,
|
||||||
|
padingEdg: padingEdg,
|
||||||
|
marginEdg: EdgeInsets.only(top: 5.h),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(height: 4.h),
|
||||||
|
Padding(
|
||||||
|
padding: padingEdg,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Material(
|
||||||
|
color: Color.fromRGBO(104, 136, 253, 1),
|
||||||
|
borderRadius: BorderRadius.circular(16.r),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => easyThrottle('OneClickReview', () {}),
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(flex: 1, child: SizedBox()),
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Material(
|
||||||
|
color: Color.fromRGBO(244, 244, 244, 1),
|
||||||
|
borderRadius: BorderRadius.circular(20.r),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () async {},
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 4.h),
|
||||||
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
|
||||||
|
child: quickText('数据快查', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(flex: 1, child: SizedBox()),
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Material(
|
||||||
|
color: Color.fromRGBO(244, 244, 244, 1),
|
||||||
|
borderRadius: BorderRadius.circular(20.r),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () async {},
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 4.h),
|
||||||
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
|
||||||
|
child: quickText('收藏夹(2)', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 4.h),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
bottomLeft: Radius.circular(10.r),
|
||||||
|
bottomRight: Radius.circular(10.r),
|
||||||
|
),
|
||||||
|
color: Colors.white,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: const Color.fromRGBO(0, 0, 0, 0.15),
|
||||||
|
offset: Offset(0, -0.0001), //阴影y轴偏移量
|
||||||
|
blurRadius: 5, //阴影模糊程度
|
||||||
|
spreadRadius: 0, //阴影扩散程度
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Row(children: [
|
||||||
|
Expanded(
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => easyThrottle('go_to_review_homework', () => quickDataCheck(taskItem)),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: quickText('数据快查', color: Color.fromRGBO(79, 79, 79, 1), size: 11.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(width: 1.w, height: 26.h, color: Color.fromRGBO(221, 221, 221, 1)),
|
||||||
|
Expanded(
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => easyThrottle('go_to_end_review_homework', () => jobViewReport(taskItem)),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 10.sp),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 手机端(已完成)
|
||||||
|
class MobileEndCompleted extends StatelessWidget {
|
||||||
|
final String genderName;
|
||||||
|
final List<MarkingTasks> data;
|
||||||
|
|
||||||
|
final Bookmarks bookmarks; // 收藏夹
|
||||||
|
final JobViewReport jobViewReport; // 查看报告
|
||||||
|
final QuickDataCheck quickDataCheck; // 数据快查
|
||||||
|
final ShowStudentList showStudentList;
|
||||||
|
|
||||||
|
const MobileEndCompleted({
|
||||||
|
required this.genderName,
|
||||||
|
required this.data,
|
||||||
|
|
||||||
|
/// 方法
|
||||||
|
required this.bookmarks,
|
||||||
|
required this.showStudentList,
|
||||||
|
required this.jobViewReport,
|
||||||
|
required this.quickDataCheck,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
var padingEdg = EdgeInsets.only(left: 10.w, right: 10.w);
|
||||||
|
return ListView(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 16.h),
|
||||||
|
children: data.map((task) {
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.only(top: 11.h),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadiusDirectional.circular(10.r),
|
||||||
|
boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.15), blurRadius: 10)],
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: padingEdg,
|
||||||
|
child: Row(
|
||||||
|
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),
|
||||||
|
SizedBox(width: 16.w),
|
||||||
|
quickText('未交:${task.studentCount - task.commitStudentCount}',
|
||||||
|
color: Color.fromRGBO(255, 86, 86, 1), size: 12.sp),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 13.h),
|
||||||
|
Padding(
|
||||||
|
padding: padingEdg,
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: task.isFinish
|
||||||
|
? [
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Material(
|
||||||
|
color: Color.fromRGBO(244, 244, 244, 1),
|
||||||
|
borderRadius: BorderRadius.circular(20.r),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () async {},
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 5.h),
|
||||||
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
|
||||||
|
child: quickText('收藏夹(2)', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
Expanded(flex: 1, child: SizedBox()),
|
||||||
|
Expanded(flex: 3, child: SizedBox()),
|
||||||
|
Expanded(flex: 1, child: SizedBox()),
|
||||||
|
Expanded(flex: 3, child: SizedBox()),
|
||||||
|
]
|
||||||
|
: [
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Material(
|
||||||
|
color: Color.fromRGBO(104, 136, 253, 1),
|
||||||
|
borderRadius: BorderRadius.circular(16.r),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => easyThrottle('OneClickReview', () {}),
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 5.h),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(20.r),
|
||||||
|
),
|
||||||
|
child: quickText('一键批阅', size: 10.sp, color: Colors.white),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(flex: 1, child: SizedBox()),
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Material(
|
||||||
|
color: Color.fromRGBO(244, 244, 244, 1),
|
||||||
|
borderRadius: BorderRadius.circular(20.r),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () async {},
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 5.h),
|
||||||
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
|
||||||
|
child: quickText('数据快查', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(flex: 1, child: SizedBox()),
|
||||||
|
Expanded(
|
||||||
|
flex: 3,
|
||||||
|
child: Material(
|
||||||
|
color: Color.fromRGBO(244, 244, 244, 1),
|
||||||
|
borderRadius: BorderRadius.circular(20.r),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () async {},
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 5.h),
|
||||||
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
|
||||||
|
child: quickText('收藏夹(2)', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 13.h),
|
||||||
|
Padding(
|
||||||
|
padding: padingEdg,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: LinearPercentIndicator(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
animation: true,
|
||||||
|
lineHeight: 8.h,
|
||||||
|
animationDuration: 2500,
|
||||||
|
|
||||||
|
percent: task.progressPercentage / 100,
|
||||||
|
// center: Text(
|
||||||
|
// '${getDoubleRemoveZero(jobTaskClassItem.progressPercentage)}%',
|
||||||
|
// style: TextStyle(color: Colors.white, fontSize: 8.sp),
|
||||||
|
// ),
|
||||||
|
linearGradient: LinearGradient(
|
||||||
|
tileMode: TileMode.mirror,
|
||||||
|
stops: [0.0, 1.0],
|
||||||
|
colors: task.progressPercentage / 100 != 1
|
||||||
|
? [Theme.of(context).primaryColor.withOpacity(0.1), Theme.of(context).primaryColor]
|
||||||
|
: [
|
||||||
|
Color.fromRGBO(144, 224, 190, 1).withOpacity(0.1),
|
||||||
|
Color.fromRGBO(144, 224, 190, 1),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
// linearStrokeCap: LinearStrokeCap.butt,
|
||||||
|
// progressColor: Theme.of(context).primaryColor,
|
||||||
|
backgroundColor: Color.fromRGBO(232, 232, 232, 1),
|
||||||
|
barRadius: Radius.circular(10.r),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 7.w),
|
||||||
|
quickText('${getDoubleRemoveZero(task.progressPercentage)}%',
|
||||||
|
size: 10.sp, color: Color.fromRGBO(70, 70, 70, 1))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (task.isFinish)
|
||||||
|
$CompletedHomeworkProgressBar(
|
||||||
|
color: Color.fromRGBO(76, 199, 147, 1),
|
||||||
|
percent: task.objectivePrecision,
|
||||||
|
title: '客观题正确率:',
|
||||||
|
padingEdg: padingEdg,
|
||||||
|
marginEdg: EdgeInsets.only(top: 8.h),
|
||||||
|
),
|
||||||
|
if (task.isFinish)
|
||||||
|
$CompletedHomeworkProgressBar(
|
||||||
|
color: Color.fromRGBO(255, 190, 91, 1),
|
||||||
|
percent: task.subjectivePrecision,
|
||||||
|
title: '主观题正确率:',
|
||||||
|
padingEdg: padingEdg,
|
||||||
|
marginEdg: EdgeInsets.only(top: 8.h),
|
||||||
|
),
|
||||||
|
if (task.isFinish)
|
||||||
|
$CompletedHomeworkProgressBar(
|
||||||
|
color: Color.fromRGBO(166, 139, 242, 1),
|
||||||
|
percent: task.precision,
|
||||||
|
title: '总正确率:',
|
||||||
|
padingEdg: padingEdg,
|
||||||
|
marginEdg: EdgeInsets.only(top: 8.h),
|
||||||
|
),
|
||||||
|
SizedBox(height: 13.h),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
bottomLeft: Radius.circular(10.r),
|
||||||
|
bottomRight: Radius.circular(10.r),
|
||||||
|
),
|
||||||
|
color: Colors.white,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: const Color.fromRGBO(0, 0, 0, 0.15),
|
||||||
|
offset: Offset(0, -0.0001), //阴影y轴偏移量
|
||||||
|
blurRadius: 5, //阴影模糊程度
|
||||||
|
spreadRadius: 0, //阴影扩散程度
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
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: 32.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: 32.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),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// 移动端
|
/// 移动端
|
||||||
class MobileEnd extends StatelessWidget {
|
class MobileEnd extends StatelessWidget {
|
||||||
final String genderName;
|
final String genderName;
|
||||||
|
|
@ -991,3 +1475,11 @@ typedef Bookmarks = void Function(MarkingTasks);
|
||||||
|
|
||||||
/// 查看作业报告
|
/// 查看作业报告
|
||||||
typedef JobViewReport = void Function(MarkingTasks);
|
typedef JobViewReport = void Function(MarkingTasks);
|
||||||
|
|
||||||
|
/// 展示学生名单
|
||||||
|
typedef ShowStudentList = void Function([bool submitted]);
|
||||||
|
|
||||||
|
/// 查看学生名单
|
||||||
|
// void showStudentList([bool submitted = false]) {
|
||||||
|
|
||||||
|
// }
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
import 'package:flutter_easyrefresh/easy_refresh.dart';
|
||||||
import 'package:flutter_hooks/flutter_hooks.dart';
|
|
||||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||||
import 'package:marking_app/common/config/request_config.dart';
|
import 'package:marking_app/common/config/request_config.dart';
|
||||||
|
|
@ -21,8 +20,6 @@ import 'package:marking_app/common/model/event_bus/marking_statistics_bus.dart';
|
||||||
import 'package:marking_app/common/model/marking/marking_statistics.dart';
|
import 'package:marking_app/common/model/marking/marking_statistics.dart';
|
||||||
import 'package:marking_app/pages/common/event_bus_mixin.dart';
|
import 'package:marking_app/pages/common/event_bus_mixin.dart';
|
||||||
import 'package:marking_app/provider/review_provider.dart';
|
import 'package:marking_app/provider/review_provider.dart';
|
||||||
import 'package:marking_app/utils/anti_shake_throttling.dart';
|
|
||||||
import 'package:marking_app/utils/index.dart';
|
|
||||||
import 'package:marking_app/utils/request/rest_client.dart';
|
import 'package:marking_app/utils/request/rest_client.dart';
|
||||||
import 'package:marking_app/common/model/common/base_page_data.dart';
|
import 'package:marking_app/common/model/common/base_page_data.dart';
|
||||||
import 'package:marking_app/common/model/marking/marking_item.dart';
|
import 'package:marking_app/common/model/marking/marking_item.dart';
|
||||||
|
|
|
||||||
|
|
@ -251,26 +251,27 @@ class RouterManager {
|
||||||
int jobId = int.parse(params['jobId']![0]);
|
int jobId = int.parse(params['jobId']![0]);
|
||||||
String jobName = params['jobName']![0];
|
String jobName = params['jobName']![0];
|
||||||
String genderName = params['genderName']![0];
|
String genderName = params['genderName']![0];
|
||||||
|
// ignore: sdk_version_since
|
||||||
return JobListParticipateInClass(jobId: jobId, jobName: jobName, genderName: genderName);
|
bool completed = bool.parse(params['completed']?[0] ?? 'false');
|
||||||
|
return JobListParticipateInClass(jobId: jobId, jobName: jobName, genderName: genderName, completed: completed);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// 数据快查
|
// 数据快查
|
||||||
static final _quickDataCheckPageHandler = Handler(
|
static final _quickDataCheckPageHandler = Handler(
|
||||||
handlerFunc: (BuildContext? context, Map<String, List<String>> params){
|
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
|
||||||
int jobId = int.parse(params['jobId']![0]);
|
int jobId = int.parse(params['jobId']![0]);
|
||||||
String className = params['className']![0];
|
String className = params['className']![0];
|
||||||
return QuickDataCheckPage(jobId: jobId,className:className);
|
return QuickDataCheckPage(jobId: jobId, className: className);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// 数据快查-个人信息
|
// 数据快查-个人信息
|
||||||
static final _quickCheckPersonalPageHandler = Handler(
|
static final _quickCheckPersonalPageHandler = Handler(
|
||||||
handlerFunc: (BuildContext? context, Map<String, List<String>> params){
|
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
|
||||||
int jobId = int.parse(params['jobId']![0]);
|
int jobId = int.parse(params['jobId']![0]);
|
||||||
int studentId = int.parse(params['studentId']![0]);
|
int studentId = int.parse(params['studentId']![0]);
|
||||||
return QuickCheckPersonal(jobId: jobId,studentId:studentId);
|
return QuickCheckPersonal(jobId: jobId, studentId: studentId);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
// 开始阅卷页面
|
// 开始阅卷页面
|
||||||
|
|
@ -310,7 +311,8 @@ class RouterManager {
|
||||||
router.define(jobListParticipateInClassPath,
|
router.define(jobListParticipateInClassPath,
|
||||||
handler: _jobListParticipateInClassHandler, transitionType: TransitionType.material);
|
handler: _jobListParticipateInClassHandler, transitionType: TransitionType.material);
|
||||||
router.define(quickDataCheckPath, handler: _quickDataCheckPageHandler, transitionType: TransitionType.material);
|
router.define(quickDataCheckPath, handler: _quickDataCheckPageHandler, transitionType: TransitionType.material);
|
||||||
router.define(quickCheckPersonalPath, handler: _quickCheckPersonalPageHandler, transitionType: TransitionType.material);
|
router.define(quickCheckPersonalPath,
|
||||||
|
handler: _quickCheckPersonalPageHandler, transitionType: TransitionType.material);
|
||||||
|
|
||||||
// getTransition()
|
// getTransition()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ description: A new Flutter project.
|
||||||
|
|
||||||
# The following line prevents the package from being accidentally published to
|
# The following line prevents the package from being accidentally published to
|
||||||
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
# pub.dev using `flutter pub publish`. This is preferred for private packages.
|
||||||
publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
|
||||||
|
|
||||||
# The following defines the version and build number for your application.
|
# The following defines the version and build number for your application.
|
||||||
# A version number is three numbers separated by dots, like 1.2.43
|
# A version number is three numbers separated by dots, like 1.2.43
|
||||||
|
|
@ -18,7 +18,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||||
version: 1.0.87
|
version: 1.0.87
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.1 <3.0.0"
|
sdk: '>=2.17.1 <3.0.0'
|
||||||
|
|
||||||
# Dependencies specify other packages that your package needs in order to woyrk.
|
# Dependencies specify other packages that your package needs in order to woyrk.
|
||||||
# To automatically upgrade your package dependencies to the latest versions
|
# To automatically upgrade your package dependencies to the latest versions
|
||||||
|
|
@ -29,7 +29,8 @@ environment:
|
||||||
dependencies:
|
dependencies:
|
||||||
flutter:
|
flutter:
|
||||||
sdk: flutter
|
sdk: flutter
|
||||||
|
flutter_localizations:
|
||||||
|
sdk: flutter
|
||||||
# The following adds the Cupertino Icons font to your application.
|
# The following adds the Cupertino Icons font to your application.
|
||||||
# Use with the CupertinoIcons class for iOS style icons.
|
# Use with the CupertinoIcons class for iOS style icons.
|
||||||
cupertino_icons: ^1.0.2
|
cupertino_icons: ^1.0.2
|
||||||
|
|
@ -60,7 +61,6 @@ dependencies:
|
||||||
permission_handler: ^11.0.1
|
permission_handler: ^11.0.1
|
||||||
flutter_widget_from_html_core: ^0.10.3
|
flutter_widget_from_html_core: ^0.10.3
|
||||||
|
|
||||||
|
|
||||||
# 事件总线
|
# 事件总线
|
||||||
event_bus: ^2.0.0
|
event_bus: ^2.0.0
|
||||||
image_picker: ^0.8.6
|
image_picker: ^0.8.6
|
||||||
|
|
@ -108,6 +108,7 @@ dependencies:
|
||||||
badges: ^3.1.2
|
badges: ^3.1.2
|
||||||
horizontal_data_table: ^4.1.1
|
horizontal_data_table: ^4.1.1
|
||||||
data_table_2: ^2.5.10
|
data_table_2: ^2.5.10
|
||||||
|
syncfusion_flutter_datepicker: ^21.2.4
|
||||||
|
|
||||||
dev_dependencies:
|
dev_dependencies:
|
||||||
flutter_test:
|
flutter_test:
|
||||||
|
|
@ -118,15 +119,12 @@ dev_dependencies:
|
||||||
# 分离样式
|
# 分离样式
|
||||||
functional_widget: ^0.10.1
|
functional_widget: ^0.10.1
|
||||||
|
|
||||||
|
|
||||||
# The "flutter_lints" package below contains a set of recommended lints to
|
# The "flutter_lints" package below contains a set of recommended lints to
|
||||||
# encourage good coding practices. The lint set provided by the package is
|
# encourage good coding practices. The lint set provided by the package is
|
||||||
# activated in the `analysis_options.yaml` file located at the root of your
|
# activated in the `analysis_options.yaml` file located at the root of your
|
||||||
# package. See that file for information about deactivating specific lint
|
# package. See that file for information about deactivating specific lint
|
||||||
# rules and activating additional ones.
|
# rules and activating additional ones.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# For information on the generic Dart part of this file, see the
|
# For information on the generic Dart part of this file, see the
|
||||||
# following page: https://dart.dev/tools/pub/pubspec
|
# following page: https://dart.dev/tools/pub/pubspec
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue