mcy_new #1
|
|
@ -148,6 +148,10 @@ Widget $scoringQuestionsView(BuildContext context, List<StudentQuestions>? stude
|
|||
studentScore.value = item.studentScore;
|
||||
});
|
||||
|
||||
// useValueChanged<StudentQuestions, void>(item, (_, __) {
|
||||
// studentScore.value = item.studentScore;
|
||||
// });
|
||||
|
||||
useEffect(() {
|
||||
/// 学生打分数据
|
||||
studentScoreListener() {
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import 'dart:async';
|
||||
import 'dart:math';
|
||||
|
||||
import 'package:flutter/cupertino.dart';
|
||||
|
|
@ -278,6 +279,10 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
|||
|
||||
int _activePointers = 0;
|
||||
|
||||
Timer? timer;
|
||||
// 定时器超时时间,单位为毫秒
|
||||
static const int timeoutDuration = 300;
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
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;
|
||||
},
|
||||
onPointerUp: (PointerUpEvent details) {
|
||||
// 处理单个触摸点抬起的逻辑
|
||||
// activePointers--;
|
||||
// globalPosition = null;
|
||||
_activePointers--;
|
||||
if (_activePointers > 0) {
|
||||
_activePointers = _activePointers - 1;
|
||||
}
|
||||
print("---进入:onPointerUp $_activePointers");
|
||||
timer?.cancel();
|
||||
if (!annotationState.pen.value) return;
|
||||
|
||||
vnHandWritings.value.add(null); // 增加空点以分隔不同的线段
|
||||
sateData.handwritings = vnHandWritings.value; // 添加笔迹数据
|
||||
},
|
||||
onPointerMove: (PointerMoveEvent event) {
|
||||
print("进入:onPointerMove $_activePointers");
|
||||
if (_activePointers != 1) return;
|
||||
timer?.cancel();
|
||||
if (!annotationState.pen.value) return;
|
||||
|
||||
Offset localPosition = event.localPosition; // 相对
|
||||
|
|
@ -486,6 +508,7 @@ class QuestionImageView extends HookWidget with EventBusMixin<BottomOperationBar
|
|||
var isPen = annotationState.pen.value;
|
||||
var showZgtAnnotate = sateData.data.value?.showZgtAnnotate;
|
||||
|
||||
print(sateData.data.value!.zgtAnswer);
|
||||
return Container(
|
||||
height: double.infinity,
|
||||
width: double.infinity,
|
||||
|
|
|
|||
|
|
@ -311,32 +311,36 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin {
|
|||
var totalUnAnnotateCount = data.totalUnAnnotateCount;
|
||||
if (data.needAnnotate) totalUnAnnotateCount -= 1; // 是否需要批阅
|
||||
|
||||
if (totalUnAnnotateCount <= 0 && !state.lastQuestionPrompt) {
|
||||
if (totalUnAnnotateCount <= 0) {
|
||||
// 批阅完成
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context1) {
|
||||
return AlertDialog(
|
||||
title: quickText('批阅已完成'),
|
||||
content: const Text('暂无更多批阅项'),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('继续'),
|
||||
onPressed: () {
|
||||
state.lastQuestionPrompt = true;
|
||||
Navigator.of(context1).pop();
|
||||
},
|
||||
),
|
||||
TextButton(
|
||||
child: const Text('退出批阅'),
|
||||
if (!state.lastQuestionPrompt) {
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context1) {
|
||||
return AlertDialog(
|
||||
title: quickText('批阅已完成'),
|
||||
content: const Text('暂无更多批阅项'),
|
||||
actions: <Widget>[
|
||||
TextButton(
|
||||
child: const Text('继续'),
|
||||
onPressed: () {
|
||||
state.lastQuestionPrompt = true;
|
||||
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;
|
||||
}
|
||||
var newParams = DoPaperDetailsParam.fromJson(state.param.value.toJson());
|
||||
|
|
|
|||
Loading…
Reference in New Issue