routes-routing.module.ts 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. import { NgModule } from '@angular/core';
  2. import { Routes, RouterModule } from '@angular/router';
  3. import { SimpleGuard } from '@delon/auth';
  4. import { environment } from '@env/environment';
  5. // layout
  6. import { LayoutDefaultComponent } from '../layout/default/default.component';
  7. import { LayoutFullScreenComponent } from '../layout/fullscreen/fullscreen.component';
  8. import { LayoutPassportComponent } from '../layout/passport/passport.component';
  9. // dashboard pages
  10. import { DashboardV1Component } from './dashboard/v1/v1.component';
  11. import { DashboardAnalysisComponent } from './dashboard/analysis/analysis.component';
  12. import { DashboardMonitorComponent } from './dashboard/monitor/monitor.component';
  13. import { DashboardWorkplaceComponent } from './dashboard/workplace/workplace.component';
  14. // passport pages
  15. import { UserLoginComponent } from './passport/login/login.component';
  16. import { UserRegisterComponent } from './passport/register/register.component';
  17. import { UserRegisterResultComponent } from './passport/register-result/register-result.component';
  18. // single pages
  19. import { CallbackComponent } from './callback/callback.component';
  20. import { UserLockComponent } from './passport/lock/lock.component';
  21. const routes: Routes = [
  22. {
  23. path: '',
  24. component: LayoutDefaultComponent,
  25. canActivate: [SimpleGuard],
  26. canActivateChild: [SimpleGuard],
  27. children: [
  28. { path: '', redirectTo: 'dashboard/analysis', pathMatch: 'full' },
  29. { path: 'dashboard', redirectTo: 'dashboard/v1', pathMatch: 'full' },
  30. { path: 'dashboard/v1', component: DashboardV1Component },
  31. { path: 'dashboard/analysis', component: DashboardAnalysisComponent },
  32. { path: 'dashboard/monitor', component: DashboardMonitorComponent },
  33. { path: 'dashboard/workplace', component: DashboardWorkplaceComponent },
  34. { path: 'widgets', loadChildren: './widgets/widgets.module#WidgetsModule' },
  35. { path: 'style', loadChildren: './style/style.module#StyleModule' },
  36. { path: 'delon', loadChildren: './delon/delon.module#DelonModule' },
  37. { path: 'extras', loadChildren: './extras/extras.module#ExtrasModule' },
  38. { path: 'pro', loadChildren: './pro/pro.module#ProModule' },
  39. // Exception
  40. { path: 'exception', loadChildren: './exception/exception.module#ExceptionModule' },
  41. // System
  42. { path: 'system', loadChildren: './system/system.module#SystemModule' },
  43. // System
  44. { path: 'monitor', loadChildren: './monitor/monitor.module#MonitorModule' },
  45. { path: 'basedata', loadChildren: './basedata/basedata.module#BasedataModule' },
  46. { path: 'pm', loadChildren: './pm/pm.module#PmModule' },
  47. //项目里程碑模板
  48. { path: 'projectMilestones', loadChildren: './project-milestones/project-milestones.module#ProjectMilestonesModule' },
  49. // 财务管理
  50. { path: 'financialManagement', loadChildren: './financial-management/financial-management.module#FinancialManagementModule' },
  51. //样本及耗材管理
  52. { path: 'samplesAndConsumables', loadChildren: './samples-and-consumables/samples-and-consumables.module#SamplesAndConsumablesModule' },
  53. // 质量管理
  54. { path: 'qualityControl', loadChildren: './quality-control/quality-control.module#QualityControlModule' },
  55. { path: 'quality-management', loadChildren: './quality-management/quality-management.module#QualityManagementModule' },
  56. //车间派工单
  57. { path: 'WorkshopDispatchList', loadChildren: './fbs-workshop-dispatch-list/fbs-workshop-dispatch-list.module#FbsWorkshopDispatchListModule' },
  58. //生产异常信息统计单
  59. { path: 'FbsAbnormalWorkingHours', loadChildren: './fbs-abnormal-working-hours/fbs-abnormal-working-hours.module#FbsAbnormalWorkingHoursModule' },
  60. //质量近六个月统计
  61. { path: 'fbs-quality-qualification-rate', loadChildren: './fbs-quality-qualification-rate/fbs-quality-qualification-rate.module#FbsQualityQualificationRateModule' },
  62. //质量近六个月统计
  63. { path: 'fbs-personnel', loadChildren: './fbs-personnel/fbs-personnel.module#FbsPersonnelModule' },
  64. //扫码记录
  65. { path: 'fbs-fbs-scan-code', loadChildren: './fbs-scan-code/fbs-scan-code.module#FbsScanCodeModule' }
  66. ],
  67. },
  68. // 全屏布局
  69. {
  70. path: 'data-v',
  71. component: LayoutFullScreenComponent,
  72. children: [{ path: '', loadChildren: './data-v/data-v.module#DataVModule' }],
  73. },
  74. // passport
  75. {
  76. path: 'passport',
  77. component: LayoutPassportComponent,
  78. children: [
  79. {
  80. path: 'login',
  81. component: UserLoginComponent,
  82. // data: { title: '登录', titleI18n: 'app.login.login' },
  83. data: { title: '登录', titleI18n: '' },
  84. },
  85. {
  86. path: 'register',
  87. component: UserRegisterComponent,
  88. data: { title: '注册', titleI18n: 'app.register.register' },
  89. },
  90. {
  91. path: 'register-result',
  92. component: UserRegisterResultComponent,
  93. data: { title: '注册结果', titleI18n: 'app.register.register' },
  94. },
  95. {
  96. path: 'lock',
  97. component: UserLockComponent,
  98. data: { title: '锁屏', titleI18n: 'app.lock' },
  99. },
  100. ],
  101. },
  102. // 单页不包裹Layout
  103. { path: 'callback/:type', component: CallbackComponent },
  104. { path: '**', redirectTo: 'exception/404' },
  105. ]
  106. @NgModule({
  107. imports: [
  108. RouterModule.forRoot(routes, {
  109. useHash: environment.useHash,
  110. // NOTICE: If you use `reuse-tab` component and turn on keepingScroll you can set to `disabled`
  111. // Pls refer to https://ng-alain.com/components/reuse-tab
  112. scrollPositionRestoration: 'top',
  113. }),
  114. ],
  115. exports: [RouterModule],
  116. })
  117. export class RouteRoutingModule { }