feat(版本详情): 接入计划时间与日期选择

This commit is contained in:
Script Generator
2026-06-29 14:18:58 +08:00
parent dde11c0899
commit 0f64a17d44
20 changed files with 601 additions and 12 deletions

View File

@@ -7,6 +7,7 @@ import { useTaskCategoryStore } from '@/stores/useTaskCategoryStore';
import { useRequirementStore } from '@/stores/useRequirementStore';
import { useMemberStore } from '@/stores/useMemberStore';
import { useAuthStore } from '@/stores/useAuthStore';
import { WorkDateTimePicker } from '@/components/WorkDateTimePicker';
import { calcWorkHours, formatWorkHours, isoToLocal, localToISO } from '@/lib/work-hours';
import type { Priority } from '@/lib/derive';
@@ -134,12 +135,12 @@ export function DevTaskCreateModal({ versionId, requirementIds, versionDeadline,
return (
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/40" onClick={onClose}>
<div className="w-full max-w-lg rounded-2xl bg-[var(--bg-card)] border border-[var(--line)] p-6 shadow-[var(--shadow-md)]" onClick={(e) => e.stopPropagation()}>
<div className="w-full max-w-3xl max-h-[92vh] overflow-y-auto rounded-2xl bg-[var(--bg-card)] border border-[var(--line)] p-6 shadow-[var(--shadow-md)]" onClick={(e) => e.stopPropagation()}>
<div className="flex items-center justify-between mb-4">
<h3 className="text-[14px] font-semibold text-[var(--ink)]"></h3>
<button onClick={onClose} className="rounded-md p-1 hover:bg-[var(--bg-subtle)]"><X className="h-4 w-4 text-[var(--ink-muted)]" /></button>
</div>
<div className="space-y-3 max-h-[60vh] overflow-y-auto">
<div className="space-y-3">
<div>
<label className="block text-[12px] text-[var(--ink-soft)] mb-1"> *</label>
<input value={title} onChange={(e) => setTitle(e.target.value)} className="h-9 w-full rounded-lg border border-[var(--line)] bg-[var(--bg)] px-3 text-[13px] focus:border-[var(--accent)] focus:outline-none" placeholder="例如:排班界面开发" />
@@ -168,11 +169,24 @@ export function DevTaskCreateModal({ versionId, requirementIds, versionDeadline,
<div className="grid grid-cols-2 gap-3">
<div>
<label className="block text-[12px] text-[var(--ink-soft)] mb-1"> *</label>
<input type="datetime-local" value={expectedStartLocal} onChange={(e) => setExpectedStartLocal(e.target.value)} className="h-9 w-full rounded-lg border border-[var(--line)] bg-[var(--bg)] px-3 text-[13px] focus:border-[var(--accent)] focus:outline-none" />
<WorkDateTimePicker
value={expectedStartLocal}
onChange={setExpectedStartLocal}
placeholder="选择预计开始时间"
defaultHour={9}
className="bg-[var(--bg)]"
/>
</div>
<div>
<label className="block text-[12px] text-[var(--ink-soft)] mb-1"> *</label>
<input type="datetime-local" value={expectedEndLocal} onChange={(e) => setExpectedEndLocal(e.target.value)} className="h-9 w-full rounded-lg border border-[var(--line)] bg-[var(--bg)] px-3 text-[13px] focus:border-[var(--accent)] focus:outline-none" />
<WorkDateTimePicker
value={expectedEndLocal}
onChange={setExpectedEndLocal}
placeholder="选择预计截止时间"
defaultHour={18}
popoverAlign="right"
className="bg-[var(--bg)]"
/>
</div>
</div>
<div className="grid grid-cols-2 gap-3">

View File

@@ -173,7 +173,7 @@ export function DevTaskDetailDrawer({ taskId, allTaskIds, onClose, contextLabel
</span>
)}
{requireDelay && (
<span className="inline-flex items-center gap-1 text-[11px] text-orange-600 bg-orange-50 border border-orange-200 px-2 py-1 rounded-lg" title="已超过预计开始时间,开干需填延后原因">
<span className="inline-flex items-center gap-1 text-[11px] text-orange-600 bg-orange-50 border border-orange-200 px-2 py-1 rounded-lg" title="已超过预计截止时间,开干需填延后原因">
<AlertTriangle className="h-3 w-3" />
</span>
)}
@@ -194,7 +194,7 @@ export function DevTaskDetailDrawer({ taskId, allTaskIds, onClose, contextLabel
<div className="rounded-lg border border-orange-200 bg-orange-50 p-3 space-y-2">
<div className="flex items-center gap-1.5 text-[11px] text-orange-700">
<AlertTriangle className="h-3.5 w-3.5" />
</div>
<input value={delayReason} onChange={(e) => setDelayReason(e.target.value)} placeholder="延后原因(必填)" className="h-8 w-full rounded-md border border-orange-200 bg-white px-2 text-[12px] focus:border-orange-400 focus:outline-none" autoFocus />
<div className="flex gap-2">