Blame view

types/config.d.ts 4.26 KB
1
import { MenuTypeEnum, MenuModeEnum, TriggerEnum, MixSidebarTriggerEnum } from '/@/enums/menuEnum';
2
3
4
5
6
7
import {
  ContentEnum,
  PermissionModeEnum,
  ThemeEnum,
  RouterTransitionEnum,
  SettingButtonPositionEnum,
8
  SessionTimeoutProcessingEnum,
9
} from '/@/enums/appEnum';
Vben authored
10
11
import { CacheTypeEnum } from '/@/enums/cacheEnum';
vben authored
12
13
14
export type LocaleType = 'zh_CN' | 'en' | 'ru' | 'ja' | 'ko';
陈文彬 authored
15
export interface MenuSetting {
vben authored
16
17
  bgColor: string;
  fixed: boolean;
陈文彬 authored
18
  collapsed: boolean;
19
  siderHidden: boolean;
20
  canDrag: boolean;
陈文彬 authored
21
  show: boolean;
22
  hidden: boolean;
陈文彬 authored
23
24
25
26
  split: boolean;
  menuWidth: number;
  mode: MenuModeEnum;
  type: MenuTypeEnum;
vben authored
27
  theme: ThemeEnum;
陈文彬 authored
28
  topMenuAlign: 'start' | 'center' | 'end';
29
  trigger: TriggerEnum;
30
  accordion: boolean;
31
  closeMixSidebarOnChange: boolean;
vben authored
32
  collapsedShowTitle: boolean;
33
  mixSideTrigger: MixSidebarTriggerEnum;
34
  mixSideFixed: boolean;
陈文彬 authored
35
36
37
}

export interface MultiTabsSetting {
38
  cache: boolean;
陈文彬 authored
39
40
  show: boolean;
  showQuick: boolean;
41
  canDrag: boolean;
vben authored
42
  showRedo: boolean;
vben authored
43
  showFold: boolean;
陈文彬 authored
44
45
46
}

export interface HeaderSetting {
vben authored
47
  bgColor: string;
陈文彬 authored
48
49
  fixed: boolean;
  show: boolean;
vben authored
50
  theme: ThemeEnum;
Vben authored
51
  // Turn on full screen
陈文彬 authored
52
  showFullScreen: boolean;
Vben authored
53
  // Whether to show the lock screen
陈文彬 authored
54
  useLockPage: boolean;
Vben authored
55
  // Show document button
陈文彬 authored
56
  showDoc: boolean;
Vben authored
57
  // Show message center button
chen-xt authored
58
  showNotice: boolean;
vben authored
59
  showSearch: boolean;
陈文彬 authored
60
}
vben authored
61
62

export interface LocaleSetting {
63
  showPicker: boolean;
vben authored
64
  // Current language
65
  locale: LocaleType;
vben authored
66
67
68
69
70
71
  // default language
  fallback: LocaleType;
  // available Locales
  availableLocales: LocaleType[];
}
vben authored
72
73
74
75
76
77
78
79
80
81
82
export interface TransitionSetting {
  //  Whether to open the page switching animation
  enable: boolean;
  // Route basic switching animation
  basicTransition: RouterTransitionEnum;
  // Whether to open page switching loading
  openPageLoading: boolean;
  // Whether to open the top progress bar
  openNProgress: boolean;
}
陈文彬 authored
83
export interface ProjectConfig {
Vben authored
84
  // Storage location of permission related information
85
  permissionCacheType: CacheTypeEnum;
Vben authored
86
  // Whether to show the configuration button
陈文彬 authored
87
  showSettingButton: boolean;
Vben authored
88
89
  // Whether to show the theme switch button
  showDarkModeToggle: boolean;
Vben authored
90
  // Configure where the button is displayed
91
  settingButtonPosition: SettingButtonPositionEnum;
Vben authored
92
  // Permission mode
陈文彬 authored
93
  permissionMode: PermissionModeEnum;
94
95
  // Session timeout processing
  sessionTimeoutProcessing: SessionTimeoutProcessingEnum;
Vben authored
96
  // Website gray mode, open for possible mourning dates
陈文彬 authored
97
  grayMode: boolean;
Vben authored
98
  // Whether to turn on the color weak mode
陈文彬 authored
99
  colorWeak: boolean;
Vben authored
100
  // Theme color
陈文彬 authored
101
  themeColor: string;
Vben authored
102
103

  // The main interface is displayed in full screen, the menu is not displayed, and the top
陈文彬 authored
104
  fullContent: boolean;
Vben authored
105
  // content width
陈文彬 authored
106
  contentMode: ContentEnum;
Vben authored
107
  // Whether to display the logo
陈文彬 authored
108
  showLogo: boolean;
Vben authored
109
  // Whether to show the global footer
vben authored
110
  showFooter: boolean;
陈文彬 authored
111
  // menuType: MenuTypeEnum;
Vben authored
112
113
  headerSetting: HeaderSetting;
  // menuSetting
陈文彬 authored
114
  menuSetting: MenuSetting;
Vben authored
115
  // Multi-tab settings
陈文彬 authored
116
  multiTabsSetting: MultiTabsSetting;
Vben authored
117
  // Animation configuration
vben authored
118
  transitionSetting: TransitionSetting;
Vben authored
119
  // pageLayout whether to enable keep-alive
陈文彬 authored
120
  openKeepAlive: boolean;
Vben authored
121
  // Lock screen time
陈文彬 authored
122
  lockTime: number;
Vben authored
123
  // Show breadcrumbs
陈文彬 authored
124
  showBreadCrumb: boolean;
Vben authored
125
  // Show breadcrumb icon
126
  showBreadCrumbIcon: boolean;
Vben authored
127
  // Use error-handler-plugin
陈文彬 authored
128
  useErrorHandle: boolean;
Vben authored
129
  // Whether to open back to top
陈文彬 authored
130
  useOpenBackTop: boolean;
Vben authored
131
  // Is it possible to embed iframe pages
陈文彬 authored
132
  canEmbedIFramePage: boolean;
Vben authored
133
  // Whether to delete unclosed messages and notify when switching the interface
134
  closeMessageOnSwitch: boolean;
Vben authored
135
  // Whether to cancel the http request that has been sent but not responded when switching the interface.
136
  removeAllHttpPending: boolean;
陈文彬 authored
137
138
139
}

export interface GlobConfig {
Vben authored
140
  // Site title
陈文彬 authored
141
  title: string;
Vben authored
142
  // Service interface url
陈文彬 authored
143
  apiUrl: string;
Vben authored
144
  // Upload url
vben authored
145
  uploadUrl?: string;
Vben authored
146
  //  Service interface url prefix
陈文彬 authored
147
  urlPrefix?: string;
Vben authored
148
  // Project abbreviation
陈文彬 authored
149
150
151
  shortName: string;
}
export interface GlobEnvConfig {
Vben authored
152
  // Site title
153
  VITE_GLOB_APP_TITLE: string;
Vben authored
154
  // Service interface url
155
  VITE_GLOB_API_URL: string;
Vben authored
156
  // Service interface url prefix
157
  VITE_GLOB_API_URL_PREFIX?: string;
Vben authored
158
  // Upload url
vben authored
159
  VITE_GLOB_UPLOAD_URL?: string;
柏杨 authored
160
  VITE_ALIYUN_OSS_DOMAIN?: string;
陈文彬 authored
161
}