Skip to content

Commit

Permalink
style:增强route的ts类型
Browse files Browse the repository at this point in the history
  • Loading branch information
huajian123 committed Oct 8, 2024
1 parent e54ec28 commit 1e15222
Show file tree
Hide file tree
Showing 30 changed files with 32 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/app/app-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export const appRoutes = [
{ path: 'login', data: { preload: true }, loadChildren: () => import('./pages/login/login-routing') },
{ path: 'default', data: { preload: true }, loadChildren: () => import('./layout/default/default-routing') },
{ path: '**', redirectTo: '/login/login-form' }
] as Route[];
] satisfies Route[];
6 changes: 3 additions & 3 deletions src/app/app.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { DOCUMENT, registerLocaleData } from '@angular/common';
import { provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
import zh from '@angular/common/locales/zh';
import { APP_INITIALIZER, ApplicationConfig, importProvidersFrom, provideExperimentalZonelessChangeDetection } from '@angular/core';
import { APP_INITIALIZER, ApplicationConfig, FactoryProvider, importProvidersFrom, provideExperimentalZonelessChangeDetection } from '@angular/core';
import { provideAnimationsAsync } from '@angular/platform-browser/animations/async';
import { provideRouter, RouteReuseStrategy, TitleStrategy, withComponentInputBinding, withHashLocation, withInMemoryScrolling, withPreloading } from '@angular/router';

Expand Down Expand Up @@ -49,7 +49,7 @@ export function SubWindowWithServiceFactory(subWindowWithService: SubWindowWithS
return () => subWindowWithService.subWindowWidth();
}

const APPINIT_PROVIDES = [
const APPINIT_PROVIDES: FactoryProvider[] = [
// 项目启动
{
provide: APP_INITIALIZER,
Expand All @@ -63,7 +63,7 @@ const APPINIT_PROVIDES = [
useFactory: LoadAliIconCdnFactory,
deps: [LoadAliIconCdnService],
multi: true
},
} satisfies FactoryProvider,
// 初始化锁屏服务
{
provide: APP_INITIALIZER,
Expand Down
2 changes: 1 addition & 1 deletion src/app/layout/blank/blank-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@ export default [
}
]
}
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/layout/default/default-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,4 @@ export default [
}
]
}
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/comp/comp-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ export default [
data: { key: 'comp5' },
loadComponent: () => import('../../pages/no-content/no-content.component').then(m => m.NoContentComponent)
}
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/comp/form/form-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default [
{ path: '', redirectTo: 'shrink-form', pathMatch: 'full' },
{ path: 'shrink-form', title: '可伸缩表单', data: { key: 'shrink-form' }, loadComponent: () => import('./shrink-form/shrink-form.component').then(m => m.ShrinkFormComponent) },
{ path: 'append-form', title: '可增删表单', data: { key: 'append-form' }, loadComponent: () => import('./append-form/append-form.component').then(m => m.AppendFormComponent) }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/comp/lazy/lazy-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default [
{ path: '', redirectTo: 'lazy-basic', pathMatch: 'full' },
{ path: 'lazy-basic', title: '懒加载基础实例', data: { key: 'lazy-basic' }, loadComponent: () => import('./lazy-basic/lazy-basic.component').then(m => m.LazyBasicComponent) },
{ path: 'lazy-scroll', title: '滚动懒加载', data: { key: 'lazy-scroll' }, loadComponent: () => import('./lazy-scroll/lazy-scroll.component').then(m => m.LazyScrollComponent) }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/dashboard/dashboard-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export default [
},
{ path: 'monitor', title: '监控页', data: { key: 'monitor' }, loadComponent: () => import('./monitor/monitor.component').then(m => m.MonitorComponent) },
{ path: 'workbench', title: '工作台', data: { key: 'workbench' }, loadComponent: () => import('./workbench/workbench.component').then(m => m.WorkbenchComponent) }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/feat/charts/charts-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default [
{ path: 'baidu-map', title: '百度', data: { key: 'baidu-map' }, loadComponent: () => import('./baidu-map/baidu-map.component').then(m => m.BaiduMapComponent) },
{ path: 'echarts', title: 'Echarts', data: { key: 'echarts' }, loadComponent: () => import('./echarts/echarts.component').then(m => m.EchartsComponent) },
{ path: '', redirectTo: 'gaode-map', pathMatch: 'full' }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/feat/feat-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,4 +70,4 @@ export default [
data: { key: 'feat5' },
loadComponent: () => import('../../pages/no-content/no-content.component').then(m => m.NoContentComponent)
}
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/feat/frame/frame-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import { Route } from '@angular/router';
export default [
{ path: 'zorro-doc', title: 'zorro文档', data: { key: 'zorro-doc' }, loadComponent: () => import('./zorro-doc/zorro-doc.component').then(m => m.ZorroDocComponent) },
{ path: '', redirectTo: 'zorro-doc', pathMatch: 'full' }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/feat/scroll/scroll-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ export default [
},
{ path: 'play-scroll', title: '玩弄滚动条', data: { key: 'play-scroll' }, loadComponent: () => import('./play-scroll/play-scroll.component').then(m => m.PlayScrollComponent) },
{ path: '', redirectTo: 'keep-scroll-page', pathMatch: 'full' }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/feat/tabs/tabs-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ export default [
data: { newTab: 'true', authCode: ActionCode.TabsDetail, key: 'example-detail' },
loadComponent: () => import('./detail/detail.component').then(m => m.DetailComponent)
}
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/level/level-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default [
{ path: '', redirectTo: 'menu1', pathMatch: 'full' },
{ path: 'menu1', loadChildren: () => import('./menu1/menu1-routing') },
{ path: 'menu2', title: 'Menu2', data: { key: 'menu2' }, loadComponent: () => import('./menu2/menu2.component').then(m => m.Menu2Component) }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/level/menu1/menu1-1/menu1-1-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default [
{ path: 'menu1-1-1', title: 'Menu1-1-1', data: { key: 'menu1-1-1' }, loadComponent: () => import('./menu1-1-1/menu111.component').then(m => m.Menu111Component) },
{ path: 'menu1-1-2', title: 'Menu1-1-2', data: { key: 'menu1-1-2' }, loadComponent: () => import('./menu1-1-2/menu112.component').then(m => m.Menu112Component) },
{ path: '', redirectTo: 'menu1-1-1', pathMatch: 'full' }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/level/menu1/menu1-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default [
{ path: 'menu1-1', loadChildren: () => import('./menu1-1/menu1-1-routing') },
{ path: 'menu1-2', title: 'Menu1-2', data: { key: 'menu1-2' }, loadComponent: () => import('./menu1-2/menu1-2.component').then(m => m.Menu12Component) },
{ path: '', redirectTo: 'menu1-2', pathMatch: 'full' }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/login/login-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ export default [
}
]
}
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/other-login/other-login-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import { Route } from '@angular/router';
export default [
{ path: '', redirectTo: 'login1', pathMatch: 'full' },
{ path: 'login1', title: '第一种登录', data: { key: 'login1' }, loadComponent: () => import('./login1/login1.component').then(m => m.Login1Component) }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/page-demo/detail/detail-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ export default [
{ path: '', redirectTo: 'base-detail', pathMatch: 'full' },
{ path: 'base-detail', title: '基础详情页', data: { key: 'base-detail' }, loadComponent: () => import('./base-detail/base-detail.component').then(m => m.BaseDetailComponent) },
{ path: 'adv-detail', title: '高级详情页', data: { key: 'adv-detail' }, loadComponent: () => import('./adv-detail/adv-detail.component').then(m => m.AdvDetailComponent) }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/page-demo/except/except-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default [
{ path: 'except500', title: '500', data: { key: 'except500' }, loadComponent: () => import('./except500/except500.component').then(m => m.Except500Component) },
{ path: 'network-error', title: '网络错误', data: { key: 'network-error' }, loadComponent: () => import('./network-error/network-error.component').then(m => m.NetworkErrorComponent) },
{ path: 'no-data', title: '无数据', data: { key: 'no-data' }, loadComponent: () => import('./no-data/no-data.component').then(m => m.NoDataComponent) }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/page-demo/flow/flow-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ import { Route } from '@angular/router';
export default [
{ path: '', redirectTo: 'flow-chat', pathMatch: 'full' },
{ path: 'flow-chat', title: '流程图', data: { key: 'flow-chat' }, loadComponent: () => import('./flow-chat/flow-chat.component').then(m => m.FlowChatComponent) }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/page-demo/form/form-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ export default [
{ path: 'base-form', title: '基础表单', data: { key: 'base-form' }, loadComponent: () => import('./base/base.component').then(m => m.BaseComponent) },
{ path: 'step-form', title: '分步表单', data: { key: 'step-form' }, loadComponent: () => import('./step/step.component').then(m => m.StepComponent) },
{ path: 'advanced-form', title: '高级表单', data: { key: 'advanced-form' }, loadComponent: () => import('./advanced/advanced.component').then(m => m.AdvancedComponent) }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/page-demo/list/list-routing.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ export default [
{ path: 'tree-list', title: '树状表格', data: { key: 'tree-list' }, loadComponent: () => import('./tree-list/tree-list.component').then(m => m.TreeListComponent) },
{ path: 'card-table', title: '卡片列表', data: { key: 'card-table' }, loadComponent: () => import('./card-table/card-table.component').then(m => m.CardTableComponent) },
{ path: 'search-list', loadChildren: () => import('./search-list/search-list-routing') }
] as Route[];
] satisfies Route[];
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ export default [
},

{ path: '', redirectTo: '/search-list', pathMatch: 'full' }
] as Route[];
] satisfies Route[];
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export default [
key: 'search-table-detail'
}
}
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/page-demo/page-demo-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ export default [
data: { key: 'page-demo4' },
loadComponent: () => import('../../pages/no-content/no-content.component').then(m => m.NoContentComponent)
}
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/page-demo/personal/personal-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default [
{ path: '', redirectTo: 'personal-center', pathMatch: 'full' },
{ path: 'personal-center', title: '个人中心', data: { key: 'personal-center' }, loadComponent: () => import('./personal-center/personal-center.component').then(m => m.PersonalCenterComponent) },
{ path: 'personal-setting', title: '个人设置', data: { key: 'personal-setting' }, loadComponent: () => import('./personal-setting/personal-setting.component').then(m => m.PersonalSettingComponent) }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/page-demo/result/result-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ export default [
{ path: '', redirectTo: 'role-manage', pathMatch: 'full' },
{ path: 'success', title: '成功页', data: { key: 'success' }, loadComponent: () => import('./success/success.component').then(m => m.SuccessComponent) },
{ path: 'fail', title: '失败页', data: { key: 'fail' }, loadComponent: () => import('./fail/fail.component').then(m => m.FailComponent) }
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/system/role-manager/role-manage-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ export default [
authCode: ActionCode.RoleManagerSetRole
}
}
] as Route[];
] satisfies Route[];
2 changes: 1 addition & 1 deletion src/app/pages/system/system-routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ export default [
{ path: 'account', title: '账号管理', data: { key: 'account' }, loadComponent: () => import('./account/account.component').then(m => m.AccountComponent) },
{ path: 'dept', title: '部门管理', data: { key: 'dept' }, loadComponent: () => import('./dept/dept.component').then(m => m.DeptComponent) },
{ path: 'role-manager', loadChildren: () => import('./role-manager/role-manage-routing') }
] as Route[];
] satisfies Route[];

0 comments on commit 1e15222

Please sign in to comment.