fix: 调研/产品/UI阶段耗时改为精确时间戳计算

- VersionPlan 新增 actualStartAt 字段
- updatePlan 流转到 in_progress 时自动记录 actualStartAt
- updatePlan 流转到 completed 时自动记录 completedAt(如未设)
- 概览阶段耗时改用 actualStartAt/completedAt 计算(不再用计划排期)
- 个人耗时汇总同步使用实际时间戳

所有阶段(调研/产品/UI/开发/测试)现在统一用精确时间戳算耗时。

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Script Generator
2026-06-12 16:24:46 +08:00
parent c86e87f95b
commit da1f98968b
3 changed files with 27 additions and 7 deletions

View File

@@ -43,7 +43,18 @@ export const useVersionPlanStore = create<VersionPlanState>((set, get) => ({
},
updatePlan: (id, data) => {
const plans = get().plans.map((p) => p.id === id ? { ...p, ...data } : p);
const now = new Date().toISOString();
const plans = get().plans.map((p) => {
if (p.id !== id) return p;
const patch = { ...data };
if (patch.status === 'in_progress' && !p.actualStartAt) {
(patch as any).actualStartAt = now;
}
if (patch.status === 'completed' && !p.completedAt) {
(patch as any).completedAt = now;
}
return { ...p, ...patch };
});
set({ plans });
saveLocal(plans);
},