fix: 修复录入人员不显示 + 状态列改名区分
1. 录入人员字段(creator): - RequirementModal 新增 currentUserName prop - handleSubmit 自动填入 creator - 编辑时保留原有 creator,新建时取当前登录用户 - 修复"新建需求后录入人员为空"的 bug 2. 表格状态列改名(消除混淆): - "状态" → "业务状态"(req.status,业务流转) - "开发状态" → "实际进度"(从 DevTask 派生) - 两个含义不同的状态不再叫同一个名字 Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -5,6 +5,7 @@ import { Search, Plus, Lightbulb, ArrowUp, ArrowDown } from 'lucide-react';
|
|||||||
import { useRequirementStore } from '@/stores/useRequirementStore';
|
import { useRequirementStore } from '@/stores/useRequirementStore';
|
||||||
import { useProductStore } from '@/stores/useProductStore';
|
import { useProductStore } from '@/stores/useProductStore';
|
||||||
import { useDevTaskStore } from '@/stores/useDevTaskStore';
|
import { useDevTaskStore } from '@/stores/useDevTaskStore';
|
||||||
|
import { useAuthStore } from '@/stores/useAuthStore';
|
||||||
import { flattenProjects, flattenVersions } from '@/lib/derive';
|
import { flattenProjects, flattenVersions } from '@/lib/derive';
|
||||||
import { REQ_STATUS_LABEL, REQ_STATUS_COLOR, SOURCE_TYPE_LABEL } from '@/lib/requirement';
|
import { REQ_STATUS_LABEL, REQ_STATUS_COLOR, SOURCE_TYPE_LABEL } from '@/lib/requirement';
|
||||||
import type { Requirement, RequirementStatus, SourceType } from '@/lib/requirement';
|
import type { Requirement, RequirementStatus, SourceType } from '@/lib/requirement';
|
||||||
@@ -45,6 +46,8 @@ export default function RequirementsPage() {
|
|||||||
} = useRequirementStore();
|
} = useRequirementStore();
|
||||||
const { overview, fetchOverview } = useProductStore();
|
const { overview, fetchOverview } = useProductStore();
|
||||||
const { tasks: devTasks, fetchTasks: fetchDevTasks } = useDevTaskStore();
|
const { tasks: devTasks, fetchTasks: fetchDevTasks } = useDevTaskStore();
|
||||||
|
const user = useAuthStore((s) => s.user);
|
||||||
|
const currentUserName = user?.name || '系统';
|
||||||
const allProjects = useMemo(() => flattenProjects(overview), [overview]);
|
const allProjects = useMemo(() => flattenProjects(overview), [overview]);
|
||||||
const allVersions = useMemo(() => flattenVersions(overview), [overview]);
|
const allVersions = useMemo(() => flattenVersions(overview), [overview]);
|
||||||
|
|
||||||
@@ -250,10 +253,10 @@ export default function RequirementsPage() {
|
|||||||
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">需求来源</th>
|
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">需求来源</th>
|
||||||
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">所属项目</th>
|
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">所属项目</th>
|
||||||
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">需求类型</th>
|
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">需求类型</th>
|
||||||
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">状态</th>
|
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">业务状态</th>
|
||||||
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">优先级</th>
|
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">优先级</th>
|
||||||
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">所属版本</th>
|
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">所属版本</th>
|
||||||
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">开发状态</th>
|
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">实际进度</th>
|
||||||
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">录入人员</th>
|
<th className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)]">录入人员</th>
|
||||||
<th
|
<th
|
||||||
className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)] cursor-pointer select-none hover:text-[var(--ink-soft)] transition-colors"
|
className="px-4 py-2.5 text-[11px] font-medium uppercase tracking-wide text-[var(--ink-muted)] cursor-pointer select-none hover:text-[var(--ink-soft)] transition-colors"
|
||||||
@@ -430,6 +433,7 @@ export default function RequirementsPage() {
|
|||||||
types={types}
|
types={types}
|
||||||
platforms={platforms}
|
platforms={platforms}
|
||||||
requirements={requirements}
|
requirements={requirements}
|
||||||
|
currentUserName={currentUserName}
|
||||||
onClose={() => { setShowModal(false); setEditingReq(null); }}
|
onClose={() => { setShowModal(false); setEditingReq(null); }}
|
||||||
onSubmit={(data) => {
|
onSubmit={(data) => {
|
||||||
if (editingReq) {
|
if (editingReq) {
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ interface RequirementModalProps {
|
|||||||
types: DictItem[];
|
types: DictItem[];
|
||||||
platforms: DictItem[];
|
platforms: DictItem[];
|
||||||
requirements: Requirement[];
|
requirements: Requirement[];
|
||||||
|
currentUserName: string;
|
||||||
onClose: () => void;
|
onClose: () => void;
|
||||||
onSubmit: (data: any) => void;
|
onSubmit: (data: any) => void;
|
||||||
onOpenDrawer: (type: 'source' | 'type' | 'platform') => void;
|
onOpenDrawer: (type: 'source' | 'type' | 'platform') => void;
|
||||||
@@ -42,6 +43,7 @@ export function RequirementModal({
|
|||||||
types,
|
types,
|
||||||
platforms,
|
platforms,
|
||||||
requirements,
|
requirements,
|
||||||
|
currentUserName,
|
||||||
onClose,
|
onClose,
|
||||||
onSubmit,
|
onSubmit,
|
||||||
onOpenDrawer,
|
onOpenDrawer,
|
||||||
@@ -127,6 +129,8 @@ export function RequirementModal({
|
|||||||
platforms: selectedPlatforms,
|
platforms: selectedPlatforms,
|
||||||
typeId: typeId || undefined,
|
typeId: typeId || undefined,
|
||||||
priority,
|
priority,
|
||||||
|
effort,
|
||||||
|
creator: initial?.creator || currentUserName || '系统',
|
||||||
parentId: parentId || undefined,
|
parentId: parentId || undefined,
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user