gongxiangp2/components/department-dashboard/workspace-navigation.ts

121 lines
5.0 KiB
TypeScript

export type WorkspaceSectionKey = 'dashboard' | 'business' | 'assets' | 'organization' | 'governance'
export type WorkspaceItem = {
key: string
title: string
href: string
status: 'connected' | 'framework'
productName?: string
}
export type WorkspaceSection = {
key: WorkspaceSectionKey
title: string
description: string
summary: string
accent: string
accentSoft: string
accentText: string
items: WorkspaceItem[]
}
export const WORKSPACE_SECTIONS: WorkspaceSection[] = [
{
key: 'dashboard',
title: '中心仪表盘',
description: '聚合指标、趋势和团队运行状态,为管理者提供统一观察面。',
summary: '掌握经营与交付全貌',
accent: '#e73b32',
accentSoft: '#fff0ee',
accentText: '#b4231c',
items: [
{ key: 'core-metrics', title: '核心指标', href: '/workspaces/dashboard/core-metrics', status: 'framework' },
{ key: 'business-trends', title: '业务趋势', href: '/workspaces/dashboard/business-trends', status: 'framework' },
{ key: 'team-capacity', title: '团队产能', href: '/workspaces/dashboard/team-capacity', status: 'framework' },
],
},
{
key: 'business',
title: '业务经营',
description: '围绕品牌、新品、创意与转化,组织跨团队经营工作。',
summary: '推动品牌与项目向前',
accent: '#e98722',
accentSoft: '#fff4e7',
accentText: '#9a4d08',
items: [
{ key: 'performance-conversion', title: '业绩转化', href: '/workspaces/business/performance-conversion', status: 'connected', productName: '美术流程商品经营监控' },
],
},
{
key: 'assets',
title: '资产与AI自动化',
description: '沉淀内容资产与品牌知识,把重复生产环节交给自动化流程。',
summary: '让资产可复用、流程可自动化',
accent: '#0f9f72',
accentSoft: '#e9f8f2',
accentText: '#087052',
items: [
{ key: 'material-library', title: '素材资产库', href: '/assets/material-library', status: 'connected', productName: '由壹点3D素材' },
{ key: 'brand-knowledge', title: '品牌知识库', href: '/workspaces/assets/brand-knowledge', status: 'framework' },
{ key: 'automation-workflows', title: '自动化工作流', href: '/workspaces/assets/automation-workflows', status: 'connected', productName: '2 项工作流已接入' },
{ key: 'value-metrics', title: '价值指标', href: '/workspaces/assets/value-metrics', status: 'connected', productName: '素材资产库复用率' },
],
},
{
key: 'organization',
title: '组织管理',
description: '明确人员结构、团队职责和绩效协作关系,建立组织视图。',
summary: '看清组织、职责与负荷',
accent: '#c99300',
accentSoft: '#fff8d9',
accentText: '#725400',
items: [
{
key: 'organization-structure',
title: '组织架构',
href: '/workspaces/organization/organization-structure',
status: 'connected',
productName: '公司与品牌中心组织架构',
},
{ key: 'team-functions', title: '团队职能', href: '/workspaces/organization/team-functions', status: 'connected', productName: '花名册与职责配置' },
{ key: 'performance-review', title: '绩效考核', href: '/workspaces/organization/performance-review', status: 'framework' },
],
},
{
key: 'governance',
title: '治理与设置',
description: '管理访问权限、编辑规则和通知机制。',
summary: '建立部门级工作规则',
accent: '#3569df',
accentSoft: '#edf3ff',
accentText: '#214ba7',
items: [
{ key: 'permissions', title: '权限管理', href: '/workspaces/governance/permissions', status: 'connected', productName: '权限组与人员权限' },
{ key: 'editing-capabilities', title: '编辑能力', href: '/workspaces/governance/editing-capabilities', status: 'framework' },
{ key: 'notifications', title: '通知机制', href: '/workspaces/governance/notifications', status: 'framework' },
],
},
]
export function getWorkspaceItem(sectionKey: string, itemKey: string) {
const section = WORKSPACE_SECTIONS.find((candidate) => candidate.key === sectionKey)
const item = section?.items.find((candidate) => candidate.key === itemKey)
return section && item ? { section, item } : null
}
// Preserve bookmarked routes while keeping one navigation entry per responsibility.
export const WORKSPACE_REDIRECTS: Record<string, string> = {
'governance/roles-permissions': '/workspaces/governance/permissions',
'governance/user-permissions': '/workspaces/governance/permissions?view=people',
'governance/data-definitions': '/workspaces/organization/organization-structure?scope=company',
'organization/people-structure': '/workspaces/organization/organization-structure',
}
export function getFrameworkWorkspaceParams() {
return WORKSPACE_SECTIONS.flatMap((section) =>
section.items
.filter((item) => item.status === 'framework')
.map((item) => ({ section: section.key, item: item.key }))
)
}