technological-brain-admin/src/router/index.ts

175 lines
5.0 KiB
TypeScript
Raw Normal View History

2025-10-10 13:43:38 +08:00
import { createRouter, createWebHistory, RouteRecordRaw } from 'vue-router'
2025-10-14 18:39:21 +08:00
// 登录页面
import LoginPage from '@/views/LoginPage.vue'
// 后台管理系统组件
import AdminLayout from '@/layouts/AdminLayout.vue'
import AdminDashboard from '@/views/admin/AdminDashboard.vue'
import NewsPolicyAdmin from '@/views/admin/NewsPolicyAdmin.vue'
import SmartQAAdmin from '@/views/admin/SmartQAAdmin.vue'
import TechResourcesAdmin from '@/views/admin/TechResourcesAdmin.vue'
import TalentProfileAdmin from '@/views/admin/TalentProfileAdmin.vue'
2025-10-10 13:43:38 +08:00
const routes: Array<RouteRecordRaw> = [
{
path: '/',
2025-10-14 18:39:21 +08:00
redirect: '/login'
},
{
path: '/login',
name: 'login',
component: LoginPage
2025-10-10 13:43:38 +08:00
},
2025-10-14 18:39:21 +08:00
// 后台管理系统路由
2025-10-10 13:43:38 +08:00
{
2025-10-14 18:39:21 +08:00
path: '/admin',
component: AdminLayout,
redirect: '/admin/dashboard',
children: [
{
path: 'dashboard',
name: 'admin-dashboard',
component: AdminDashboard
},
{
path: 'news-policy',
name: 'admin-news-policy',
component: NewsPolicyAdmin
},
{
path: 'news-policy/create',
name: 'admin-news-policy-create',
component: () => import('@/views/admin/NewsPolicyForm.vue')
},
{
path: 'news-policy/edit/:id',
name: 'admin-news-policy-edit',
component: () => import('@/views/admin/NewsPolicyForm.vue')
},
{
path: 'smart-qa',
name: 'admin-smart-qa',
component: SmartQAAdmin
},
{
path: 'smart-qa/create',
name: 'admin-smart-qa-create',
component: () => import('@/views/admin/SmartQAForm.vue')
},
{
path: 'smart-qa/edit/:id',
name: 'admin-smart-qa-edit',
component: () => import('@/views/admin/SmartQAForm.vue')
},
{
path: 'tech-resources',
name: 'admin-tech-resources',
component: TechResourcesAdmin
},
{
path: 'tech-resources/create',
name: 'admin-tech-resources-create',
component: () => import('@/views/admin/TechResourcesForm.vue')
},
{
path: 'tech-resources/edit/:id',
name: 'admin-tech-resources-edit',
component: () => import('@/views/admin/TechResourcesForm.vue')
},
{
path: 'talent-profile',
name: 'admin-talent-profile',
component: TalentProfileAdmin
},
{
path: 'talent-profile/create',
name: 'admin-talent-profile-create',
component: () => import('@/views/admin/TalentProfileForm.vue')
},
{
path: 'talent-profile/edit/:id',
name: 'admin-talent-profile-edit',
component: () => import('@/views/admin/TalentProfileForm.vue')
},
{
path: 'tech-projects',
name: 'admin-tech-projects',
component: () => import('@/views/admin/TechProjectsAdmin.vue')
},
{
path: 'tech-projects/create',
name: 'admin-tech-projects-create',
component: () => import('@/views/admin/TechProjectsForm.vue')
},
{
path: 'tech-projects/edit/:id',
name: 'admin-tech-projects-edit',
component: () => import('@/views/admin/TechProjectsForm.vue')
},
{
path: 'tech-achievements',
name: 'admin-tech-achievements',
component: () => import('@/views/admin/TechAchievementsAdmin.vue')
},
{
path: 'tech-achievements/create',
name: 'admin-tech-achievements-create',
component: () => import('@/views/admin/TechAchievementsForm.vue')
},
{
path: 'tech-achievements/edit/:id',
name: 'admin-tech-achievements-edit',
component: () => import('@/views/admin/TechAchievementsForm.vue')
},
{
path: 'tech-reports',
name: 'admin-tech-reports',
component: () => import('@/views/admin/TechReportsAdmin.vue')
},
{
path: 'tech-reports/create',
name: 'admin-tech-reports-create',
component: () => import('@/views/admin/TechReportsForm.vue')
},
{
path: 'tech-reports/edit/:id',
name: 'admin-tech-reports-edit',
component: () => import('@/views/admin/TechReportsForm.vue')
},
{
path: 'tech-awards',
name: 'admin-tech-awards',
component: () => import('@/views/admin/TechAwardsAdmin.vue')
},
{
path: 'tech-awards/create',
name: 'admin-tech-awards-create',
component: () => import('@/views/admin/TechAwardsForm.vue')
},
{
path: 'tech-awards/edit/:id',
name: 'admin-tech-awards-edit',
component: () => import('@/views/admin/TechAwardsForm.vue')
},
{
path: 'users',
name: 'admin-users',
component: () => import('@/views/admin/UsersAdmin.vue')
},
{
path: 'permissions',
name: 'admin-permissions',
component: () => import('@/views/admin/PermissionsAdmin.vue')
}
]
2025-10-10 13:43:38 +08:00
}
]
const router = createRouter({
history: createWebHistory(process.env.BASE_URL),
routes
})
export default router