110 lines
4.3 KiB
TypeScript
110 lines
4.3 KiB
TypeScript
/**
|
|
|
|
* app/router/routes/admin.routes.ts
|
|
|
|
* 管理后台嵌套路由;全部 admin 模块已独立拆分。
|
|
|
|
*/
|
|
|
|
import type { RouteRecordRaw } from 'vue-router';
|
|
|
|
|
|
|
|
const AdminLayout = () => import('@/features/admin/views/AdminLayout.vue');
|
|
|
|
const AgentsPage = () => import('@/features/admin/modules/agents/AgentsPage.vue');
|
|
|
|
const UsersPage = () => import('@/features/admin/modules/users/UsersPage.vue');
|
|
|
|
const DepartmentsPage = () => import('@/features/admin/modules/departments/DepartmentsPage.vue');
|
|
|
|
const ApprovalsPage = () => import('@/features/admin/modules/approvals/ApprovalsPage.vue');
|
|
|
|
const AnnouncementsPage = () => import('@/features/admin/modules/announcements/AnnouncementsPage.vue');
|
|
|
|
const QuestionsPage = () => import('@/features/admin/modules/questions/QuestionsPage.vue');
|
|
|
|
const RequestsPage = () => import('@/features/admin/modules/requests/RequestsPage.vue');
|
|
|
|
const PermissionsPage = () => import('@/features/admin/modules/permissions/PermissionsPage.vue');
|
|
|
|
const DashboardPage = () => import('@/features/admin/modules/dashboard/DashboardPage.vue');
|
|
|
|
const SchedulesPage = () => import('@/features/admin/modules/schedules/SchedulesPage.vue');
|
|
|
|
const KnowledgeBasePage = () => import('@/features/admin/modules/knowledge-base/KnowledgeBasePage.vue');
|
|
|
|
const WecomPage = () => import('@/features/admin/modules/wecom/WecomPage.vue');
|
|
|
|
const ReportsPage = () => import('@/features/admin/modules/reports/ReportsPage.vue');
|
|
|
|
|
|
|
|
export const adminRoutes: RouteRecordRaw[] = [
|
|
|
|
{
|
|
|
|
path: '/admin',
|
|
|
|
component: AdminLayout,
|
|
|
|
meta: { requiresAdmin: true },
|
|
|
|
children: [
|
|
|
|
{ path: '', redirect: '/admin/dashboard' },
|
|
|
|
{
|
|
|
|
path: 'dashboard',
|
|
|
|
name: 'AdminDashboard',
|
|
|
|
component: DashboardPage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'dashboard', title: '概览' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'schedules',
|
|
|
|
name: 'AdminSchedules',
|
|
|
|
component: SchedulesPage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'schedules', title: '定时任务' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'knowledge-base',
|
|
|
|
name: 'AdminKnowledgeBase',
|
|
|
|
component: KnowledgeBasePage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'knowledge_base', title: '知识库' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'wecom',
|
|
|
|
name: 'AdminWecom',
|
|
|
|
component: WecomPage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'wecom', title: '企业微信' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'approvals',
|
|
|
|
name: 'AdminApprovals',
|
|
|
|
component: ApprovalsPage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'approvals', title: '用户审批' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'agents',
|
|
|
|
name: 'AdminAgents',
|
|
|
|
component: AgentsPage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'agents', title: '应用管理' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'users',
|
|
|
|
name: 'AdminUsers',
|
|
|
|
component: UsersPage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'users', title: '用户管理' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'departments',
|
|
|
|
name: 'AdminDepartments',
|
|
|
|
component: DepartmentsPage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'departments', title: '部门管理' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'announcements',
|
|
|
|
name: 'AdminAnnouncements',
|
|
|
|
component: AnnouncementsPage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'announcements', title: '公告管理' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'questions',
|
|
|
|
name: 'AdminQuestions',
|
|
|
|
component: QuestionsPage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'questions', title: '常用问题' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'requests',
|
|
|
|
name: 'AdminRequests',
|
|
|
|
component: RequestsPage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'requests', title: '权限申请' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'permissions',
|
|
|
|
name: 'AdminPermissions',
|
|
|
|
component: PermissionsPage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'permissions', title: '权限管理' },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: 'reports/:table?',
|
|
|
|
name: 'AdminReports',
|
|
|
|
component: ReportsPage,
|
|
|
|
meta: { requiresAdmin: true, adminModule: 'reports', title: '报表' },
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|
|
|
|
|