config.d.ts 4.2 KB

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