更新此次批阅优化问题

This commit is contained in:
1147192855@qq.com 2024-04-12 12:20:36 +08:00
parent d5249ba0af
commit ecfb2c33b6
3 changed files with 38 additions and 17 deletions

1
.gitignore vendored
View File

@ -214,3 +214,4 @@ 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_papers_submit_check_switch_bus.g.dart
marking_app/lib/common/model/event_bus/jobs/job_do_synchro_tab.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 marking_app/lib/pages/homework_correction/widget/top_count.g.dart
marking_app/lib/pages/homework_correction/job_knowledge_points.g.dart

View File

@ -290,7 +290,9 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
var _currentTab = _useSwitchStudentAndType.currentTab.value; var _currentTab = _useSwitchStudentAndType.currentTab.value;
var _pageIndex = _currentTab?.pageIndex; var _pageIndex = _currentTab?.pageIndex;
if (_currentTab == null || _pageIndex == null) return; if (_currentTab == null || _pageIndex == null) return;
_useSwitchStudentAndType.refreshQuestionTypeData(context, taskId: taskId, exitCallback: exitCallback, getNewData: false).then((value) {
var params = MarkingTextQuestionJobTabParamsBus(taskId, _pageIndex); var params = MarkingTextQuestionJobTabParamsBus(taskId, _pageIndex);
if (_currentTab.finishCount < _currentTab.total) {
if (_currentTab.finishCount + 1 == _currentTab.total) { if (_currentTab.finishCount + 1 == _currentTab.total) {
var _currentTabNew = var _currentTabNew =
_useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.pageIndex != _currentTab.pageIndex && e.finishCount != e.total); _useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.pageIndex != _currentTab.pageIndex && e.finishCount != e.total);
@ -302,7 +304,10 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
_theCurrentPage.finishCount += 1; _theCurrentPage.finishCount += 1;
_useSwitchStudentAndType.tabs.value = _useSwitchStudentAndType.tabs.value.map((e) => JobPageTab.fromJson(e.toJson())).toList(); _useSwitchStudentAndType.tabs.value = _useSwitchStudentAndType.tabs.value.map((e) => JobPageTab.fromJson(e.toJson())).toList();
} }
}
_useSwitchStudentAndType.eventFire(model: params); _useSwitchStudentAndType.eventFire(model: params);
});
break; break;
default: default:
} }
@ -396,7 +401,7 @@ Widget $dropdownBoxSwitchStudentsOrTypeView(BuildContext context, {required Func
), ),
Expanded(flex: 1, child: SizedBox()), Expanded(flex: 1, child: SizedBox()),
Expanded( Expanded(
flex: 4, flex: isPad() ? 4 : 5,
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.end, mainAxisAlignment: MainAxisAlignment.end,

View File

@ -99,8 +99,12 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
} }
/// tab类型数据 /// tab类型数据
Future<JobPageTab?> refreshQuestionTypeData(BuildContext context, {required int taskId, required Function() exitCallback}) async { Future<JobPageTab?> refreshQuestionTypeData(BuildContext context,
List<JobPageTab>? tabDatas = await getDataForTestpaper(taskId: taskId, synchronization: false); {required int taskId, required Function() exitCallback, bool getNewData = true}) async {
List<JobPageTab>? tabDatas = tabs.value;
if (getNewData) {
tabDatas = await getDataForTestpaper(taskId: taskId, synchronization: false);
}
if (tabDatas?.isNotEmpty ?? false) { if (tabDatas?.isNotEmpty ?? false) {
JobPageTab? tabJob = tabDatas!.firstWhereOrNull((e) => e.finishCount < e.total); JobPageTab? tabJob = tabDatas!.firstWhereOrNull((e) => e.finishCount < e.total);
if (tabJob == null && !exitPromptFlag.value) { if (tabJob == null && !exitPromptFlag.value) {
@ -124,9 +128,20 @@ class UseSwitchStudentAndType with CommonMixin, EventBusMixin {
exitCallback(); exitCallback();
} else { } else {
// //
if (!getNewData) return tabJob;
tabs.value = tabDatas; tabs.value = tabDatas;
if (tabJob != null) currentTab.value = tabJob; if (tabJob != null) currentTab.value = tabJob;
if (tabJob == null && exitPromptFlag.value) ToastUtils.showSuccess('最后一题提交成功'); if (tabJob == null && exitPromptFlag.value) {
var _thePageIndex = currentTab.value?.pageIndex;
if (_thePageIndex != null) {
var _theIndex = tabDatas.indexWhere((e) => e.pageIndex == _thePageIndex);
if (_theIndex != -1 && _theIndex < tabDatas.length - 1) {
currentTab.value = tabDatas[_theIndex + 1];
return tabJob;
}
}
ToastUtils.showSuccess('最后一题提交成功');
}
return tabJob; return tabJob;
} }
} }