/** * 超管 2.0 · 扁平侧栏(无下拉) * 顺序(§6.1 合并后):仪表盘 → 项目管理 → 内容库 → 设备管理 → 客户池 → AI 中心 * §6.1:删除「内容管理」独立入口,唯一入口 = 内容库(含「分类与审核」顶 Tab) */ export interface FlatNavItem { id: string label: string path: string icon: string /** 精确匹配,不含子路径(用于项目管理列表页) */ exact?: boolean } export const FLAT_NAV: FlatNavItem[] = [ { id: "dashboard", label: "仪表盘", path: "/dashboard", icon: "LayoutDashboard", exact: true }, { id: "projects", label: "项目管理", path: "/dashboard/projects", icon: "FolderKanban", exact: true }, { id: "content", label: "内容库", path: "/dashboard/content-library", icon: "BookOpen" }, { id: "devices", label: "设备管理", path: "/dashboard/devices", icon: "Smartphone" }, { id: "customers", label: "客户池", path: "/dashboard/customers", icon: "Users", exact: true }, { id: "ai-center", label: "AI 中心", path: "/dashboard/ai-center", icon: "Sparkles" }, ] /** 项目工作台 Tab(详情页顶栏,不在侧栏展开) */ export const PROJECT_TAB_IDS = [ "overview", "devices", "traffic", "content", "plans", "workbench", "accounts", "tokens", "integration", ] export function isNavActive(path: string, currentPath: string, exact?: boolean): boolean { if (exact) { return currentPath === path } return currentPath === path || currentPath.startsWith(path + "/") } export function projectTabHref(projectId: number, tabId: string): string { return `/dashboard/projects/${projectId}?tab=${tabId}` } export function projectDetailHref(projectId: number, tab = "overview"): string { return projectTabHref(projectId, tab) }