Blame view

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

export interface MultiTabsSetting {
  // 是否显示
  show: boolean;
  // 开启快速操作
  showQuick: boolean;
33
  canDrag: boolean;
vben authored
34
35
36

  // 显示刷新按钮
  showRedo: boolean;
vben authored
37
38
39

  // 显示折叠按钮
  showFold: boolean;
陈文彬 authored
40
41
42
}

export interface HeaderSetting {
vben authored
43
  bgColor: string;
陈文彬 authored
44
45
  fixed: boolean;
  show: boolean;
vben authored
46
  theme: ThemeEnum;
vben authored
47
陈文彬 authored
48
49
50
51
52
53
  // 显示全屏按钮
  showFullScreen: boolean;
  // 开启全屏功能
  useLockPage: boolean;
  // 显示文档按钮
  showDoc: boolean;
chen-xt authored
54
55
  // 显示消息中心按钮
  showNotice: boolean;
vben authored
56
57

  showSearch: boolean;
陈文彬 authored
58
}
vben authored
59
60

export interface LocaleSetting {
vben authored
61
  show: boolean;
vben authored
62
63
64
65
66
67
68
69
  // Current language
  lang: LocaleType;
  // default language
  fallback: LocaleType;
  // available Locales
  availableLocales: LocaleType[];
}
vben authored
70
71
72
73
74
75
76
77
78
79
80
81
82
83
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
84
export interface ProjectConfig {
vben authored
85
  locale: LocaleSetting;
vben authored
86
87
88
  permissionCacheType: CacheTypeEnum;
陈文彬 authored
89
90
91
92
93
94
95
96
97
98
  // 是否显示配置按钮
  showSettingButton: boolean;
  // 权限模式
  permissionMode: PermissionModeEnum;
  // 网站灰色模式,用于可能悼念的日期开启
  grayMode: boolean;
  // 是否开启色弱模式
  colorWeak: boolean;
  // 主题色
  themeColor: string;
vben authored
99
  themeMode: ThemeMode;
陈文彬 authored
100
101
102
103
104
105
  // 全屏显示主界面,不显示菜单,及顶部
  fullContent: boolean;
  // 区域宽度
  contentMode: ContentEnum;
  // 是否显示logo
  showLogo: boolean;
vben authored
106
  showFooter: boolean;
陈文彬 authored
107
108
109
110
111
112
113
  headerSetting: HeaderSetting;
  // 菜单类型
  // menuType: MenuTypeEnum;
  menuSetting: MenuSetting;

  // 多标签页设置
  multiTabsSetting: MultiTabsSetting;
vben authored
114
115
116

  transitionSetting: TransitionSetting;
陈文彬 authored
117
118
119
  // pageLayout是否开启keep-alive
  openKeepAlive: boolean;
120
  //
陈文彬 authored
121
122
123
124
  // 锁屏时间
  lockTime: number;
  // 显示面包屑
  showBreadCrumb: boolean;
125
126
  // 显示面包屑图标
  showBreadCrumbIcon: boolean;
陈文彬 authored
127
128
129
130
131
132
  // 使用error-handler-plugin
  useErrorHandle: boolean;
  // 是否开启回到顶部
  useOpenBackTop: boolean;
  // 是否可以嵌入iframe页面
  canEmbedIFramePage: boolean;
133
134
135
136
  // 切换界面的时候是否删除未关闭的message及notify
  closeMessageOnSwitch: boolean;
  // 切换界面的时候是否取消已经发送但是未响应的http请求。
  removeAllHttpPending: boolean;
陈文彬 authored
137
138
139
140
141
142
143
}

export interface GlobConfig {
  // 网站标题
  title: string;
  // 项目路径
  apiUrl: string;
vben authored
144
  uploadUrl?: string;
陈文彬 authored
145
146
147
148
149
  urlPrefix?: string;
  shortName: string;
}
export interface GlobEnvConfig {
  // 网站标题
150
  VITE_GLOB_APP_TITLE: string;
陈文彬 authored
151
  // 项目路径
152
153
154
  VITE_GLOB_API_URL: string;
  VITE_GLOB_API_URL_PREFIX?: string;
  VITE_GLOB_APP_SHORT_NAME: string;
vben authored
155
  VITE_GLOB_UPLOAD_URL?: string;
陈文彬 authored
156
157
158
159
160
}

interface GlobWrap {
  globSetting: Readonly<GlobConfig>;
}
161
陈文彬 authored
162
163
164
interface ProjectSettingWrap {
  projectSetting: Readonly<ProjectConfig>;
}