From 0a83ab8816263e26a89915025979c9eaa1e07b26 Mon Sep 17 00:00:00 2001 From: Script Generator Date: Mon, 15 Jun 2026 15:17:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=85=B3=E8=81=94=E9=9C=80=E6=B1=82?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E4=BA=BA=E6=98=BE=E7=A4=BA"=E7=B3=BB?= =?UTF-8?q?=E7=BB=9F=E6=B7=BB=E5=8A=A0"=20+=20=E5=BC=80=E5=8F=91=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=88=97=20+=20=E5=BC=80=E5=8F=91=E4=B8=AD=E4=B8=8D?= =?UTF-8?q?=E5=8F=AF=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 添加人字段:无值时显示"系统添加"而非"-" 2. 新增"开发状态"列:从 linkage-engine 推导 3. 开发中的需求:移除按钮替换为"开发中"文字提示 4. 去掉"描述"列(表格更紧凑) Co-Authored-By: Claude Opus 4.7 (1M context) --- apps/web/app/versions/[id]/page.tsx | 1 + .../version/VersionRequirementsTab.tsx | 51 ++++++++++++------- 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/apps/web/app/versions/[id]/page.tsx b/apps/web/app/versions/[id]/page.tsx index fff74bd..07dde5e 100644 --- a/apps/web/app/versions/[id]/page.tsx +++ b/apps/web/app/versions/[id]/page.tsx @@ -727,6 +727,7 @@ export default function VersionDetailPage() { versionId={version.id} projectId={version.projectId} requirements={requirements} + devTasks={devTasks} currentUserName={user?.name ?? ''} onLink={(ids, addedBy) => { ids.forEach((id) => updateRequirement(id, { versionId: version.id, addedToVersionBy: addedBy })); diff --git a/apps/web/components/version/VersionRequirementsTab.tsx b/apps/web/components/version/VersionRequirementsTab.tsx index b1041f1..557455c 100644 --- a/apps/web/components/version/VersionRequirementsTab.tsx +++ b/apps/web/components/version/VersionRequirementsTab.tsx @@ -3,18 +3,21 @@ import { useState } from 'react'; import { Plus, X, Search } from 'lucide-react'; import type { Requirement } from '@/lib/requirement'; +import type { DevTask } from '@/lib/dev-task'; import { REQ_STATUS_LABEL, REQ_STATUS_COLOR } from '@/lib/requirement'; +import { deriveReqDevStatus, canEditRequirement, REQ_DEV_STATUS_LABEL, REQ_DEV_STATUS_COLOR } from '@/lib/linkage-engine'; interface Props { versionId: string; projectId: string; requirements: Requirement[]; + devTasks: DevTask[]; onLink: (reqIds: string[], addedBy: string) => void; onUnlink: (reqId: string) => void; currentUserName: string; } -export function VersionRequirementsTab({ versionId, projectId, requirements, onLink, onUnlink, currentUserName }: Props) { +export function VersionRequirementsTab({ versionId, projectId, requirements, devTasks, onLink, onUnlink, currentUserName }: Props) { const [showAddModal, setShowAddModal] = useState(false); const linkedReqs = requirements.filter((r) => r.versionId === versionId); const availableReqs = requirements.filter((r) => r.projectId === projectId && !r.versionId && r.status === 'adopted'); @@ -40,29 +43,41 @@ export function VersionRequirementsTab({ versionId, projectId, requirements, onL 编号 需求概述 - 描述 状态 + 开发状态 添加人 操作 - {linkedReqs.map((req) => ( - - {req.code} - {req.title} - {req.description || '-'} - - - {REQ_STATUS_LABEL[req.status]} - - - {req.addedToVersionBy || '-'} - - - - - ))} + {linkedReqs.map((req) => { + const devStatus = deriveReqDevStatus(req.id, devTasks); + const isDeveloping = !canEditRequirement(req.id, devTasks); + return ( + + {req.code} + {req.title} + + + {REQ_STATUS_LABEL[req.status]} + + + + + {REQ_DEV_STATUS_LABEL[devStatus]} + + + {req.addedToVersionBy || '系统添加'} + + {isDeveloping ? ( + 开发中 + ) : ( + + )} + + + ); + })}