Blame view

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

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

  // 显示刷新按钮
  showRedo: boolean;
陈文彬 authored
34
35
36
}

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

  showSearch: boolean;
陈文彬 authored
52
}
vben authored
53
54

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

  // 多标签页设置
  multiTabsSetting: MultiTabsSetting;
vben authored
107
108
109

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

export interface GlobConfig {
  // 网站标题
  title: string;
  // 项目路径
  apiUrl: string;
vben authored
137
  uploadUrl?: string;
陈文彬 authored
138
139
140
141
142
  urlPrefix?: string;
  shortName: string;
}
export interface GlobEnvConfig {
  // 网站标题
143
  VITE_GLOB_APP_TITLE: string;
陈文彬 authored
144
  // 项目路径
145
146
147
  VITE_GLOB_API_URL: string;
  VITE_GLOB_API_URL_PREFIX?: string;
  VITE_GLOB_APP_SHORT_NAME: string;
vben authored
148
  VITE_GLOB_UPLOAD_URL?: string;
陈文彬 authored
149
150
151
152
153
}

interface GlobWrap {
  globSetting: Readonly<GlobConfig>;
}
154
陈文彬 authored
155
156
157
interface ProjectSettingWrap {
  projectSetting: Readonly<ProjectConfig>;
}