config.d.ts 4.7 KB

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