config.d.ts 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  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. autoCollapse: boolean;
  41. }
  42. export interface HeaderSetting {
  43. bgColor: string;
  44. fixed: boolean;
  45. show: boolean;
  46. theme: ThemeEnum;
  47. // Turn on full screen
  48. showFullScreen: boolean;
  49. // Whether to show the lock screen
  50. useLockPage: boolean;
  51. // Show document button
  52. showDoc: boolean;
  53. // Show message center button
  54. showNotice: boolean;
  55. showSearch: boolean;
  56. showApi: boolean;
  57. }
  58. export interface LocaleSetting {
  59. showPicker: boolean;
  60. // Current language
  61. locale: LocaleType;
  62. // default language
  63. fallback: LocaleType;
  64. // available Locales
  65. availableLocales: LocaleType[];
  66. }
  67. export interface TransitionSetting {
  68. // Whether to open the page switching animation
  69. enable: boolean;
  70. // Route basic switching animation
  71. basicTransition: RouterTransitionEnum;
  72. // Whether to open page switching loading
  73. openPageLoading: boolean;
  74. // Whether to open the top progress bar
  75. openNProgress: boolean;
  76. }
  77. export interface ProjectConfig {
  78. // Storage location of permission related information
  79. permissionCacheType: CacheTypeEnum;
  80. // Whether to show the configuration button
  81. showSettingButton: boolean;
  82. // Whether to show the theme switch button
  83. showDarkModeToggle: boolean;
  84. // Configure where the button is displayed
  85. settingButtonPosition: SettingButtonPositionEnum;
  86. // Permission mode
  87. permissionMode: PermissionModeEnum;
  88. // Session timeout processing
  89. sessionTimeoutProcessing: SessionTimeoutProcessingEnum;
  90. // Website gray mode, open for possible mourning dates
  91. grayMode: boolean;
  92. // Whether to turn on the color weak mode
  93. colorWeak: boolean;
  94. // Theme color
  95. themeColor: string;
  96. // The main interface is displayed in full screen, the menu is not displayed, and the top
  97. fullContent: boolean;
  98. // content width
  99. contentMode: ContentEnum;
  100. // Whether to display the logo
  101. showLogo: boolean;
  102. // Whether to show the global footer
  103. showFooter: boolean;
  104. // menuType: MenuTypeEnum;
  105. headerSetting: HeaderSetting;
  106. // menuSetting
  107. menuSetting: MenuSetting;
  108. // Multi-tab settings
  109. multiTabsSetting: MultiTabsSetting;
  110. // Animation configuration
  111. transitionSetting: TransitionSetting;
  112. // pageLayout whether to enable keep-alive
  113. openKeepAlive: boolean;
  114. // Lock screen time
  115. lockTime: number;
  116. // Show breadcrumbs
  117. showBreadCrumb: boolean;
  118. // Show breadcrumb icon
  119. showBreadCrumbIcon: boolean;
  120. // Use error-handler-plugin
  121. useErrorHandle: boolean;
  122. // Whether to open back to top
  123. useOpenBackTop: boolean;
  124. // Is it possible to embed iframe pages
  125. canEmbedIFramePage: boolean;
  126. // Whether to delete unclosed messages and notify when switching the interface
  127. closeMessageOnSwitch: boolean;
  128. // Whether to cancel the http request that has been sent but not responded when switching the interface.
  129. removeAllHttpPending: boolean;
  130. }
  131. export interface GlobConfig {
  132. // Site title
  133. title: string;
  134. // Service interface url
  135. apiUrl: string;
  136. // Upload url
  137. uploadUrl?: string;
  138. // Service interface url prefix
  139. urlPrefix?: string;
  140. // Project abbreviation
  141. shortName: string;
  142. }
  143. export interface GlobEnvConfig {
  144. // Site title
  145. VITE_GLOB_APP_TITLE: string;
  146. // Service interface url
  147. VITE_GLOB_API_URL: string;
  148. // Service interface url prefix
  149. VITE_GLOB_API_URL_PREFIX?: string;
  150. // Upload url
  151. VITE_GLOB_UPLOAD_URL?: string;
  152. }