Blame view

src/settings/projectSetting.ts 4.82 KB
陈文彬 authored
1
2
import type { ProjectConfig } from '/@/types/config';
3
import { MenuTypeEnum, MenuModeEnum, TriggerEnum, MixSidebarTriggerEnum } from '/@/enums/menuEnum';
4
import { CacheTypeEnum } from '/@/enums/cacheEnum';
vben authored
5
import { ContentEnum, PermissionModeEnum, ThemeEnum, RouterTransitionEnum } from '/@/enums/appEnum';
vben authored
6
import { primaryColor, themeMode } from '../../build/config/themeConfig';
7
import { isProdMode } from '/@/utils/env';
8
9
// ! You need to clear the browser cache after the change
陈文彬 authored
10
11
12
const setting: ProjectConfig = {
  // Whether to show the configuration button
  showSettingButton: true,
vben authored
13
vben authored
14
  // Permission mode
15
  permissionMode: PermissionModeEnum.ROLE,
vben authored
16
17
18
19
  // Permission-related cache is stored in sessionStorage or localStorage
  permissionCacheType: CacheTypeEnum.LOCAL,
vben authored
20
21
22
  // color
  // TODO Theme color
  themeColor: primaryColor,
vben authored
23
24
  // TODO dark theme
  themeMode: themeMode,
vben authored
25
26

  // Website gray mode, open for possible mourning dates
陈文彬 authored
27
  grayMode: false,
vben authored
28
vben authored
29
  // Color Weakness Mode
陈文彬 authored
30
  colorWeak: false,
31
vben authored
32
  // Whether to cancel the menu, the top, the multi-tab page display, for possible embedded in other systems
陈文彬 authored
33
  fullContent: false,
vben authored
34
陈文彬 authored
35
36
  // content mode
  contentMode: ContentEnum.FULL,
vben authored
37
vben authored
38
  // Whether to display the logo
陈文彬 authored
39
40
  showLogo: true,
vben authored
41
  // Whether to show footer
42
  showFooter: false,
vben authored
43
vben authored
44
45
  // locale setting
  locale: {
vben authored
46
    show: true,
vben authored
47
48
49
50
51
52
53
54
55
    // Locale
    lang: 'zh_CN',
    // Default locale
    fallback: 'zh_CN',
    // available Locales
    availableLocales: ['zh_CN', 'en'],
  },

  // Header configuration
陈文彬 authored
56
  headerSetting: {
vben authored
57
58
    // header bg color
    bgColor: '#ffffff',
vben authored
59
    // Fixed at the top
陈文彬 authored
60
    fixed: true,
vben authored
61
    // Whether to show top
陈文彬 authored
62
63
    show: true,
    // theme
vben authored
64
    theme: ThemeEnum.LIGHT,
vben authored
65
    // Whether to enable the lock screen function
vben authored
66
    useLockPage: true,
vben authored
67
vben authored
68
    // Whether to show the full screen button
陈文彬 authored
69
    showFullScreen: true,
vben authored
70
    // Whether to show the document button
陈文彬 authored
71
    showDoc: true,
vben authored
72
    // Whether to show the notification button
chen-xt authored
73
    showNotice: true,
vben authored
74
75
    // Whether to display the menu search
    showSearch: true,
陈文彬 authored
76
  },
vben authored
77
vben authored
78
  // Menu configuration
陈文彬 authored
79
  menuSetting: {
vben authored
80
    // sidebar menu bg color
vben authored
81
    bgColor: '#001529',
vben authored
82
    //  Whether to fix the left menu
vben authored
83
    fixed: true,
vben authored
84
    // Menu collapse
陈文彬 authored
85
    collapsed: false,
vben authored
86
87
    // Whether to display the menu name when folding the menu
    collapsedShowTitle: false,
vben authored
88
89
    // Whether it can be dragged
    // Only limited to the opening of the left menu, the mouse has a drag bar on the right side of the menu
90
    canDrag: false,
vben authored
91
    // Whether to show no dom
陈文彬 authored
92
    show: true,
vben authored
93
    // Whether to show dom
94
    hidden: false,
vben authored
95
    // Menu width
vben authored
96
    menuWidth: 210,
vben authored
97
    // Menu mode
陈文彬 authored
98
    mode: MenuModeEnum.INLINE,
vben authored
99
    // Menu type
陈文彬 authored
100
    type: MenuTypeEnum.SIDEBAR,
vben authored
101
    // Menu theme
vben authored
102
    theme: ThemeEnum.DARK,
vben authored
103
    // Split menu
陈文彬 authored
104
    split: false,
vben authored
105
    // Top menu layout
106
    topMenuAlign: 'center',
vben authored
107
    // Fold trigger position
108
    trigger: TriggerEnum.HEADER,
vben authored
109
    // Turn on accordion mode, only show a menu
110
    accordion: true,
111
112
    // Switch page to close menu
    closeMixSidebarOnChange: false,
113
    // Module opening method ‘click’ |'hover'
114
    mixSideTrigger: MixSidebarTriggerEnum.CLICK,
115
116
    // Fixed expanded menu
    mixSideFixed: false,
陈文彬 authored
117
  },
vben authored
118
vben authored
119
  // Multi-label
陈文彬 authored
120
  multiTabsSetting: {
vben authored
121
    // Turn on
陈文彬 authored
122
    show: true,
123
124
    // Is it possible to drag and drop sorting tabs
    canDrag: true,
vben authored
125
    // Turn on quick actions
陈文彬 authored
126
    showQuick: true,
vben authored
127
128
129

    // Whether to show the refresh button
    showRedo: true,
vben authored
130
131
    // Whether to show the collapse button
    showFold: true,
陈文彬 authored
132
  },
vben authored
133
vben authored
134
135
136
137
138
139
140
141
142
143
144
145
146
147
  // Transition Setting
  transitionSetting: {
    //  Whether to open the page switching animation
    // The disabled state will also disable pageLoadinng
    enable: true,

    // Route basic switching animation
    basicTransition: RouterTransitionEnum.FADE_SIDE,

    // Whether to open page switching loading
    // Only open when enable=true
    openPageLoading: true,

    // Whether to open the top progress bar
148
    openNProgress: false,
vben authored
149
150
151
  },

  // Whether to enable KeepAlive cache is best to close during development, otherwise the cache needs to be cleared every time
陈文彬 authored
152
153
  openKeepAlive: true,
vben authored
154
  // Automatic screen lock time, 0 does not lock the screen. Unit minute default 0
陈文彬 authored
155
  lockTime: 0,
vben authored
156
vben authored
157
  // Whether to show breadcrumbs
陈文彬 authored
158
  showBreadCrumb: true,
vben authored
159
vben authored
160
  // Whether to show the breadcrumb icon
161
  showBreadCrumbIcon: false,
陈文彬 authored
162
vben authored
163
  // Use error-handler-plugin
164
  useErrorHandle: isProdMode(),
陈文彬 authored
165
vben authored
166
  // Whether to open back to top
陈文彬 authored
167
168
  useOpenBackTop: true,
vben authored
169
  //  Is it possible to embed iframe pages
陈文彬 authored
170
  canEmbedIFramePage: true,
171
vben authored
172
  // Whether to delete unclosed messages and notify when switching the interface
173
174
  closeMessageOnSwitch: true,
vben authored
175
176
  // Whether to cancel the http request that has been sent but not responded when switching the interface.
  // If it is enabled, I want to overwrite a single interface. Can be set in a separate interface
vben authored
177
  removeAllHttpPending: false,
陈文彬 authored
178
179
180
};

export default setting;