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 {