Files
cms/src/mock/navigation.ts
T
2026-06-18 17:36:17 +08:00

188 lines
5.4 KiB
TypeScript

import {
Aim,
Avatar,
Bell,
ChatDotRound,
Collection,
Connection,
Cpu,
DataAnalysis,
DocumentChecked,
Files,
FirstAidKit,
Flag,
Histogram,
House,
Key,
List,
Management,
Memo,
Monitor,
OfficeBuilding,
Operation,
PriceTag,
Reading,
Refresh,
School,
Search,
Setting,
Share,
Star,
TrendCharts,
User,
UserFilled,
UserFilled as DoctorIcon
} from '@element-plus/icons-vue'
import type { MenuSection, RoleKey } from '@/types'
export const roleMenus: Record<RoleKey, MenuSection[]> = {
'super-admin': [
{ title: '概览', items: [{ page: 'dashboard', icon: House, title: '平台总览' }] },
{
title: '用户管理',
items: [
{ page: 'user-list', icon: User, title: '用户列表' },
{ page: 'hospital-list', icon: OfficeBuilding, title: '医院管理' },
{ page: 'department-list', icon: Management, title: '科室管理' },
]
},
{
title: '内容管理',
items: [
{ page: 'case-list', icon: Collection, title: '病例库' },
{ page: 'tag-category', icon: PriceTag, title: '标签分类', disabled: true },
{ page: 'ai-case', icon: Cpu, title: 'AI病例生成' }
]
},
{
title: '训练管理',
items: [
{ page: 'training-list', icon: Memo, title: '训练记录' },
]
},
{
title: '能力评估',
items: [
{ page: 'ability-profile', icon: Aim, title: '能力画像' },
{ page: 'ability-radar', icon: Share, title: '雷达图分析' },
]
},
{
title: '数据分析',
items: [
{ page: 'data-user', icon: UserFilled, title: '用户分析', disabled: true },
{ page: 'data-case', icon: Files, title: '病例分析', disabled: true },
{ page: 'data-hospital', icon: OfficeBuilding, title: '医院分析', disabled: true },
{ page: 'data-retention', icon: Refresh, title: '留存分析', disabled: true }
]
},
],
'hospital-admin': [
{
title: '概览',
items: [
{ page: 'hospital-dashboard', icon: OfficeBuilding, title: '医院驾驶舱' },
{ page: 'hospital-settings', icon: Setting, title: '本院配置' }
]
},
{
title: '人员管理',
items: [
{ page: 'doctor-list', icon: DoctorIcon, title: '带教医生管理' },
{ page: 'student-list', icon: School, title: '医学生管理' },
{ page: 'teacher-list', icon: Reading, title: '师生关系管理' }
]
},
{
title: '运营数据',
items: [
{ page: 'case-review', icon: DocumentChecked, title: '病例审核' },
{ page: 'hospital-data', icon: DataAnalysis, title: '运营数据' },
{ page: 'case-usage', icon: Collection, title: '病例使用' },
{ page: 'training-stats', icon: Memo, title: '训练统计' },
{ page: 'dept-analysis', icon: Management, title: '科室分析' }
]
},
{
title: '能力提升',
items: [
{ page: 'ability-trend', icon: TrendCharts, title: '能力趋势' },
{ page: 'student-ranking', icon: Histogram, title: '学生排行' }
]
}
],
'content-admin': [
{ title: '概览', items: [{ page: 'content-dashboard', icon: Files, title: '内容概览' }] },
{
title: '病例管理',
items: [
{ page: 'case-library', icon: Collection, title: '病例库管理' },
{ page: 'knowledge-base', icon: Files, title: '知识库管理' }
]
},
{
title: 'AI内容',
items: [
{ page: 'ai-generate', icon: Cpu, title: 'AI生成病例' },
]
},
{ title: '统计', items: [{ page: 'content-stats', icon: DataAnalysis, title: '内容统计' }] }
],
teacher: [
{ title: '概览', items: [{ page: 'teacher-dashboard', icon: Reading, title: '教学概览' }] },
{
title: '学生管理',
items: [
{ page: 'my-students', icon: User, title: '我的学生' },
{ page: 'student-ability', icon: Aim, title: '能力画像' }
]
},
{
title: '教学工具',
items: [
{ page: 'training-record', icon: Collection, title: '训练记录' },
{ page: 'leaderboard', icon: Histogram, title: '排行榜' },
{ page: 'assign-task', icon: Flag, title: '分配任务' },
{ page: 'growth-path', icon: TrendCharts, title: '成长轨迹' },
]
},
]
}
export const pageTitles = Object.values(roleMenus).reduce<Record<string, string>>((acc, sections) => {
sections.forEach(section => {
section.items.forEach(item => {
acc[item.page] = item.title
})
})
return acc
}, {})
const directPagePaths: Record<string, string> = {
'ai-case': '/cases/ai-generate',
'ai-generate': '/cases/ai-generate',
'case-library': '/cases',
'case-list': '/cases',
'case-review': '/cases/review',
'content-admin-list': '/users/content-admins',
'department-list': '/departments',
'doctor-list': '/users/doctors',
'hospital-list': '/institutions',
'my-students': '/my-students',
'student-list': '/users/students',
'teacher-list': '/teacher-student-relations',
'user-list': '/users'
}
export function getPagePath(page: string) {
if (directPagePaths[page]) {
return directPagePaths[page]
}
return page === 'dashboard' ? '/dashboard' : `/module/${page}`
}
export function getFirstPage(role: RoleKey) {
return roleMenus[role][0].items[0].page
}