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.

134 lines
4.0 KiB

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