types.d.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import type { RouteRecordRaw } from 'vue-router';
  2. import { RoleEnum } from '/@/enums/roleEnum';
  3. export interface RouteMeta {
  4. // title
  5. title: string;
  6. // Whether to ignore permissions
  7. ignoreAuth?: boolean;
  8. // role info
  9. roles?: RoleEnum[];
  10. // Whether not to cache
  11. ignoreKeepAlive?: boolean;
  12. // Is it fixed on tab
  13. affix?: boolean;
  14. // icon on tab
  15. icon?: string;
  16. // Jump address
  17. frameSrc?: string;
  18. // Outer link jump address
  19. externalLink?: string;
  20. // current page transition
  21. transitionName?: string;
  22. // Whether the route has been dynamically added
  23. hideBreadcrumb?: boolean;
  24. // disabled redirect
  25. disabledRedirect?: boolean;
  26. // close loading
  27. afterCloseLoading?: boolean;
  28. // Is it in the tab
  29. inTab?: boolean;
  30. // Carrying parameters
  31. carryParam?: boolean;
  32. }
  33. export interface AppRouteRecordRaw extends Omit<RouteRecordRaw, 'meta'> {
  34. meta: RouteMeta;
  35. component?: any;
  36. components?: any;
  37. children?: AppRouteRecordRaw[];
  38. props?: any;
  39. fullPath?: string;
  40. }
  41. export interface MenuTag {
  42. type?: 'primary' | 'error' | 'warn' | 'success';
  43. content?: string;
  44. dot?: boolean;
  45. }
  46. export interface Menu {
  47. name: string;
  48. icon?: string;
  49. path: string;
  50. disabled?: boolean;
  51. children?: Menu[];
  52. orderNo?: number;
  53. roles?: RoleEnum[];
  54. meta?: Partial<RouteMeta>;
  55. tag?: MenuTag;
  56. }
  57. export interface MenuModule {
  58. orderNo?: number;
  59. menu: Menu;
  60. }
  61. interface RouteModule {
  62. layout: AppRouteRecordRaw;
  63. routes: AppRouteRecordRaw[];
  64. children?: AppRouteRecordRaw[];
  65. component?: any;
  66. }
  67. export type AppRouteModule = RouteModule | AppRouteRecordRaw;