job_report_revision #2
|
|
@ -147,7 +147,7 @@ Widget $completedHomeworkView(BuildContext context,
|
|||
{required JobTaskItem jobTaskItem, required ShowStudentsCall showStudentsCall}) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
padding: EdgeInsets.symmetric(vertical: 20.h, horizontal: 10.w),
|
||||
padding: EdgeInsets.only(top: 20.h),
|
||||
margin: EdgeInsets.only(bottom: 12.h),
|
||||
decoration: BoxDecoration(
|
||||
borderRadius: BorderRadius.circular(6.r),
|
||||
|
|
@ -164,109 +164,134 @@ Widget $completedHomeworkView(BuildContext context,
|
|||
child: Column(
|
||||
children: [
|
||||
// 顶部任务名称
|
||||
Row(
|
||||
children: [
|
||||
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,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
RouterManager.router.navigateTo(
|
||||
context,
|
||||
RouterManager.jobReportPagePath + '?title=${Uri.encodeComponent(jobTaskItem.title)}&id=${jobTaskItem.id}',
|
||||
transition: getTransition(),
|
||||
);
|
||||
},
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
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)],
|
||||
),
|
||||
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),
|
||||
),
|
||||
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: 12.h),
|
||||
Padding(
|
||||
padding: EdgeInsets.symmetric(horizontal: 10.w),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
quickText(
|
||||
jobTaskItem.createTime.substring(0, 10),
|
||||
color: Color.fromRGBO(97, 97, 97, 1),
|
||||
size: 14.sp,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
quickText(' / ', color: Color.fromRGBO(76, 199, 147, 1), size: 12.sp, fontWeight: FontWeight.w500),
|
||||
quickText(
|
||||
'参与班级:字段待定',
|
||||
color: Color.fromRGBO(76, 199, 147, 1),
|
||||
size: 12.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
quickText(' / ', color: Color.fromRGBO(116, 145, 253, 1), size: 12.sp, fontWeight: FontWeight.w500),
|
||||
quickText(
|
||||
'科目:' + jobTaskItem.subjectName,
|
||||
color: Color.fromRGBO(116, 145, 253, 1),
|
||||
size: 12.sp,
|
||||
fontWeight: FontWeight.w600,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
|
||||
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()),
|
||||
// ],
|
||||
// ),
|
||||
// )
|
||||
],
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -308,6 +308,7 @@ Widget $easyRefresh({
|
|||
required int tab,
|
||||
}) {
|
||||
bool completed = tab == 2; // 是否是待批阅
|
||||
bool isPadFlag = isPad();
|
||||
return EasyRefresh(
|
||||
firstRefresh: true,
|
||||
taskIndependence: true,
|
||||
|
|
@ -317,18 +318,144 @@ Widget $easyRefresh({
|
|||
controller: controller,
|
||||
header: MaterialHeader(),
|
||||
footer: TaurusFooter(),
|
||||
child: ListView.builder(
|
||||
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 16.w, right: 16.w),
|
||||
itemBuilder: (context, index) {
|
||||
return HomeworkTasksViewItem(
|
||||
completed: completed,
|
||||
jobTaskItem: data[index],
|
||||
call: () => controller.callRefresh(),
|
||||
);
|
||||
},
|
||||
itemCount: data.length,
|
||||
),
|
||||
child: completed && isPadFlag
|
||||
? GridView(
|
||||
padding: EdgeInsets.only(top: 11.h, bottom: 10.h, left: 12.w, right: 12.w),
|
||||
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||
crossAxisCount: 2, //横轴三个子widget
|
||||
mainAxisSpacing: 10.h,
|
||||
crossAxisSpacing: 6.w,
|
||||
childAspectRatio: 2.2 //宽高比为1时,子widget
|
||||
),
|
||||
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),
|
||||
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),
|
||||
),
|
||||
)),
|
||||
]),
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -21,6 +21,7 @@ import 'dart:math';
|
|||
|
||||
import 'package:fluro/fluro.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_screenutil/flutter_screenutil.dart';
|
||||
import 'package:marking_app/common/config/request_config.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);
|
||||
}
|
||||
|
||||
// 是否是平板
|
||||
bool isPad([double mobilePhoneScale = 1.2]) {
|
||||
return ScreenUtil().scaleWidth > mobilePhoneScale;
|
||||
}
|
||||
|
||||
class EUMNoScrollBehavior extends ScrollBehavior {
|
||||
@override
|
||||
Widget buildViewportChrome(BuildContext context, Widget child, AxisDirection axisDirection) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue