Compare commits
No commits in common. "aca987a4df118c20b361e54ad114089d9574798a" and "46f4beaf81c2fe4ad14e314bbff63690e9f4465b" have entirely different histories.
aca987a4df
...
46f4beaf81
|
|
@ -211,6 +211,3 @@ marking_app/lib/common/model/job/job_fav_student.g.dart
|
|||
marking_app/lib/common/model/job/job_data_report.g.dart
|
||||
marking_app/lib/common/model/job/job_student_history.g.dart
|
||||
marking_app/lib/pages/homework_correction/job_personal_detail.g.dart
|
||||
marking_app/lib/common/model/event_bus/jobs/job_do_papers_submit_check_switch_bus.g.dart
|
||||
marking_app/lib/common/model/event_bus/jobs/job_do_synchro_tab.g.dart
|
||||
marking_app/lib/pages/homework_correction/widget/top_count.g.dart
|
||||
|
|
|
|||
|
|
@ -1,12 +0,0 @@
|
|||
import 'package:json_annotation/json_annotation.dart';
|
||||
|
||||
part 'job_do_papers_submit_check_switch_bus.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class JobDoPapersSubmitCheckSwitchBus extends Object {
|
||||
JobDoPapersSubmitCheckSwitchBus();
|
||||
|
||||
factory JobDoPapersSubmitCheckSwitchBus.fromJson(Map<String, dynamic> srcJson) => _$JobDoPapersSubmitCheckSwitchBusFromJson(srcJson);
|
||||
|
||||
Map<String, dynamic> toJson() => _$JobDoPapersSubmitCheckSwitchBusToJson(this);
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
import 'package:json_annotation/json_annotation.dart';
|
||||
import 'package:marking_app/common/model/job/job_page_tab.dart';
|
||||
|
||||
part 'job_do_synchro_tab.g.dart';
|
||||
|
||||
@JsonSerializable()
|
||||
class JobDoSynchroTab extends Object {
|
||||
List<JobPageTab> tabs;
|
||||
|
||||
JobDoSynchroTab(this.tabs);
|
||||
|
||||
factory JobDoSynchroTab.fromJson(Map<String, dynamic> srcJson) => _$JobDoSynchroTabFromJson(srcJson);
|
||||
|
||||
Map<String, dynamic> toJson() => _$JobDoSynchroTabToJson(this);
|
||||
|
||||
/// 当前tab下一个tab的pageIndex
|
||||
int? getNextPageIndex([int? indexLocated]) {
|
||||
if (indexLocated == null) return null;
|
||||
return indexLocated == tabs.length - 1 ? null : tabs[indexLocated + 1].pageIndex;
|
||||
}
|
||||
|
||||
/// 当前tab上一个tab的pageIndex
|
||||
int? getPreviousPageIndex([int? indexLocated]) {
|
||||
if (indexLocated == null) return null;
|
||||
return indexLocated == 0 ? null : tabs[indexLocated - 1].pageIndex;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,5 +1,4 @@
|
|||
import 'dart:async';
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:collection/collection.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
|
@ -11,8 +10,6 @@ import 'package:hooks_riverpod/hooks_riverpod.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/event_bus/jobs/job_do_papers_student_bus.dart';
|
||||
import 'package:marking_app/common/model/event_bus/jobs/job_do_papers_submit_check_switch_bus.dart';
|
||||
import 'package:marking_app/common/model/event_bus/jobs/job_do_synchro_tab.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_do_marking_status_info.dart';
|
||||
|
|
@ -25,7 +22,6 @@ import 'package:marking_app/pages/common/event_bus_mixin.dart';
|
|||
import 'package:marking_app/pages/homework_correction/components/new_version_of_homework/bottom_annotation_switch_job.dart';
|
||||
import 'package:marking_app/pages/homework_correction/eventBus/marking_text_question_job_tab_params_bus.dart';
|
||||
import 'package:marking_app/pages/homework_correction/providers/drawing_provider.dart';
|
||||
import 'package:marking_app/routes/RouterManager.dart';
|
||||
import 'package:marking_app/utils/index.dart';
|
||||
|
||||
// utils
|
||||
|
|
@ -231,11 +227,6 @@ class ReviewStatusInfo extends HookWidget with CommonMixin {
|
|||
Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Function() exitCallback, required int taskId, required int jobId}) {
|
||||
UseSwitchStudentAndType _useSwitchStudentAndType = UseSwitchStudentAndType.use(); // 学生和试卷状态
|
||||
|
||||
// 当前tab改变时
|
||||
useValueChanged<List<JobPageTab>?, String>(_useSwitchStudentAndType.tabs.value, (_, __) {
|
||||
_useSwitchStudentAndType.eventFire(model: JobDoSynchroTab(_useSwitchStudentAndType.tabs.value));
|
||||
});
|
||||
|
||||
// 当前tab改变时
|
||||
useValueChanged<JobPageTab?, String>(_useSwitchStudentAndType.currentTab.value, (_, __) {
|
||||
var thePageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex;
|
||||
|
|
@ -243,7 +234,11 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
|
|||
if (studentBus != null && studentBus.pageIndex == thePageIndex) return; // 获取试卷详情数据 定位到对应学生的数据 无需再通知详情获取数据
|
||||
if (thePageIndex != null) {
|
||||
_useSwitchStudentAndType.getDataForStudents(taskId: taskId, pageIndex: thePageIndex);
|
||||
_useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex));
|
||||
int indexLocated = _useSwitchStudentAndType.tabs.value.indexWhere((element) => element.pageIndex == thePageIndex);
|
||||
_useSwitchStudentAndType.eventFire(
|
||||
model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex,
|
||||
nextPageIndex: _useSwitchStudentAndType.getNextPageIndex(indexLocated),
|
||||
previousPageIndex: _useSwitchStudentAndType.getPreviousPageIndex(indexLocated)));
|
||||
}
|
||||
});
|
||||
useValueChanged<JobConcernedWithStudent?, String>(_useSwitchStudentAndType.currentStudent.value, (oldData, __) {
|
||||
|
|
@ -252,8 +247,15 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
|
|||
if (studentBus != null && studentBus.studentId == studentId) return; // 获取试卷详情数据 定位到对应学生的数据 无需再通知详情获取数据
|
||||
|
||||
var thePageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex;
|
||||
if (thePageIndex != null) {
|
||||
_useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex, studentId: studentId));
|
||||
if (thePageIndex != null) // 通知详情数据
|
||||
{
|
||||
int indexLocated = _useSwitchStudentAndType.tabs.value.indexWhere((element) => element.pageIndex == thePageIndex);
|
||||
_useSwitchStudentAndType.eventFire(
|
||||
model: MarkingTextQuestionJobTabParamsBus(taskId, thePageIndex,
|
||||
studentId: studentId,
|
||||
nextPageIndex: _useSwitchStudentAndType.getNextPageIndex(indexLocated),
|
||||
previousPageIndex: _useSwitchStudentAndType.getPreviousPageIndex(indexLocated)),
|
||||
);
|
||||
}
|
||||
});
|
||||
|
||||
|
|
@ -287,24 +289,6 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
|
|||
_useSwitchStudentAndType.currentTab.value =
|
||||
_useSwitchStudentAndType.tabs.value.firstWhere((element) => moldeParams.pageIndex == element.pageIndex);
|
||||
break;
|
||||
case JobDoPapersSubmitCheckSwitchBus: // 提交后切换试题通知
|
||||
var _currentTab = _useSwitchStudentAndType.currentTab.value;
|
||||
var _pageIndex = _currentTab?.pageIndex;
|
||||
if (_currentTab == null || _pageIndex == null) return;
|
||||
var params = MarkingTextQuestionJobTabParamsBus(taskId, _pageIndex);
|
||||
if (_currentTab.finishCount + 1 == _currentTab.total) {
|
||||
var _currentTabNew =
|
||||
_useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.pageIndex != _currentTab.pageIndex && e.finishCount != e.total);
|
||||
// 如果全部都已经批阅完成就不需要跳转到不必要得批阅试题
|
||||
if (_currentTabNew != null) params.pageIndex = _currentTabNew.pageIndex;
|
||||
}
|
||||
var _theCurrentPage = _useSwitchStudentAndType.tabs.value.firstWhereOrNull((element) => element.pageIndex == _pageIndex);
|
||||
if (_theCurrentPage != null) {
|
||||
_theCurrentPage.finishCount += 1;
|
||||
_useSwitchStudentAndType.tabs.value = _useSwitchStudentAndType.tabs.value.map((e) => JobPageTab.fromJson(e.toJson())).toList();
|
||||
}
|
||||
_useSwitchStudentAndType.eventFire(model: params);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
},
|
||||
|
|
@ -313,7 +297,9 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
|
|||
_useSwitchStudentAndType.eventCancel();
|
||||
};
|
||||
}, []);
|
||||
print(_useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.finishCount < e.total)?.toJson());
|
||||
|
||||
var _currentTab = _useSwitchStudentAndType.currentTab.value;
|
||||
|
||||
return Container(
|
||||
padding: EdgeInsets.only(bottom: 2.r, left: 12.r, right: 12.r),
|
||||
decoration: BoxDecoration(
|
||||
|
|
@ -362,7 +348,7 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
|
|||
),
|
||||
Expanded(flex: 1, child: SizedBox()),
|
||||
Expanded(
|
||||
flex: 4,
|
||||
flex: 5,
|
||||
child: Container(
|
||||
padding: EdgeInsets.only(left: 10.w),
|
||||
decoration: BoxDecoration(
|
||||
|
|
@ -403,8 +389,7 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
|
|||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
if (_useSwitchStudentAndType.isFinish.value &&
|
||||
_useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.finishCount < e.total) != null)
|
||||
if (_useSwitchStudentAndType.isFinish.value && _currentTab?.finishCount != _currentTab?.total)
|
||||
Expanded(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
@ -416,10 +401,10 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
|
|||
onTap: () => easyThrottle(
|
||||
'DO_PAPERS_JOB_CONTINUE_TO_REVIEW',
|
||||
() {
|
||||
var _currentTabNew = _useSwitchStudentAndType.tabs.value.firstWhere((e) => e.finishCount < e.total);
|
||||
_useSwitchStudentAndType.eventFire(
|
||||
model: MarkingTextQuestionJobTabParamsBus(taskId, _currentTabNew.pageIndex),
|
||||
);
|
||||
var _pageIndex = _useSwitchStudentAndType.currentTab.value?.pageIndex;
|
||||
if (_pageIndex == null) return;
|
||||
|
||||
_useSwitchStudentAndType.eventFire(model: MarkingTextQuestionJobTabParamsBus(taskId, _pageIndex));
|
||||
},
|
||||
),
|
||||
child: quickText(
|
||||
|
|
@ -433,30 +418,6 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
|
|||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () => easyThrottle('DO_PAPERS_JOB_HISTORICAL_HOMEWORK', () {
|
||||
JobConcernedWithStudent? _studentModel = _useSwitchStudentAndType.currentStudent.value;
|
||||
if (_studentModel == null) return;
|
||||
String url =
|
||||
'${RouterManager.jobPersonalDetailPath}?studentId=${_studentModel.studentId}&studentName=${Uri.encodeComponent(_studentModel.studentName)}';
|
||||
RouterManager.router.navigateTo(context, url, transition: getTransition());
|
||||
}),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
children: [
|
||||
Icon(Icons.location_history, size: 12.sp, color: Color.fromRGBO(104, 103, 103, 1)),
|
||||
SizedBox(width: 1.w),
|
||||
quickText(
|
||||
'历史作业',
|
||||
size: 10.sp,
|
||||
decoration: TextDecoration.underline,
|
||||
color: Theme.of(context).primaryColor.withOpacity(0.8),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
Stack(
|
||||
alignment: const FractionalOffset(0.52, 0.24),
|
||||
children: [
|
||||
|
|
@ -468,6 +429,12 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
|
|||
quickText('优先', size: 4.sp, color: Colors.white),
|
||||
],
|
||||
),
|
||||
SizedBox(width: 1.2.w),
|
||||
quickText(
|
||||
'优先批阅',
|
||||
size: 10.sp,
|
||||
color: _useSwitchStudentAndType.isFirst.value ? Color.fromRGBO(76, 199, 147, 1) : Color.fromRGBO(164, 164, 164, 1),
|
||||
),
|
||||
],
|
||||
),
|
||||
// InkWell(
|
||||
|
|
@ -525,7 +492,6 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
|
|||
final GlobalKey<JobPictureOverviewState> scaffoldKeyPictureOverview = GlobalKey<JobPictureOverviewState>();
|
||||
Future<MarkingTextQuestionJob?>? _future; // 考试试卷
|
||||
bool firstLoading = true;
|
||||
JobDoSynchroTab? synchroTabs;
|
||||
late RemoveListener _doJobObtainGradingDataProviderListener; // 批注关闭监听
|
||||
|
||||
@override
|
||||
|
|
@ -548,9 +514,6 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
|
|||
nextPageIndex: theEventVal.nextPageIndex,
|
||||
));
|
||||
break;
|
||||
case JobDoSynchroTab:
|
||||
synchroTabs = eventVal as JobDoSynchroTab;
|
||||
break;
|
||||
default:
|
||||
}
|
||||
});
|
||||
|
|
@ -574,8 +537,8 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
|
|||
if (_result.success) {
|
||||
var jobDetails = _result.data;
|
||||
if (jobDetails != null) {
|
||||
jobDetails.previousPageIndex = synchroTabs?.getPreviousPageIndex(jobDetails.pageIndex - 1);
|
||||
jobDetails.nextPageIndex = synchroTabs?.getNextPageIndex(jobDetails.pageIndex - 1);
|
||||
jobDetails.previousPageIndex = params.previousPageIndex;
|
||||
jobDetails.nextPageIndex = params.nextPageIndex;
|
||||
// 触发学生下拉选中
|
||||
try {
|
||||
// 清空已有数据
|
||||
|
|
@ -737,10 +700,12 @@ class _EexamPaperAndScoringViewState extends ConsumerState<ExamPaperAndScoringVi
|
|||
child: (jobData?.questions ?? []).isEmpty
|
||||
? null
|
||||
: $ExamPaperAndScoringKeyboardView(
|
||||
data: jobData,
|
||||
data: jobData!,
|
||||
questions: questions,
|
||||
toNextQuestionCall: () => switchTestQuestions(jobData: jobData),
|
||||
switchQuestionTypes: () => eventFire(model: JobCheckSwitchingQuestionTabBus(jobData.pageIndex)),
|
||||
switchQuestionTypes: () {
|
||||
eventFire(model: JobCheckSwitchingQuestionTabBus(jobData.pageIndex));
|
||||
},
|
||||
viewHomeworkNotes: (JobReviewQuestions subJobQuestion) {
|
||||
var _theBusModel =
|
||||
JobNotesViewBus(taskId: jobData.taskId, paperId: jobData.paperId, questionNo: subJobQuestion.questionNo);
|
||||
|
|
@ -791,8 +756,7 @@ Widget $examPaperAndScoringKeyboardView(
|
|||
return;
|
||||
}
|
||||
// 有下一道题 自动跳转下一道题
|
||||
// toNextQuestionCall();
|
||||
_useDoScoring.eventFire(model: JobDoPapersSubmitCheckSwitchBus());
|
||||
toNextQuestionCall();
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -82,8 +82,8 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
|
|||
RestClient client = await getClient();
|
||||
BaseStructureResult<List<JobPageTab>> result = await client.getJobOfTabs(taskId);
|
||||
if (result.success && result.data != null) {
|
||||
tabs.value = result.data!;
|
||||
if (synchronization) {
|
||||
tabs.value = result.data!;
|
||||
currentTab.value = tabs.value.firstWhere((e) => e.finishCount < e.total, orElse: () => tabs.value[0]);
|
||||
}
|
||||
} else {
|
||||
|
|
@ -121,9 +121,38 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
|
|||
exitPromptFlag.value = true;
|
||||
return tabJob; // 不跳转
|
||||
}
|
||||
|
||||
exitCallback();
|
||||
} else {
|
||||
// 跳转到对于位置
|
||||
/**
|
||||
*
|
||||
var continueFlag = await showDialog<bool>(
|
||||
context: context,
|
||||
builder: (BuildContext context1) {
|
||||
return AlertDialog(
|
||||
title: quickText('页码跳转提示'),
|
||||
content: Text('当前页:${currentTab.value?.pageIndex} 已批阅完成,是否跳转到页码:${tabJob.pageIndex}继续批阅?'),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: Text('是'),
|
||||
onPressed: () {
|
||||
Navigator.of(context1).pop(true);
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
child: Text('否'),
|
||||
onPressed: () {
|
||||
// 在这里处理删除操作
|
||||
Navigator.of(context1).pop(false);
|
||||
},
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
);
|
||||
if (continueFlag == null || !continueFlag) return tabJob; // 不跳转
|
||||
*/
|
||||
tabs.value = tabDatas;
|
||||
if (tabJob != null) currentTab.value = tabJob;
|
||||
if (tabJob == null && exitPromptFlag.value) ToastUtils.showSuccess('最后一题提交成功');
|
||||
|
|
@ -133,6 +162,20 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
|
|||
return null;
|
||||
}
|
||||
|
||||
/// 当前tab下一个tab的pageIndex
|
||||
int? getNextPageIndex(int? indexLocated) {
|
||||
if (indexLocated == null) indexLocated = currentTab.value?.pageIndex;
|
||||
if (indexLocated == null) return null;
|
||||
return indexLocated == tabs.value.length - 1 ? null : tabs.value[indexLocated + 1].pageIndex;
|
||||
}
|
||||
|
||||
/// 当前tab上一个tab的pageIndex
|
||||
int? getPreviousPageIndex(int? indexLocated) {
|
||||
if (indexLocated == null) indexLocated = currentTab.value?.pageIndex;
|
||||
if (indexLocated == null) return null;
|
||||
return indexLocated == 0 ? null : tabs.value[indexLocated - 1].pageIndex;
|
||||
}
|
||||
|
||||
/// 优先批阅 ==> 取消优先批阅
|
||||
Future<void> jobPriorityReviewCancel(int jobId) async {
|
||||
RestClient _client = await getClient();
|
||||
|
|
|
|||
|
|
@ -6,23 +6,25 @@ import 'package:marking_app/routes/RouterManager.dart';
|
|||
import 'package:marking_app/utils/easy_refresh/MyEmptyWidget.dart';
|
||||
import 'package:marking_app/utils/index.dart';
|
||||
|
||||
part 'top_count.g.dart';
|
||||
|
||||
class TopCount extends StatelessWidget {
|
||||
final JobReportModel data;
|
||||
final String className;
|
||||
final int jobId;
|
||||
|
||||
const TopCount(this.data, this.className, this.jobId, {Key? key}) : super(key: key);
|
||||
const TopCount(this.data, this.className, this.jobId,{Key? key}) : super(key: key);
|
||||
|
||||
void showStudentListDialog({required BuildContext context, required String title, required List arr}) {
|
||||
void showStudentListDialog(
|
||||
{required BuildContext context,
|
||||
required String title,
|
||||
required List arr}) {
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertDialog(
|
||||
// insetPadding: EdgeInsets.symmetric(vertical: 20.r,horizontal: 20.r),
|
||||
contentPadding: EdgeInsets.all(20.r),
|
||||
shape: RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(15.r))),
|
||||
shape: RoundedRectangleBorder(
|
||||
borderRadius: BorderRadius.all(Radius.circular(15.r))),
|
||||
content: SizedBox(
|
||||
width: MediaQuery.of(context).size.width * 0.7,
|
||||
height: MediaQuery.of(context).size.height * 0.7,
|
||||
|
|
@ -32,7 +34,10 @@ class TopCount extends StatelessWidget {
|
|||
Center(
|
||||
child: Text(
|
||||
className + title,
|
||||
style: TextStyle(fontSize: 15.sp, color: Color(0xFF3C3C3C), fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 15.sp,
|
||||
color: Color(0xFF3C3C3C),
|
||||
fontWeight: FontWeight.w500),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
|
|
@ -48,19 +53,24 @@ class TopCount extends StatelessWidget {
|
|||
itemBuilder: (context, index) {
|
||||
AnswerOkStudents item = arr[index];
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
onTap: (){
|
||||
RouterManager.router.navigateTo(
|
||||
context,
|
||||
RouterManager.quickCheckPersonalPath + '?jobId=$jobId&studentId=${item.id}',
|
||||
transition: getTransition(),
|
||||
);
|
||||
RouterManager.quickCheckPersonalPath +
|
||||
'?jobId=$jobId&studentId=${item.id}',
|
||||
transition: getTransition(),);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 5.r, horizontal: 15.r),
|
||||
color: index.isOdd ? Colors.white : Color(0xFFF0F0F0),
|
||||
padding: EdgeInsets.symmetric(
|
||||
vertical: 5.r, horizontal: 15.r),
|
||||
color: index.isOdd
|
||||
? Colors.white
|
||||
: Color(0xFFF0F0F0),
|
||||
child: Text(
|
||||
item.name,
|
||||
style: TextStyle(fontSize: 12.sp, color: Color(0xFF323232)),
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: Color(0xFF323232)),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
@ -78,8 +88,8 @@ class TopCount extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
double leftWidth = (MediaQuery.of(context).size.width - 40.r) * 0.7 / 3;
|
||||
double rightWidth = (MediaQuery.of(context).size.width - 40.r) * 0.3 / 2;
|
||||
double leftWidth = (MediaQuery.of(context).size.width-40.r) * 0.7/3;
|
||||
double rightWidth = (MediaQuery.of(context).size.width-40.r) * 0.3/2;
|
||||
return Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r),
|
||||
margin: EdgeInsets.symmetric(vertical: 10.r, horizontal: 10.r),
|
||||
|
|
@ -94,21 +104,31 @@ class TopCount extends StatelessWidget {
|
|||
children: [
|
||||
InkWell(
|
||||
onTap: () {
|
||||
showStudentListDialog(context: context, title: '未提交作业学生', arr: data.noAnswerStudents!);
|
||||
showStudentListDialog(
|
||||
context: context,
|
||||
title: '未提交作业学生',
|
||||
arr: data.noAnswerStudents!);
|
||||
},
|
||||
child: leftContainer(context, count: data.noAnswerCount, name: '未提交', nameColor: Color(0xFFD92F2F), bgColor: Color(0xFFEEEEEE)),
|
||||
child:leftContainer(context,count: data.noAnswerCount,name: '未提交',nameColor: Color(0xFFD92F2F),bgColor: Color(0xFFEEEEEE)),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
showStudentListDialog(context: context, title: '已提交作业学生', arr: data.validStudents!);
|
||||
showStudentListDialog(
|
||||
context: context,
|
||||
title: '已提交作业学生',
|
||||
arr: data.validStudents!);
|
||||
},
|
||||
child: leftContainer(context, count: data.validCount, name: '已提交', nameColor: Color(0xFF4CC793), bgColor: Color(0xFFF5F5F5)),
|
||||
child: leftContainer(context,count: data.validCount,name: '已提交',nameColor: Color(0xFF4CC793),bgColor: Color(0xFFF5F5F5)),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {
|
||||
showStudentListDialog(context: context, title: '全对作业学生', arr: data.allCorrectStudents!);
|
||||
showStudentListDialog(
|
||||
context: context,
|
||||
title: '全对作业学生',
|
||||
arr: data.allCorrectStudents!);
|
||||
},
|
||||
child: leftContainer(context, count: data.allCorrect, name: '全对', nameColor: Color(0xFFFF9800), bgColor: Color(0xFFEEEEEE)),
|
||||
child:leftContainer(context,count: data.allCorrect,name: '全对',nameColor: Color(0xFFFF9800),bgColor: Color(0xFFEEEEEE)),
|
||||
|
||||
),
|
||||
Container(
|
||||
height: 92.r,
|
||||
|
|
@ -118,48 +138,55 @@ class TopCount extends StatelessWidget {
|
|||
children: [
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showStudentListDialog(context: context, title: '优等作业学生', arr: data.overallInfos['优']!.students);
|
||||
onTap: (){
|
||||
showStudentListDialog(
|
||||
context: context,
|
||||
title: '优等作业学生',
|
||||
arr: data.overallInfos['优']!.students);
|
||||
},
|
||||
child: rightContainer(
|
||||
count: data.overallInfos['优']!.count,
|
||||
bgColor: Color(0xFF56FFB8),
|
||||
nameColor: Color(0xFF009254),
|
||||
name: '优',
|
||||
child: rightContainer(count: data.overallInfos['优']!.count,bgColor: Color(0xFF56FFB8),nameColor: Color(0xFF009254),name: '优',),
|
||||
)
|
||||
),
|
||||
)),
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showStudentListDialog(context: context, title: '中等作业学生', arr: data.overallInfos['中']!.students);
|
||||
onTap: (){
|
||||
showStudentListDialog(
|
||||
context: context,
|
||||
title: '中等作业学生',
|
||||
arr: data.overallInfos['中']!.students);
|
||||
},
|
||||
child:
|
||||
rightContainer(count: data.overallInfos['中']!.count, bgColor: Color(0xFFD3FF93), nameColor: Color(0xFF3F6605), name: '中'),
|
||||
)),
|
||||
child: rightContainer(count: data.overallInfos['中']!.count,bgColor: Color(0xFFD3FF93),nameColor: Color(0xFF3F6605),name: '中'),
|
||||
)
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 92.r,
|
||||
width: rightWidth,
|
||||
width:rightWidth,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showStudentListDialog(context: context, title: '良等作业学生', arr: data.overallInfos['良']!.students);
|
||||
onTap: (){
|
||||
showStudentListDialog(
|
||||
context: context,
|
||||
title: '良等作业学生',
|
||||
arr: data.overallInfos['良']!.students);
|
||||
},
|
||||
child:
|
||||
rightContainer(count: data.overallInfos['良']!.count, bgColor: Color(0xFFFFC38C), nameColor: Color(0xFFD36500), name: '良'),
|
||||
)),
|
||||
child: rightContainer(count: data.overallInfos['良']!.count,bgColor: Color(0xFFFFC38C),nameColor: Color(0xFFD36500),name: '良' ),
|
||||
)
|
||||
),
|
||||
Expanded(
|
||||
child: InkWell(
|
||||
onTap: () {
|
||||
showStudentListDialog(context: context, title: '差等作业学生', arr: data.overallInfos['差']!.students);
|
||||
onTap: (){
|
||||
showStudentListDialog(
|
||||
context: context,
|
||||
title: '差等作业学生',
|
||||
arr: data.overallInfos['差']!.students);
|
||||
},
|
||||
child:
|
||||
rightContainer(count: data.overallInfos['差']!.count, bgColor: Color(0xFFFF9D94), nameColor: Color(0xFFD12616), name: '差'),
|
||||
child: rightContainer(count: data.overallInfos['差']!.count,bgColor: Color(0xFFFF9D94),nameColor: Color(0xFFD12616),name: '差' ),
|
||||
)),
|
||||
],
|
||||
),
|
||||
|
|
@ -364,7 +391,10 @@ class TopCount extends StatelessWidget {
|
|||
}
|
||||
return InkWell(
|
||||
onTap: () {
|
||||
showStudentListDialog(context: context, title: item.title + '等作业学生', arr: item.studentNames);
|
||||
showStudentListDialog(
|
||||
context: context,
|
||||
title: item.title + '等作业学生',
|
||||
arr: item.studentNames);
|
||||
},
|
||||
child: Container(
|
||||
padding: EdgeInsets.symmetric(vertical: 10.r),
|
||||
|
|
@ -384,12 +414,16 @@ class TopCount extends StatelessWidget {
|
|||
height: 28.r,
|
||||
decoration: BoxDecoration(
|
||||
color: Colors.white,
|
||||
border: Border.all(color: bgColor, width: 1.r, style: BorderStyle.solid),
|
||||
border: Border.all(
|
||||
color: bgColor,
|
||||
width: 1.r,
|
||||
style: BorderStyle.solid),
|
||||
borderRadius: BorderRadius.circular(14.r)),
|
||||
child: Center(
|
||||
child: Text(
|
||||
item.title,
|
||||
style: TextStyle(color: bgColor, fontSize: 12.r),
|
||||
style:
|
||||
TextStyle(color: bgColor, fontSize: 12.r),
|
||||
)),
|
||||
),
|
||||
],
|
||||
|
|
@ -400,11 +434,13 @@ class TopCount extends StatelessWidget {
|
|||
),
|
||||
Text(
|
||||
item.count.toString(),
|
||||
style: TextStyle(fontSize: 20.sp, color: Color(0xFF595959)),
|
||||
style: TextStyle(
|
||||
fontSize: 20.sp, color: Color(0xFF595959)),
|
||||
),
|
||||
Text(
|
||||
'人',
|
||||
style: TextStyle(fontSize: 14.sp, color: Color(0xFF595959)),
|
||||
style: TextStyle(
|
||||
fontSize: 14.sp, color: Color(0xFF595959)),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
@ -420,12 +456,13 @@ class TopCount extends StatelessWidget {
|
|||
}
|
||||
|
||||
@swidget
|
||||
Widget leftContainer(context, {required int count, required String name, required Color nameColor, required Color bgColor}) {
|
||||
double leftWidth = (MediaQuery.of(context).size.width - 40.r) * 0.7 / 3;
|
||||
Widget leftContainer(context,{required int count,required String name,required Color nameColor,required Color bgColor}){
|
||||
double leftWidth = (MediaQuery.of(context).size.width-40.r) * 0.7/3;
|
||||
return Container(
|
||||
width: leftWidth,
|
||||
height: 92.r,
|
||||
padding: EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r),
|
||||
padding:
|
||||
EdgeInsets.symmetric(vertical: 10.r, horizontal: 6.r),
|
||||
color: bgColor,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
|
|
@ -439,11 +476,17 @@ Widget leftContainer(context, {required int count, required String name, require
|
|||
children: [
|
||||
Text(
|
||||
count.toString(),
|
||||
style: TextStyle(fontSize: 18.sp, color: Color(0xFF595959), fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
fontSize: 18.sp,
|
||||
color: Color(0xFF595959),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
Text(
|
||||
'人',
|
||||
style: TextStyle(fontSize: 10.sp, color: Color(0xFF595959), fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
fontSize: 10.sp,
|
||||
color: Color(0xFF595959),
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
@ -452,7 +495,10 @@ Widget leftContainer(context, {required int count, required String name, require
|
|||
),
|
||||
Text(
|
||||
name,
|
||||
style: TextStyle(fontSize: 12.sp, color: nameColor, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: nameColor,
|
||||
fontWeight: FontWeight.w500),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
@ -460,9 +506,9 @@ Widget leftContainer(context, {required int count, required String name, require
|
|||
}
|
||||
|
||||
@swidget
|
||||
Widget rightContainer({required int count, required Color bgColor, required Color nameColor, required String name}) {
|
||||
Widget rightContainer({required int count,required Color bgColor,required Color nameColor,required String name}){
|
||||
return Container(
|
||||
color: bgColor,
|
||||
color:bgColor,
|
||||
child: Column(
|
||||
children: [
|
||||
SizedBox(
|
||||
|
|
@ -474,11 +520,17 @@ Widget rightContainer({required int count, required Color bgColor, required Colo
|
|||
children: [
|
||||
Text(
|
||||
count.toString(),
|
||||
style: TextStyle(fontSize: 12.sp, color: nameColor, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: nameColor,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
Text(
|
||||
'人',
|
||||
style: TextStyle(fontSize: 8.sp, color: nameColor, fontWeight: FontWeight.w600),
|
||||
style: TextStyle(
|
||||
fontSize: 8.sp,
|
||||
color: nameColor,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
],
|
||||
),
|
||||
|
|
@ -487,7 +539,10 @@ Widget rightContainer({required int count, required Color bgColor, required Colo
|
|||
),
|
||||
Text(
|
||||
name,
|
||||
style: TextStyle(fontSize: 12.sp, color: nameColor, fontWeight: FontWeight.w500),
|
||||
style: TextStyle(
|
||||
fontSize: 12.sp,
|
||||
color: nameColor,
|
||||
fontWeight: FontWeight.w500),
|
||||
)
|
||||
],
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in New Issue