Compare commits

..

No commits in common. "0fad2da7f6511335f26a0c4a41cbefbfe551a94e" and "7e1ce0ef7298b923ba151e3d33e7fbc1b8eebe22" have entirely different histories.

11 changed files with 302 additions and 1146 deletions

View File

@ -1,91 +0,0 @@
// GENERATED CODE - DO NOT MODIFY BY HAND
part of 'job_data_report.dart';
// **************************************************************************
// JsonSerializableGenerator
// **************************************************************************
JobDataReport _$JobDataReportFromJson(Map<String, dynamic> json) =>
JobDataReport(
json['jobId'] as int,
json['jobName'] as String,
json['gradeName'] as String,
json['className'] as String?,
json['validCount'] as int,
json['noAnswerCount'] as int,
(json['kgValidRate'] as num).toDouble(),
json['kgQuestionCount'] as int,
(json['zgValidRate'] as num).toDouble(),
json['zgQuestionCount'] as int,
(json['studentDetails'] as List<dynamic>)
.map((e) => StudentDetails.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$JobDataReportToJson(JobDataReport instance) =>
<String, dynamic>{
'jobId': instance.jobId,
'jobName': instance.jobName,
'gradeName': instance.gradeName,
'className': instance.className,
'validCount': instance.validCount,
'noAnswerCount': instance.noAnswerCount,
'kgValidRate': instance.kgValidRate,
'kgQuestionCount': instance.kgQuestionCount,
'zgValidRate': instance.zgValidRate,
'zgQuestionCount': instance.zgQuestionCount,
'studentDetails': instance.studentDetails,
};
StudentDetails _$StudentDetailsFromJson(Map<String, dynamic> json) =>
StudentDetails(
json['studentId'] as int,
json['studentName'] as String,
json['kgValidCount'] as int,
json['kgValidRate'] as int,
json['zgValidCount'] as int,
json['zgValidRate'] as int,
(json['kgDetails'] as List<dynamic>)
.map((e) => KgDetails.fromJson(e as Map<String, dynamic>))
.toList(),
(json['zgDetails'] as List<dynamic>)
.map((e) => KgDetails.fromJson(e as Map<String, dynamic>))
.toList(),
);
Map<String, dynamic> _$StudentDetailsToJson(StudentDetails instance) =>
<String, dynamic>{
'studentId': instance.studentId,
'studentName': instance.studentName,
'kgValidCount': instance.kgValidCount,
'kgValidRate': instance.kgValidRate,
'zgValidCount': instance.zgValidCount,
'zgValidRate': instance.zgValidRate,
'kgDetails': instance.kgDetails,
'zgDetails': instance.zgDetails,
};
KgDetails _$KgDetailsFromJson(Map<String, dynamic> json) => KgDetails(
json['questionNo'] as String,
json['questionId'] as int,
json['partName'] as String,
json['state'] as int,
json['studentAnswer'] as String?,
json['questionAnswer'] as String?,
json['useTime'] as int?,
json['annotateAnswers'] as String?,
(json['score'] as num?)?.toDouble(),
);
Map<String, dynamic> _$KgDetailsToJson(KgDetails instance) => <String, dynamic>{
'questionNo': instance.questionNo,
'questionId': instance.questionId,
'partName': instance.partName,
'state': instance.state,
'studentAnswer': instance.studentAnswer,
'questionAnswer': instance.questionAnswer,
'useTime': instance.useTime,
'annotateAnswers': instance.annotateAnswers,
'score': instance.score,
};

View File

@ -56,8 +56,6 @@ class JobTaskItem extends Object {
@JsonKey(name: 'markingTypeEnum')
JobMarkingTypeEnum markingTypeEnum; //
int taskCount; //
JobTaskItem(
this.id,
this.title,
@ -74,7 +72,6 @@ class JobTaskItem extends Object {
// this.markingTasks,
this.createTime,
this.markingType,
this.taskCount,
{this.progressPercentage = 0,
this.markingTypeEnum = JobMarkingTypeEnum.UNUSED}) {
try {

View File

@ -21,22 +21,12 @@ class MarkingListParams extends BasePage {
@JsonKey(name: 'PageType')
int pageType;
String? startTime;
String? endTime;
int? markingType; // 1 2
MarkingListParams({
required this.isFinish,
required this.pageType,
required page,
required limit,
this.markingType,
this.startTime,
this.endTime,
}) : super(page, limit) {
this.markingType ??= 1;
}
}) : super(page, limit);
factory MarkingListParams.fromJson(Map<String, dynamic> srcJson) => _$MarkingListParamsFromJson(srcJson);

View File

@ -10,7 +10,6 @@ import 'dart:async';
import 'package:connectivity_plus/connectivity_plus.dart';
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
import 'package:flutter/services.dart';
@ -84,28 +83,6 @@ class _MyAppState extends State<MyApp> {
title: '远轩阅卷系统',
navigatorKey: TheGlobal.navigatorKey,
debugShowCheckedModeBanner: false,
// locale: const Locale('zh', 'CN'), // ,
// supportedLocales: [
// const Locale('zh', 'CN'), //
// // locale可以在这里添加
// ],
// flutter_localizations依赖
supportedLocales: [
const Locale('zh', 'CN'), //
// locale可以在这里添加
],
localizationsDelegates: [
// ...delegates
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate,
GlobalCupertinoLocalizations.delegate, // 使Cupertino风格的组件
// ...delegates
],
localeResolutionCallback: (locale, supportedLocales) {
// locale解析逻辑
// Locale对象
return locale;
},
theme: ThemeData(
primarySwatch: createMaterialColor(const Color.fromRGBO(46, 91, 255, 1)),
// textTheme: Typography.englishLike2018.apply(fontSizeFactor: 1.sp,),

View File

@ -357,6 +357,29 @@ Widget $theTabBar({required TabController controller, ValueChanged<int>? onTap})
isScrollable: true,
labelColor: const Color.fromRGBO(45, 56, 76, 1),
indicatorSize: TabBarIndicatorSize.label, //
// labelPadding: EdgeInsets.symmetric(vertical: 0), //
// background: linear-gradient(270deg, #2E5BFF 30.23%, rgba(46, 91, 255, 0.00) 96.59%);
// indicatorColor: RectangleIndicator(),
// indicator: BoxDecoration(
// gradient: LinearGradient(
// begin: Alignment.centerLeft,
// end: Alignment.centerRight,
// colors: [
// Color.fromRGBO(46, 91, 255, 0.00),
// Color(0xFF2E5BFF),
// ],
// stops: [0.3023, 0.9659],
// // transform: GradientRotation(3.14 / 2), //270
// ),
// ),
// indicator: BoxDecoration(
// //
// gradient: LinearGradient(
// colors: [Colors.yellow, Colors.green], //
// begin: Alignment.centerLeft,
// end: Alignment.centerRight,
// ),
// ),
onTap: onTap,
tabs: const <Widget>[Tab(text: '阅卷'), Tab(text: '作业')],
),

View File

@ -145,13 +145,7 @@ class HomeworkTasksViewItem extends StatelessWidget with CommonMixin {
@hwidget
Widget $completedHomeworkView(BuildContext context,
{required JobTaskItem jobTaskItem, required ShowStudentsCall showStudentsCall}) {
return InkWell(
onTap: () {
String url =
'${RouterManager.jobListParticipateInClassPath}?&jobId=${jobTaskItem.id}&genderName=${Uri.encodeComponent(jobTaskItem.genderName)}&jobName=${Uri.encodeComponent(jobTaskItem.title)}&completed=${true}';
RouterManager.router.navigateTo(context, url, transition: getTransition());
},
child: Container(
return Container(
width: double.infinity,
padding: EdgeInsets.only(top: 20.h),
margin: EdgeInsets.only(bottom: 12.h),
@ -215,7 +209,7 @@ Widget $completedHomeworkView(BuildContext context,
),
quickText(' / ', color: Color.fromRGBO(76, 199, 147, 1), size: 12.sp, fontWeight: FontWeight.w500),
quickText(
'参与班级:${jobTaskItem.taskCount}',
'参与班级:字段待定',
color: Color.fromRGBO(76, 199, 147, 1),
size: 12.sp,
fontWeight: FontWeight.w600,
@ -300,7 +294,6 @@ Widget $completedHomeworkView(BuildContext context,
// )
],
),
),
);
}
@ -661,6 +654,13 @@ Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskIt
),
backgroundColor: Color.fromRGBO(244, 244, 244, 1),
),
// Container(
// child: Container(
// color: Colors.red,
// height: 40.r,
// width: 40.r,
// )
// ),
),
],
);

View File

@ -9,7 +9,6 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:functional_widget_annotation/functional_widget_annotation.dart';
import 'package:marking_app/common/mixin/common.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
@ -27,7 +26,6 @@ import 'package:marking_app/common/model/common/base_page_data.dart';
import 'package:marking_app/common/model/marking/marking_list_params.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/easy_refresh/mixin/refresh_data_handle.dart';
import 'package:syncfusion_flutter_datepicker/datepicker.dart';
part 'index.g.dart';
@ -42,7 +40,7 @@ class HomeworkCorrection extends StatefulHookConsumerWidget {
class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
with
CommonMixin,
TickerProviderStateMixin,
SingleTickerProviderStateMixin,
RefreshDataHandle<JobTaskItem, MarkingListParams>,
AutomaticKeepAliveClientMixin {
@override
@ -50,8 +48,6 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
/* Tab控制器 */
late TabController _tabController;
late TabController _tabController2;
int _tabIndex = 0;
bool completedToRefresh = true;
@ -100,7 +96,6 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
length: 2,
vsync: this,
);
_tabController2 = TabController(length: 4, vsync: this);
_refreshController1 = EasyRefreshController();
_refreshController2 = EasyRefreshController();
@ -123,7 +118,6 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
if (_currentTaskIdListener != null) {
_currentTaskIdListener!();
}
_tabController2.dispose();
_tabController.dispose();
_refreshController1.dispose();
_refreshController2.dispose();
@ -176,7 +170,10 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 1,
child: SizedBox(),
),
Expanded(
flex: 4,
child: Container(
@ -269,29 +266,6 @@ class _HomeworkCorrectionState extends ConsumerState<HomeworkCorrection>
],
),
),
if (_tabIndex == 1)
$CompletedJobConditionFilter(
controller: _tabController2,
jobType: params2.markingType ?? 1,
customTime: _tabController2.index != 3 || (params2.startTime == null && params2.endTime == null)
? null
: PickerDateRange(
params2.startTime == null ? null : DateTime.parse(params2.startTime!),
params2.endTime == null ? null : DateTime.parse(params2.endTime!),
),
onJobTypeTap: (int jobTypeVal) {
params2.markingType = jobTypeVal;
_refreshController2.callRefresh();
},
onTimeFilter: (String? startTime, String? endTime) {
if (startTime == null && endTime == null && _tabController2.index == 3) {
_tabController2.animateTo(0);
}
params2.endTime = endTime;
params2.startTime = startTime;
_refreshController2.callRefresh();
},
),
Expanded(
child: IndexedStack(
index: _tabIndex,
@ -379,13 +353,7 @@ Widget $easyRefresh({
@swidget
Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
EdgeInsets padEdg = EdgeInsets.symmetric(horizontal: 10.w);
return InkWell(
onTap: () {
String url =
'${RouterManager.jobListParticipateInClassPath}?&jobId=${jobTaskItem.id}&genderName=${Uri.encodeComponent(jobTaskItem.genderName)}&jobName=${Uri.encodeComponent(jobTaskItem.title)}&completed=${true}';
RouterManager.router.navigateTo(context, url, transition: getTransition());
},
child: Container(
return Container(
padding: EdgeInsets.only(top: 10.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
@ -449,7 +417,7 @@ Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
),
quickText(' / ', color: Color.fromRGBO(76, 199, 147, 1), size: 10.sp, fontWeight: FontWeight.w500),
quickText(
'参与班级:${jobTaskItem.taskCount}',
'参与班级2',
color: Color.fromRGBO(76, 199, 147, 1),
size: 10.sp,
fontWeight: FontWeight.w600,
@ -464,11 +432,8 @@ Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
],
),
),
GestureDetector(
onTap: () => easyThrottle('go_to_homework_report', () {
print('子级点击方法');
}),
child: Container(
Container(
padding: EdgeInsets.symmetric(vertical: 6.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(bottomLeft: Radius.circular(6.r), bottomRight: Radius.circular(6.r)),
@ -484,231 +449,15 @@ Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
),
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),
),
),
)),
]),
),
),
],
),
),
);
}
//
@swidget
Widget $theTabBar({required TabController controller, ValueChanged<int>? onTap, PickerDateRange? customTime}) {
var customTimeStr = '自定义';
if (customTime != null) {
customTimeStr = customTime.startDate?.toString().substring(0, 10) ?? '';
if (customTime.endDate != null) {
print(customTime.startDate!.year == customTime.endDate!.year);
if (!isPad() && customTime.startDate!.year == customTime.endDate!.year) {
customTimeStr =
customTime.startDate.toString().substring(5, 10) + '~${customTime.endDate.toString().substring(5, 10)}';
} else {
customTimeStr += '~${customTime.endDate?.toString().substring(0, 10)}';
}
}
}
return Container(
alignment: Alignment.centerLeft,
child: TabBar(
controller: controller,
unselectedLabelStyle: TextStyle(fontSize: 12.sp, color: const Color.fromRGBO(102, 102, 102, 1)),
labelStyle: TextStyle(
fontSize: 12.sp,
fontWeight: FontWeight.bold,
color: Color.fromRGBO(116, 145, 253, 1),
),
isScrollable: true,
labelColor: const Color.fromRGBO(45, 56, 76, 1),
indicatorSize: TabBarIndicatorSize.label, //
onTap: onTap,
tabs: <Widget>[
const Tab(text: '全部'),
const Tab(text: '近一周'),
const Tab(text: '近一月'),
Tab(text: customTimeStr),
],
),
);
}
///
@hwidget
Widget $completedJobConditionFilter(BuildContext context,
{required TabController controller,
required int jobType,
PickerDateRange? customTime,
required ValueChanged<int> onJobTypeTap,
required Function(String? startTime, String? endTime) onTimeFilter}) {
List<Map<String, dynamic>> jobTypes = [
{'type': 1, 'name': '作业'},
{'type': 2, 'name': '考试'}
];
var jobTypeState = useState(0);
var customTimeState = useState<PickerDateRange?>(null);
useEffect(() {
if (jobTypeState.value != jobType) jobTypeState.value = jobType;
if (customTimeState.value != customTime) customTimeState.value = customTime;
return () {};
}, []);
DateTime getWeekStartDate() {
DateTime now = DateTime.now();
int dayOfWeek = now.weekday; // 17
int diff = dayOfWeek - 1; //
if (diff < 0) {
diff += 7; //
}
return now.subtract(Duration(days: diff)); //
}
DateTime getWeekEndDate() {
DateTime now = DateTime.now();
int dayOfWeek = now.weekday; //
int diff = 7 - dayOfWeek; //
if (diff == 0) {
diff = 7; //
}
return now.add(Duration(days: diff)); //
}
DateTime getMonthStartDate() {
DateTime now = DateTime.now();
return DateTime(now.year, now.month, 1); //
}
DateTime getMonthEndDate() {
DateTime now = DateTime.now();
int nextMonth = now.month + 1;
if (nextMonth > 12) {
nextMonth = 1;
now = now.add(Duration(days: 31 - now.day)); //
} else {
now = now.add(Duration(days: DateTime(now.year, nextMonth, 0).day - now.day)); //
}
return now;
}
return Container(
height: 36.h,
padding: EdgeInsets.only(left: 4.w, right: 12.w),
decoration: BoxDecoration(
color: Color.fromRGBO(244, 244, 244, 1),
border: Border(bottom: BorderSide(color: Color.fromRGBO(204, 204, 204, 1), width: 1)),
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
$TheTabBar(
controller: controller,
customTime: customTimeState.value,
onTap: (int val) async {
switch (val) {
case 0: //
onTimeFilter(null, null);
break;
case 1: //
onTimeFilter(
getWeekStartDate().toString().substring(0, 10),
getWeekEndDate().toString().substring(0, 10),
);
break;
case 2: //
onTimeFilter(
getMonthStartDate().toString().substring(0, 10),
getMonthEndDate().toString().substring(0, 10),
);
break;
default: //
// DateTimeRange? range = await showDateRangePicker(
// // locale: const Locale('zh', 'CN'),
// locale: const Locale('zh', 'CN'),
// context: context,
// confirmText: '搜索',
// initialEntryMode: DatePickerEntryMode.calendarOnly,
// currentDate: DateTime.now(),
// firstDate: DateTime.now().subtract(const Duration(days: 4)),
// lastDate: DateTime.now().add(const Duration(days: 3)),
// );
var dialogData = await showDialog<PickerDateRange?>(
context: context,
builder: (BuildContext context1) {
return Center(
child: Container(
color: Colors.white,
width: isPad() ? ScreenUtil().screenWidth / 2 : ScreenUtil().screenWidth / 1.3,
height: ScreenUtil().screenHeight / 2,
child: SfDateRangePicker(
showActionButtons: true,
confirmText: '确定',
cancelText: '取消',
onSubmit: (p0) {
print(p0);
Navigator.of(context1).pop(p0);
},
onCancel: () {
Navigator.of(context1).pop();
},
selectionMode: DateRangePickerSelectionMode.range,
initialSelectedRange: customTimeState.value,
),
),
);
});
// startDate: 2024-03-04 18:47:00.117958, endDate: 2024-03-11 18:47:00.117986
// if (dialogData != null && (dialogData.startDate != null || dialogData.endDate != null)) {}
onTimeFilter(
dialogData?.startDate?.toString().substring(0, 10),
dialogData?.endDate?.toString().substring(0, 10),
);
customTimeState.value = dialogData;
}
},
),
Expanded(child: SizedBox()),
Container(
width: 74.r,
margin: EdgeInsets.symmetric(vertical: 5.h),
padding: EdgeInsets.symmetric(horizontal: 10.r),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.vertical(
top: Radius.elliptical(6, 6),
bottom: Radius.elliptical(6, 6),
),
),
child: DropdownButton(
icon: Icon(Icons.expand_more_outlined),
padding: EdgeInsets.zero,
// value: params2.jobType ?? 1,
value: jobType,
style: TextStyle(color: Color.fromRGBO(89, 89, 89, 1), fontSize: 12.sp),
underline: Container(),
isExpanded: true,
items: jobTypes.map((e) {
return DropdownMenuItem(
value: e['type'],
child: quickText(e['name'], size: 12.sp, color: Colors.black),
);
}).toList(),
onChanged: (dynamic value) {
if (value != null) {
jobTypeState.value = value;
onJobTypeTap(value as int);
}
// jobTypeState
},
),
)
],
),
);

View File

@ -17,9 +17,7 @@ class JobListParticipateInClass extends StatefulWidget {
final int jobId;
final String jobName;
final String genderName;
final bool completed;
const JobListParticipateInClass(
{required this.jobId, required this.jobName, required this.genderName, this.completed = false, super.key});
const JobListParticipateInClass({required this.jobId, required this.jobName, required this.genderName, super.key});
@override
State<JobListParticipateInClass> createState() => _JobListParticipateInClassState();
@ -256,9 +254,6 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
//
void jobViewReport(MarkingTasks task) {}
///
void showStudentList([bool submitted = false]) {}
@override
Widget build(BuildContext context) {
return Scaffold(
@ -276,31 +271,8 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
),
body: MyFutureBuilder.buildFutureBuilderOfSingleInstance<List<MarkingTasks>?>(context, _future, (value) {
if (value == null) return Container();
bool thePadTerminal = isPad();
if (widget.completed) {
//
if (thePadTerminal)
return TabletEndCompleted(
data: value,
genderName: widget.genderName,
bookmarks: bookmarks,
jobViewReport: jobViewReport,
quickDataCheck: quickDataCheck,
);
//
return MobileEndCompleted(
data: value,
genderName: widget.genderName,
bookmarks: bookmarks,
jobViewReport: jobViewReport,
quickDataCheck: quickDataCheck,
showStudentList: showStudentList,
);
}
//
if (thePadTerminal)
if (isPad())
return TabletEnd(
data: value,
genderName: widget.genderName,
@ -327,7 +299,7 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
}
}
///
///
class TabletEnd extends StatelessWidget {
final String genderName;
final List<MarkingTasks> data;
@ -360,7 +332,7 @@ class TabletEnd extends StatelessWidget {
child: Wrap(
spacing: 8.0.w, //
runSpacing: 10.h, //
children: data
children: [...data, ...data, ...data]
.map((e) => $ItemDataViewOfPad(
task: e,
bookmarks: bookmarks,
@ -377,462 +349,6 @@ class TabletEnd extends StatelessWidget {
}
}
///
class TabletEndCompleted extends StatelessWidget {
final String genderName;
final List<MarkingTasks> data;
final Bookmarks bookmarks; //
final JobViewReport jobViewReport;
final QuickDataCheck quickDataCheck; //
const TabletEndCompleted({
required this.genderName,
required this.data,
///
required this.bookmarks,
required this.jobViewReport,
required this.quickDataCheck,
super.key,
});
@override
Widget build(BuildContext context) {
var padingEdg = EdgeInsets.only(left: 10.w, right: 10.w);
return Container(
width: ScreenUtil().screenWidth,
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 16.h),
child: GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, //widget
mainAxisSpacing: 10.h,
crossAxisSpacing: 6.w,
childAspectRatio: 1.48 //1widget
),
children: data.map((taskItem) {
return Container(
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(6.r)),
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Container(
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 6.h),
alignment: Alignment.centerLeft,
decoration: BoxDecoration(
border: Border(bottom: BorderSide(color: Color.fromRGBO(238, 238, 238, 1), width: 0.5.r)),
),
child: quickText(taskItem.className, color: Color.fromRGBO(104, 136, 253, 1), size: 12.sp),
),
Column(
mainAxisSize: MainAxisSize.min,
children: [
$CompletedHomeworkProgressBar(
color: Color.fromRGBO(76, 199, 147, 1),
percent: taskItem.objectivePrecision,
title: '客观题正确率:',
padingEdg: padingEdg,
fontSize: 8.sp,
lineHeight: 5.h,
marginEdg: EdgeInsets.only(top: 5.h),
),
$CompletedHomeworkProgressBar(
color: Color.fromRGBO(255, 190, 91, 1),
percent: taskItem.subjectivePrecision,
title: '主观题正确率:',
fontSize: 8.sp,
lineHeight: 5.h,
padingEdg: padingEdg,
marginEdg: EdgeInsets.only(top: 5.h),
),
$CompletedHomeworkProgressBar(
color: Color.fromRGBO(166, 139, 242, 1),
percent: taskItem.precision,
title: '总正确率:',
fontSize: 8.sp,
lineHeight: 5.h,
padingEdg: padingEdg,
marginEdg: EdgeInsets.only(top: 5.h),
),
],
),
SizedBox(height: 4.h),
Padding(
padding: padingEdg,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 3,
child: Material(
color: Color.fromRGBO(104, 136, 253, 1),
borderRadius: BorderRadius.circular(16.r),
child: InkWell(
onTap: () => easyThrottle('OneClickReview', () {}),
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 4.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r),
),
child: quickText('已提交(${taskItem.commitStudentCount})', size: 8.sp, color: Colors.white),
),
),
),
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
onTap: () async {},
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 4.h),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
child: quickText('数据快查', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)),
),
),
),
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
onTap: () async {},
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 4.h),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
child: quickText('收藏夹2', size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)),
),
),
)),
],
),
),
SizedBox(height: 4.h),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10.r),
bottomRight: Radius.circular(10.r),
),
color: Colors.white,
boxShadow: [
BoxShadow(
color: const Color.fromRGBO(0, 0, 0, 0.15),
offset: Offset(0, -0.0001), //y轴偏移量
blurRadius: 5, //
spreadRadius: 0, //
)
],
),
child: Row(children: [
Expanded(
child: InkWell(
onTap: () => easyThrottle('go_to_review_homework', () => quickDataCheck(taskItem)),
child: Container(
alignment: Alignment.center,
child: quickText('数据快查', color: Color.fromRGBO(79, 79, 79, 1), size: 11.sp),
),
),
),
Container(width: 1.w, height: 26.h, color: Color.fromRGBO(221, 221, 221, 1)),
Expanded(
child: InkWell(
onTap: () => easyThrottle('go_to_end_review_homework', () => jobViewReport(taskItem)),
child: Container(
alignment: Alignment.center,
child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 10.sp),
),
)),
]),
),
],
),
);
}).toList(),
),
);
}
}
///
class MobileEndCompleted extends StatelessWidget {
final String genderName;
final List<MarkingTasks> data;
final Bookmarks bookmarks; //
final JobViewReport jobViewReport; //
final QuickDataCheck quickDataCheck; //
final ShowStudentList showStudentList;
const MobileEndCompleted({
required this.genderName,
required this.data,
///
required this.bookmarks,
required this.showStudentList,
required this.jobViewReport,
required this.quickDataCheck,
super.key,
});
@override
Widget build(BuildContext context) {
var padingEdg = EdgeInsets.only(left: 10.w, right: 10.w);
return ListView(
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 16.h),
children: data.map((task) {
return Container(
padding: EdgeInsets.only(top: 11.h),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadiusDirectional.circular(10.r),
boxShadow: [BoxShadow(color: Color.fromRGBO(0, 0, 0, 0.15), blurRadius: 10)],
),
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
Padding(
padding: padingEdg,
child: Row(
children: [
quickText(genderName + task.className, color: Color.fromRGBO(0, 0, 0, 1), size: 14.sp),
Expanded(child: SizedBox()),
quickText('已交:${task.commitStudentCount}', color: Color.fromRGBO(104, 136, 253, 1), size: 12.sp),
SizedBox(width: 16.w),
quickText('未交:${task.studentCount - task.commitStudentCount}',
color: Color.fromRGBO(255, 86, 86, 1), size: 12.sp),
],
),
),
SizedBox(height: 13.h),
Padding(
padding: padingEdg,
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: task.isFinish
? [
Expanded(
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
onTap: () async {},
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 5.h),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
child: quickText('收藏夹2', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
),
),
)),
Expanded(flex: 1, child: SizedBox()),
Expanded(flex: 3, child: SizedBox()),
Expanded(flex: 1, child: SizedBox()),
Expanded(flex: 3, child: SizedBox()),
]
: [
Expanded(
flex: 3,
child: Material(
color: Color.fromRGBO(104, 136, 253, 1),
borderRadius: BorderRadius.circular(16.r),
child: InkWell(
onTap: () => easyThrottle('OneClickReview', () {}),
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 5.h),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r),
),
child: quickText('一键批阅', size: 10.sp, color: Colors.white),
),
),
),
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
onTap: () async {},
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 5.h),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
child: quickText('数据快查', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
),
),
),
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
onTap: () async {},
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 5.h),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
child: quickText('收藏夹2', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
),
),
)),
],
),
),
SizedBox(height: 13.h),
Padding(
padding: padingEdg,
child: Row(
children: [
Expanded(
child: LinearPercentIndicator(
padding: EdgeInsets.zero,
animation: true,
lineHeight: 8.h,
animationDuration: 2500,
percent: task.progressPercentage / 100,
// center: Text(
// '${getDoubleRemoveZero(jobTaskClassItem.progressPercentage)}%',
// style: TextStyle(color: Colors.white, fontSize: 8.sp),
// ),
linearGradient: LinearGradient(
tileMode: TileMode.mirror,
stops: [0.0, 1.0],
colors: task.progressPercentage / 100 != 1
? [Theme.of(context).primaryColor.withOpacity(0.1), Theme.of(context).primaryColor]
: [
Color.fromRGBO(144, 224, 190, 1).withOpacity(0.1),
Color.fromRGBO(144, 224, 190, 1),
],
),
// linearStrokeCap: LinearStrokeCap.butt,
// progressColor: Theme.of(context).primaryColor,
backgroundColor: Color.fromRGBO(232, 232, 232, 1),
barRadius: Radius.circular(10.r),
),
),
SizedBox(width: 7.w),
quickText('${getDoubleRemoveZero(task.progressPercentage)}%',
size: 10.sp, color: Color.fromRGBO(70, 70, 70, 1))
],
),
),
if (task.isFinish)
$CompletedHomeworkProgressBar(
color: Color.fromRGBO(76, 199, 147, 1),
percent: task.objectivePrecision,
title: '客观题正确率:',
padingEdg: padingEdg,
marginEdg: EdgeInsets.only(top: 8.h),
),
if (task.isFinish)
$CompletedHomeworkProgressBar(
color: Color.fromRGBO(255, 190, 91, 1),
percent: task.subjectivePrecision,
title: '主观题正确率:',
padingEdg: padingEdg,
marginEdg: EdgeInsets.only(top: 8.h),
),
if (task.isFinish)
$CompletedHomeworkProgressBar(
color: Color.fromRGBO(166, 139, 242, 1),
percent: task.precision,
title: '总正确率:',
padingEdg: padingEdg,
marginEdg: EdgeInsets.only(top: 8.h),
),
SizedBox(height: 13.h),
Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
bottomLeft: Radius.circular(10.r),
bottomRight: Radius.circular(10.r),
),
color: Colors.white,
boxShadow: [
BoxShadow(
color: const Color.fromRGBO(0, 0, 0, 0.15),
offset: Offset(0, -0.0001), //y轴偏移量
blurRadius: 5, //
spreadRadius: 0, //
)
],
),
child: Row(
children: task.isFinish
? [
Expanded(
child: InkWell(
onTap: () => easyThrottle('go_to_review_homework', () => quickDataCheck(task)),
child: Container(
alignment: Alignment.center,
child: quickText('数据快查', color: Color.fromRGBO(79, 79, 79, 1), size: 13.sp),
),
),
),
Container(width: 1.w, height: 32.h, color: Color.fromRGBO(221, 221, 221, 1)),
Expanded(
child: InkWell(
onTap: () => easyThrottle('go_to_end_review_homework', () => jobViewReport(task)),
child: Container(
alignment: Alignment.center,
child: quickText('查看报告', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp),
),
)),
]
: [
Expanded(
child: InkWell(
onTap: () => easyThrottle('go_to_review_homework', () {}),
child: Container(
alignment: Alignment.center,
child: quickText('批阅', color: Color.fromRGBO(79, 79, 79, 1), size: 13.sp),
),
),
),
Container(width: 1.w, height: 32.h, color: Color.fromRGBO(221, 221, 221, 1)),
Expanded(
child: InkWell(
onTap: () => easyThrottle('go_to_end_review_homework', () => {}),
child: Container(
alignment: Alignment.center,
child: quickText('结束批阅', color: Color.fromRGBO(118, 118, 118, 1), size: 12.sp),
),
)),
],
),
),
],
));
}).toList(),
);
}
}
///
class MobileEnd extends StatelessWidget {
final String genderName;
@ -1475,11 +991,3 @@ typedef Bookmarks = void Function(MarkingTasks);
///
typedef JobViewReport = void Function(MarkingTasks);
///
typedef ShowStudentList = void Function([bool submitted]);
///
// void showStudentList([bool submitted = false]) {
// }

View File

@ -10,6 +10,7 @@
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:hooks_riverpod/hooks_riverpod.dart';
import 'package:marking_app/common/config/request_config.dart';
@ -20,6 +21,8 @@ import 'package:marking_app/common/model/event_bus/marking_statistics_bus.dart';
import 'package:marking_app/common/model/marking/marking_statistics.dart';
import 'package:marking_app/pages/common/event_bus_mixin.dart';
import 'package:marking_app/provider/review_provider.dart';
import 'package:marking_app/utils/anti_shake_throttling.dart';
import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/request/rest_client.dart';
import 'package:marking_app/common/model/common/base_page_data.dart';
import 'package:marking_app/common/model/marking/marking_item.dart';

View File

@ -254,27 +254,26 @@ class RouterManager {
int jobId = int.parse(params['jobId']![0]);
String jobName = params['jobName']![0];
String genderName = params['genderName']![0];
// ignore: sdk_version_since
bool completed = bool.parse(params['completed']?[0] ?? 'false');
return JobListParticipateInClass(jobId: jobId, jobName: jobName, genderName: genderName, completed: completed);
return JobListParticipateInClass(jobId: jobId, jobName: jobName, genderName: genderName);
},
);
//
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]);
String className = params['className']![0];
return QuickDataCheckPage(jobId: jobId, className: className);
return QuickDataCheckPage(jobId: jobId,className:className);
},
);
// -
static final _quickCheckPersonalPageHandler = Handler(
handlerFunc: (BuildContext? context, Map<String, List<String>> params) {
handlerFunc: (BuildContext? context, Map<String, List<String>> params){
int jobId = int.parse(params['jobId']![0]);
int studentId = int.parse(params['studentId']![0]);
return QuickCheckPersonal(jobId: jobId, studentId: studentId);
return QuickCheckPersonal(jobId: jobId,studentId:studentId);
},
);
@ -322,8 +321,7 @@ class RouterManager {
router.define(jobListParticipateInClassPath,
handler: _jobListParticipateInClassHandler, 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);
router.define(jobPriorityReviewSetPath, handler: _jobPriorityReviewSetPageHandler, transitionType: TransitionType.material);
// getTransition()

View File

@ -3,7 +3,7 @@ description: A new Flutter project.
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: 'none' # Remove this line if you wish to publish to pub.dev
publish_to: "none" # Remove this line if you wish to publish to pub.dev
# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
@ -18,7 +18,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
version: 1.0.87
environment:
sdk: '>=2.17.1 <3.0.0'
sdk: ">=2.17.1 <3.0.0"
# Dependencies specify other packages that your package needs in order to woyrk.
# To automatically upgrade your package dependencies to the latest versions
@ -29,8 +29,7 @@ environment:
dependencies:
flutter:
sdk: flutter
flutter_localizations:
sdk: flutter
# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
cupertino_icons: ^1.0.2
@ -61,6 +60,7 @@ dependencies:
permission_handler: ^11.0.1
flutter_widget_from_html_core: ^0.10.3
# 事件总线
event_bus: ^2.0.0
image_picker: ^0.8.6
@ -108,7 +108,6 @@ dependencies:
badges: ^3.1.2
horizontal_data_table: ^4.1.1
data_table_2: ^2.5.10
syncfusion_flutter_datepicker: ^21.2.4
dev_dependencies:
flutter_test:
@ -119,12 +118,15 @@ dev_dependencies:
# 分离样式
functional_widget: ^0.10.1
# The "flutter_lints" package below contains a set of recommended lints to
# encourage good coding practices. The lint set provided by the package is
# activated in the `analysis_options.yaml` file located at the root of your
# package. See that file for information about deactivating specific lint
# rules and activating additional ones.
# For information on the generic Dart part of this file, see the
# following page: https://dart.dev/tools/pub/pubspec