From 54efe53b11cf0bfdf785b361cb061491b1416332 Mon Sep 17 00:00:00 2001 From: Script Generator Date: Mon, 15 Jun 2026 15:59:04 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=A6=82=E8=A7=88=E8=80=97=E6=97=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E7=B2=BE=E7=A1=AE=E5=88=B0=E6=97=B6=E5=88=86?= =?UTF-8?q?=20+=20=E6=80=BB=E8=80=97=E6=97=B6=E5=90=AB=E5=8A=A0=E7=8F=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 开始日期/实际截止显示精确到分钟: - 开始:取所有阶段最早时间 slice(0,16) - 实际截止:取所有阶段最晚完成时间 slice(0,16) - 格式如"2025-06-15 14:30" 2. 总耗时包含加班时长: - 显示"已耗时 X 天(含加班 Yh)" - 加班时长从 overtime records 实时汇总 - 无加班时不显示加班部分 Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/web/app/versions/[id]/page.tsx | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/apps/web/app/versions/[id]/page.tsx b/apps/web/app/versions/[id]/page.tsx index 6310050..575b155 100644 --- a/apps/web/app/versions/[id]/page.tsx +++ b/apps/web/app/versions/[id]/page.tsx @@ -396,7 +396,7 @@ export default function VersionDetailPage() { }); vDTs.forEach((t) => { if (t.startDate) startDates.push(t.startDate); }); vTCsAll.forEach((c) => { if (c.startedAt) startDates.push(c.startedAt); }); - const actualStart = startDates.length > 0 ? startDates.sort()[0].slice(0, 10) : (version.startDate ?? null); + const actualStart = startDates.length > 0 ? startDates.sort()[0].slice(0, 16).replace('T', ' ') : (version.startDate ?? null); // 实际截止日期 const endDates: string[] = []; @@ -404,15 +404,19 @@ export default function VersionDetailPage() { vDTs.forEach((t) => { if (t.completedAt) endDates.push(t.completedAt); }); vTCsAll.forEach((c) => { if (c.completedAt) endDates.push(c.completedAt); }); vBugsAll.forEach((b) => { if (b.closedAt) endDates.push(b.closedAt); }); - const actualEnd = endDates.length > 0 ? endDates.sort().reverse()[0].slice(0, 10) : null; + const actualEnd = endDates.length > 0 ? endDates.sort().reverse()[0].slice(0, 16).replace('T', ' ') : null; // 逾期天数 const deadline = version.expectedReleaseDate; let overdueDays = 0; if (deadline && actualEnd) { - overdueDays = Math.floor((new Date(actualEnd).getTime() - new Date(deadline).getTime()) / (1000 * 60 * 60 * 24)); + overdueDays = Math.floor((new Date(actualEnd.replace(' ', 'T')).getTime() - new Date(deadline).getTime()) / (1000 * 60 * 60 * 24)); } + // 总耗时 = 日历天数 + 加班时长 + const versionOTForTime = records.filter((r) => r.versionId === version.id); + const otHoursTotal = Math.round(versionOTForTime.reduce((sum, r) => sum + r.duration, 0) * 10) / 10; + return (
@@ -436,6 +440,9 @@ export default function VersionDetailPage() {
已耗时 {elapsedDays} 天 + {otHoursTotal > 0 && ( + (含加班 {otHoursTotal}h + )}
);