Blame view

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

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

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

export interface LocaleSetting {
61
  showPicker: boolean;
vben authored
62
  // Current language
63
  locale: LocaleType;
vben authored
64
65
66
67
68
69
  // default language
  fallback: LocaleType;
  // available Locales
  availableLocales: LocaleType[];
}
vben authored
70
71
72
73
74
75
76
77
78
79
80
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
81
export interface ProjectConfig {
Vben authored
82
  // Storage location of permission related information
83
  permissionCacheType: CacheTypeEnum;
Vben authored
84
  // Whether to show the configuration button
陈文彬 authored
85
  showSettingButton: boolean;
Vben authored
86
87
  // Whether to show the theme switch button
  showDarkModeToggle: boolean;
Vben authored
88
  // Configure where the button is displayed
89
  settingButtonPosition: SettingButtonPositionEnum;
Vben authored
90
  // Permission mode
陈文彬 authored
91
  permissionMode: PermissionModeEnum;
Vben authored
92
  // Website gray mode, open for possible mourning dates
陈文彬 authored
93
  grayMode: boolean;
Vben authored
94
  // Whether to turn on the color weak mode
陈文彬 authored
95
  colorWeak: boolean;
Vben authored
96
  // Theme color
陈文彬 authored
97
  themeColor: string;
Vben authored
98
99

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

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