config.d.ts 4.5 KB

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