Compare commits

..

No commits in common. "b2f50b10a6e11b228c2dcab0d870a4937b064331" and "ee487e63bd892ad7c20c890762707f172b13184b" have entirely different histories.

7 changed files with 267 additions and 303 deletions

View File

@ -11,8 +11,7 @@ import 'package:marking_app/utils/request/rest_client.dart';
/// isFavorite
/// favoriteNum
class FavoriteWidget extends StatefulWidget {
final Function call;
FavoriteWidget(this.call, {Key? key}) : super(key: key);
FavoriteWidget({Key? key}) : super(key: key);
@override
_FavoriteState createState() => _FavoriteState();
@ -57,7 +56,6 @@ class _FavoriteState extends State<FavoriteWidget> with EventBusMixin<JobQuestio
BaseStructureResult<bool> res = await _client.toJobFavoriteCancel(favoriteVal);
if (res.success) {
_future = getData(favoriteVal.taskId, favoriteVal.studentId, _eventModel!.paperId);
widget.call();
toUpState(setState, () {}, mounted);
} else {
ToastUtils.showError(res.message ?? '操作失败,请重试');

View File

@ -170,7 +170,6 @@ Widget $completedHomeworkView(BuildContext context,
Padding(
padding: EdgeInsets.symmetric(horizontal: 10.w),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: isPad() ? 32.w : 36.w,
@ -189,14 +188,11 @@ Widget $completedHomeworkView(BuildContext context,
margin: EdgeInsets.only(right: 4.w),
child: quickText('作业', color: Colors.white, size: 10.sp),
),
Expanded(
child: quickText(
quickText(
jobTaskItem.title,
maxLines: 2,
size: 16.sp,
color: Color.fromRGBO(70, 70, 70, 1),
fontWeight: FontWeight.bold,
),
)
],
),
@ -570,7 +566,6 @@ Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskIt
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Container(
width: isPad() ? 32.w : 38.w,
@ -591,14 +586,11 @@ Widget $unfinishedHomework(BuildContext context, {required JobTaskItem jobTaskIt
margin: EdgeInsets.only(right: 4.w),
child: quickText(jobTaskItem.markingTypeEnum.name, color: Colors.white, size: 10.sp),
),
Expanded(
child: quickText(
quickText(
jobTaskItem.title,
maxLines: 2,
size: isPad() ? 14.sp : 16.sp,
color: Color.fromRGBO(70, 70, 70, 1),
fontWeight: FontWeight.bold,
),
)
],
),

View File

@ -73,7 +73,7 @@ class DoPapersJob extends HookWidget with EventBusMixin<DoPapersJobRefreshBus> {
backgroundColor: Colors.white,
elevation: 0,
actions: [
FavoriteWidget(() => refresh = true),
FavoriteWidget(),
// Container(
// padding: EdgeInsets.only(right: 4.w),
// alignment: Alignment.center,
@ -156,7 +156,6 @@ class ReviewStatusInfo extends HookWidget with CommonMixin {
print('点击了...');
List<JobConcernedWithStudent>? students = await getStudents();
if (students == null) return;
students = students..sort((e, e1) => e.studentName.compareTo(e1.studentName));
showModalBottomSheet(
context: context,
elevation: 10,
@ -190,15 +189,14 @@ class ReviewStatusInfo extends HookWidget with CommonMixin {
spacing: 6.0, // ()
runSpacing: 4.0, //
alignment: WrapAlignment.spaceAround, //沿
children: students!.map((e) {
children: students.map((e) {
return Chip(
labelPadding: EdgeInsets.symmetric(vertical: 1.5.h, horizontal: 5.w),
backgroundColor: Color.fromRGBO(239, 242, 255, 1),
// avatar: CircleAvatar(
// backgroundColor: Colors.white,
// child: quickText(e.studentName.substring(0, 1),
// size: 12.sp, color: Theme.of(context).primaryColor),
// ),
avatar: CircleAvatar(
backgroundColor: Colors.white,
child: quickText(e.studentName.substring(0, 1),
size: 12.sp, color: Theme.of(context).primaryColor),
),
label: quickText(e.studentName, color: Color.fromRGBO(80, 94, 110, 1), size: 12.sp),
);
}).toList(),

View File

@ -1,6 +1,5 @@
import 'package:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
import 'package:flutter_echart/flutter_echart.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';
@ -236,7 +235,6 @@ class _JobReportState extends State<JobReport> with CommonMixin {
@override
Widget build(BuildContext context) {
bool isPadFlag = isPad();
return Scaffold(
backgroundColor: Color.fromRGBO(245, 245, 245, 1),
appBar: AppBar(
@ -339,7 +337,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
height: 6.r,
),
SizedBox(
height: data.kgReport.details.length > 10 ? 300.r : data.kgReport.details.length * 50.r + (isPadFlag == true ?40.r:65.r),
height: data.kgReport.details.length > 10 ? 300.r : data.kgReport.details.length * 50.r + 20.r,
child: ReportTable(
headList: ['', '作答率', '作答人数', '正确率', '标准答案', '优先批阅概况'],
bodyList: data.kgReport.details,
@ -381,7 +379,7 @@ class _JobReportState extends State<JobReport> with CommonMixin {
height: 10.r,
),
SizedBox(
height: data.zgReport.details.length > 10 ? 300.r : data.zgReport.details.length * 50.r + 50.r,
height: data.zgReport.details.length > 10 ? 300.r : data.zgReport.details.length * 50.r + 20.r,
child: ReportTable(
headList: ['', '作答率', '作答人数', '正确率', '查看原题', '优先批阅概况'],
bodyList: data.zgReport.details,
@ -1198,7 +1196,7 @@ Widget $overallPerformance(int totalNumber, List<OverallTitles> overallTitles) {
Color.fromRGBO(104, 136, 253, 1),
Color.fromRGBO(255, 186, 33, 1),
Color.fromRGBO(243, 163, 44, 1),
Color.fromRGBO(201, 201, 201, 1),
Color.fromRGBO(211, 211, 211, 1).withOpacity(0.5),
Color.fromRGBO(211, 211, 211, 1),
];
return Container(
@ -1218,36 +1216,7 @@ Widget $overallPerformance(int totalNumber, List<OverallTitles> overallTitles) {
margin: EdgeInsets.only(bottom: 20.h),
),
Expanded(
child: PieChatWidget(
dataList: overallTitles.asMap().keys.map((index) {
var e = overallTitles[index];
return EChartPieBean(
title: e.title,
number: e.count,
color: colorMap[index]);
}).toList(),
//
isBackground: true,
//线
isLineText: true,
//
bgColor: Colors.white,
//
isFrontgText: false,
//
initSelect: 1,
//
openType: OpenType.ANI,
//
loopType: LoopType.DOWN_LOOP,
//
clickCallBack: (int value) {
print("当前点击显示 $value");
},
),
/* PieChart(
child: PieChart(
PieChartData(
borderData: FlBorderData(show: false),
sectionsSpace: 0,
@ -1263,7 +1232,7 @@ Widget $overallPerformance(int totalNumber, List<OverallTitles> overallTitles) {
);
}).toList(),
),
),*/
),
)
],
),
@ -1340,9 +1309,10 @@ Widget $unitTimeAnsweringSituation(BuildContext context, int jobid, List<Questio
return false; //
}
return Container(
width: double.infinity,
// height: isPad() ? 520.h : 460.h,
height: isPad() ? 520.h : 460.h,
margin: EdgeInsets.only(top: 20.h),
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 12.w),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.r)),
@ -1353,7 +1323,8 @@ Widget $unitTimeAnsweringSituation(BuildContext context, int jobid, List<Questio
child: quickText('整体表现', color: Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold),
margin: EdgeInsets.only(bottom: 20.h),
),
Scrollbar(
Expanded(
child: Scrollbar(
thickness: 8.w,
thumbVisibility: true,
trackVisibility: true,
@ -1485,6 +1456,7 @@ Widget $unitTimeAnsweringSituation(BuildContext context, int jobid, List<Questio
),
),
),
),
],
),
);
@ -1522,7 +1494,7 @@ Widget $personnelDataOverview(BuildContext context, List<StudentAnswerInfos> stu
return Container(
width: double.infinity,
// height: isPad() ? 290.h : 264.h,
height: isPad() ? 290.h : 264.h,
margin: EdgeInsets.only(top: 20.h),
padding: EdgeInsets.symmetric(vertical: 16.h, horizontal: 12.w),
decoration: BoxDecoration(color: Colors.white, borderRadius: BorderRadius.circular(10.r)),
@ -1533,7 +1505,8 @@ Widget $personnelDataOverview(BuildContext context, List<StudentAnswerInfos> stu
child: quickText('人员数据概况', color: Color.fromRGBO(92, 92, 92, 1), size: 14.sp, fontWeight: FontWeight.bold),
margin: EdgeInsets.only(bottom: 20.h),
),
Scrollbar(
Expanded(
child: Scrollbar(
thickness: 8.w,
thumbVisibility: true,
trackVisibility: true,
@ -1585,6 +1558,7 @@ Widget $personnelDataOverview(BuildContext context, List<StudentAnswerInfos> stu
),
),
),
),
],
),
);

View File

@ -159,7 +159,7 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
color: Theme.of(context).primaryColor,
).show(context);
}
print('进入页面................');
if (task.isFinish) {
return AchievementView(
elevation: 0.5,
@ -175,10 +175,8 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
RouterManager.router.navigateTo(context, url, transition: getTransition()).then((value) {
if (value == true) {
isRefresh = true;
getListOfJobFavoritesData().then((value) {
_future = getData();
toUpState(setState, () {}, mounted);
});
}
});
}
@ -281,11 +279,8 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
transition: getTransition(),
)
.then((value) async {
isRefresh = true;
getListOfJobFavoritesData().then((value) {
_future = getData();
toUpState(setState, () {}, mounted);
});
_future = getData()
..then((value) => getListOfJobFavoritesData().then((value) => toUpState(setState, () {}, mounted)));
});
}
@ -326,7 +321,7 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
if (_result.data?.isEmpty ?? true) {
return ToastUtils.showError('获取到的学生列表为空');
}
students = _result.data!..sort((e, e1) => e.studentName.compareTo(e1.studentName));
students = _result.data!;
} catch (e) {
return ToastUtils.showError('获取学生列表失败');
} finally {
@ -368,12 +363,11 @@ class _JobListParticipateInClassState extends State<JobListParticipateInClass> w
children: students.map((e) {
return Chip(
backgroundColor: Color.fromRGBO(239, 242, 255, 1),
labelPadding: EdgeInsets.symmetric(vertical: 1.5.h, horizontal: 5.w),
// avatar: CircleAvatar(
// backgroundColor: Colors.white,
// child: quickText(e.studentName.substring(0, 1),
// size: 12.sp, color: Theme.of(context).primaryColor),
// ),
avatar: CircleAvatar(
backgroundColor: Colors.white,
child: quickText(e.studentName.substring(0, 1),
size: 12.sp, color: Theme.of(context).primaryColor),
),
label: quickText(e.studentName, color: Color.fromRGBO(80, 94, 110, 1), size: 12.sp),
);
}).toList(),
@ -630,21 +624,19 @@ class TabletEndCompleted extends StatelessWidget {
Expanded(
flex: 4,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
color: Color.fromRGBO(104, 136, 253, 1),
borderRadius: BorderRadius.circular(16.r),
child: InkWell(
onTap: () => easyThrottle(
'OneClickReview', () => showStudentList([taskItem.id], taskItem.className, true)),
borderRadius: BorderRadius.circular(8.r),
splashColor: Theme.of(context).primaryColor,
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: Color.fromRGBO(102, 102, 102, 1)),
child: quickText('已提交:${taskItem.commitStudentCount}', size: 8.sp, color: Colors.white),
),
),
),
@ -658,7 +650,6 @@ class TabletEndCompleted extends StatelessWidget {
child: InkWell(
onTap: () => easyThrottle(
'OneClickReview', () => showStudentList([taskItem.id], taskItem.className)),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
@ -678,7 +669,6 @@ class TabletEndCompleted extends StatelessWidget {
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
onTap: () => bookmarks(taskItem),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
@ -821,12 +811,11 @@ class MobileEndCompleted extends StatelessWidget {
Expanded(
flex: 4,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
color: Color.fromRGBO(104, 136, 253, 1),
borderRadius: BorderRadius.circular(16.r),
child: InkWell(
onTap: () =>
easyThrottle('OneClickReview', () => showStudentList([task.id], task.className, true)),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
@ -834,8 +823,7 @@ class MobileEndCompleted extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r),
),
child: quickText('已提交:${task.commitStudentCount}',
size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
child: quickText('已提交:${task.commitStudentCount}', size: 10.sp, color: Colors.white),
),
),
),
@ -898,7 +886,9 @@ class MobileEndCompleted extends StatelessWidget {
)
],
),
child: Row(children: [
child: Row(
children: task.isFinish
? [
Expanded(
child: InkWell(
onTap: () => easyThrottle('go_to_review_homework', () => quickDataCheck(task)),
@ -917,7 +907,28 @@ class MobileEndCompleted extends StatelessWidget {
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: 36.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),
),
)),
],
),
),
],
));
@ -1055,10 +1066,9 @@ Widget $itemDataViewOfPad(
Expanded(
flex: 4,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
color: Color.fromRGBO(104, 136, 253, 1),
borderRadius: BorderRadius.circular(16.r),
child: InkWell(
splashColor: Theme.of(context).primaryColor,
onTap: () => easyThrottle('OneClickReview', () {
if (!task.canMarking) {
return AchievementView(
@ -1075,8 +1085,10 @@ Widget $itemDataViewOfPad(
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)),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r),
),
child: quickText('一键批阅', size: 8.sp, color: Colors.white),
),
),
),
@ -1089,7 +1101,6 @@ Widget $itemDataViewOfPad(
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
onTap: () => quickDataCheck(task),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
@ -1107,7 +1118,6 @@ Widget $itemDataViewOfPad(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
splashColor: Theme.of(context).primaryColor,
onTap: () => bookmarks(task),
borderRadius: BorderRadius.circular(8.r),
child: Container(
@ -1328,10 +1338,9 @@ Widget $itemDataView(
Expanded(
flex: 4,
child: Material(
color: Color.fromRGBO(244, 244, 244, 1),
color: Color.fromRGBO(104, 136, 253, 1),
borderRadius: BorderRadius.circular(16.r),
child: InkWell(
splashColor: Theme.of(context).primaryColor,
onTap: () => easyThrottle('OneClickReview', () {
if (!task.canMarking) {
return AchievementView(
@ -1351,7 +1360,7 @@ Widget $itemDataView(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(20.r),
),
child: quickText('一键批阅', size: 10.sp, color: Color.fromRGBO(102, 102, 102, 1)),
child: quickText('一键批阅', size: 10.sp, color: Colors.white),
),
),
),
@ -1363,7 +1372,6 @@ Widget $itemDataView(
color: Color.fromRGBO(244, 244, 244, 1),
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
splashColor: Theme.of(context).primaryColor,
onTap: () => quickDataCheck(task),
borderRadius: BorderRadius.circular(8.r),
child: Container(
@ -1383,7 +1391,6 @@ Widget $itemDataView(
borderRadius: BorderRadius.circular(20.r),
child: InkWell(
onTap: () => bookmarks(task),
splashColor: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(8.r),
child: Container(
alignment: Alignment.center,
@ -1575,7 +1582,7 @@ Widget $completedHomeworkProgressBar(
percent: percent,
center: Text(
percentStr,
style: TextStyle(color: Colors.white, fontSize: 4.5.sp),
style: TextStyle(color: Colors.white, fontSize: 6.sp),
),
// linearStrokeCap: LinearStrokeCap.butt,
progressColor: color,

View File

@ -3,7 +3,6 @@ import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:flutter_widget_from_html_core/flutter_widget_from_html_core.dart';
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
import 'package:marking_app/utils/index.dart';
import 'package:marking_app/utils/toast_utils.dart';
import 'package:photo_view/photo_view.dart';
@ -284,7 +283,6 @@ class _ReportTableState extends State<ReportTable> {
@override
Widget build(BuildContext context) {
bool isPadFlag = isPad();
return DataTable2(
dividerThickness: 0,
scrollController: _controller,
@ -316,7 +314,7 @@ class _ReportTableState extends State<ReportTable> {
fixedCornerColor: Colors.grey[400],
minWidth: widget.headList.length > 6
? 80.r * widget.headList.length
: isPadFlag?MediaQuery.of(context).size.width:85.r * widget.headList.length,
: MediaQuery.of(context).size.width,
fixedTopRows: widget.fixedRows!,
fixedLeftColumns: widget.fixedCols!,
sortColumnIndex: _sortColumnIndex,
@ -334,8 +332,8 @@ class _ReportTableState extends State<ReportTable> {
? 40.r
: widget.headList.length > 6
? 80.r
: isPadFlag?(MediaQuery.of(context).size.width - 8.r) /
widget.headList.length:85.r,
: (MediaQuery.of(context).size.width - 8.r) /
widget.headList.length,
);
}),
rows: List<DataRow>.generate(widget.bodyList.length,

View File

@ -112,9 +112,6 @@ dependencies:
data_table_2: ^2.5.10
syncfusion_flutter_datepicker: ^21.2.10
flutter_staggered_grid_view: ^0.6.2
# 饼图
flutter_echart: ^2.0.0
dev_dependencies:
flutter_test: