From 19db13b360b7809d0c961df297b42772fc579bb9 Mon Sep 17 00:00:00 2001 From: Nixevol Date: Tue, 17 Nov 2026 21:15:40 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BB=BB=E5=8A=A1=E5=81=9C=E6=AD=A2?= =?UTF-8?q?=E5=90=8E=E4=BB=8D=E7=94=A8=E6=96=B0=E7=9A=84=E6=9C=AC=E6=9C=88?= =?UTF-8?q?=E5=AD=A6=E6=97=B6=E6=9B=B4=E6=96=B0=E9=A6=96=E9=A1=B5=E5=92=8C?= =?UTF-8?q?=E8=BF=9B=E5=BA=A6=E6=9D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/src/features/home/HomeView.vue | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/web/src/features/home/HomeView.vue b/web/src/features/home/HomeView.vue index 6aca9c3..98e8cd8 100644 --- a/web/src/features/home/HomeView.vue +++ b/web/src/features/home/HomeView.vue @@ -650,9 +650,16 @@ function applyStudyControl(payload: Record) { } else if (!studying) { hoursRefreshIn.value = 0; } - if (studying && typeof payload.month_hours === "string" && payload.month_hours) { - progressHours.value = payload.month_hours; - if (summary.value) summary.value = { ...summary.value, month_hours: payload.month_hours }; + const incomingHours = typeof payload.month_hours === "string" ? payload.month_hours.trim() : ""; + if (incomingHours) { + const shown = progressHours.value || summary.value?.month_hours || ""; + const incomingMinutes = Number(incomingHours.match(/(\d+)/)?.[1] ?? 0); + const shownMinutes = Number(String(shown).match(/(\d+)/)?.[1] ?? 0); + // 达标后任务已停,这一帧仍要补上本月学时和进度条。空闲帧不把刚刷新到的更大数字改小。 + if (studying || incomingMinutes > shownMinutes) { + progressHours.value = incomingHours; + if (summary.value) summary.value = { ...summary.value, month_hours: incomingHours }; + } } if (typeof payload.monthly_target === "number" && Number.isFinite(payload.monthly_target)) { progressTarget.value = Math.trunc(payload.monthly_target);