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.

133 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. roles?: Array<string>;
  76. /** 按钮级别权限设置 `可选` */
  77. auths?: Array<string>;
  78. /** 路由组件缓存(开启 `true`、关闭 `false`)`可选` */
  79. keepAlive?: boolean;
  80. /** 内嵌的`iframe`链接 `可选` */
  81. frameSrc?: string;
  82. /** `iframe`页是否开启首次加载动画(默认`true`)`可选` */
  83. frameLoading?: boolean;
  84. /** 页面加载动画(有两种形式,一种直接采用vue内置的`transitions`动画,另一种是使用`animate.css`写进、离场动画)`可选` */
  85. transition?: {
  86. /**
  87. * @description
  88. * @see {@link https://next.router.vuejs.org/guide/advanced/transitions.html#transitions}
  89. */
  90. name?: string;
  91. /** 进场动画 */
  92. enterTransition?: string;
  93. /** 离场动画 */
  94. leaveTransition?: string;
  95. };
  96. // 是否不添加信息到标签页,(默认`false`)
  97. hiddenTag?: boolean;
  98. /** 动态路由可打开的最大数量 `可选` */
  99. dynamicLevel?: number;
  100. };
  101. /** 子路由配置项 */
  102. children?: Array<RouteChildrenConfigsTable>;
  103. }
  104. /**
  105. * @description
  106. * @see {@link https://yiming_chang.gitee.io/pure-admin-doc/pages/782b6e/#%E4%B8%80-%E9%85%8D%E7%BD%AE%E9%A1%B9}
  107. */
  108. export interface RouteConfigsTable {
  109. /** 路由地址 `必填` */
  110. path: string;
  111. /** 路由名字(保持唯一)`可选` */
  112. name?: string;
  113. /** `Layout`组件 `可选` */
  114. component?: RouteComponent;
  115. /** 路由重定向 `可选` */
  116. redirect?: string;
  117. meta?: {
  118. /** 菜单名称(兼容国际化、非国际化,如何用国际化的写法就必须在根目录的`locales`文件夹下对应添加)`必填` */
  119. title: string;
  120. /** 菜单图标 `可选` */
  121. icon?: string;
  122. /** 是否在菜单中显示(默认`true`)`可选` */
  123. showLink?: boolean;
  124. /** 菜单升序排序,值越高排的越后(只针对顶级路由)`可选` */
  125. rank?: number;
  126. };
  127. /** 子路由配置项 */
  128. children?: Array<RouteChildrenConfigsTable>;
  129. }