Compare commits
6 Commits
2ca30595d9
...
046f8cda4d
| Author | SHA1 | Date |
|---|---|---|
|
|
046f8cda4d | |
|
|
1de02f27e2 | |
|
|
35eaa570d1 | |
|
|
cf76e6aa44 | |
|
|
ff1b70d39d | |
|
|
e1db8ae9b9 |
|
|
@ -200,3 +200,4 @@ marking_app/lib/common/model/job/job_report_knowledge_model.g.dart
|
||||||
marking_app/lib/common/model/job/job_report_question_deatil_model.g.dart
|
marking_app/lib/common/model/job/job_report_question_deatil_model.g.dart
|
||||||
marking_app/lib/common/model/job/job_do_marking_status_info.g.dart
|
marking_app/lib/common/model/job/job_do_marking_status_info.g.dart
|
||||||
marking_app/lib/common/model/report/small_question.g.dart
|
marking_app/lib/common/model/report/small_question.g.dart
|
||||||
|
marking_app/lib/pages/homework_correction/pages/job_list_participate_in_class.g.dart
|
||||||
|
|
|
||||||
|
|
@ -15,15 +15,16 @@ class RequestConfig {
|
||||||
static const devLoginBaseUrl = "http://192.168.2.9:6400"; // 基本请求接口
|
static const devLoginBaseUrl = "http://192.168.2.9:6400"; // 基本请求接口
|
||||||
static const devBaseUrlOfReport = "http://192.168.2.9:4000"; // 获取报告接口*/
|
static const devBaseUrlOfReport = "http://192.168.2.9:4000"; // 获取报告接口*/
|
||||||
|
|
||||||
static const devBaseUrl = "https://mk-hw.23544.com"; // 基本请求
|
static const devBaseUrl = "https://mhw.qwit.top"; // 基本请求
|
||||||
static const devLoginBaseUrl = "https://mk-hw.23544.com"; // 登录接口
|
static const devLoginBaseUrl = "https://mhw.qwit.top"; // 登录接口
|
||||||
static const devBaseUrlOfReport = "https://dc-api.23544.com"; // 获取报告接口
|
static const devBaseUrlOfReport = "https://mhw.qwit.top"; // 获取报告接口
|
||||||
|
static const proBaseUrlOfHomework = "https://mhw.qwit.top/hw"; // 获取作业接口
|
||||||
|
|
||||||
/* 正式地址 */
|
/* 正式地址 */
|
||||||
static const proBaseUrl = "https://mk-hw.23544.com"; // 基本请求
|
static const proBaseUrl = "https://mk-hw.23544.com"; // 基本请求
|
||||||
static const proLoginBaseUrl = "https://mk-hw.23544.com"; // 登录接口
|
static const proLoginBaseUrl = "https://mk-hw.23544.com"; // 登录接口
|
||||||
static const proBaseUrlOfReport = "https://dc-api.23544.com"; // 获取报告接口
|
static const proBaseUrlOfReport = "https://dc-api.23544.com"; // 获取报告接口
|
||||||
static const proBaseUrlOfHomework = "https://mk-hw.23544.com/hw"; // 获取作业接口
|
// static const proBaseUrlOfHomework = "https://mk-hw.23544.com/hw"; // 获取作业接口
|
||||||
|
|
||||||
static const hwProxyKeywords = "/hw"; // 作业代理条件关键字
|
static const hwProxyKeywords = "/hw"; // 作业代理条件关键字
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
// 作业类型枚举
|
||||||
|
enum JobMarkingTypeEnum {
|
||||||
|
UNUSED(name: '未使用废弃', indexValue: 0),
|
||||||
|
JOB(name: '作业', indexValue: 1),
|
||||||
|
EXAMINATION(name: '考试', indexValue: 2);
|
||||||
|
|
||||||
|
const JobMarkingTypeEnum({required this.name, required this.indexValue});
|
||||||
|
final String name;
|
||||||
|
final int indexValue;
|
||||||
|
}
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import 'package:json_annotation/json_annotation.dart';
|
import 'package:json_annotation/json_annotation.dart';
|
||||||
|
import 'package:marking_app/common/model/enum/job_marking_type_enum.dart';
|
||||||
|
|
||||||
part 'job_task_item.g.dart';
|
part 'job_task_item.g.dart';
|
||||||
|
|
||||||
|
|
@ -40,8 +41,8 @@ class JobTaskItem extends Object {
|
||||||
@JsonKey(name: 'precision')
|
@JsonKey(name: 'precision')
|
||||||
double precision;
|
double precision;
|
||||||
|
|
||||||
@JsonKey(name: 'markingTasks')
|
// @JsonKey(name: 'markingTasks')
|
||||||
List<MarkingTasks> markingTasks;
|
// List<MarkingTasks> markingTasks;
|
||||||
|
|
||||||
@JsonKey(name: 'createTime')
|
@JsonKey(name: 'createTime')
|
||||||
String createTime;
|
String createTime;
|
||||||
|
|
@ -49,23 +50,30 @@ class JobTaskItem extends Object {
|
||||||
@JsonKey(name: 'progressPercentage')
|
@JsonKey(name: 'progressPercentage')
|
||||||
double progressPercentage; // 进度百分比
|
double progressPercentage; // 进度百分比
|
||||||
|
|
||||||
|
@JsonKey(name: 'markingType')
|
||||||
|
int markingType; // 考试类型
|
||||||
|
|
||||||
|
@JsonKey(name: 'markingTypeEnum')
|
||||||
|
JobMarkingTypeEnum markingTypeEnum; // 考试类型
|
||||||
|
|
||||||
JobTaskItem(
|
JobTaskItem(
|
||||||
this.id,
|
this.id,
|
||||||
this.title,
|
this.title,
|
||||||
this.subjectName,
|
this.subjectName,
|
||||||
this.genderName,
|
this.genderName,
|
||||||
this.isFinish,
|
this.isFinish,
|
||||||
this.studentCount,
|
this.studentCount,
|
||||||
this.commitStudentCount,
|
this.commitStudentCount,
|
||||||
this.totalCount,
|
this.totalCount,
|
||||||
this.finishCount,
|
this.finishCount,
|
||||||
this.objectivePrecision,
|
this.objectivePrecision,
|
||||||
this.subjectivePrecision,
|
this.subjectivePrecision,
|
||||||
this.precision,
|
this.precision,
|
||||||
this.markingTasks,
|
// this.markingTasks,
|
||||||
this.createTime, {
|
this.createTime,
|
||||||
this.progressPercentage = 0,
|
this.markingType,
|
||||||
}) {
|
{this.progressPercentage = 0,
|
||||||
|
this.markingTypeEnum = JobMarkingTypeEnum.UNUSED}) {
|
||||||
try {
|
try {
|
||||||
progressPercentage = (finishCount / totalCount) * 100;
|
progressPercentage = (finishCount / totalCount) * 100;
|
||||||
if (progressPercentage.isNaN) {
|
if (progressPercentage.isNaN) {
|
||||||
|
|
@ -76,6 +84,11 @@ class JobTaskItem extends Object {
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
progressPercentage = 0;
|
progressPercentage = 0;
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
markingTypeEnum = JobMarkingTypeEnum.values[this.markingType];
|
||||||
|
} catch (e) {
|
||||||
|
markingTypeEnum = JobMarkingTypeEnum.UNUSED;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
factory JobTaskItem.fromJson(Map<String, dynamic> srcJson) => _$JobTaskItemFromJson(srcJson);
|
factory JobTaskItem.fromJson(Map<String, dynamic> srcJson) => _$JobTaskItemFromJson(srcJson);
|
||||||
|
|
|
||||||
|
|
@ -46,30 +46,29 @@ class HomeworkTasksViewItem extends StatelessWidget with CommonMixin {
|
||||||
/// @param {bool} className 班级名称(不传此参数为主任务;传此参数为子任务)
|
/// @param {bool} className 班级名称(不传此参数为主任务;传此参数为子任务)
|
||||||
/// @param {bool} submitted 是否已提交(默认未提交)
|
/// @param {bool} submitted 是否已提交(默认未提交)
|
||||||
Future<void> showStudents(
|
Future<void> showStudents(
|
||||||
BuildContext context,
|
BuildContext context, [
|
||||||
List<int> taskIds, [
|
|
||||||
bool? submitted = false,
|
bool? submitted = false,
|
||||||
String? className,
|
String? className,
|
||||||
]) async {
|
]) async {
|
||||||
ToastUtils.showLoading();
|
ToastUtils.showLoading();
|
||||||
List<JobConcernedWithStudent> students = [];
|
List<JobConcernedWithStudent> students = [];
|
||||||
try {
|
// try {
|
||||||
RestClient _client = await getClient();
|
// RestClient _client = await getClient();
|
||||||
BaseStructureResult<List<JobConcernedWithStudent>> _result = await _client.getJobWithStudents(
|
// BaseStructureResult<List<JobConcernedWithStudent>> _result = await _client.getJobWithStudents(
|
||||||
JobConcernedWithStudentParams(taskIds, isCommit: submitted),
|
// JobConcernedWithStudentParams(taskIds, isCommit: submitted),
|
||||||
);
|
// );
|
||||||
if (!_result.success) {
|
// if (!_result.success) {
|
||||||
return ToastUtils.showError(_result.message ?? '获取学生列表失败');
|
// return ToastUtils.showError(_result.message ?? '获取学生列表失败');
|
||||||
}
|
// }
|
||||||
if (_result.data?.isEmpty ?? true) {
|
// if (_result.data?.isEmpty ?? true) {
|
||||||
return ToastUtils.showError('获取到的学生列表为空');
|
// return ToastUtils.showError('获取到的学生列表为空');
|
||||||
}
|
// }
|
||||||
students = _result.data!;
|
// students = _result.data!;
|
||||||
} catch (e) {
|
// } catch (e) {
|
||||||
return ToastUtils.showError('获取学生列表失败');
|
// return ToastUtils.showError('获取学生列表失败');
|
||||||
} finally {
|
// } finally {
|
||||||
ToastUtils.dismiss();
|
// ToastUtils.dismiss();
|
||||||
}
|
// }
|
||||||
|
|
||||||
showModalBottomSheet(
|
showModalBottomSheet(
|
||||||
context: context,
|
context: context,
|
||||||
|
|
@ -125,28 +124,19 @@ class HomeworkTasksViewItem extends StatelessWidget with CommonMixin {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
void oneClickReview(int taskId) async {
|
|
||||||
try {
|
|
||||||
ToastUtils.showLoading();
|
|
||||||
RestClient _client = await getClient();
|
|
||||||
BaseStructureResult<bool> res = await _client.toJobOneClickReview(taskId);
|
|
||||||
if (res.success) return call();
|
|
||||||
ToastUtils.showError(res.message ?? '操作失败');
|
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
|
||||||
ToastUtils.dismiss();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return completed
|
return completed
|
||||||
? $CompletedHomeworkView(jobTaskItem: jobTaskItem, showStudentsCall: showStudents)
|
? $CompletedHomeworkView(jobTaskItem: jobTaskItem, showStudentsCall: showStudents)
|
||||||
: $UnfinishedHomework(
|
: InkWell(
|
||||||
jobTaskItem: jobTaskItem,
|
onTap: () {
|
||||||
refreshCallback: call,
|
String url =
|
||||||
endReviewCallback: endReview,
|
'${RouterManager.jobListParticipateInClassPath}?&jobId=${jobTaskItem.id}&genderName=${Uri.encodeComponent(jobTaskItem.genderName)}&jobName=${Uri.encodeComponent(jobTaskItem.title)}';
|
||||||
oneClickReviewCallback: oneClickReview,
|
RouterManager.router.navigateTo(context, url, transition: getTransition()).then((value) {
|
||||||
|
if (value != null && value == true) call();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
child: $UnfinishedHomework(jobTaskItem: jobTaskItem),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -157,7 +147,7 @@ Widget $completedHomeworkView(BuildContext context,
|
||||||
{required JobTaskItem jobTaskItem, required ShowStudentsCall showStudentsCall}) {
|
{required JobTaskItem jobTaskItem, required ShowStudentsCall showStudentsCall}) {
|
||||||
return Container(
|
return Container(
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 10.w),
|
padding: EdgeInsets.only(top: 20.h),
|
||||||
margin: EdgeInsets.only(bottom: 12.h),
|
margin: EdgeInsets.only(bottom: 12.h),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.circular(6.r),
|
borderRadius: BorderRadius.circular(6.r),
|
||||||
|
|
@ -174,158 +164,134 @@ Widget $completedHomeworkView(BuildContext context,
|
||||||
child: Column(
|
child: Column(
|
||||||
children: [
|
children: [
|
||||||
// 顶部任务名称
|
// 顶部任务名称
|
||||||
Row(
|
Padding(
|
||||||
children: [
|
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||||
Container(
|
|
||||||
width: 32.w,
|
|
||||||
height: 18.h,
|
|
||||||
alignment: Alignment.center,
|
|
||||||
padding: EdgeInsets.only(left: 2.w),
|
|
||||||
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),
|
|
||||||
),
|
|
||||||
quickText(
|
|
||||||
jobTaskItem.title,
|
|
||||||
size: 16.sp,
|
|
||||||
color: Color.fromRGBO(70, 70, 70, 1),
|
|
||||||
fontWeight: FontWeight.bold,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 12.h),
|
|
||||||
Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
quickText(
|
|
||||||
jobTaskItem.subjectName,
|
|
||||||
color: Color.fromRGBO(97, 97, 97, 1),
|
|
||||||
size: 14.sp,
|
|
||||||
fontWeight: FontWeight.w600,
|
|
||||||
),
|
|
||||||
quickText(' / ', color: Color.fromRGBO(130, 130, 130, 1), size: 12.sp, fontWeight: FontWeight.w500),
|
|
||||||
Container(
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
quickText('题量:', color: Color.fromRGBO(130, 130, 130, 1), size: 13.sp),
|
|
||||||
quickText(
|
|
||||||
jobTaskItem.totalCount,
|
|
||||||
color: Color.fromRGBO(97, 97, 97, 1),
|
|
||||||
size: 14.sp,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
quickText(' / ', color: Color.fromRGBO(130, 130, 130, 1), size: 12.sp, fontWeight: FontWeight.w500),
|
|
||||||
quickText(
|
|
||||||
jobTaskItem.createTime.substring(0, 16),
|
|
||||||
color: Color.fromRGBO(97, 97, 97, 1),
|
|
||||||
size: 14.sp,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 20.h),
|
|
||||||
$CompletedHomeworkInfoBox(
|
|
||||||
segmentation: false,
|
|
||||||
showStudentsCall: showStudentsCall,
|
|
||||||
unsubmittedQuantity: jobTaskItem.studentCount - jobTaskItem.commitStudentCount,
|
|
||||||
submittedQuantity: jobTaskItem.commitStudentCount,
|
|
||||||
precision: jobTaskItem.precision / 100,
|
|
||||||
objectivePrecision: jobTaskItem.objectivePrecision / 100,
|
|
||||||
subjectivePrecision: jobTaskItem.subjectivePrecision / 100,
|
|
||||||
taskIds: jobTaskItem.markingTasks.map((e) => e.id).toList(),
|
|
||||||
),
|
|
||||||
InkWell(
|
|
||||||
onTap: () {
|
|
||||||
RouterManager.router.navigateTo(
|
|
||||||
context,
|
|
||||||
RouterManager.jobReportPagePath + '?title=${Uri.encodeComponent(jobTaskItem.title)}&id=${jobTaskItem.id}',
|
|
||||||
transition: getTransition(),
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Row(
|
child: Row(
|
||||||
children: [
|
children: [
|
||||||
Expanded(flex: 1, child: SizedBox()),
|
Container(
|
||||||
Expanded(
|
width: 32.w,
|
||||||
flex: 9,
|
height: 18.h,
|
||||||
child: Container(
|
alignment: Alignment.center,
|
||||||
alignment: Alignment.center,
|
padding: EdgeInsets.only(left: 2.w),
|
||||||
margin: EdgeInsets.only(top: 20.h),
|
decoration: BoxDecoration(
|
||||||
padding: EdgeInsets.symmetric(vertical: 7.h),
|
color: Color.fromRGBO(104, 136, 253, 1),
|
||||||
decoration: BoxDecoration(
|
borderRadius: BorderRadius.only(
|
||||||
borderRadius: BorderRadius.circular(20),
|
topLeft: Radius.circular(18.r),
|
||||||
gradient: LinearGradient(
|
topRight: Radius.circular(3.r),
|
||||||
begin: Alignment.centerLeft,
|
bottomLeft: Radius.circular(4.r),
|
||||||
end: Alignment.centerRight,
|
bottomRight: Radius.circular(4.r),
|
||||||
colors: [Color.fromRGBO(95, 197, 255, 1), Color.fromRGBO(61, 68, 255, 0.82)],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
child: quickText('查看报告', color: Colors.white, size: 12.sp),
|
|
||||||
),
|
),
|
||||||
|
margin: EdgeInsets.only(right: 4.w),
|
||||||
|
child: quickText('作业', color: Colors.white, size: 10.sp),
|
||||||
),
|
),
|
||||||
Expanded(flex: 1, child: SizedBox()),
|
quickText(
|
||||||
|
jobTaskItem.title,
|
||||||
|
size: 16.sp,
|
||||||
|
color: Color.fromRGBO(70, 70, 70, 1),
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
)
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
SizedBox(height: 10.h),
|
|
||||||
ExpansionTile(
|
SizedBox(height: 12.h),
|
||||||
tilePadding: EdgeInsets.only(right: 10.w, bottom: 0),
|
Padding(
|
||||||
title: Row(
|
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||||
mainAxisSize: MainAxisSize.min,
|
child: Row(
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
children: [
|
children: [
|
||||||
// badges.Badge(
|
quickText(
|
||||||
// position: badges.BadgePosition.topEnd(top: -3.r, end: -12.r),
|
jobTaskItem.createTime.substring(0, 10),
|
||||||
// badgeStyle: BadgeStyle(badgeColor: Theme.of(context).primaryColor.withOpacity(0.7)),
|
color: Color.fromRGBO(97, 97, 97, 1),
|
||||||
// badgeContent: Text(
|
size: 14.sp,
|
||||||
// jobTaskItem.markingTasks.length.toString(),
|
fontWeight: FontWeight.w500,
|
||||||
// style: TextStyle(color: Colors.white, fontSize: 10.sp),
|
),
|
||||||
// ),
|
quickText(' / ', color: Color.fromRGBO(76, 199, 147, 1), size: 12.sp, fontWeight: FontWeight.w500),
|
||||||
// child: quickText('班级列表 ', size: 17.sp),
|
quickText(
|
||||||
// ),
|
'参与班级:字段待定',
|
||||||
badges.Badge(
|
color: Color.fromRGBO(76, 199, 147, 1),
|
||||||
badgeStyle: badges.BadgeStyle(
|
size: 12.sp,
|
||||||
shape: badges.BadgeShape.square,
|
fontWeight: FontWeight.w600,
|
||||||
borderRadius: BorderRadius.circular(5.r),
|
),
|
||||||
padding: EdgeInsets.all(2.r),
|
quickText(' / ', color: Color.fromRGBO(116, 145, 253, 1), size: 12.sp, fontWeight: FontWeight.w500),
|
||||||
badgeGradient: badges.BadgeGradient.linear(
|
quickText(
|
||||||
colors: [
|
'科目:' + jobTaskItem.subjectName,
|
||||||
Colors.purple,
|
color: Color.fromRGBO(116, 145, 253, 1),
|
||||||
Colors.blue,
|
size: 12.sp,
|
||||||
],
|
fontWeight: FontWeight.w600,
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
position: badges.BadgePosition.topEnd(top: -2.r, end: -8.r),
|
|
||||||
badgeContent: Text(
|
|
||||||
jobTaskItem.markingTasks.length.toString(),
|
|
||||||
style: TextStyle(color: Colors.white, fontSize: 10, fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
child: quickText('班级列表 ', size: 17.sp),
|
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
childrenPadding: EdgeInsets.only(top: 0.h),
|
|
||||||
children: jobTaskItem.markingTasks.map((e) {
|
|
||||||
return $CompletedHomeworkChildView(
|
|
||||||
jobTaskItem: jobTaskItem,
|
|
||||||
taskItem: e,
|
|
||||||
showStudentsCall: showStudentsCall,
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
),
|
),
|
||||||
|
|
||||||
|
SizedBox(height: 20.h),
|
||||||
|
Container(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 8.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: InkWell(
|
||||||
|
onTap: () => easyThrottle('go_to_homework_report', () => {}),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
// $CompletedHomeworkInfoBox(
|
||||||
|
// segmentation: false,
|
||||||
|
// showStudentsCall: showStudentsCall,
|
||||||
|
// unsubmittedQuantity: jobTaskItem.studentCount - jobTaskItem.commitStudentCount,
|
||||||
|
// submittedQuantity: jobTaskItem.commitStudentCount,
|
||||||
|
// precision: jobTaskItem.precision / 100,
|
||||||
|
// objectivePrecision: jobTaskItem.objectivePrecision / 100,
|
||||||
|
// subjectivePrecision: jobTaskItem.subjectivePrecision / 100,
|
||||||
|
// ),
|
||||||
|
// InkWell(
|
||||||
|
// onTap: () {
|
||||||
|
// RouterManager.router.navigateTo(
|
||||||
|
// context,
|
||||||
|
// RouterManager.jobReportPagePath + '?title=${Uri.encodeComponent(jobTaskItem.title)}&id=${jobTaskItem.id}',
|
||||||
|
// transition: getTransition(),
|
||||||
|
// );
|
||||||
|
// },
|
||||||
|
// child: Row(
|
||||||
|
// children: [
|
||||||
|
// Expanded(flex: 1, child: SizedBox()),
|
||||||
|
// Expanded(
|
||||||
|
// flex: 9,
|
||||||
|
// child: Container(
|
||||||
|
// alignment: Alignment.center,
|
||||||
|
// margin: EdgeInsets.only(top: 20.h),
|
||||||
|
// padding: EdgeInsets.symmetric(vertical: 7.h),
|
||||||
|
// decoration: BoxDecoration(
|
||||||
|
// 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()),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// )
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
|
|
@ -364,7 +330,6 @@ Widget $completedHomeworkChildView(
|
||||||
submittedQuantity: taskItem.commitStudentCount,
|
submittedQuantity: taskItem.commitStudentCount,
|
||||||
unsubmittedQuantity: taskItem.studentCount - taskItem.commitStudentCount,
|
unsubmittedQuantity: taskItem.studentCount - taskItem.commitStudentCount,
|
||||||
showStudentsCall: showStudentsCall,
|
showStudentsCall: showStudentsCall,
|
||||||
taskIds: [taskItem.id],
|
|
||||||
className: taskItem.className,
|
className: taskItem.className,
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
|
|
@ -375,7 +340,6 @@ Widget $completedHomeworkChildView(
|
||||||
@swidget
|
@swidget
|
||||||
Widget $completedHomeworkBtn(
|
Widget $completedHomeworkBtn(
|
||||||
BuildContext context, {
|
BuildContext context, {
|
||||||
required List<int> taskIds,
|
|
||||||
required int submittedQuantity,
|
required int submittedQuantity,
|
||||||
required int unsubmittedQuantity,
|
required int unsubmittedQuantity,
|
||||||
required ShowStudentsCall showStudentsCall,
|
required ShowStudentsCall showStudentsCall,
|
||||||
|
|
@ -391,7 +355,7 @@ Widget $completedHomeworkBtn(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () {
|
onTap: () {
|
||||||
if (unsubmittedQuantity <= 0) return ToastUtils.showInfo('没有未提交的作业');
|
if (unsubmittedQuantity <= 0) return ToastUtils.showInfo('没有未提交的作业');
|
||||||
showStudentsCall(context, taskIds, false, className);
|
showStudentsCall(context, false, className);
|
||||||
},
|
},
|
||||||
borderRadius: BorderRadius.circular(8.r),
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
@ -413,7 +377,7 @@ Widget $completedHomeworkBtn(
|
||||||
child: InkWell(
|
child: InkWell(
|
||||||
onTap: () async {
|
onTap: () async {
|
||||||
if (submittedQuantity <= 0) return ToastUtils.showInfo('没有已提交的作业');
|
if (submittedQuantity <= 0) return ToastUtils.showInfo('没有已提交的作业');
|
||||||
showStudentsCall(context, taskIds, true, className);
|
showStudentsCall(context, true, className);
|
||||||
},
|
},
|
||||||
borderRadius: BorderRadius.circular(8.r),
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
child: Container(
|
child: Container(
|
||||||
|
|
@ -511,7 +475,6 @@ Widget $completedHomeworkProgressBar(
|
||||||
@swidget
|
@swidget
|
||||||
Widget $completedHomeworkInfoBox(
|
Widget $completedHomeworkInfoBox(
|
||||||
BuildContext context, {
|
BuildContext context, {
|
||||||
required List<int> taskIds,
|
|
||||||
required int unsubmittedQuantity,
|
required int unsubmittedQuantity,
|
||||||
required int submittedQuantity,
|
required int submittedQuantity,
|
||||||
required double objectivePrecision, // 客观题正确率
|
required double objectivePrecision, // 客观题正确率
|
||||||
|
|
@ -524,7 +487,6 @@ Widget $completedHomeworkInfoBox(
|
||||||
return Column(
|
return Column(
|
||||||
children: [
|
children: [
|
||||||
$CompletedHomeworkBtn(
|
$CompletedHomeworkBtn(
|
||||||
taskIds: taskIds,
|
|
||||||
className: className,
|
className: className,
|
||||||
unsubmittedQuantity: unsubmittedQuantity,
|
unsubmittedQuantity: unsubmittedQuantity,
|
||||||
submittedQuantity: submittedQuantity,
|
submittedQuantity: submittedQuantity,
|
||||||
|
|
@ -557,13 +519,7 @@ Widget $completedHomeworkInfoBox(
|
||||||
|
|
||||||
// 未完成作业单个view
|
// 未完成作业单个view
|
||||||
@swidget
|
@swidget
|
||||||
Widget $unfinishedHomework(
|
Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskItem}) {
|
||||||
BuildContext context, {
|
|
||||||
required JobTaskItem jobTaskItem,
|
|
||||||
required VoidCallback refreshCallback,
|
|
||||||
required EndReviewCall endReviewCallback,
|
|
||||||
required Function(int) oneClickReviewCallback,
|
|
||||||
}) {
|
|
||||||
return Stack(
|
return Stack(
|
||||||
alignment: const FractionalOffset(0.95, 0),
|
alignment: const FractionalOffset(0.95, 0),
|
||||||
children: [
|
children: [
|
||||||
|
|
@ -599,7 +555,9 @@ Widget $unfinishedHomework(
|
||||||
alignment: Alignment.center,
|
alignment: Alignment.center,
|
||||||
padding: EdgeInsets.only(left: 2.w),
|
padding: EdgeInsets.only(left: 2.w),
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: Color.fromRGBO(104, 136, 253, 1),
|
color: jobTaskItem.markingTypeEnum.name == '作业'
|
||||||
|
? const Color.fromRGBO(104, 136, 253, 1)
|
||||||
|
: const Color.fromRGBO(255, 175, 56, 1),
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topLeft: Radius.circular(18.r),
|
topLeft: Radius.circular(18.r),
|
||||||
topRight: Radius.circular(3.r),
|
topRight: Radius.circular(3.r),
|
||||||
|
|
@ -608,7 +566,7 @@ Widget $unfinishedHomework(
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
margin: EdgeInsets.only(right: 4.w),
|
margin: EdgeInsets.only(right: 4.w),
|
||||||
child: quickText('作业', color: Colors.white, size: 10.sp),
|
child: quickText(jobTaskItem.markingTypeEnum.name, color: Colors.white, size: 10.sp),
|
||||||
),
|
),
|
||||||
quickText(
|
quickText(
|
||||||
jobTaskItem.title,
|
jobTaskItem.title,
|
||||||
|
|
@ -653,50 +611,6 @@ Widget $unfinishedHomework(
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
// 未完成按钮
|
|
||||||
$UnfinishedBtn(
|
|
||||||
isChild: false,
|
|
||||||
jobTaskItem: jobTaskItem,
|
|
||||||
endCallback: endReviewCallback,
|
|
||||||
refreshcall: refreshCallback,
|
|
||||||
),
|
|
||||||
SizedBox(height: 20.h),
|
|
||||||
ExpansionTile(
|
|
||||||
tilePadding: EdgeInsets.only(right: 10.w),
|
|
||||||
title: Row(
|
|
||||||
mainAxisSize: MainAxisSize.min,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
badges.Badge(
|
|
||||||
badgeStyle: badges.BadgeStyle(
|
|
||||||
shape: badges.BadgeShape.square,
|
|
||||||
borderRadius: BorderRadius.circular(5.r),
|
|
||||||
padding: EdgeInsets.all(2.r),
|
|
||||||
badgeGradient: badges.BadgeGradient.linear(
|
|
||||||
colors: [Colors.purple, Colors.blue],
|
|
||||||
begin: Alignment.topLeft,
|
|
||||||
end: Alignment.bottomRight,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
position: badges.BadgePosition.topEnd(top: -2.r, end: -8.r),
|
|
||||||
badgeContent: Text(
|
|
||||||
jobTaskItem.markingTasks.length.toString(),
|
|
||||||
style: TextStyle(color: Colors.white, fontSize: 10, fontWeight: FontWeight.bold),
|
|
||||||
),
|
|
||||||
child: quickText('班级列表 ', size: 17.sp),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
children: jobTaskItem.markingTasks.map((e) {
|
|
||||||
return $UnfinishedClassItem(
|
|
||||||
jobTaskItem: jobTaskItem,
|
|
||||||
jobTaskClassItem: e,
|
|
||||||
endReviewCallback: endReviewCallback,
|
|
||||||
refreshCallback: refreshCallback,
|
|
||||||
oneClickReviewCallback: oneClickReviewCallback,
|
|
||||||
);
|
|
||||||
}).toList(),
|
|
||||||
),
|
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -752,500 +666,9 @@ Widget $unfinishedHomework(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 未完成作业按钮 (名称和数量)
|
|
||||||
@swidget
|
|
||||||
Widget $unfinishedBtn(
|
|
||||||
BuildContext context, {
|
|
||||||
required JobTaskItem jobTaskItem,
|
|
||||||
required VoidCallback refreshcall,
|
|
||||||
required EndReviewCall endCallback,
|
|
||||||
MarkingTasks? jobTaskClassItem,
|
|
||||||
bool isChild = true,
|
|
||||||
}) {
|
|
||||||
if (!isChild) {
|
|
||||||
MarkingTasks? theCanReviewChild = jobTaskItem.markingTasks.firstWhereOrNull((e) => e.canGoReview);
|
|
||||||
|
|
||||||
List<MarkingTasks> canEndTaskChilds = jobTaskItem.markingTasks.where((e) => !e.isFinish && e.canMarking).toList();
|
|
||||||
return Container(
|
|
||||||
margin: EdgeInsets.only(top: 22.h),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: Material(
|
|
||||||
color: theCanReviewChild != null ? Colors.white : Colors.grey[300],
|
|
||||||
borderRadius: BorderRadius.circular(30.r),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
MarkingTasks? markingTask =
|
|
||||||
jobTaskItem.markingTasks.firstWhereOrNull((e) => e.canMarking && e.totalCount > 0 && !e.isFinish);
|
|
||||||
if (markingTask == null) {
|
|
||||||
ToastUtils.showInfo('没有找到可以批阅的任务');
|
|
||||||
// AchievementView(
|
|
||||||
// elevation: 0.5,
|
|
||||||
// duration: Duration(seconds: 1),
|
|
||||||
// title: "提示",
|
|
||||||
// subTitle: "没有找到可以批阅的任务",
|
|
||||||
// color: Theme.of(context).primaryColor,
|
|
||||||
// ).show(context);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
String url =
|
|
||||||
'${RouterManager.markingHomeworkDoPath}?taskId=${markingTask.id}&jobId=${jobTaskItem.id}&taskName=${Uri.encodeComponent(jobTaskItem.title)}&className=${Uri.encodeComponent(jobTaskItem.genderName + markingTask.className)}';
|
|
||||||
RouterManager.router.navigateTo(context, url, transition: getTransition()).then((value) {
|
|
||||||
if (value != null && value == true) refreshcall();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
borderRadius: BorderRadius.circular(30.r),
|
|
||||||
child: Container(
|
|
||||||
height: 36.h,
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 3.h),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(30.r),
|
|
||||||
border: Border.all(color: Theme.of(context).primaryColor),
|
|
||||||
),
|
|
||||||
child: quickText('批阅', color: Theme.of(context).primaryColor, size: 14.sp),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 1,
|
|
||||||
child: SizedBox(width: 5.w),
|
|
||||||
),
|
|
||||||
Expanded(
|
|
||||||
flex: 2,
|
|
||||||
child: Material(
|
|
||||||
color: canEndTaskChilds.isNotEmpty ? Color.fromRGBO(104, 136, 253, 1) : Colors.grey,
|
|
||||||
borderRadius: BorderRadius.circular(30.r),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
List<MarkingTasks> childTasks =
|
|
||||||
jobTaskItem.markingTasks.where((e) => !e.isFinish && e.canMarking).toList();
|
|
||||||
if (childTasks.isEmpty) return ToastUtils.showInfo('没有可以结束的任务');
|
|
||||||
|
|
||||||
// 未完成批阅任务提示
|
|
||||||
List<MarkingTasks> incompleteTasks = childTasks.where((e) => e.finishCount < e.totalCount).toList();
|
|
||||||
if (incompleteTasks.isNotEmpty) {
|
|
||||||
var continueFlag = await showDialog<bool>(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context1) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: Text('未完成批阅提示'),
|
|
||||||
content: Text('当前批阅任务未完成,请确认需要结束此任务?'),
|
|
||||||
actions: <Widget>[
|
|
||||||
TextButton(
|
|
||||||
child: Text('否'),
|
|
||||||
onPressed: () {
|
|
||||||
// 在这里处理删除操作
|
|
||||||
Navigator.of(context1).pop(false);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
child: Text('是'),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context1).pop(true);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
if (continueFlag == null || !continueFlag) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context1) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: Text('提示'),
|
|
||||||
content: Text('确认完成以下${childTasks.map((e) => e.className).toList().join(",")}的批阅任务?'),
|
|
||||||
actions: <Widget>[
|
|
||||||
TextButton(
|
|
||||||
child: Text('否'),
|
|
||||||
onPressed: () {
|
|
||||||
// 在这里处理删除操作
|
|
||||||
Navigator.of(context1).pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
child: Text('确定'),
|
|
||||||
onPressed: () async {
|
|
||||||
try {
|
|
||||||
bool result = await endCallback(childTasks);
|
|
||||||
if (result) refreshcall();
|
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
|
||||||
ToastUtils.dismiss();
|
|
||||||
Navigator.of(context1).pop();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
borderRadius: BorderRadius.circular(30.r),
|
|
||||||
child: Container(
|
|
||||||
height: 36.h,
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 3.5.h),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(30.r),
|
|
||||||
),
|
|
||||||
child: quickText('结束批阅', size: 14.sp, color: Colors.white),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!jobTaskClassItem!.canMarking)
|
|
||||||
return Container(
|
|
||||||
alignment: Alignment.centerRight,
|
|
||||||
child: jobTaskClassItem.isFinish
|
|
||||||
? Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
quickText(jobTaskClassItem.finishTime?.substring(0, 16),
|
|
||||||
size: 10.sp, color: Color.fromRGBO(170, 170, 170, 1)),
|
|
||||||
SizedBox(width: 4.w),
|
|
||||||
quickText('已批阅', size: 10.sp, color: Theme.of(context).primaryColor),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: quickText(
|
|
||||||
'待批阅',
|
|
||||||
size: 10.sp,
|
|
||||||
color: Color.fromRGBO(255, 138, 0, 1),
|
|
||||||
),
|
|
||||||
);
|
|
||||||
|
|
||||||
return Container(
|
|
||||||
child: jobTaskClassItem.isFinish
|
|
||||||
? Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.end,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
quickText(jobTaskClassItem.finishTime?.substring(0, 16),
|
|
||||||
size: 12.sp, color: Color.fromRGBO(170, 170, 170, 1)),
|
|
||||||
SizedBox(width: 4.w),
|
|
||||||
quickText('已批阅', size: 13.sp, color: Theme.of(context).primaryColor),
|
|
||||||
],
|
|
||||||
)
|
|
||||||
: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.end,
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
flex: 5,
|
|
||||||
child: Material(
|
|
||||||
color: jobTaskClassItem.canGoReview ? Colors.white : Colors.grey[300],
|
|
||||||
borderRadius: BorderRadius.circular(4.r),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () {
|
|
||||||
if (jobTaskClassItem.totalCount <= 0) {
|
|
||||||
return ToastUtils.showInfo('没有找到可以批阅的任务');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!jobTaskClassItem.canMarking) {
|
|
||||||
return AchievementView(
|
|
||||||
elevation: 0.5,
|
|
||||||
duration: Duration(seconds: 1),
|
|
||||||
title: "提示",
|
|
||||||
subTitle: "此账号无法批阅该任务",
|
|
||||||
color: Theme.of(context).primaryColor,
|
|
||||||
).show(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (jobTaskClassItem.isFinish) {
|
|
||||||
return AchievementView(
|
|
||||||
elevation: 0.5,
|
|
||||||
duration: Duration(seconds: 1),
|
|
||||||
title: "提示",
|
|
||||||
subTitle: "此批阅任务已完成",
|
|
||||||
color: Theme.of(context).primaryColor,
|
|
||||||
).show(context);
|
|
||||||
}
|
|
||||||
|
|
||||||
String url =
|
|
||||||
'${RouterManager.markingHomeworkDoPath}?taskId=${jobTaskClassItem.id}&jobId=${jobTaskItem.id}&taskName=${Uri.encodeComponent(jobTaskItem.title)}&className=${Uri.encodeComponent(jobTaskItem.genderName + jobTaskClassItem.className)}';
|
|
||||||
RouterManager.router.navigateTo(context, url, transition: getTransition()).then((value) {
|
|
||||||
if (value == true) refreshcall();
|
|
||||||
});
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 6.h),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(4.r),
|
|
||||||
border: Border.all(color: Theme.of(context).primaryColor),
|
|
||||||
),
|
|
||||||
child: quickText('批阅', color: Theme.of(context).primaryColor, size: 12.sp),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
Expanded(flex: 1, child: SizedBox()),
|
|
||||||
Expanded(
|
|
||||||
flex: 5,
|
|
||||||
child: Material(
|
|
||||||
color: !jobTaskClassItem.isFinish && jobTaskClassItem.canMarking
|
|
||||||
? Color.fromRGBO(237, 240, 255, 1)
|
|
||||||
: Colors.grey,
|
|
||||||
borderRadius: BorderRadius.circular(4.r),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () async {
|
|
||||||
if (!jobTaskClassItem.canMarking) return ToastUtils.showInfo('此任务非该账号任务');
|
|
||||||
if (jobTaskClassItem.isFinish) return ToastUtils.showInfo('此任务已经结束');
|
|
||||||
|
|
||||||
// 未完成批阅任务提示
|
|
||||||
if (jobTaskClassItem.finishCount < jobTaskClassItem.totalCount) {
|
|
||||||
var continueFlag = await showDialog<bool>(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context1) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: Text('未完成批阅提示'),
|
|
||||||
content: Text('当前批阅任务未完成,请确认需要结束此任务?'),
|
|
||||||
actions: <Widget>[
|
|
||||||
TextButton(
|
|
||||||
child: Text('否'),
|
|
||||||
onPressed: () {
|
|
||||||
// 在这里处理删除操作
|
|
||||||
Navigator.of(context1).pop(false);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
child: Text('是'),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context1).pop(true);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
if (continueFlag == null || !continueFlag) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
showDialog(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context1) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: Text('提示'),
|
|
||||||
content: Text('确认完成当前${jobTaskClassItem.className}批阅任务?'),
|
|
||||||
actions: <Widget>[
|
|
||||||
TextButton(
|
|
||||||
child: Text('否'),
|
|
||||||
onPressed: () {
|
|
||||||
// 在这里处理删除操作
|
|
||||||
Navigator.of(context1).pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
child: Text('确定'),
|
|
||||||
onPressed: () async {
|
|
||||||
try {
|
|
||||||
bool result = await endCallback([jobTaskClassItem]);
|
|
||||||
if (result) refreshcall();
|
|
||||||
} catch (e) {
|
|
||||||
} finally {
|
|
||||||
ToastUtils.dismiss();
|
|
||||||
Navigator.of(context1).pop();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
},
|
|
||||||
child: Container(
|
|
||||||
padding: EdgeInsets.symmetric(vertical: 6.h),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(4.r),
|
|
||||||
border: Border.all(color: Color.fromRGBO(130, 156, 255, 1)),
|
|
||||||
),
|
|
||||||
child: quickText('结束批阅', size: 12.sp, color: Color.fromRGBO(104, 136, 253, 1)),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
)),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// 未完成作业单个班级view
|
|
||||||
@swidget
|
|
||||||
Widget $unfinishedClassItem(
|
|
||||||
BuildContext context, {
|
|
||||||
required JobTaskItem jobTaskItem,
|
|
||||||
required MarkingTasks jobTaskClassItem,
|
|
||||||
required VoidCallback refreshCallback,
|
|
||||||
required EndReviewCall endReviewCallback,
|
|
||||||
required Function(int) oneClickReviewCallback,
|
|
||||||
}) {
|
|
||||||
return Container(
|
|
||||||
padding: EdgeInsets.only(bottom: 14.w),
|
|
||||||
margin: EdgeInsets.only(bottom: 20.h),
|
|
||||||
decoration: BoxDecoration(border: Border(bottom: BorderSide(color: Color.fromRGBO(233, 233, 233, 1), width: 1.r))),
|
|
||||||
child: Column(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.start,
|
|
||||||
children: [
|
|
||||||
Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: quickText(jobTaskItem.genderName + jobTaskClassItem.className,
|
|
||||||
color: Color.fromRGBO(255, 123, 1, 1), size: 14.sp)),
|
|
||||||
if (!jobTaskClassItem.isFinish)
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
borderRadius: BorderRadius.circular(10.r),
|
|
||||||
boxShadow: [
|
|
||||||
BoxShadow(
|
|
||||||
color: Color.fromRGBO(104, 136, 253, 1),
|
|
||||||
spreadRadius: 0.5,
|
|
||||||
blurRadius: 1,
|
|
||||||
offset: Offset(0, 0),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
child: LinearPercentIndicator(
|
|
||||||
padding: EdgeInsets.zero,
|
|
||||||
animation: true,
|
|
||||||
lineHeight: 10.h,
|
|
||||||
animationDuration: 2500,
|
|
||||||
percent: jobTaskClassItem.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: [
|
|
||||||
Theme.of(context).primaryColor.withOpacity(0.1),
|
|
||||||
Theme.of(context).primaryColor,
|
|
||||||
],
|
|
||||||
),
|
|
||||||
// linearStrokeCap: LinearStrokeCap.butt,
|
|
||||||
// progressColor: Theme.of(context).primaryColor,
|
|
||||||
backgroundColor: Colors.white,
|
|
||||||
barRadius: Radius.circular(10.r),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
SizedBox(width: 4.w),
|
|
||||||
quickText('${getDoubleRemoveZero(jobTaskClassItem.progressPercentage)}%',
|
|
||||||
size: 10.sp, color: Color.fromRGBO(104, 136, 253, 1))
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
SizedBox(height: 14.h),
|
|
||||||
Container(
|
|
||||||
child: Row(
|
|
||||||
children: [
|
|
||||||
Expanded(
|
|
||||||
child: Row(children: [
|
|
||||||
quickText('题量:${jobTaskClassItem.totalCount}'),
|
|
||||||
SizedBox(width: 20.w),
|
|
||||||
quickText(jobTaskClassItem.teacherName)
|
|
||||||
])),
|
|
||||||
Expanded(
|
|
||||||
child: $UnfinishedBtn(
|
|
||||||
jobTaskItem: jobTaskItem,
|
|
||||||
jobTaskClassItem: jobTaskClassItem,
|
|
||||||
endCallback: endReviewCallback,
|
|
||||||
refreshcall: refreshCallback,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
if (jobTaskClassItem.canGoReview) SizedBox(height: 6.h),
|
|
||||||
if (jobTaskClassItem.canGoReview)
|
|
||||||
Material(
|
|
||||||
borderRadius: BorderRadius.circular(30.r),
|
|
||||||
child: InkWell(
|
|
||||||
onTap: () => easyThrottle('OneClickReview', () async {
|
|
||||||
var continueFlag = await showDialog<bool>(
|
|
||||||
context: context,
|
|
||||||
builder: (BuildContext context1) {
|
|
||||||
return AlertDialog(
|
|
||||||
title: Text('一键批阅'),
|
|
||||||
content: Text('一键批阅后,默认学生答题结果全部正确,是否进行此操作?'),
|
|
||||||
actions: <Widget>[
|
|
||||||
TextButton(
|
|
||||||
child: Text('否'),
|
|
||||||
onPressed: () {
|
|
||||||
// 在这里处理删除操作
|
|
||||||
Navigator.of(context1).pop(false);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
child: Text('是'),
|
|
||||||
onPressed: () {
|
|
||||||
Navigator.of(context1).pop(true);
|
|
||||||
},
|
|
||||||
),
|
|
||||||
],
|
|
||||||
);
|
|
||||||
},
|
|
||||||
);
|
|
||||||
if (continueFlag == null || !continueFlag) return;
|
|
||||||
oneClickReviewCallback(jobTaskClassItem.id);
|
|
||||||
}),
|
|
||||||
borderRadius: BorderRadius.circular(30.r),
|
|
||||||
child: Container(
|
|
||||||
height: 20.h,
|
|
||||||
constraints: BoxConstraints(minWidth: 50.w, maxWidth: 60.w),
|
|
||||||
alignment: Alignment.center,
|
|
||||||
decoration: BoxDecoration(
|
|
||||||
color: Colors.white,
|
|
||||||
borderRadius: BorderRadius.circular(30.r),
|
|
||||||
border: Border.all(color: Color.fromRGBO(76, 199, 147, 1)),
|
|
||||||
),
|
|
||||||
child: Row(
|
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: [
|
|
||||||
quickText('一键批阅', color: Color.fromRGBO(76, 199, 147, 1), size: 10.sp),
|
|
||||||
Padding(
|
|
||||||
padding: EdgeInsets.only(top: 1.1.h),
|
|
||||||
child: Icon(Icons.arrow_forward_ios, size: 8.sp, color: Color.fromRGBO(76, 199, 147, 1)),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
typedef EndReviewCall = Future<bool> Function(List<MarkingTasks> markingTasks);
|
typedef EndReviewCall = Future<bool> Function(List<MarkingTasks> markingTasks);
|
||||||
typedef ShowStudentsCall = Future<void> Function(
|
typedef ShowStudentsCall = Future<void> Function(
|
||||||
BuildContext context,
|
BuildContext context, [
|
||||||
List<int> taskIds, [
|
|
||||||
bool? submitted,
|
bool? submitted,
|
||||||
String? className,
|
String? className,
|
||||||
]);
|
]);
|
||||||
|
|
|
||||||
|
|
@ -167,6 +167,7 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
|
||||||
margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
margin: EdgeInsets.only(top: MediaQuery.of(context).padding.top),
|
||||||
padding: EdgeInsets.only(bottom: 9.h, top: 4.h),
|
padding: EdgeInsets.only(bottom: 9.h, top: 4.h),
|
||||||
child: Row(
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
children: [
|
children: [
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
|
|
@ -254,7 +255,10 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
|
||||||
),
|
),
|
||||||
Expanded(
|
Expanded(
|
||||||
flex: 1,
|
flex: 1,
|
||||||
child: SizedBox(),
|
child: InkWell(
|
||||||
|
onTap: () {},
|
||||||
|
child: Icon(Icons.settings_outlined, color: Color.fromRGBO(44, 48, 63, 1), size: 24.sp),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
@ -304,6 +308,7 @@ Widget $easyRefresh({
|
||||||
required int tab,
|
required int tab,
|
||||||
}) {
|
}) {
|
||||||
bool completed = tab == 2; // 是否是待批阅
|
bool completed = tab == 2; // 是否是待批阅
|
||||||
|
bool isPadFlag = isPad();
|
||||||
return EasyRefresh(
|
return EasyRefresh(
|
||||||
firstRefresh: true,
|
firstRefresh: true,
|
||||||
taskIndependence: true,
|
taskIndependence: true,
|
||||||
|
|
@ -313,18 +318,144 @@ Widget $easyRefresh({
|
||||||
controller: controller,
|
controller: controller,
|
||||||
header: MaterialHeader(),
|
header: MaterialHeader(),
|
||||||
footer: TaurusFooter(),
|
footer: TaurusFooter(),
|
||||||
child: ListView.builder(
|
child: completed && isPadFlag
|
||||||
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 16.w, right: 16.w),
|
? GridView(
|
||||||
itemBuilder: (context, index) {
|
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
|
||||||
return HomeworkTasksViewItem(
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
completed: completed,
|
crossAxisCount: 2, //横轴三个子widget
|
||||||
jobTaskItem: data[index],
|
mainAxisSpacing: 10.h,
|
||||||
call: () => controller.callRefresh(),
|
crossAxisSpacing: 6.w,
|
||||||
);
|
childAspectRatio: 2.2 //宽高比为1时,子widget
|
||||||
},
|
),
|
||||||
itemCount: data.length,
|
children: data.map((e) {
|
||||||
),
|
return $ReviewedItem(jobTaskItem: e);
|
||||||
|
}).toList(),
|
||||||
|
)
|
||||||
|
: ListView.builder(
|
||||||
|
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
|
||||||
|
itemBuilder: (context, index) {
|
||||||
|
return HomeworkTasksViewItem(
|
||||||
|
completed: completed,
|
||||||
|
jobTaskItem: data[index],
|
||||||
|
call: () => controller.callRefresh(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
itemCount: data.length,
|
||||||
|
),
|
||||||
onRefresh: () => onRefresh(controller, params, tab),
|
onRefresh: () => onRefresh(controller, params, tab),
|
||||||
onLoad: () => onLoad(controller, params, tab),
|
onLoad: () => onLoad(controller, params, tab),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@swidget
|
||||||
|
Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
|
||||||
|
EdgeInsets padEdg = EdgeInsets.symmetric(horizontal: 10.w);
|
||||||
|
return Container(
|
||||||
|
padding: EdgeInsets.only(top: 10.h),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(6.r),
|
||||||
|
color: Colors.white,
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: const Color.fromRGBO(210, 216, 241, 1),
|
||||||
|
offset: Offset.zero, //阴影y轴偏移量
|
||||||
|
blurRadius: 5.8, //阴影模糊程度
|
||||||
|
spreadRadius: 0, //阴影扩散程度
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
// 顶部任务名称
|
||||||
|
Padding(
|
||||||
|
padding: padEdg,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 32.w,
|
||||||
|
height: 18.h,
|
||||||
|
alignment: Alignment.center,
|
||||||
|
padding: EdgeInsets.only(left: 2.w),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: jobTaskItem.markingTypeEnum.name == '作业'
|
||||||
|
? 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(
|
||||||
|
'参与班级:2',
|
||||||
|
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,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
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: InkWell(
|
||||||
|
onTap: () => easyThrottle('go_to_homework_report', () => {}),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 11.sp),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
]),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,993 @@
|
||||||
|
import 'package:achievement_view/achievement_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
|
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
|
||||||
|
import 'package:marking_app/common/mixin/common.dart';
|
||||||
|
import 'package:marking_app/common/model/common/base_structure_result.dart';
|
||||||
|
import 'package:marking_app/common/model/job/job_task_item.dart';
|
||||||
|
import 'package:marking_app/routes/RouterManager.dart';
|
||||||
|
import 'package:marking_app/utils/index.dart';
|
||||||
|
import 'package:marking_app/utils/my_text.dart';
|
||||||
|
import 'package:marking_app/utils/request/rest_client.dart';
|
||||||
|
import 'package:percent_indicator/linear_percent_indicator.dart';
|
||||||
|
|
||||||
|
part 'job_list_participate_in_class.g.dart';
|
||||||
|
|
||||||
|
class JobListParticipateInClass extends StatefulWidget {
|
||||||
|
final int jobId;
|
||||||
|
final String jobName;
|
||||||
|
final String genderName;
|
||||||
|
const JobListParticipateInClass({required this.jobId, required this.jobName, required this.genderName, super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
State<JobListParticipateInClass> createState() => _JobListParticipateInClassState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _JobListParticipateInClassState extends State<JobListParticipateInClass> with CommonMixin {
|
||||||
|
late Future<List<MarkingTasks>?> _future;
|
||||||
|
|
||||||
|
bool isRefresh = false;
|
||||||
|
|
||||||
|
@override
|
||||||
|
void initState() {
|
||||||
|
// TODO: implement initState
|
||||||
|
super.initState();
|
||||||
|
_future = getData();
|
||||||
|
Future.delayed(Duration.zero, () {
|
||||||
|
print(ScreenUtil().scaleWidth);
|
||||||
|
print(MediaQuery.of(context).devicePixelRatio);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
void dispose() {
|
||||||
|
// TODO: implement dispose
|
||||||
|
super.dispose();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future<List<MarkingTasks>?> getData() async {
|
||||||
|
RestClient _client = await getClient();
|
||||||
|
BaseStructureResult<List<MarkingTasks>> _result = await _client.getJobListParticipateInClass(widget.jobId);
|
||||||
|
return _result.data;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 一键批阅
|
||||||
|
void oneClickReview(int taskId) async {
|
||||||
|
var continueFlag = await showDialog<bool>(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context1) {
|
||||||
|
return Center(
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 25.h, horizontal: 18.w),
|
||||||
|
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadiusDirectional.circular(12.r)),
|
||||||
|
height: 150.h,
|
||||||
|
width: 280.w,
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: quickText('一键批阅后,默认学生答题结果全部正确,是否进行此操作?',
|
||||||
|
maxLines: 3, size: 14.sp, color: Color.fromRGBO(80, 94, 110, 1)))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context1).pop(false);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsetsDirectional.symmetric(horizontal: 36.w, vertical: 7.h),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color.fromRGBO(244, 244, 244, 1), borderRadius: BorderRadius.circular(20.r)),
|
||||||
|
child: quickText('取消', size: 14.sp, color: Color.fromRGBO(102, 102, 102, 1)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
onTap: () {
|
||||||
|
Navigator.of(context1).pop(true);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsetsDirectional.symmetric(horizontal: 36.w, vertical: 7.h),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(20.r)),
|
||||||
|
child: quickText('确认', size: 14.sp, color: Color.fromRGBO(255, 255, 255, 1)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
));
|
||||||
|
},
|
||||||
|
);
|
||||||
|
if (continueFlag == null || !continueFlag) return;
|
||||||
|
try {
|
||||||
|
ToastUtils.showLoading();
|
||||||
|
RestClient _client = await getClient();
|
||||||
|
BaseStructureResult<bool> res = await _client.toJobOneClickReview(taskId);
|
||||||
|
if (res.success) {
|
||||||
|
isRefresh = true;
|
||||||
|
_future = getData();
|
||||||
|
toUpState(setState, () {}, mounted);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
ToastUtils.showError(res.message ?? '操作失败');
|
||||||
|
} catch (e) {
|
||||||
|
} finally {
|
||||||
|
ToastUtils.dismiss();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 前往批阅
|
||||||
|
void goToReview(MarkingTasks task) {
|
||||||
|
if (task.totalCount <= 0) {
|
||||||
|
return ToastUtils.showInfo('没有找到可以批阅的任务');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!task.canMarking) {
|
||||||
|
return AchievementView(
|
||||||
|
elevation: 0.5,
|
||||||
|
duration: Duration(seconds: 1),
|
||||||
|
title: "提示",
|
||||||
|
subTitle: "此账号无法批阅该任务",
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
).show(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (task.isFinish) {
|
||||||
|
return AchievementView(
|
||||||
|
elevation: 0.5,
|
||||||
|
duration: Duration(seconds: 1),
|
||||||
|
title: "提示",
|
||||||
|
subTitle: "此批阅任务已完成",
|
||||||
|
color: Theme.of(context).primaryColor,
|
||||||
|
).show(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
String url =
|
||||||
|
'${RouterManager.markingHomeworkDoPath}?taskId=${task.id}&jobId=${widget.jobId}&taskName=${Uri.encodeComponent(widget.jobName)}&className=${Uri.encodeComponent(widget.genderName + task.className)}';
|
||||||
|
RouterManager.router.navigateTo(context, url, transition: getTransition()).then((value) {
|
||||||
|
if (value == true) {
|
||||||
|
isRefresh = true;
|
||||||
|
_future = getData();
|
||||||
|
toUpState(setState, () {}, mounted);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 结束批阅请求方法
|
||||||
|
Future<bool> endReviewInitialRequest(List<MarkingTasks> markingTasks) async {
|
||||||
|
try {
|
||||||
|
ToastUtils.showLoading();
|
||||||
|
RestClient client = await getClient();
|
||||||
|
BaseStructureResult res = await client.toEndReviewJob(markingTasks.map((e) => e.id).toList());
|
||||||
|
if (!res.success) ToastUtils.showError('结束失败,请重试');
|
||||||
|
return res.success;
|
||||||
|
} catch (e) {
|
||||||
|
ToastUtils.showError('结束失败,请重试');
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void endReview(MarkingTasks task) async {
|
||||||
|
/// 结束批阅逻辑
|
||||||
|
if (!task.canMarking) return ToastUtils.showInfo('此任务非该账号任务');
|
||||||
|
if (task.isFinish) return ToastUtils.showInfo('此任务已经结束');
|
||||||
|
|
||||||
|
// 未完成批阅任务提示
|
||||||
|
if (task.finishCount < task.totalCount) {
|
||||||
|
var continueFlag = await showDialog<bool>(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context1) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: Text('未完成批阅提示'),
|
||||||
|
content: Text('当前批阅任务未完成,请确认需要结束此任务?'),
|
||||||
|
actions: <Widget>[
|
||||||
|
TextButton(
|
||||||
|
child: Text('否'),
|
||||||
|
onPressed: () {
|
||||||
|
// 在这里处理删除操作
|
||||||
|
Navigator.of(context1).pop(false);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
child: Text('是'),
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.of(context1).pop(true);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
if (continueFlag == null || !continueFlag) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
showDialog(
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context1) {
|
||||||
|
return AlertDialog(
|
||||||
|
title: Text('提示'),
|
||||||
|
content: Text('确认完成当前${task.className}批阅任务?'),
|
||||||
|
actions: <Widget>[
|
||||||
|
TextButton(
|
||||||
|
child: Text('否'),
|
||||||
|
onPressed: () {
|
||||||
|
// 在这里处理删除操作
|
||||||
|
Navigator.of(context1).pop();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
TextButton(
|
||||||
|
child: Text('确定'),
|
||||||
|
onPressed: () async {
|
||||||
|
try {
|
||||||
|
bool result = await endReviewInitialRequest([task]);
|
||||||
|
if (result) {
|
||||||
|
isRefresh = true;
|
||||||
|
_future = getData();
|
||||||
|
toUpState(setState, () {}, mounted);
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
} finally {
|
||||||
|
ToastUtils.dismiss();
|
||||||
|
Navigator.of(context1).pop();
|
||||||
|
}
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 收藏夹
|
||||||
|
void bookmarks(MarkingTasks task) {}
|
||||||
|
|
||||||
|
// 数据快查
|
||||||
|
void quickDataCheck(MarkingTasks task) {}
|
||||||
|
|
||||||
|
// 查看作业报告
|
||||||
|
void jobViewReport(MarkingTasks task) {}
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor: const Color.fromRGBO(245, 245, 245, 1),
|
||||||
|
appBar: AppBar(
|
||||||
|
leading: IconButton(
|
||||||
|
icon: Icon(Icons.arrow_back_ios, color: Color.fromRGBO(51, 51, 51, 1)),
|
||||||
|
onPressed: () => Navigator.of(context).pop()),
|
||||||
|
title: Container(
|
||||||
|
child:
|
||||||
|
quickText(widget.jobName, size: 16.sp, color: Color.fromRGBO(51, 51, 51, 1), fontWeight: FontWeight.w500),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
),
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
),
|
||||||
|
body: MyFutureBuilder.buildFutureBuilderOfSingleInstance<List<MarkingTasks>?>(context, _future, (value) {
|
||||||
|
if (value == null) return Container();
|
||||||
|
|
||||||
|
if (isPad())
|
||||||
|
return TabletEnd(
|
||||||
|
data: value,
|
||||||
|
genderName: widget.genderName,
|
||||||
|
bookmarks: bookmarks,
|
||||||
|
endReview: endReview,
|
||||||
|
goToReview: goToReview,
|
||||||
|
jobViewReport: jobViewReport,
|
||||||
|
quickDataCheck: quickDataCheck,
|
||||||
|
oneClickReview: oneClickReview,
|
||||||
|
);
|
||||||
|
|
||||||
|
return MobileEnd(
|
||||||
|
data: value,
|
||||||
|
genderName: widget.genderName,
|
||||||
|
bookmarks: bookmarks,
|
||||||
|
endReview: endReview,
|
||||||
|
goToReview: goToReview,
|
||||||
|
jobViewReport: jobViewReport,
|
||||||
|
quickDataCheck: quickDataCheck,
|
||||||
|
oneClickReview: oneClickReview,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 平板电脑端
|
||||||
|
class TabletEnd extends StatelessWidget {
|
||||||
|
final String genderName;
|
||||||
|
final List<MarkingTasks> data;
|
||||||
|
|
||||||
|
final EndReview endReview; // 结束批阅
|
||||||
|
final Bookmarks bookmarks; // 收藏夹
|
||||||
|
final GoToReview goToReview; // 前往批阅
|
||||||
|
final JobViewReport jobViewReport;
|
||||||
|
final OneClickReview oneClickReview; // 一键批阅
|
||||||
|
final QuickDataCheck quickDataCheck; // 数据快查
|
||||||
|
const TabletEnd({
|
||||||
|
required this.genderName,
|
||||||
|
required this.data,
|
||||||
|
|
||||||
|
/// 方法
|
||||||
|
required this.endReview,
|
||||||
|
required this.bookmarks,
|
||||||
|
required this.goToReview,
|
||||||
|
required this.jobViewReport,
|
||||||
|
required this.oneClickReview,
|
||||||
|
required this.quickDataCheck,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
width: ScreenUtil().screenWidth,
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 16.h),
|
||||||
|
child: Wrap(
|
||||||
|
spacing: 8.0.w, // 子元素之间的间距
|
||||||
|
runSpacing: 10.h, // 主轴方向上不同行之间的间距
|
||||||
|
children: [...data, ...data, ...data]
|
||||||
|
.map((e) => $ItemDataViewOfPad(
|
||||||
|
task: e,
|
||||||
|
bookmarks: bookmarks,
|
||||||
|
endReview: endReview,
|
||||||
|
genderName: genderName,
|
||||||
|
goToReview: goToReview,
|
||||||
|
jobViewReport: jobViewReport,
|
||||||
|
quickDataCheck: quickDataCheck,
|
||||||
|
oneClickReview: oneClickReview,
|
||||||
|
))
|
||||||
|
.toList(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 移动端
|
||||||
|
class MobileEnd extends StatelessWidget {
|
||||||
|
final String genderName;
|
||||||
|
final List<MarkingTasks> data;
|
||||||
|
|
||||||
|
final EndReview endReview; // 结束批阅
|
||||||
|
final Bookmarks bookmarks; // 收藏夹
|
||||||
|
final GoToReview goToReview; // 前往批阅
|
||||||
|
final JobViewReport jobViewReport;
|
||||||
|
final OneClickReview oneClickReview; // 一键批阅
|
||||||
|
final QuickDataCheck quickDataCheck; // 数据快查
|
||||||
|
|
||||||
|
const MobileEnd({
|
||||||
|
required this.genderName,
|
||||||
|
required this.data,
|
||||||
|
|
||||||
|
/// 方法
|
||||||
|
required this.endReview,
|
||||||
|
required this.bookmarks,
|
||||||
|
required this.goToReview,
|
||||||
|
required this.jobViewReport,
|
||||||
|
required this.oneClickReview,
|
||||||
|
required this.quickDataCheck,
|
||||||
|
super.key,
|
||||||
|
});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ListView(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 16.h),
|
||||||
|
children: data.map((e) {
|
||||||
|
return $ItemDataView(
|
||||||
|
task: e,
|
||||||
|
bookmarks: bookmarks,
|
||||||
|
endReview: endReview,
|
||||||
|
genderName: genderName,
|
||||||
|
goToReview: goToReview,
|
||||||
|
jobViewReport: jobViewReport,
|
||||||
|
quickDataCheck: quickDataCheck,
|
||||||
|
oneClickReview: oneClickReview,
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// pad item view
|
||||||
|
@swidget
|
||||||
|
Widget $itemDataViewOfPad(
|
||||||
|
BuildContext context, {
|
||||||
|
required MarkingTasks task,
|
||||||
|
required String genderName,
|
||||||
|
|
||||||
|
/// 方法
|
||||||
|
required EndReview endReview,
|
||||||
|
required Bookmarks bookmarks,
|
||||||
|
required GoToReview goToReview,
|
||||||
|
required JobViewReport jobViewReport,
|
||||||
|
required OneClickReview oneClickReview,
|
||||||
|
required QuickDataCheck quickDataCheck,
|
||||||
|
}) {
|
||||||
|
EdgeInsets edgins = EdgeInsets.only(left: 8.w, right: 8.w);
|
||||||
|
return Container(
|
||||||
|
width: ScreenUtil().screenWidth / 2 - (12.w + 4.w),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.white,
|
||||||
|
borderRadius: BorderRadiusDirectional.circular(4.r),
|
||||||
|
boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.15), blurRadius: 10)],
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.only(top: 10.h),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: edgins,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
quickText(genderName + task.className, color: Color.fromRGBO(0, 0, 0, 1), size: 10.sp),
|
||||||
|
Expanded(child: SizedBox()),
|
||||||
|
quickText('已交:${task.commitStudentCount}', color: Color.fromRGBO(104, 136, 253, 1), size: 8.sp),
|
||||||
|
SizedBox(width: 10.w),
|
||||||
|
quickText('未交:${task.studentCount - task.commitStudentCount}',
|
||||||
|
color: Color.fromRGBO(255, 86, 86, 1), size: 8.sp),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.h),
|
||||||
|
Padding(
|
||||||
|
padding: edgins,
|
||||||
|
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: 3.h),
|
||||||
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
|
||||||
|
child: quickText('收藏夹(2)', size: 8.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', () => oneClickReview(task.id)),
|
||||||
|
borderRadius: BorderRadius.circular(8.r),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
padding: EdgeInsets.symmetric(vertical: 3.h),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(20.r),
|
||||||
|
),
|
||||||
|
child: quickText('一键批阅', size: 8.sp, color: Colors.white),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
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: 3.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: 3.h),
|
||||||
|
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
|
||||||
|
child: quickText('收藏夹(2)', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(height: 8.h),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(left: 10.w, right: 10.w),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: LinearPercentIndicator(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
animation: true,
|
||||||
|
lineHeight: 5.h,
|
||||||
|
animationDuration: 2500,
|
||||||
|
percent: task.progressPercentage / 100,
|
||||||
|
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),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
backgroundColor: Color.fromRGBO(232, 232, 232, 1),
|
||||||
|
barRadius: Radius.circular(10.r),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 7.w),
|
||||||
|
quickText('${getDoubleRemoveZero(task.progressPercentage)}%',
|
||||||
|
size: 8.sp, color: Color.fromRGBO(70, 70, 70, 1))
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
if (task.isFinish)
|
||||||
|
$CompletedHomeworkProgressBar(
|
||||||
|
fontSize: 8.sp,
|
||||||
|
lineHeight: 6.h,
|
||||||
|
color: Color.fromRGBO(76, 199, 147, 1),
|
||||||
|
percent: task.objectivePrecision,
|
||||||
|
title: '客观题正确率:',
|
||||||
|
padingEdg: edgins,
|
||||||
|
marginEdg: EdgeInsets.only(top: 8.h),
|
||||||
|
),
|
||||||
|
if (task.isFinish)
|
||||||
|
$CompletedHomeworkProgressBar(
|
||||||
|
fontSize: 8.sp,
|
||||||
|
lineHeight: 6.h,
|
||||||
|
color: Color.fromRGBO(255, 190, 91, 1),
|
||||||
|
percent: task.subjectivePrecision,
|
||||||
|
title: '主观题正确率:',
|
||||||
|
padingEdg: edgins,
|
||||||
|
marginEdg: EdgeInsets.only(top: 8.h),
|
||||||
|
),
|
||||||
|
if (task.isFinish)
|
||||||
|
$CompletedHomeworkProgressBar(
|
||||||
|
fontSize: 8.sp,
|
||||||
|
lineHeight: 6.h,
|
||||||
|
color: Color.fromRGBO(166, 139, 242, 1),
|
||||||
|
percent: task.precision,
|
||||||
|
title: '总正确率:',
|
||||||
|
padingEdg: edgins,
|
||||||
|
marginEdg: EdgeInsets.only(top: 8.h),
|
||||||
|
),
|
||||||
|
SizedBox(height: 8.h),
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(4.r), bottomRight: Radius.circular(4.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: 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', () => goToReview(task)),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: quickText('批阅', color: Color.fromRGBO(79, 79, 79, 1), size: 11.sp),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(width: 0.3.w, height: 24.h, color: Color.fromRGBO(221, 221, 221, 1)),
|
||||||
|
Expanded(
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () => easyThrottle('go_to_end_review_homework', () => endReview(task)),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: quickText('结束批阅', color: Color.fromRGBO(118, 118, 118, 1), size: 10.sp),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// item view
|
||||||
|
@swidget
|
||||||
|
Widget $itemDataView(
|
||||||
|
BuildContext context, {
|
||||||
|
required MarkingTasks task,
|
||||||
|
required String genderName,
|
||||||
|
|
||||||
|
/// 方法
|
||||||
|
required EndReview endReview,
|
||||||
|
required Bookmarks bookmarks,
|
||||||
|
required GoToReview goToReview,
|
||||||
|
required OneClickReview oneClickReview,
|
||||||
|
required QuickDataCheck quickDataCheck,
|
||||||
|
required JobViewReport jobViewReport,
|
||||||
|
}) {
|
||||||
|
var padingEdg = EdgeInsets.only(left: 10.w, right: 10.w);
|
||||||
|
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', () => oneClickReview(task.id)),
|
||||||
|
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', () => goToReview(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', () => endReview(task)),
|
||||||
|
child: Container(
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: quickText('结束批阅', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp),
|
||||||
|
),
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
@swidget
|
||||||
|
Widget $completedHomeworkProgressBar(
|
||||||
|
BuildContext context, {
|
||||||
|
double? fontSize,
|
||||||
|
double? lineHeight,
|
||||||
|
required String title,
|
||||||
|
required Color color,
|
||||||
|
required double percent,
|
||||||
|
required EdgeInsets padingEdg,
|
||||||
|
required EdgeInsets marginEdg,
|
||||||
|
}) {
|
||||||
|
var percentStr = '${doubleToStringAsFixed(percent * 100)}%';
|
||||||
|
print(fontSize);
|
||||||
|
fontSize ??= 10.sp;
|
||||||
|
lineHeight ??= 8.h;
|
||||||
|
return Container(
|
||||||
|
margin: marginEdg,
|
||||||
|
padding: padingEdg,
|
||||||
|
child: Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
if (title == '总正确率:') quickText('确率', color: Colors.transparent, size: fontSize),
|
||||||
|
quickText(title, color: Color.fromRGBO(139, 139, 139, 1), size: fontSize),
|
||||||
|
Expanded(
|
||||||
|
flex: 1,
|
||||||
|
child: Container(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10.r),
|
||||||
|
boxShadow: [
|
||||||
|
BoxShadow(
|
||||||
|
color: color,
|
||||||
|
spreadRadius: 0.6,
|
||||||
|
blurRadius: 3,
|
||||||
|
offset: Offset(0, 0),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
child: LinearPercentIndicator(
|
||||||
|
padding: EdgeInsets.zero,
|
||||||
|
animation: true,
|
||||||
|
lineHeight: lineHeight,
|
||||||
|
animationDuration: 2500,
|
||||||
|
percent: percent,
|
||||||
|
center: Text(
|
||||||
|
percentStr,
|
||||||
|
style: TextStyle(color: Colors.white, fontSize: 8.sp),
|
||||||
|
),
|
||||||
|
// linearStrokeCap: LinearStrokeCap.butt,
|
||||||
|
progressColor: color,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
barRadius: Radius.circular(10.r),
|
||||||
|
// linearGradient: LinearGradient(
|
||||||
|
// tileMode: TileMode.mirror,
|
||||||
|
// stops: [0.0, 1.0],
|
||||||
|
// colors: [color.withOpacity(0.1), color],
|
||||||
|
// ),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(width: 4.w),
|
||||||
|
quickText(percentStr, size: fontSize, color: color)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// 一键批阅
|
||||||
|
typedef OneClickReview = void Function(int);
|
||||||
|
|
||||||
|
/// 前往批阅
|
||||||
|
typedef GoToReview = void Function(MarkingTasks);
|
||||||
|
|
||||||
|
/// 结束批阅
|
||||||
|
typedef EndReview = void Function(MarkingTasks);
|
||||||
|
|
||||||
|
/// 数据快查
|
||||||
|
typedef QuickDataCheck = void Function(MarkingTasks);
|
||||||
|
|
||||||
|
/// 收藏夹
|
||||||
|
typedef Bookmarks = void Function(MarkingTasks);
|
||||||
|
|
||||||
|
/// 查看作业报告
|
||||||
|
typedef JobViewReport = void Function(MarkingTasks);
|
||||||
|
|
@ -13,17 +13,17 @@ 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:percent_indicator/linear_percent_indicator.dart';
|
import 'package:percent_indicator/linear_percent_indicator.dart';
|
||||||
|
|
||||||
class QuickDataCheck extends StatefulWidget {
|
class QuickDataCheckPage extends StatefulWidget {
|
||||||
final int jobId;
|
final int jobId;
|
||||||
final String className;
|
final String className;
|
||||||
|
|
||||||
const QuickDataCheck({Key? key, required this.jobId,required this.className}) : super(key: key);
|
const QuickDataCheckPage({Key? key, required this.jobId,required this.className}) : super(key: key);
|
||||||
|
|
||||||
@override
|
@override
|
||||||
State<QuickDataCheck> createState() => _QuickDataCheckState();
|
State<QuickDataCheckPage> createState() => _QuickDataCheckPageState();
|
||||||
}
|
}
|
||||||
|
|
||||||
class _QuickDataCheckState extends State<QuickDataCheck> with CommonMixin {
|
class _QuickDataCheckPageState extends State<QuickDataCheckPage> with CommonMixin {
|
||||||
JobDataReport? jobData;
|
JobDataReport? jobData;
|
||||||
|
|
||||||
void initState() {
|
void initState() {
|
||||||
|
|
|
||||||
|
|
@ -15,10 +15,10 @@ import 'package:marking_app/common/model/enum/marking_list_type.dart';
|
||||||
import 'package:marking_app/pages/common/startUpPage.dart';
|
import 'package:marking_app/pages/common/startUpPage.dart';
|
||||||
import 'package:marking_app/pages/homework_correction/do_papers_job_exam.dart';
|
import 'package:marking_app/pages/homework_correction/do_papers_job_exam.dart';
|
||||||
import 'package:marking_app/pages/homework_correction/job_report.dart';
|
import 'package:marking_app/pages/homework_correction/job_report.dart';
|
||||||
|
import 'package:marking_app/pages/homework_correction/pages/job_list_participate_in_class.dart';
|
||||||
|
import 'package:marking_app/pages/homework_correction/review_job.dart';
|
||||||
import 'package:marking_app/pages/homework_correction/quick_check_personal.dart';
|
import 'package:marking_app/pages/homework_correction/quick_check_personal.dart';
|
||||||
import 'package:marking_app/pages/homework_correction/quick_data_check.dart';
|
import 'package:marking_app/pages/homework_correction/quick_data_check.dart';
|
||||||
import 'package:marking_app/pages/homework_correction/review_job.dart';
|
|
||||||
|
|
||||||
import 'package:marking_app/pages/login/index.dart';
|
import 'package:marking_app/pages/login/index.dart';
|
||||||
import 'package:marking_app/pages/mainPage.dart';
|
import 'package:marking_app/pages/mainPage.dart';
|
||||||
import 'package:marking_app/pages/marking/do_papers.dart';
|
import 'package:marking_app/pages/marking/do_papers.dart';
|
||||||
|
|
@ -55,6 +55,8 @@ class RouterManager {
|
||||||
static const String jobReportPagePath = '/job/report/index';
|
static const String jobReportPagePath = '/job/report/index';
|
||||||
// 作业 ==> 横屏考试
|
// 作业 ==> 横屏考试
|
||||||
static const String jobExamPagePath = '/job/exam/index';
|
static const String jobExamPagePath = '/job/exam/index';
|
||||||
|
// 作业 ==> 列表 ==> 参与班级
|
||||||
|
static const String jobListParticipateInClassPath = '/job/list/participateInClass';
|
||||||
|
|
||||||
static const String reportClassTeacherPath = 'report/details/reportClassTeacher';
|
static const String reportClassTeacherPath = 'report/details/reportClassTeacher';
|
||||||
static const String reportSubjectTeacherPath = 'report/details/reportSubjectTeacher';
|
static const String reportSubjectTeacherPath = 'report/details/reportSubjectTeacher';
|
||||||
|
|
@ -244,12 +246,22 @@ class RouterManager {
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// 数据快查
|
static final _jobListParticipateInClassHandler = Handler(
|
||||||
|
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
|
||||||
|
int jobId = int.parse(params['jobId']![0]);
|
||||||
|
String jobName = params['jobName']![0];
|
||||||
|
String genderName = params['genderName']![0];
|
||||||
|
|
||||||
|
return JobListParticipateInClass(jobId: jobId, jobName: jobName, genderName: genderName);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
|
||||||
|
// 数据快查
|
||||||
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 QuickDataCheck(jobId: jobId,className:className);
|
return QuickDataCheckPage(jobId: jobId,className:className);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
@ -261,7 +273,6 @@ class RouterManager {
|
||||||
return QuickCheckPersonal(jobId: jobId,studentId:studentId);
|
return QuickCheckPersonal(jobId: jobId,studentId:studentId);
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
// 开始阅卷页面
|
// 开始阅卷页面
|
||||||
// static final _doMarkingPapers = Handler(handlerFunc: (BuildContext? context, Map<String, List<String>> params) => MarkingPapers());
|
// static final _doMarkingPapers = Handler(handlerFunc: (BuildContext? context, Map<String, List<String>> params) => MarkingPapers());
|
||||||
|
|
||||||
|
|
@ -296,6 +307,8 @@ class RouterManager {
|
||||||
router.define(reportDetailPath, handler: _reportDetailPath, transitionType: TransitionType.material);
|
router.define(reportDetailPath, handler: _reportDetailPath, transitionType: TransitionType.material);
|
||||||
router.define(jobReportPagePath, handler: _jobReportPageHandler, transitionType: TransitionType.material);
|
router.define(jobReportPagePath, handler: _jobReportPageHandler, transitionType: TransitionType.material);
|
||||||
router.define(jobExamPagePath, handler: _jobExamPageHandler, transitionType: TransitionType.material);
|
router.define(jobExamPagePath, handler: _jobExamPageHandler, transitionType: TransitionType.material);
|
||||||
|
router.define(jobListParticipateInClassPath,
|
||||||
|
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);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -21,6 +21,7 @@ import 'dart:math';
|
||||||
|
|
||||||
import 'package:fluro/fluro.dart';
|
import 'package:fluro/fluro.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||||
import 'package:marking_app/common/config/request_config.dart';
|
import 'package:marking_app/common/config/request_config.dart';
|
||||||
|
|
||||||
export "./colorUtils.dart";
|
export "./colorUtils.dart";
|
||||||
|
|
@ -105,6 +106,11 @@ void toPrint({required dynamic val, bool toPrintJson = false}) {
|
||||||
if (printSwitch && val != null) toPrintJson ? printJson(val) : print(val);
|
if (printSwitch && val != null) toPrintJson ? printJson(val) : print(val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 是否是平板
|
||||||
|
bool isPad([double mobilePhoneScale = 1.2]) {
|
||||||
|
return ScreenUtil().scaleWidth > mobilePhoneScale;
|
||||||
|
}
|
||||||
|
|
||||||
class EUMNoScrollBehavior extends ScrollBehavior {
|
class EUMNoScrollBehavior extends ScrollBehavior {
|
||||||
@override
|
@override
|
||||||
Widget buildViewportChrome(BuildContext context, Widget child, AxisDirection axisDirection) {
|
Widget buildViewportChrome(BuildContext context, Widget child, AxisDirection axisDirection) {
|
||||||
|
|
|
||||||
|
|
@ -287,11 +287,17 @@ abstract class RestClient {
|
||||||
Future<BaseStructureResult<List<JobReportQuestionDeatilModel>>> getJobReportQuestionDetail(
|
Future<BaseStructureResult<List<JobReportQuestionDeatilModel>>> getJobReportQuestionDetail(
|
||||||
@the_retrofit.Query("jobid") int jobId, @the_retrofit.Query("questionid") int questionid);
|
@the_retrofit.Query("jobid") int jobId, @the_retrofit.Query("questionid") int questionid);
|
||||||
|
|
||||||
|
// 作业 => 列表 ==> 参与班级列表
|
||||||
|
@the_retrofit.GET("${RequestConfig.hwProxyKeywords}/api/Task/tasks")
|
||||||
|
Future<BaseStructureResult<List<MarkingTasks>>> getJobListParticipateInClass(
|
||||||
|
@the_retrofit.Query("markingId") int jobId);
|
||||||
|
|
||||||
// 作业 => 数据快查
|
// 作业 => 数据快查
|
||||||
@the_retrofit.GET("/api/read/job-data-center-report")
|
@the_retrofit.GET("/api/read/job-data-center-report")
|
||||||
Future<BaseStructureResult<JobDataReport>> getJobDataCenterReport(@the_retrofit.Queries() Map<String, dynamic> params);
|
Future<BaseStructureResult<JobDataReport>> getJobDataCenterReport(@the_retrofit.Queries() Map<String, dynamic> params);
|
||||||
|
|
||||||
// 作业 => 数据快查--个人
|
// 作业 => 数据快查--个人
|
||||||
@the_retrofit.GET("/api/read/job-data-center-student-report")
|
@the_retrofit.GET("/api/read/job-data-center-student-report")
|
||||||
Future<BaseStructureResult<StudentDetails>> getJobPersonalReport(@the_retrofit.Queries() Map<String, dynamic> params);
|
Future<BaseStructureResult<StudentDetails>> getJobPersonalReport(@the_retrofit.Queries() Map<String, dynamic> params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ publish_to: "none" # Remove this line if you wish to publish to pub.dev
|
||||||
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
|
||||||
# Read more about iOS versioning at
|
# Read more about iOS versioning at
|
||||||
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
|
||||||
version: 1.0.95
|
version: 1.0.87
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: ">=2.17.1 <3.0.0"
|
sdk: ">=2.17.1 <3.0.0"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue