You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

131 lines
3.9 KiB

2 years ago
  1. import { type RouteComponent } from "vue-router";
  2. export interface StorageConfigs {
  3. version?: string;
  4. title?: string;
  5. fixedHeader?: boolean;
  6. hiddenSideBar?: boolean;
  7. multiTagsCache?: boolean;
  8. keepAlive?: boolean;
  9. locale?: string;
  10. layout?: string;
  11. theme?: string;
  12. darkMode?: boolean;
  13. grey?: boolean;
  14. weak?: boolean;
  15. hideTabs?: boolean;
  16. sidebarStatus?: boolean;
  17. epThemeColor?: string;
  18. showLogo?: boolean;
  19. showModel?: string;
  20. mapConfigure?: {
  21. amapKey?: string;
  22. options: {
  23. resizeEnable?: boolean;
  24. center?: number[];
  25. zoom?: number;
  26. };
  27. };
  28. username?: string;
  29. }
  30. export interface ResponsiveStorage {
  31. locale: {
  32. locale?: string;
  33. };
  34. layout: {
  35. layout?: string;
  36. theme?: string;
  37. darkMode?: boolean;
  38. sidebarStatus?: boolean;
  39. epThemeColor?: string;
  40. };
  41. configure: {
  42. grey?: boolean;
  43. weak?: boolean;
  44. hideTabs?: boolean;
  45. showLogo?: boolean;
  46. showModel?: string;
  47. multiTagsCache?: boolean;
  48. };
  49. tags?: Array<any>;
  50. }
  51. export interface RouteChildrenConfigsTable {
  52. /** 子路由地址 `必填` */
  53. path: string;
  54. /** 路由名字(对应不要重复,和当前组件的`name`保持一致)`必填` */
  55. name?: string;
  56. /** 路由重定向 `可选` */
  57. redirect?: string;
  58. /** 按需加载组件 `可选` */
  59. component?: RouteComponent;
  60. meta?: {
  61. /** 菜单名称(兼容国际化、非国际化,如何用国际化的写法就必须在根目录的`locales`文件夹下对应添加) `必填` */
  62. title: string;
  63. /** 菜单图标 `可选` */
  64. icon?: string;
  65. /** 菜单名称右侧的额外图标,支持`fontawesome`、`iconfont`、`element-plus-icon` `可选` */
  66. extraIcon?: {
  67. svg?: boolean;
  68. name?: string;
  69. };
  70. /** 是否在菜单中显示(默认`true`)`可选` */
  71. showLink?: boolean;
  72. /** 是否显示父级菜单 `可选` */
  73. showParent?: boolean;
  74. /** 路由权限设置 `可选` */
  75. authority?: Array<string>;
  76. /** 路由组件缓存(开启 `true`、关闭 `false`)`可选` */
  77. keepAlive?: boolean;
  78. /** 内嵌的`iframe`链接 `可选` */
  79. frameSrc?: string;
  80. /** `iframe`页是否开启首次加载动画(默认`true`)`可选` */
  81. frameLoading?: boolean;
  82. /** 页面加载动画(有两种形式,一种直接采用vue内置的`transitions`动画,另一种是使用`animate.css`写进、离场动画)`可选` */
  83. transition?: {
  84. /**
  85. * @description
  86. * @see {@link https://next.router.vuejs.org/guide/advanced/transitions.html#transitions}
  87. */
  88. name?: string;
  89. /** 进场动画 */
  90. enterTransition?: string;
  91. /** 离场动画 */
  92. leaveTransition?: string;
  93. };
  94. // 是否不添加信息到标签页,(默认`false`)
  95. hiddenTag?: boolean;
  96. /** 动态路由可打开的最大数量 `可选` */
  97. dynamicLevel?: number;
  98. };
  99. /** 子路由配置项 */
  100. children?: Array<RouteChildrenConfigsTable>;
  101. }
  102. /**
  103. * @description
  104. * @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/782b6e/#%E4%B8%80-%E9%85%8D%E7%BD%AE%E9%A1%B9}
  105. */
  106. export interface RouteConfigsTable {
  107. /** 路由地址 `必填` */
  108. path: string;
  109. /** 路由名字(保持唯一)`可选` */
  110. name?: string;
  111. /** `Layout`组件 `可选` */
  112. component?: RouteComponent;
  113. /** 路由重定向 `可选` */
  114. redirect?: string;
  115. meta?: {
  116. /** 菜单名称(兼容国际化、非国际化,如何用国际化的写法就必须在根目录的`locales`文件夹下对应添加)`必填` */
  117. title: string;
  118. /** 菜单图标 `可选` */
  119. icon?: string;
  120. /** 是否在菜单中显示(默认`true`)`可选` */
  121. showLink?: boolean;
  122. /** 菜单升序排序,值越高排的越后(只针对顶级路由)`可选` */
  123. rank?: number;
  124. };
  125. /** 子路由配置项 */
  126. children?: Array<RouteChildrenConfigsTable>;
  127. }