更新此次批阅优化问题
This commit is contained in:
parent
d5249ba0af
commit
ecfb2c33b6
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -290,19 +290,24 @@ 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;
|
||||||
var params = MarkingTextQuestionJobTabParamsBus(taskId, _pageIndex);
|
_useSwitchStudentAndType.refreshQuestionTypeData(context, taskId: taskId, exitCallback: exitCallback, getNewData: false).then((value) {
|
||||||
if (_currentTab.finishCount + 1 == _currentTab.total) {
|
var params = MarkingTextQuestionJobTabParamsBus(taskId, _pageIndex);
|
||||||
var _currentTabNew =
|
if (_currentTab.finishCount < _currentTab.total) {
|
||||||
_useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.pageIndex != _currentTab.pageIndex && e.finishCount != e.total);
|
if (_currentTab.finishCount + 1 == _currentTab.total) {
|
||||||
// 如果全部都已经批阅完成就不需要跳转到不必要得批阅试题
|
var _currentTabNew =
|
||||||
if (_currentTabNew != null) params.pageIndex = _currentTabNew.pageIndex;
|
_useSwitchStudentAndType.tabs.value.firstWhereOrNull((e) => e.pageIndex != _currentTab.pageIndex && e.finishCount != e.total);
|
||||||
}
|
// 如果全部都已经批阅完成就不需要跳转到不必要得批阅试题
|
||||||
var _theCurrentPage = _useSwitchStudentAndType.tabs.value.firstWhereOrNull((element) => element.pageIndex == _pageIndex);
|
if (_currentTabNew != null) params.pageIndex = _currentTabNew.pageIndex;
|
||||||
if (_theCurrentPage != null) {
|
}
|
||||||
_theCurrentPage.finishCount += 1;
|
var _theCurrentPage = _useSwitchStudentAndType.tabs.value.firstWhereOrNull((element) => element.pageIndex == _pageIndex);
|
||||||
_useSwitchStudentAndType.tabs.value = _useSwitchStudentAndType.tabs.value.map((e) => JobPageTab.fromJson(e.toJson())).toList();
|
if (_theCurrentPage != null) {
|
||||||
}
|
_theCurrentPage.finishCount += 1;
|
||||||
_useSwitchStudentAndType.eventFire(model: params);
|
_useSwitchStudentAndType.tabs.value = _useSwitchStudentAndType.tabs.value.map((e) => JobPageTab.fromJson(e.toJson())).toList();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_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,
|
||||||
|
|
|
||||||
|
|
@ -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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue