批阅页面修改
This commit is contained in:
parent
a8d0e80555
commit
9d2f15c80c
|
|
@ -148,6 +148,10 @@ Widget $scoringQuestionsView(BuildContext context, List<StudentQuestions>? stude
|
||||||
studentScore.value = item.studentScore;
|
studentScore.value = item.studentScore;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// useValueChanged<StudentQuestions, void>(item, (_, __) {
|
||||||
|
// studentScore.value = item.studentScore;
|
||||||
|
// });
|
||||||
|
|
||||||
useEffect(() {
|
useEffect(() {
|
||||||
/// 学生打分数据
|
/// 学生打分数据
|
||||||
studentScoreListener() {
|
studentScoreListener() {
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,4 @@
|
||||||
|
import 'dart:async';
|
||||||
import 'dart:math';
|
import 'dart:math';
|
||||||
|
|
||||||
import 'package:flutter/cupertino.dart';
|
import 'package:flutter/cupertino.dart';
|
||||||
|
|
@ -278,6 +279,10 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
||||||
|
|
||||||
int _activePointers = 0;
|
int _activePointers = 0;
|
||||||
|
|
||||||
|
Timer? timer;
|
||||||
|
// 定时器超时时间,单位为毫秒
|
||||||
|
static const int timeoutDuration = 300;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
final theMaxHeight = useState<double>(maxHeight);
|
final theMaxHeight = useState<double>(maxHeight);
|
||||||
|
|
@ -424,21 +429,38 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
||||||
// 判断当前是否已经有触摸点,如果有则忽略该触摸事件
|
// 判断当前是否已经有触摸点,如果有则忽略该触摸事件
|
||||||
|
|
||||||
// 处理单个触摸点按下的逻辑
|
// 处理单个触摸点按下的逻辑
|
||||||
_activePointers++;
|
_activePointers = _activePointers + 1;
|
||||||
|
print("+++进入:onPointerDown $_activePointers");
|
||||||
|
timer?.cancel();
|
||||||
|
timer = Timer(const Duration(milliseconds: timeoutDuration), () {
|
||||||
|
if (_activePointers > 0) {
|
||||||
|
_activePointers = 0;
|
||||||
|
if (vnHandWritings.value.last != null) {
|
||||||
|
vnHandWritings.value.add(null); // 增加空点以分隔不同的线段
|
||||||
|
sateData.handwritings = vnHandWritings.value; // 添加笔迹数据
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
sateData.panQuestView = true;
|
sateData.panQuestView = true;
|
||||||
},
|
},
|
||||||
onPointerUp: (PointerUpEvent details) {
|
onPointerUp: (PointerUpEvent details) {
|
||||||
// 处理单个触摸点抬起的逻辑
|
// 处理单个触摸点抬起的逻辑
|
||||||
// activePointers--;
|
// activePointers--;
|
||||||
// globalPosition = null;
|
// globalPosition = null;
|
||||||
_activePointers--;
|
if (_activePointers > 0) {
|
||||||
|
_activePointers = _activePointers - 1;
|
||||||
|
}
|
||||||
|
print("---进入:onPointerUp $_activePointers");
|
||||||
|
timer?.cancel();
|
||||||
if (!annotationState.pen.value) return;
|
if (!annotationState.pen.value) return;
|
||||||
|
|
||||||
vnHandWritings.value.add(null); // 增加空点以分隔不同的线段
|
vnHandWritings.value.add(null); // 增加空点以分隔不同的线段
|
||||||
sateData.handwritings = vnHandWritings.value; // 添加笔迹数据
|
sateData.handwritings = vnHandWritings.value; // 添加笔迹数据
|
||||||
},
|
},
|
||||||
onPointerMove: (PointerMoveEvent event) {
|
onPointerMove: (PointerMoveEvent event) {
|
||||||
|
print("进入:onPointerMove $_activePointers");
|
||||||
if (_activePointers != 1) return;
|
if (_activePointers != 1) return;
|
||||||
|
timer?.cancel();
|
||||||
if (!annotationState.pen.value) return;
|
if (!annotationState.pen.value) return;
|
||||||
|
|
||||||
Offset localPosition = event.localPosition; // 相对
|
Offset localPosition = event.localPosition; // 相对
|
||||||
|
|
@ -486,6 +508,7 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
||||||
var isPen = annotationState.pen.value;
|
var isPen = annotationState.pen.value;
|
||||||
var showZgtAnnotate = sateData.data.value?.showZgtAnnotate;
|
var showZgtAnnotate = sateData.data.value?.showZgtAnnotate;
|
||||||
|
|
||||||
|
print(sateData.data.value!.zgtAnswer);
|
||||||
return Container(
|
return Container(
|
||||||
height: double.infinity,
|
height: double.infinity,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
|
|
|
||||||
|
|
@ -125,7 +125,7 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
||||||
// var theImageScaleZoom = state.imageScaleZoom.value;
|
// var theImageScaleZoom = state.imageScaleZoom.value;
|
||||||
// if (theImageScaleZoom == null || theImageScaleZoom.url != e?.url) state.imageScaleZoom.value = e;
|
// if (theImageScaleZoom == null || theImageScaleZoom.url != e?.url) state.imageScaleZoom.value = e;
|
||||||
// });
|
// });
|
||||||
|
|
||||||
WidgetsBinding.instance.addPostFrameCallback((_) => getData());
|
WidgetsBinding.instance.addPostFrameCallback((_) => getData());
|
||||||
super.onInit();
|
super.onInit();
|
||||||
}
|
}
|
||||||
|
|
@ -311,32 +311,36 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
||||||
var totalUnAnnotateCount = data.totalUnAnnotateCount;
|
var totalUnAnnotateCount = data.totalUnAnnotateCount;
|
||||||
if (data.needAnnotate) totalUnAnnotateCount -= 1; // 是否需要批阅
|
if (data.needAnnotate) totalUnAnnotateCount -= 1; // 是否需要批阅
|
||||||
|
|
||||||
if (totalUnAnnotateCount <= 0 && !state.lastQuestionPrompt) {
|
if (totalUnAnnotateCount <= 0) {
|
||||||
// 批阅完成
|
// 批阅完成
|
||||||
showDialog(
|
if (!state.lastQuestionPrompt) {
|
||||||
context: context,
|
await showDialog(
|
||||||
builder: (BuildContext context1) {
|
context: context,
|
||||||
return AlertDialog(
|
builder: (BuildContext context1) {
|
||||||
title: quickText('批阅已完成'),
|
return AlertDialog(
|
||||||
content: const Text('暂无更多批阅项'),
|
title: quickText('批阅已完成'),
|
||||||
actions: <Widget>[
|
content: const Text('暂无更多批阅项'),
|
||||||
TextButton(
|
actions: <Widget>[
|
||||||
child: const Text('继续'),
|
TextButton(
|
||||||
onPressed: () {
|
child: const Text('继续'),
|
||||||
state.lastQuestionPrompt = true;
|
|
||||||
Navigator.of(context1).pop();
|
|
||||||
},
|
|
||||||
),
|
|
||||||
TextButton(
|
|
||||||
child: const Text('退出批阅'),
|
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
|
state.lastQuestionPrompt = true;
|
||||||
Navigator.of(context1).pop();
|
Navigator.of(context1).pop();
|
||||||
Get.back();
|
},
|
||||||
}),
|
),
|
||||||
],
|
TextButton(
|
||||||
);
|
child: const Text('退出批阅'),
|
||||||
},
|
onPressed: () {
|
||||||
);
|
Navigator.of(context1).pop();
|
||||||
|
Get.back();
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}else{
|
||||||
|
ToastUtils.showSuccess("已经提交",duration:const Duration(milliseconds: 800));
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var newParams = DoPaperDetailsParam.fromJson(state.param.value.toJson());
|
var newParams = DoPaperDetailsParam.fromJson(state.param.value.toJson());
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue