diff --git a/frontend/src/app/layout/SideNav.tsx b/frontend/src/app/layout/SideNav.tsx index 7ee85e3..76ea200 100644 --- a/frontend/src/app/layout/SideNav.tsx +++ b/frontend/src/app/layout/SideNav.tsx @@ -11,7 +11,7 @@ import type { ReactNode } from 'react' import { NavLink, useLocation } from 'react-router-dom' import { cn } from '../../lib/cn' -import { modules } from '../../stores/system' +import { modules } from './nav' import { useCurrentStageNote } from './PipelineConsole' const NAV_ITEM = cn( diff --git a/frontend/src/app/layout/nav.ts b/frontend/src/app/layout/nav.ts new file mode 100644 index 0000000..d35bad3 --- /dev/null +++ b/frontend/src/app/layout/nav.ts @@ -0,0 +1,17 @@ +/** + * 侧栏导航表(唯一的两处之一:全局三项在 SideNav 里直接写死,项目七页签在这里)。 + * + * 为什么不在 zustand store 里:这张表和 health/models 一样,历史上寄居在 + * `stores/system.ts`,但它既不是状态也不可变——放进 store 只会让人误以为 + * 有「切换项目模块」的订阅逻辑。加一个项目页签 = 这里加一行 + `app/router.tsx` + * 加一条子路由(含 `handle` 标题),两边顺序保持一致即可,别按字母排。 + */ +export const modules: { to: (id: number | string) => string; icon: string; label: string; hint: string }[] = [ + { to: (id) => `/projects/${id}/overview`, icon: '◎', label: '流程概览', hint: '总控台 / 全节点进度' }, + { to: (id) => `/projects/${id}/library`, icon: '☺', label: '资产管理', hint: '人物 / 声音 / 场景' }, + { to: (id) => `/projects/${id}/storyboard`, icon: '▤', label: '分镜与脚本', hint: '镜头 / 关键帧 / 提示词' }, + { to: (id) => `/projects/${id}/dispatch`, icon: '⇶', label: '任务调度中心', hint: '队列 / 执行 / 重试 / 并发' }, + { to: (id) => `/projects/${id}/review`, icon: '✓', label: '质检与审核', hint: '质检 + 人工审核' }, + { to: (id) => `/projects/${id}/timeline`, icon: '≡', label: '时间线合成', hint: '片段 / 配音 / 字幕' }, + { to: (id) => `/projects/${id}/delivery`, icon: '⇩', label: '导出与成本', hint: '成片 / 成本台账' } +] diff --git a/frontend/src/stores/system.ts b/frontend/src/stores/system.ts index 5d788ed..f392c80 100644 --- a/frontend/src/stores/system.ts +++ b/frontend/src/stores/system.ts @@ -70,14 +70,3 @@ export const presetLabel: Record = { hq_1080p: '高质量 1080p', uhd_4k: '超清 4K' } - -/** 项目详情的七个页签 = 侧栏项目分组(顺序即业务流程顺序,别按字母排) */ -export const modules: { to: (id: number | string) => string; icon: string; label: string; hint: string }[] = [ - { to: (id) => `/projects/${id}/overview`, icon: '◎', label: '流程概览', hint: '总控台 / 全节点进度' }, - { to: (id) => `/projects/${id}/library`, icon: '☺', label: '资产管理', hint: '人物 / 声音 / 场景' }, - { to: (id) => `/projects/${id}/storyboard`, icon: '▤', label: '分镜与脚本', hint: '镜头 / 关键帧 / 提示词' }, - { to: (id) => `/projects/${id}/dispatch`, icon: '⇶', label: '任务调度中心', hint: '队列 / 执行 / 重试 / 并发' }, - { to: (id) => `/projects/${id}/review`, icon: '✓', label: '质检与审核', hint: '质检 + 人工审核' }, - { to: (id) => `/projects/${id}/timeline`, icon: '≡', label: '时间线合成', hint: '片段 / 配音 / 字幕' }, - { to: (id) => `/projects/${id}/delivery`, icon: '⇩', label: '导出与成本', hint: '成片 / 成本台账' } -]