| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- import { Routes } from '@angular/router';
- import { adminGuard, operatorManagerGuard, superAdminGuard } from './admin.guard';
- const operationsChildren: Routes = [
- {path:'store-home',data:{title:'本店工作台',parentUrl:null},loadComponent:()=>import('./pages/store-home.component').then(m=>m.StoreHomeComponent)},
- { path: 'support-requests', data: { title: '意见反馈与休假申请', parentUrl: '/admin/dashboard' }, loadComponent: () => import('./pages/support-requests.component').then(m => m.SupportRequestsComponent) },
- {path:'privacy-requests',data:{title:'注销申请',parentUrl:'/admin/dashboard'},canActivate:[operatorManagerGuard],loadComponent:()=>import('./pages/privacy-requests.component').then(m=>m.PrivacyRequestsComponent)},
- { path: '', pathMatch: 'full', redirectTo: 'dashboard' },
- { path: 'dashboard', data: { title: '工作台', parentUrl: null, preloadOperationsMenu: true, reuseOperationsMenu: true }, loadComponent: () => import('./pages/admin-dashboard.component').then((module) => module.AdminDashboardComponent) },
- { path: 'users', pathMatch: 'full', redirectTo: 'members' },
- { path: 'users/:objectId', redirectTo: 'members/:objectId' },
- { path: 'members', data: { title: '会员管理', parentUrl: '/admin/dashboard', preloadOperationsMenu: true, reuseOperationsMenu: true }, loadComponent: () => import('./pages/operations-users.component').then((module) => module.OperationsUsersComponent) },
- { path: 'members/:objectId', data: { title: '会员详情', parentUrl: '/admin/members', parentTitle: '会员管理' }, loadComponent: () => import('./pages/operations-user-detail.component').then((module) => module.OperationsUserDetailComponent) },
- { path: 'stores', data: { title: '门店管理', parentUrl: '/admin/dashboard', preloadOperationsMenu: true, reuseOperationsMenu: true }, loadComponent: () => import('./pages/operations-stores.component').then((module) => module.OperationsStoresComponent) },
- { path: 'stores/:objectId', data: { title: '门店详情', parentUrl: '/admin/stores', parentTitle: '门店管理' }, loadComponent: () => import('./pages/operations-store-detail.component').then((module) => module.OperationsStoreDetailComponent) },
- { path: 'schedule', data: { title: '排课中心', parentUrl: '/admin/dashboard', preloadOperationsMenu: true, reuseOperationsMenu: true }, loadComponent: () => import('./pages/operations-schedule.component').then((module) => module.OperationsScheduleComponent) },
- { path: 'lessons', data: { title: '训练记录', parentUrl: '/admin/dashboard' }, loadComponent: () => import('./pages/lesson-records.component').then(m => m.LessonRecordsComponent) },
- { path: 'learning-reports', data: { title: '学习报表', parentUrl: '/admin/dashboard', preloadOperationsMenu: true, reuseOperationsMenu: true }, loadComponent: () => import('./pages/operations-learning-reports.component').then((module) => module.OperationsLearningReportsComponent) },
- { path: 'appointments', pathMatch: 'full', redirectTo: 'schedule' },
- { path: 'coaches', data: { title: '陪练老师', parentUrl: '/admin/dashboard', preloadOperationsMenu: true, reuseOperationsMenu: true }, loadComponent: () => import('./pages/operations-coaches.component').then((module) => module.OperationsCoachesComponent) },
- { path: 'coaches/:objectId', data: { title: '老师详情', parentUrl: '/admin/coaches', parentTitle: '陪练老师' }, loadComponent: () => import('./pages/operations-coach-detail.component').then((module) => module.OperationsCoachDetailComponent) },
- { path: 'payroll', data: { title: '费用结算', parentUrl: '/admin/dashboard', preloadOperationsMenu: true, reuseOperationsMenu: true }, loadComponent: () => import('./pages/operations-payroll.component').then((module) => module.OperationsPayrollComponent) },
- { path: 'vocabulary', data: { title: '词库管理', parentUrl: '/admin/dashboard', preloadOperationsMenu: true, reuseOperationsMenu: true }, loadComponent: () => import('./pages/operations-vocabulary.component').then((module) => module.OperationsVocabularyComponent) },
- { path: 'special-training', data: { title: '专项训练', parentUrl: '/admin/dashboard', preloadOperationsMenu: true, reuseOperationsMenu: true }, loadComponent: () => import('./pages/operations-special-training.component').then((module) => module.OperationsSpecialTrainingComponent) },
- { path: 'operator-accounts', data: { title: '运营账号管理', parentUrl: '/admin/dashboard' }, canActivate: [operatorManagerGuard], loadComponent: () => import('./pages/operator-accounts.component').then(module => module.OperatorAccountsComponent) },
- { path: 'change-password', data: { title: '修改密码', parentUrl: '/admin/dashboard' }, loadComponent: () => import('./pages/admin-change-password.component').then((module) => module.AdminChangePasswordComponent) },
- { path: 'forbidden', data: { title: '无访问权限', parentUrl: '/admin/dashboard' }, loadComponent: () => import('./pages/admin-forbidden.component').then((module) => module.AdminForbiddenComponent) },
- ];
- const technicalChildren: Routes = [
- { path: '', pathMatch: 'full', redirectTo: 'dashboard' },
- { path: 'dashboard', data: { title: '技术工作台', parentUrl: null }, loadComponent: () => import('./pages/tech-dashboard.component').then((module) => module.TechDashboardComponent) },
- { path: 'api-catalog', data: { title: '云函数接口', parentUrl: '/tech-admin/dashboard' }, loadComponent: () => import('./pages/admin-api-catalog.component').then((module) => module.AdminApiCatalogComponent) },
- { path: 'icon-catalog', data: { title: '图标选择器', parentUrl: '/tech-admin/dashboard' }, loadComponent: () => import('./pages/admin-icon-catalog.component').then((module) => module.AdminIconCatalogComponent) },
- { path: 'boot-layout', data: { title: 'Bootstrap 布局', parentUrl: '/tech-admin/dashboard' }, loadComponent: () => import('./pages/admin-boot-layout.component').then((module) => module.AdminBootLayoutComponent) },
- { path: 'resources', data: { title: '全部数据类', parentUrl: '/tech-admin/dashboard' }, loadComponent: () => import('./pages/admin-resource-catalog.component').then((module) => module.AdminResourceCatalogComponent) },
- { path: 'resources/:className', data: { title: '数据类详情', parentUrl: '/tech-admin/resources', parentTitle: '全部数据类' }, loadComponent: () => import('./pages/admin-resource.component').then((module) => module.AdminResourceComponent) },
- { path: 'sync', data: { title: '数据同步中心', parentUrl: '/tech-admin/dashboard' }, loadComponent: () => import('./pages/admin-sync-center.component').then((module) => module.AdminSyncCenterComponent) },
- { path: 'migration', data: { title: '迁移状态', parentUrl: '/tech-admin/dashboard' }, loadComponent: () => import('./pages/admin-migration.component').then((module) => module.AdminMigrationComponent) },
- ];
- export const adminRoutes: Routes = [
- { path: 'admin/login', loadComponent: () => import('./pages/admin-login.component').then((module) => module.AdminLoginComponent) },
- {
- path: 'admin',
- canActivate: [adminGuard],
- canActivateChild: [adminGuard],
- loadComponent: () => import('./layout/admin-shell.component').then((module) => module.AdminShellComponent),
- data: { mode: 'operations' },
- children: operationsChildren,
- },
- {
- path: 'tech-admin',
- canActivate: [adminGuard, superAdminGuard],
- loadComponent: () => import('./layout/admin-shell.component').then((module) => module.AdminShellComponent),
- data: { mode: 'technical' },
- children: technicalChildren,
- },
- ];
|