config.d.ts 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. import { MenuTypeEnum, MenuModeEnum, TriggerEnum, MixSidebarTriggerEnum } from '@/enums/menuEnum';
  2. import {
  3. ContentEnum,
  4. PermissionModeEnum,
  5. ThemeEnum,
  6. RouterTransitionEnum,
  7. SettingButtonPositionEnum,
  8. SessionTimeoutProcessingEnum,
  9. NoPermissionModeEnum,
  10. } from '@/enums/appEnum';
  11. import { CacheTypeEnum } from '@/enums/cacheEnum';
  12. export type LocaleType = 'zh_CN' | 'en_US' | 'ru' | 'ja' | 'ko';
  13. export interface MenuSetting {
  14. bgColor: string;
  15. fixed: boolean;
  16. collapsed: boolean;
  17. siderHidden: boolean;
  18. canDrag: boolean;
  19. show: boolean;
  20. hidden: boolean;
  21. split: boolean;
  22. menuWidth: number;
  23. mode: MenuModeEnum;
  24. type: MenuTypeEnum;
  25. theme: ThemeEnum;
  26. topMenuAlign: 'start' | 'center' | 'end';
  27. trigger: TriggerEnum;
  28. accordion: boolean;
  29. closeMixSidebarOnChange: boolean;
  30. collapsedShowTitle: boolean;
  31. mixSideTrigger: MixSidebarTriggerEnum;
  32. mixSideFixed: boolean;
  33. }
  34. export interface MultiTabsSetting {
  35. cache: boolean;
  36. show: boolean;
  37. showQuick: boolean;
  38. canDrag: boolean;
  39. showRedo: boolean;
  40. showFold: boolean;
  41. autoCollapse: boolean;
  42. }
  43. export interface HeaderSetting {
  44. bgColor: string;
  45. fixed: boolean;
  46. show: boolean;
  47. theme: ThemeEnum;
  48. // Turn on full screen
  49. showFullScreen: boolean;
  50. // Whether to show the lock screen
  51. useLockPage: boolean;
  52. // Show document button
  53. showDoc: boolean;
  54. // Show message center button
  55. showNotice: boolean;
  56. showSearch: boolean;
  57. showApi: boolean;
  58. }
  59. export interface LocaleSetting {
  60. showPicker: boolean;
  61. // Current language
  62. locale: LocaleType;
  63. // default language
  64. fallback: LocaleType;
  65. // available Locales
  66. availableLocales: LocaleType[];
  67. }
  68. export interface TransitionSetting {
  69. // Whether to open the page switching animation
  70. enable: boolean;
  71. // Route basic switching animation
  72. basicTransition: RouterTransitionEnum;
  73. // Whether to open page switching loading
  74. openPageLoading: boolean;
  75. // Whether to open the top progress bar
  76. openNProgress: boolean;
  77. }
  78. export interface ProjectConfig {
  79. // Storage location of permission related information
  80. permissionCacheType: CacheTypeEnum;
  81. // Whether to show the configuration button
  82. showSettingButton: boolean;
  83. // Whether to show the theme switch button
  84. showDarkModeToggle: boolean;
  85. // Configure where the button is displayed
  86. settingButtonPosition: SettingButtonPositionEnum;
  87. // Permission mode
  88. permissionMode: PermissionModeEnum;
  89. // Session timeout processing
  90. sessionTimeoutProcessing: SessionTimeoutProcessingEnum;
  91. // Website gray mode, open for possible mourning dates
  92. grayMode: boolean;
  93. // Whether to turn on the color weak mode
  94. colorWeak: boolean;
  95. // Theme color
  96. themeColor: string;
  97. // The main interface is displayed in full screen, the menu is not displayed, and the top
  98. fullContent: boolean;
  99. // content width
  100. contentMode: ContentEnum;
  101. // Whether to display the logo
  102. showLogo: boolean;
  103. // Whether to show the global footer
  104. showFooter: boolean;
  105. // menuType: MenuTypeEnum;
  106. headerSetting: HeaderSetting;
  107. // menuSetting
  108. menuSetting: MenuSetting;
  109. // Multi-tab settings
  110. multiTabsSetting: MultiTabsSetting;
  111. // Animation configuration
  112. transitionSetting: TransitionSetting;
  113. // pageLayout whether to enable keep-alive
  114. openKeepAlive: boolean;
  115. // Lock screen time
  116. lockTime: number;
  117. // Show breadcrumbs
  118. showBreadCrumb: boolean;
  119. // Show breadcrumb icon
  120. showBreadCrumbIcon: boolean;
  121. // Use error-handler-plugin
  122. useErrorHandle: boolean;
  123. // Whether to open back to top
  124. useOpenBackTop: boolean;
  125. // Is it possible to embed iframe pages
  126. canEmbedIFramePage: boolean;
  127. // Whether to delete unclosed messages and notify when switching the interface
  128. closeMessageOnSwitch: boolean;
  129. // Whether to cancel the http request that has been sent but not responded when switching the interface.
  130. removeAllHttpPending: boolean;
  131. // 尺寸配置
  132. sizeConfig: SizeConfig;
  133. // 无权限模式
  134. noPermissionMode: NoPermissionModeEnum;
  135. }
  136. export interface GlobConfig {
  137. // Site title
  138. title: string;
  139. // Service interface url
  140. apiUrl: string;
  141. // Upload url
  142. uploadUrl?: string;
  143. // Service interface url prefix
  144. urlPrefix?: string;
  145. // Project abbreviation
  146. shortName: string;
  147. // 是否是单体架构
  148. isStandalone: boolean;
  149. }
  150. export interface GlobEnvConfig {
  151. // Site title
  152. VITE_GLOB_APP_TITLE: string;
  153. // Service interface url
  154. VITE_GLOB_API_URL: string;
  155. // Service interface url prefix
  156. VITE_GLOB_API_URL_PREFIX?: string;
  157. // Upload url
  158. VITE_GLOB_UPLOAD_URL?: string;
  159. /**
  160. * 后台api模式,standalone:单体架构,cloud:微服务架构
  161. */
  162. VITE_GLOB_API_MODE?: ApiMode;
  163. }
  164. /**
  165. * 后台api模式,standalone:单体架构,cloud:微服务架构
  166. */
  167. type ApiMode = 'standalone' | 'cloud';
  168. export interface SizeConfig {
  169. table: VxeTablePropTypes.Size;
  170. button: string;
  171. form: FormSize;
  172. }