Blame view

src/settings/projectSetting.ts 3.77 KB
陈文彬 authored
1
2
import type { ProjectConfig } from '/@/types/config';
3
import { MenuTypeEnum, MenuThemeEnum, MenuModeEnum, TriggerEnum } from '/@/enums/menuEnum';
4
import { ContentEnum, PermissionModeEnum, RouterTransitionEnum } from '/@/enums/appEnum';
5
import { primaryColor } from '../../build/config/lessModifyVars';
6
import { isProdMode } from '/@/utils/env';
7
8
// ! You need to clear the browser cache after the change
陈文彬 authored
9
const setting: ProjectConfig = {
10
11
12
13
14
15
16
17
18
19
  // color
  // TODO 主题色
  themeColor: primaryColor,

  // header bg color
  headerBgColor: '#ffffff',

  // sidebar menu bg color
  menuBgColor: '#273352',
陈文彬 authored
20
21
22
  // Whether to show the configuration button
  showSettingButton: true,
  // 权限模式
23
  permissionMode: PermissionModeEnum.ROLE,
陈文彬 authored
24
25
26
27
  // 网站灰色模式,用于可能悼念的日期开启
  grayMode: false,
  // 色弱模式
  colorWeak: false,
28
陈文彬 authored
29
30
31
32
33
34
35
  // 是否取消菜单,顶部,多标签页显示, 用于可能内嵌在别的系统内
  fullContent: false,
  // content mode
  contentMode: ContentEnum.FULL,
  // 是否显示logo
  showLogo: true,
36
  // 头部配置
陈文彬 authored
37
38
39
40
41
42
43
  headerSetting: {
    fixed: true,
    // 是否显示顶部
    show: true,
    // theme
    theme: MenuThemeEnum.LIGHT,
    // 开启锁屏功能
vben authored
44
    useLockPage: true,
陈文彬 authored
45
46
47
48
49
50
51
52
    // 显示刷新按钮
    showRedo: true,
    // 显示全屏按钮
    showFullScreen: true,
    // 显示文档按钮
    showDoc: true,
    //  是否显示github
    showGithub: true,
chen-xt authored
53
54
    // 显示消息中心按钮
    showNotice: true,
陈文彬 authored
55
56
57
58
59
  },
  // 菜单配置
  menuSetting: {
    // 菜单折叠
    collapsed: false,
60
61
    // 折叠菜单时候是否显示菜单名
    collapsedShowTitle: false,
陈文彬 authored
62
    // 是否可拖拽
63
    hasDrag: false,
64
    // 是否显示 没有dom
陈文彬 authored
65
    show: true,
66
    // 是否显示 有dom
vben authored
67
    hidden: true,
陈文彬 authored
68
69
70
    // 是否显示搜索框
    showSearch: true,
    // 菜单宽度
vben authored
71
    menuWidth: 210,
陈文彬 authored
72
73
74
75
76
77
78
79
80
    // 菜单模式
    mode: MenuModeEnum.INLINE,
    // 菜单类型
    type: MenuTypeEnum.SIDEBAR,
    // 菜单主题
    theme: MenuThemeEnum.DARK,
    // 分割菜单
    split: false,
    // 顶部菜单布局
81
    topMenuAlign: 'center',
vben authored
82
    // 折叠菜单时候隐藏搜索框
83
84
85
    collapsedShowSearch: false,
    // 折叠触发器的位置
    trigger: TriggerEnum.HEADER,
86
87
    // 开启手风琴模式,只显示一个菜单
    accordion: true,
陈文彬 authored
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
  },
  // 消息配置
  messageSetting: {
    // 弹窗title
    title: '操作提示',
    // 取消按钮的文子,
    cancelText: '取消',
    // 确认按钮的文字
    okText: '确定',
  },
  // 多标签
  multiTabsSetting: {
    // 开启
    show: true,
    // 开启快速操作
    showQuick: true,
    // 显示icon
105
    showIcon: false,
陈文彬 authored
106
107
108
109
110
111
    // 标签页缓存最大数量
    max: 12,
  },
  // 是否开启KeepAlive缓存  开发时候最好关闭,不然每次都需要清除缓存
  openKeepAlive: true,
vben authored
112
  // 自动锁屏时间,为0不锁屏。 单位分钟 默认0
陈文彬 authored
113
114
115
  lockTime: 0,
  // 显示面包屑
  showBreadCrumb: true,
116
117
  // 显示面包屑图标
  showBreadCrumbIcon: false,
陈文彬 authored
118
119

  // 使用error-handler-plugin
120
  useErrorHandle: isProdMode(),
陈文彬 authored
121
122
123

  //  开启页面切换动画
  openRouterTransition: true,
vben authored
124
陈文彬 authored
125
  // 路由切换动画
126
  routerTransition: RouterTransitionEnum.FADE_SIDE,
陈文彬 authored
127
128
129
130
131
132
133
134
135
136

  // 是否开启登录安全校验
  openLoginVerify: true,

  // 是否开启页面切换loading
  openPageLoading: true,

  // 是否开启回到顶部
  useOpenBackTop: true,
137
138
139
  // 开启顶部进度条
  openNProgress: isProdMode(),
陈文彬 authored
140
141
  //  是否可以嵌入iframe页面
  canEmbedIFramePage: true,
142
143
144
145
146
147
148

  // 切换界面的时候是否删除未关闭的message及notify
  closeMessageOnSwitch: true,

  // 切换界面的时候是否取消已经发送但是未响应的http请求。
  // 如果开启,想对单独接口覆盖。可以在单独接口设置
  removeAllHttpPending: true,
陈文彬 authored
149
150
151
};

export default setting;