From 2ac88000cc351023b2b7a5ed739c4bdf6628a589 Mon Sep 17 00:00:00 2001 From: "DESKTOP-I3JPKHK\\wy" <1111> Date: Mon, 29 Sep 2025 17:30:47 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=BB=E9=99=A4=E9=AB=98=E9=A2=91=20print=20?= =?UTF-8?q?=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/question_number_view.dart | 3 +-- .../configuration_files/index.dart | 7 +++---- .../configuration_files/zoom_logic.dart | 19 +------------------ 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/making_school_asignment_app/lib/page/home_page/children/homework_review/components/question_number_view.dart b/making_school_asignment_app/lib/page/home_page/children/homework_review/components/question_number_view.dart index 0a76601..ec0106d 100644 --- a/making_school_asignment_app/lib/page/home_page/children/homework_review/components/question_number_view.dart +++ b/making_school_asignment_app/lib/page/home_page/children/homework_review/components/question_number_view.dart @@ -133,7 +133,7 @@ Widget $questionNumberScrollView({ // var actualImgHeight = useImageInfo.value?.actualImgHeight ?? 0; // 实际图片高度 - print("图片高度:${usePiddingTop.value}"); + // 移除高频日志,避免在滚动/缩放时造成不必要的 I/O 开销 return SingleChildScrollView( controller: scrollControllerNum, @@ -183,7 +183,6 @@ Widget $scoringQuestionsView( useEffect(() { /// 学生打分数据 studentScoreListener() { - print(item.toJson()); item.studentScore = studentScore.value; try { var theVal = sateData.studentQuestions.value?.firstWhere((e) => e.questionNo == item.questionNo); diff --git a/making_school_asignment_app/lib/page/home_page/children/homework_review/configuration_files/index.dart b/making_school_asignment_app/lib/page/home_page/children/homework_review/configuration_files/index.dart index 24937b5..ef2020c 100644 --- a/making_school_asignment_app/lib/page/home_page/children/homework_review/configuration_files/index.dart +++ b/making_school_asignment_app/lib/page/home_page/children/homework_review/configuration_files/index.dart @@ -164,7 +164,7 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin, EventBus state.studentQuestions.value = data.studentQuestions; // 赋值试题集合 state.data.value = data; } catch (e) { - print('获取数据报错了:$e'); + // 移除冗余打印,使用提示替代 state.getDataError.value = true; ToastUtils.showError('获取试题数据失败,请检查网络连接后重试'); } finally { @@ -247,8 +247,7 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin, EventBus return imgKey; } catch (e) { - print('图片上传失败'); - print(e.toString()); + // 图片上传失败日志移除,统一提示 ToastUtils.getFluttertoast(msg: '图片上传失败', context: context); } finally { // ToastUtils.dismiss(); @@ -331,7 +330,7 @@ class HomeworkReviewLogic extends GetxController with RequestToolMixin, EventBus ToastUtils.showSuccess("批阅已提交"); }); } catch (e) { - print("批阅提交报错 $e"); + // 提交异常日志移除,统一提示 ToastUtils.showError('提交失败,请检查网络连接后重试'); } finally { state.submitLoading.value = false; diff --git a/making_school_asignment_app/lib/page/home_page/children/homework_review/configuration_files/zoom_logic.dart b/making_school_asignment_app/lib/page/home_page/children/homework_review/configuration_files/zoom_logic.dart index f8da892..a6abc6b 100644 --- a/making_school_asignment_app/lib/page/home_page/children/homework_review/configuration_files/zoom_logic.dart +++ b/making_school_asignment_app/lib/page/home_page/children/homework_review/configuration_files/zoom_logic.dart @@ -36,7 +36,6 @@ class ZoomLogic extends GetxController { WidgetsBinding.instance.addPostFrameCallback((e) { /// 试题加载后更新尺寸对象(只要题号没有变就不更新尺寸对象) _streamHomework = homeworkReviewLogic.state.data.listen((e) { - print("HOMEWORKSTATE 变化了"); var zoomFile = zoomState.zoomFile.value; if (e == null || zoomFile == null) return; @@ -83,7 +82,7 @@ class ZoomLogic extends GetxController { oldTemplateId = templateId; final fileSize = imageSizeMap[templateId]; - print("fileSize: ${fileSize?.toJson()}"); + // 移除冗余日志,避免频繁 I/O if (fileSize != null) { zoomState.zoomFile.value = fileSize; return; @@ -113,8 +112,6 @@ class ZoomLogic extends GetxController { // 缩放组件 ==> 缩放监听 void onScaleUpdate(double zoom) async { - print("缩放比例:$zoom"); - /// 防抖 zoomState.initScale.value = zoom; // anti_shake_throttling.debounce(() => zoomState.initScale.value = zoom, const Duration(milliseconds: 100))(); @@ -124,8 +121,6 @@ class ZoomLogic extends GetxController { void onPanUpPosition(Offset val) async { // 手指在移动 非物体移动的位置 var state = homeworkReviewLogic.state; - print('**************** 正在移动位置 YYY:${val.dy}'); - print('**************** 正在移动位置 XXX:${val.dx}'); state.zoomOffset = val; state.slide.value = val.dy.abs().toInt().toDouble(); } @@ -138,18 +133,6 @@ class ZoomLogic extends GetxController { // 重置位置偏移 homeworkReviewLogic.state.zoomOffset = Offset.zero; homeworkReviewLogic.state.slide.value = 0.0; - - // final zoomFile = zoomState.zoomFile.value; - // final double imageOffsetY = (zoomFile?.imageHeightOffsetStart ?? 0).toDouble(); - // final controller = homeworkReviewLogic.zoomController; - // if (controller != null) { - // // 以单位矩阵为基,设置垂直平移到居中位置 - // final Matrix4 centered = Matrix4.identity()..setTranslationRaw(0, imageOffsetY > 0 ? imageOffsetY : 0, 0); - - // controller.value = centered; - // } - - print('缩放已重置'); } }