Compare commits

..

No commits in common. "4dfab0f4c3e7d0f7dba37cd64c1e58865adb6e4e" and "be2c1e1e6b0cdf9ac90d1bdd59817e76aa8232b4" have entirely different histories.

7 changed files with 123 additions and 200 deletions

View File

@ -1,3 +1,5 @@
import 'package:achievement_view/achievement_view.dart';
import 'package:collection/collection.dart';
import 'package:flutter/material.dart';
import 'package:flutter_hooks/flutter_hooks.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
@ -5,6 +7,7 @@ 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_concerned_with_student.dart';
import 'package:marking_app/common/model/job/job_concerned_with_student_params.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';
@ -207,7 +210,7 @@ Widget $completedHomeworkView(BuildContext context,
quickText(
jobTaskItem.createTime.substring(0, 10),
color: Color.fromRGBO(97, 97, 97, 1),
size: 12.sp,
size: 14.sp,
fontWeight: FontWeight.w500,
),
quickText(' / ', color: Color.fromRGBO(76, 199, 147, 1), size: 12.sp, fontWeight: FontWeight.w500),
@ -540,7 +543,7 @@ Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskIt
children: [
SizedBox(height: 30.h),
Container(
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 10.w),
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 10.w),
width: double.infinity,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(6.r),
@ -561,16 +564,16 @@ Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskIt
Row(
children: [
Container(
width: isPad() ? 32.w : 38.w,
width: 32.w,
height: 18.h,
alignment: Alignment.center,
padding: EdgeInsets.only(left: isPad() ? 2.w : 3.w),
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(14.r),
topLeft: Radius.circular(18.r),
topRight: Radius.circular(3.r),
bottomLeft: Radius.circular(4.r),
bottomRight: Radius.circular(4.r),
@ -581,43 +584,47 @@ Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskIt
),
quickText(
jobTaskItem.title,
size: isPad() ? 14.sp : 16.sp,
size: 16.sp,
color: Color.fromRGBO(70, 70, 70, 1),
fontWeight: FontWeight.bold,
)
],
),
SizedBox(height: 10.h),
SizedBox(height: 22.h),
Row(
crossAxisAlignment: CrossAxisAlignment.end,
children: [
quickText(
jobTaskItem.subjectName,
color: Color.fromRGBO(97, 97, 97, 1),
size: 12.sp,
size: 14.sp,
fontWeight: FontWeight.w600,
),
quickText(' / ',
color: Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500),
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: 11.sp),
quickText('题量:', color: Color.fromRGBO(130, 130, 130, 1), size: 13.sp),
quickText(
jobTaskItem.totalCount,
color: Color.fromRGBO(97, 97, 97, 1),
size: 13.sp,
size: 14.sp,
fontWeight: FontWeight.w500,
),
],
),
),
quickText(' / ',
color: Color.fromRGBO(130, 130, 130, 1), size: 11.sp, fontWeight: FontWeight.w500),
quickText(jobTaskItem.createTime.substring(0, 16),
color: Color.fromRGBO(97, 97, 97, 1), size: 12.sp),
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: 12.sp,
),
],
),
FavoriteButton(jobTaskItem.id, jobTaskItem.title),
],
),
),
@ -672,70 +679,3 @@ typedef ShowStudentsCall = Future<void> Function(
bool? submitted,
String? className,
]);
///
class FavoriteButton extends HookWidget with CommonMixin {
final int jobId;
final String jobName;
EdgeInsets? margin;
FavoriteButton(this.jobId, this.jobName, {this.margin, super.key});
Future<int> getInvolveClasses() async {
try {
RestClient _client = await getClient();
var result = await _client.getListOfJobFavoriteNumber(jobId);
if (result.success && (result.data?.isNotEmpty ?? false)) {
return result.data!.map((e) => e.count).reduce((value, element) => value + element);
}
} catch (e) {
print(e);
}
return 0;
}
//
void bookmarks(BuildContext context) {
RouterManager.router.navigateTo(
context,
RouterManager.jobFavoritePagePath + '?jobId=$jobId&jobName=${Uri.encodeComponent(jobName)}',
transition: getTransition(),
);
}
@override
Widget build(BuildContext context) {
var favoriteNumber = useState(0);
useEffect(() {
getInvolveClasses().then((value) {
var favoriteCount = favoriteNumber.value;
if (favoriteCount != value) favoriteNumber.value = value;
});
return () {};
}, []);
if (favoriteNumber.value <= 0) return Container();
margin ??= EdgeInsets.only(top: 15.h);
return Row(
children: [
Container(
margin: margin,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
onTap: () => bookmarks(context),
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 4.h, horizontal: 17.w),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
child: quickText('收藏夹(${favoriteNumber.value})', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
),
),
),
),
Expanded(child: SizedBox())
],
);
}
}

View File

@ -356,9 +356,11 @@ Widget $easyRefresh({
crossAxisCount: 2, //widget
mainAxisSpacing: 10.h,
crossAxisSpacing: 6.w,
childAspectRatio: 2.0 //1widget
childAspectRatio: 2.2 //1widget
),
children: data.map((e) => $ReviewedItem(jobTaskItem: e)).toList(),
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),
@ -406,7 +408,6 @@ Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
Padding(
padding: padEdg,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: 32.w,
@ -418,7 +419,7 @@ Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
? const Color.fromRGBO(104, 136, 253, 1)
: const Color.fromRGBO(255, 175, 56, 1),
borderRadius: BorderRadius.only(
topLeft: Radius.circular(14.r),
topLeft: Radius.circular(18.r),
topRight: Radius.circular(3.r),
bottomLeft: Radius.circular(4.r),
bottomRight: Radius.circular(4.r),
@ -427,9 +428,11 @@ Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
margin: EdgeInsets.only(right: 4.w),
child: quickText(jobTaskItem.markingTypeEnum.name, color: Colors.white, size: 10.sp),
),
Expanded(
child: quickText(jobTaskItem.title,
size: 14.sp, color: Color.fromRGBO(70, 70, 70, 1), maxLines: 2, fontWeight: FontWeight.w500),
quickText(
jobTaskItem.title,
size: 16.sp,
color: Color.fromRGBO(70, 70, 70, 1),
fontWeight: FontWeight.bold,
)
],
),
@ -448,32 +451,21 @@ Widget $reviewedItem(BuildContext context, {required JobTaskItem jobTaskItem}) {
),
quickText(' / ', color: Color.fromRGBO(76, 199, 147, 1), size: 10.sp, fontWeight: FontWeight.w500),
quickText(
'参与班级:',
color: Color.fromRGBO(76, 199, 147, 1),
size: 9.sp,
),
quickText(
'${jobTaskItem.taskCount}',
'参与班级:${jobTaskItem.taskCount}',
color: Color.fromRGBO(76, 199, 147, 1),
size: 10.sp,
fontWeight: FontWeight.w600,
),
quickText(' / ', color: Color.fromRGBO(116, 145, 253, 1), size: 10.sp, fontWeight: FontWeight.w500),
quickText(
'科目:' + jobTaskItem.subjectName,
color: Color.fromRGBO(116, 145, 253, 1),
size: 9.sp,
size: 10.sp,
fontWeight: FontWeight.w600,
),
],
),
),
Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: FavoriteButton(
jobTaskItem.id,
jobTaskItem.title,
margin: EdgeInsets.only(top: 4.h, bottom: 6.h),
),
),
GestureDetector(
onTap: () => easyThrottle('go_to_homework_report', () {
RouterManager.router.navigateTo(
@ -520,7 +512,7 @@ Widget $theTabBar({required TabController controller, ValueChanged<int>? onTap,
if (customTime != null) {
customTimeStr = customTime.startDate?.toString().substring(0, 10) ?? '';
if (customTime.endDate != null) {
// print(customTime.startDate!.year == customTime.endDate!.year);
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)}';
@ -613,7 +605,7 @@ Widget $completedJobConditionFilter(BuildContext context,
}
return Container(
height: 39.h,
height: 36.h,
padding: EdgeInsets.only(left: 4.w, right: 12.w),
decoration: BoxDecoration(
color: Color.fromRGBO(244, 244, 244, 1),

View File

@ -43,7 +43,7 @@ class _JobFavoriteState extends State<JobFavorite> with CommonMixin {
JobReportJoinClass? classData;
late String loginName;
final int pageSize = 100;
String className = '全部';
String className = '-1';
@override
void initState() {
@ -376,7 +376,6 @@ Widget $classSelection(List<JobReportJoinClass>? involveClasses, JobReportJoinCl
)),
child: DropdownButton(
value: classData?.uniqueId ?? '-1',
style: TextStyle(color: Color.fromRGBO(89, 89, 89, 1), fontSize: 12.sp),
underline: Container(),
// isExpanded:true,

View File

@ -376,20 +376,15 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
@override
Widget build(BuildContext context) {
return WillPopScope(
onWillPop: () async {
Navigator.of(context).pop(isRefresh);
return false;
},
child: Scaffold(
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(isRefresh)),
onPressed: () => Navigator.of(context).pop()),
title: Container(
child: quickText(widget.jobName,
size: 14.sp, color: Color.fromRGBO(51, 51, 51, 1), fontWeight: FontWeight.w500),
child:
quickText(widget.jobName, size: 16.sp, color: Color.fromRGBO(51, 51, 51, 1), fontWeight: FontWeight.w500),
alignment: Alignment.center,
),
backgroundColor: Colors.white,
@ -449,7 +444,6 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
showStudentList: showStudentList,
);
}),
),
);
}
}
@ -553,7 +547,7 @@ class TabletEndCompleted extends StatelessWidget {
var padingEdg = EdgeInsets.only(left: 10.w, right: 10.w);
return Container(
width: ScreenUtil().screenWidth,
padding: EdgeInsets.symmetric(horizontal: 10.w, vertical: 16.h),
padding: EdgeInsets.symmetric(horizontal: 12.w, vertical: 16.h),
child: GridView(
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 2, //widget
@ -614,13 +608,13 @@ class TabletEndCompleted extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(104, 136, 253, 1),
borderRadius: BorderRadius.circular(16.r),
child: InkWell(
onTap: () => easyThrottle(
'OneClickReview', () => showStudentList([taskItem.id], taskItem.className, true)),
'OneClickReview', () => showStudentList([taskItem.id], taskItem.className)),
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
@ -635,13 +629,13 @@ class TabletEndCompleted extends StatelessWidget {
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
onTap: () => easyThrottle(
'OneClickReview', () => showStudentList([taskItem.id], taskItem.className)),
'OneClickReview', () => showStudentList([taskItem.id], taskItem.className, false)),
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
@ -655,7 +649,7 @@ class TabletEndCompleted extends StatelessWidget {
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
@ -666,7 +660,7 @@ class TabletEndCompleted extends StatelessWidget {
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 4.h),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
child: quickText(taskItem.collectNumber <= 0 ? '收藏夹' : '收藏夹(${taskItem.collectNumber})',
child: quickText('收藏夹(${taskItem.collectNumber})',
size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)),
),
),
@ -801,13 +795,13 @@ class MobileEndCompleted extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(104, 136, 253, 1),
borderRadius: BorderRadius.circular(16.r),
child: InkWell(
onTap: () =>
easyThrottle('OneClickReview', () => showStudentList([task.id], task.className, true)),
easyThrottle('OneClickReview', () => showStudentList([task.id], task.className)),
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
@ -822,13 +816,13 @@ class MobileEndCompleted extends StatelessWidget {
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
onTap: () =>
easyThrottle('OneClickReview', () => showStudentList([task.id], task.className)),
easyThrottle('OneClickReview', () => showStudentList([task.id], task.className, false)),
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
@ -842,7 +836,7 @@ class MobileEndCompleted extends StatelessWidget {
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
@ -1033,7 +1027,7 @@ Widget $itemDataViewOfPad(
children: task.isFinish
? [
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
@ -1044,19 +1038,19 @@ Widget $itemDataViewOfPad(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 3.h),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
child: quickText(task.collectNumber <= 0 ? '收藏夹' : '收藏夹(${task.collectNumber})',
child: quickText('收藏夹(${task.collectNumber})',
size: 8.sp, color: Color.fromRGBO(102, 102, 102, 1)),
),
),
)),
Expanded(flex: 1, child: SizedBox()),
Expanded(flex: 4, child: SizedBox()),
Expanded(flex: 3, child: SizedBox()),
Expanded(flex: 1, child: SizedBox()),
Expanded(flex: 4, child: SizedBox()),
Expanded(flex: 3, child: SizedBox()),
]
: [
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(104, 136, 253, 1),
borderRadius: BorderRadius.circular(16.r),
@ -1076,7 +1070,7 @@ Widget $itemDataViewOfPad(
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
@ -1094,7 +1088,7 @@ Widget $itemDataViewOfPad(
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
@ -1294,7 +1288,7 @@ Widget $itemDataView(
children: task.isFinish
? [
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
@ -1305,19 +1299,19 @@ Widget $itemDataView(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 5.h),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
child: quickText(task.collectNumber <= 0 ? '收藏夹' : '收藏夹(${task.collectNumber})',
child: quickText('收藏夹(${task.collectNumber})',
size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
),
),
)),
Expanded(flex: 1, child: SizedBox()),
Expanded(flex: 4, child: SizedBox()),
Expanded(flex: 3, child: SizedBox()),
Expanded(flex: 1, child: SizedBox()),
Expanded(flex: 4, child: SizedBox()),
Expanded(flex: 3, child: SizedBox()),
]
: [
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(104, 136, 253, 1),
borderRadius: BorderRadius.circular(16.r),
@ -1337,7 +1331,7 @@ Widget $itemDataView(
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
@ -1355,7 +1349,7 @@ Widget $itemDataView(
),
Expanded(flex: 1, child: SizedBox()),
Expanded(
flex: 4,
flex: 3,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
@ -1366,7 +1360,7 @@ Widget $itemDataView(
alignment: Alignment.center,
padding: EdgeInsets.symmetric(vertical: 5.h),
decoration: BoxDecoration(borderRadius: BorderRadius.circular(20.r)),
child: quickText(task.collectNumber <= 0 ? '收藏夹' : '收藏夹(${task.collectNumber})',
child: quickText('收藏夹(${task.collectNumber})',
size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
),
),
@ -1552,7 +1546,7 @@ Widget $completedHomeworkProgressBar(
percent: percent,
center: Text(
percentStr,
style: TextStyle(color: Colors.white, fontSize: 6.sp),
style: TextStyle(color: Colors.white, fontSize: 8.sp),
),
// linearStrokeCap: LinearStrokeCap.butt,
progressColor: color,

View File

@ -105,7 +105,6 @@ class _QuickDataCheckPageState extends State<QuickDataCheckPage>
style: TextStyle(fontSize: 14.sp, color: Colors.white),
)),
)),
SizedBox(width: 24.r,),
],
),
SizedBox(height: 10.r),

View File

@ -34,29 +34,27 @@ class _QuickStudentDataTableState extends State<QuickStudentDataTable> {
assert(index >= 0);
StudentDetails item = widget.bodyList[index];
int num = 0;
int total = 0;
item.kgDetails.forEach((element) {
if (element.state == 0) {
num = num + 1;
}
total = total + 1;
});
item.zgDetails.forEach((element) {
if (element.state == 0) {
num = num + 1;
}
total = total + 1;
});
return DataRow2.byIndex(
index: index,
color: color != null
? num == total
? MaterialStateProperty.all(Color(0xFFFFD79C))
: MaterialStateProperty.all(color)
? num == 0
? MaterialStateProperty.all(color)
: MaterialStateProperty.all(Color(0xFFFFD79C))
: null,
cells: [
DataCell(InkWell(
onTap: () {
RouterManager.router.navigateTo(
context,
RouterManager.quickCheckPersonalPath +

View File

@ -274,7 +274,7 @@ abstract class RestClient {
@the_retrofit.GET("/api/jobs/job-report")
Future<BaseStructureResult<JobReportModel>> getJobReport(@the_retrofit.Queries() Map<String, dynamic> params);
// =>
// =>
@the_retrofit.GET("/api/jobs/student-job-for-class")
Future<BaseStructureResult<List<JobReportJoinClass>>> getJobReportJoinClasses(@the_retrofit.Query("jobId") int jobId);
@ -340,8 +340,9 @@ abstract class RestClient {
@the_retrofit.POST("/api/read/jc-job-read-level")
Future<BaseStructureResult> getSetJobReadLevel(@the_retrofit.Body() JobLevelSetParams params);
// =>
@the_retrofit.POST("/api/jobs/de-fav-student-job")
Future<BaseStructureResult> getJobDeFavorites(@the_retrofit.Field("jobId") int jobId,
@the_retrofit.Field("studentId") int studentId, @the_retrofit.Field("questionPage") int questionPage);
Future<BaseStructureResult> getJobDeFavorites(
@the_retrofit.Field("jobId") int jobId, @the_retrofit.Field("studentId") int studentId,@the_retrofit.Field("questionPage") int questionPage);
}