auto-sync: 2026-05-19 13:43:25
This commit is contained in:
@@ -153,8 +153,8 @@ function StatusPipeline({ status }: { status: string }) {
|
||||
}
|
||||
|
||||
// ── 任务卡片 ──
|
||||
function TaskCard({ task, subtaskCount, subtaskDone, activeStage, onOpen }: {
|
||||
task: V2Task; subtaskCount: number; subtaskDone: number; activeStage: string | null; onOpen: () => void;
|
||||
function TaskCard({ task, subtaskCount, subtaskDone, activeStage, onOpen, onAction }: {
|
||||
task: V2Task; subtaskCount: number; subtaskDone: number; activeStage: string | null; onOpen: () => void; onAction: (action: string) => void;
|
||||
}) {
|
||||
const sm = STATUS_META[task.status] || STATUS_META.pending;
|
||||
const pm = getPriorityLabel(task.priority);
|
||||
@@ -212,13 +212,22 @@ function TaskCard({ task, subtaskCount, subtaskDone, activeStage, onOpen }: {
|
||||
<span style={{ fontSize: 10, padding: '1px 5px', borderRadius: 3, background: `${rm.color}22`, color: rm.color }}>{rm.label}</span>
|
||||
{task.retry_count > 0 && <span style={{ fontSize: 10, color: '#f59e0b' }}>🔄 x{task.retry_count}</span>}
|
||||
</div>
|
||||
<div style={{ display: 'flex', gap: 6 }}>
|
||||
<div style={{ display: 'flex', gap: 4, alignItems: 'center' }}>
|
||||
{/* 快捷动作按钮 */}
|
||||
{(CARD_ACTIONS[task.status] || []).map((btn, i) => (
|
||||
<button key={i} onClick={(e) => { e.stopPropagation(); onAction(btn.action); }} style={{
|
||||
padding: '2px 8px', borderRadius: 4, fontSize: 10, cursor: 'pointer',
|
||||
background: btn.bg, color: btn.color, border: `1px solid ${btn.border}`, fontWeight: 600,
|
||||
transition: 'opacity .15s', opacity: 0.9,
|
||||
}} onMouseEnter={e => (e.currentTarget.style.opacity = '1')} onMouseLeave={e => (e.currentTarget.style.opacity = '0.9')}>
|
||||
{btn.icon} {btn.label}
|
||||
</button>
|
||||
))}
|
||||
{task.deadline && (
|
||||
<span style={{ fontSize: 10, color: new Date(task.deadline).getTime() - Date.now() < 3600000 ? '#ff5270' : 'var(--muted)' }}>
|
||||
📅 {formatDeadline(task.deadline)}
|
||||
</span>
|
||||
)}
|
||||
<span style={{ fontSize: 10, padding: '2px 8px', borderRadius: 4, background: 'var(--acc)11', color: 'var(--acc)', border: '1px solid var(--acc)33', cursor: 'pointer' }}>详情 →</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user