config.d.ts 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188
  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. 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. theme: string;
  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. }
  56. export interface LocaleSetting {
  57. showPicker: boolean;
  58. // Current language
  59. locale: LocaleType;
  60. // default language
  61. fallback: LocaleType;
  62. // available Locales
  63. availableLocales: LocaleType[];
  64. }
  65. export interface TransitionSetting {
  66. // Whether to open the page switching animation
  67. enable: boolean;
  68. // Route basic switching animation
  69. basicTransition: RouterTransitionEnum;
  70. // Whether to open page switching loading
  71. openPageLoading: boolean;
  72. // Whether to open the top progress bar
  73. openNProgress: boolean;
  74. }
  75. export interface ProjectConfig {
  76. // Storage location of permission related information
  77. permissionCacheType: CacheTypeEnum;
  78. // Whether to show the configuration button
  79. showSettingButton: boolean;
  80. // Whether to show the theme switch button
  81. showDarkModeToggle: boolean;
  82. // Configure where the button is displayed
  83. settingButtonPosition: SettingButtonPositionEnum;
  84. // Permission mode
  85. permissionMode: PermissionModeEnum;
  86. // Session timeout processing
  87. sessionTimeoutProcessing: SessionTimeoutProcessingEnum;
  88. // Website gray mode, open for possible mourning dates
  89. grayMode: boolean;
  90. // Whether to turn on the color weak mode
  91. colorWeak: boolean;
  92. // Theme color
  93. themeColor: string;
  94. // The main interface is displayed in full screen, the menu is not displayed, and the top
  95. fullContent: boolean;
  96. // content width
  97. contentMode: ContentEnum;
  98. // Whether to display the logo
  99. showLogo: boolean;
  100. // Whether to show the global footer
  101. showFooter: boolean;
  102. // menuType: MenuTypeEnum;
  103. headerSetting: HeaderSetting;
  104. // menuSetting
  105. menuSetting: MenuSetting;
  106. // Multi-tab settings
  107. multiTabsSetting: MultiTabsSetting;
  108. // Animation configuration
  109. transitionSetting: TransitionSetting;
  110. // pageLayout whether to enable keep-alive
  111. openKeepAlive: boolean;
  112. // Lock screen time
  113. lockTime: number;
  114. // Show breadcrumbs
  115. showBreadCrumb: boolean;
  116. // Show breadcrumb icon
  117. showBreadCrumbIcon: boolean;
  118. // Use error-handler-plugin
  119. useErrorHandle: boolean;
  120. // Whether to open back to top
  121. useOpenBackTop: boolean;
  122. // Is it possible to embed iframe pages
  123. canEmbedIFramePage: boolean;
  124. // Whether to delete unclosed messages and notify when switching the interface
  125. closeMessageOnSwitch: boolean;
  126. // Whether to cancel the http request that has been sent but not responded when switching the interface.
  127. removeAllHttpPending: boolean;
  128. }
  129. export interface GlobConfig {
  130. logoUrl: string;
  131. // Site title
  132. title: string;
  133. // Service interface url
  134. apiUrl: string;
  135. domainUrl: string;
  136. // Upload url (作废)
  137. uploadUrl?: string;
  138. openSso?: string;
  139. openQianKun?: string;
  140. casBaseUrl?: string;
  141. // onlineview url
  142. viewUrl?: string;
  143. // Service interface url prefix
  144. urlPrefix?: string;
  145. // Project abbreviation
  146. shortName: string;
  147. modalUrlArr: string;
  148. // isSimulate: 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. VITE_USE_MOCK: string;
  156. // Service interface url prefix
  157. VITE_GLOB_API_URL_PREFIX?: string;
  158. // Project abbreviation
  159. VITE_GLOB_APP_SHORT_NAME: string;
  160. //是否开启单点登录
  161. VITE_GLOB_APP_OPEN_SSO: string;
  162. //是否开启微应用模式
  163. VITE_GLOB_APP_OPEN_QIANKUN: string;
  164. //单点服务端地址
  165. VITE_GLOB_APP_CAS_BASE_URL: string;
  166. VITE_GLOB_DOMAIN_URL: string;
  167. // Upload url
  168. VITE_GLOB_UPLOAD_URL?: string;
  169. // view url
  170. VITE_GLOB_ONLINE_VIEW_URL?: string;
  171. // 3D modal names arr
  172. VITE_3D_MODAL_ARR: string;
  173. // 子应用 arr
  174. VITE_APP_SUB_APP?: Array;
  175. // 是否模拟
  176. VITE_GLOB_IS_SIMULATE: boolean;
  177. }