From f65f6e12c67cf45fd26b1f8c2210d0dbcde98222 Mon Sep 17 00:00:00 2001 From: duxingchen Date: Thu, 3 Sep 2026 16:27:10 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=95=88=E8=83=BD=E5=88=86=E6=9E=90?= =?UTF-8?q?=E9=BB=98=E8=AE=A4=E6=97=B6=E9=97=B4=E6=81=A2=E5=A4=8D=E4=BB=8A?= =?UTF-8?q?=E5=A4=A9,=E5=88=A0=E9=99=A4=E4=BC=AA=E9=80=A01h=E5=85=9C?= =?UTF-8?q?=E5=BA=95,=E8=BD=A8=E8=BF=B9=E6=B5=81=E8=BD=ACX=E8=BD=B4?= =?UTF-8?q?=E5=9B=9B=E8=A1=8C=E5=B1=95=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/pages/admin/AnalyticsDashboard.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/frontend/src/pages/admin/AnalyticsDashboard.tsx b/frontend/src/pages/admin/AnalyticsDashboard.tsx index ec50d2d..e187f3e 100644 --- a/frontend/src/pages/admin/AnalyticsDashboard.tsx +++ b/frontend/src/pages/admin/AnalyticsDashboard.tsx @@ -418,7 +418,7 @@ export default function AnalyticsDashboard() { }); // 1. 预计算每台设备的统计:累计投入、空闲时长、人员排序(按 isWorkday 选偏移/时长) - const deviceStats = chunkDevices.map((d, idx) => { + const deviceStats = chunkDevices.map((_, idx) => { let totalInputHours = 0; const personHours: Record = {}; const intervals: [number, number][] = []; @@ -462,7 +462,8 @@ export default function AnalyticsDashboard() { }); // 背景主干高度:所选模式下的总生命周期(严丝合缝,消除自然空闲断层) - const leadByMode = chunkDevices.map((d, idx) => { + // 🔧 不再伪造 1h:设备该是多长就返回多长(0 也是 0,绝不显示虚假的 1h 兜底) + const leadByMode = chunkDevices.map((_, idx) => { let maxEnd = 0; chunkSeries.forEach((s) => s.data.forEach((t) => { if (t[0] === idx) { @@ -470,7 +471,7 @@ export default function AnalyticsDashboard() { if (e > maxEnd) maxEnd = e; } })); - return Math.max(maxEnd, 1); + return maxEnd; }); return {