Blame view

src/types/config.d.ts 3.57 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
  collapsedShowTitle: boolean;
11
  canDrag: boolean;
陈文彬 authored
12
13
  showSearch: boolean;
  show: boolean;
14
  hidden: boolean;
陈文彬 authored
15
16
17
18
  split: boolean;
  menuWidth: number;
  mode: MenuModeEnum;
  type: MenuTypeEnum;
vben authored
19
  theme: ThemeEnum;
陈文彬 authored
20
  topMenuAlign: 'start' | 'center' | 'end';
vben authored
21
  collapsedShowSearch: boolean;
22
  trigger: TriggerEnum;
23
  accordion: boolean;
陈文彬 authored
24
25
26
27
28
29
30
}

export interface MultiTabsSetting {
  // 是否显示
  show: boolean;
  // 开启快速操作
  showQuick: boolean;
31
  canDrag: boolean;
陈文彬 authored
32
33
34
35
36
  // 缓存最大数量
  max: number;
}

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

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

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

  transitionSetting: TransitionSetting;
陈文彬 authored
109
110
111
112
113
114
115
  // pageLayout是否开启keep-alive
  openKeepAlive: boolean;

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

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

interface GlobWrap {
  globSetting: Readonly<GlobConfig>;
}
150
陈文彬 authored
151
152
153
interface ProjectSettingWrap {
  projectSetting: Readonly<ProjectConfig>;
}