refactor(dev-task): 移除工时记录,改为由开始/完成日期自动计算实际工时
- 状态流转到"开发中"时自动记录 startDate - 实际工时 = startDate → completedAt 的工作日 × 8h - 详情抽屉移除工时记录面板,增加"开发开始日期"展示 - 列表行工时展示同步改为日期计算 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
'use client';
|
||||
|
||||
import { useState } from 'react';
|
||||
import { X, AlertTriangle, Link2, ChevronRight, Clock, User, Tag, Calendar } from 'lucide-react';
|
||||
import { X, AlertTriangle, Link2, ChevronRight, Clock, User, Tag, Calendar, Play } from 'lucide-react';
|
||||
import { StatusBadge } from './StatusBadge';
|
||||
import { CategoryChip } from './CategoryChip';
|
||||
import { WorklogPanel } from './WorklogPanel';
|
||||
import { useDevTaskStore } from '@/stores/useDevTaskStore';
|
||||
import { useTaskCategoryStore } from '@/stores/useTaskCategoryStore';
|
||||
import { useRequirementStore } from '@/stores/useRequirementStore';
|
||||
import { ALLOWED_TRANSITIONS, DEV_TASK_STATUS_LABEL, DEV_TASK_STATUS_COLOR, formatHours } from '@/lib/dev-task';
|
||||
import { ALLOWED_TRANSITIONS, DEV_TASK_STATUS_LABEL, DEV_TASK_STATUS_COLOR, formatHours, calcActualHoursByDates } from '@/lib/dev-task';
|
||||
import type { DevTaskStatus } from '@/lib/dev-task';
|
||||
|
||||
interface Props {
|
||||
@@ -153,8 +152,15 @@ export function DevTaskDetailDrawer({ taskId, allTaskIds, onClose }: Props) {
|
||||
<div className="flex items-center gap-2">
|
||||
<Clock className="h-3 w-3 text-[var(--ink-muted)]" />
|
||||
<span className="text-[var(--ink-muted)]">实际</span>
|
||||
<span className="text-[var(--ink)] font-medium">{task.actualHours > 0 ? `${task.actualHours}h` : '-'}</span>
|
||||
<span className="text-[var(--ink)] font-medium">{task.startDate ? formatHours(calcActualHoursByDates(task.startDate, task.completedAt)) : '-'}</span>
|
||||
</div>
|
||||
{task.startDate && (
|
||||
<div className="flex items-center gap-2">
|
||||
<Play className="h-3 w-3 text-[var(--ink-muted)]" />
|
||||
<span className="text-[var(--ink-muted)]">开始开发</span>
|
||||
<span className="text-[var(--ink)]">{task.startDate}</span>
|
||||
</div>
|
||||
)}
|
||||
{task.dueDate && (
|
||||
<div className="flex items-center gap-2">
|
||||
<Calendar className="h-3 w-3 text-[var(--ink-muted)]" />
|
||||
@@ -194,10 +200,6 @@ export function DevTaskDetailDrawer({ taskId, allTaskIds, onClose }: Props) {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 卡片5:工时记录 */}
|
||||
<div className="rounded-xl border border-[var(--line)] bg-[var(--bg-card)] p-4">
|
||||
<WorklogPanel taskId={task.id} />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user