feat: 计划时间改为年月日时分 + 到期自动开始 + 耗时统计同步
1. 日期选择改为 datetime-local(年月日时分): - 计划开始时间/截止时间均精确到分钟 - 展示时显示完整时间而非仅日期 2. 到期自动开始逻辑: - 当前时间 >= plan.startTime 且 status=pending → 自动视为开始 - 自动触发 store 更新 status=in_progress + actualStartAt - 用户仍可在计划开始前手动点击"开始"按钮 - 按钮改为"提前开始",已到期的不再显示按钮 3. 耗时计算统一用实际时间: - 耗时 = actualStartAt 到 completedAt(或当前时间) - 自动开始的 plan 使用 startTime 作为 effectiveStartAt - 概览总耗时/开始日期计算也同步纳入自动开始的 plan 4. checkbox 与自动开始联动: - 自动开始后 checkbox 可交互(不需要手动点开始) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -104,7 +104,10 @@ export default function VersionDetailPage() {
|
||||
const vTCs = testCases.filter((c) => c.versionId === version.id);
|
||||
|
||||
const startDates: string[] = [];
|
||||
vPlans.forEach((p) => { if (p.actualStartAt) startDates.push(p.actualStartAt); });
|
||||
vPlans.forEach((p) => {
|
||||
if (p.actualStartAt) startDates.push(p.actualStartAt);
|
||||
else if (p.status === 'pending' && p.startTime && new Date(p.startTime) <= new Date()) startDates.push(p.startTime);
|
||||
});
|
||||
vDevTasks.forEach((t) => { if (t.startDate) startDates.push(t.startDate); });
|
||||
vTCs.forEach((c) => { if (c.startedAt) startDates.push(c.startedAt); });
|
||||
|
||||
@@ -387,7 +390,10 @@ export default function VersionDetailPage() {
|
||||
const vBugsAll = bugs.filter((b) => b.versionId === version.id);
|
||||
|
||||
const startDates: string[] = [];
|
||||
vPlansAll.forEach((p) => { if (p.actualStartAt) startDates.push(p.actualStartAt); });
|
||||
vPlansAll.forEach((p) => {
|
||||
if (p.actualStartAt) startDates.push(p.actualStartAt);
|
||||
else if (p.status === 'pending' && p.startTime && new Date(p.startTime) <= new Date()) startDates.push(p.startTime);
|
||||
});
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user