Blame view

src/settings/projectSetting.ts 4.77 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';
6
import { primaryColor } from '../../build/config/lessModifyVars';
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
23
24
  // color
  // TODO Theme color
  themeColor: primaryColor,

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

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

    // Whether to show the refresh button
    showRedo: true,
vben authored
128
129
    // Whether to show the collapse button
    showFold: true,
陈文彬 authored
130
  },
vben authored
131
vben authored
132
133
134
135
136
137
138
139
140
141
142
143
144
145
  // 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
146
    openNProgress: false,
vben authored
147
148
149
  },

  // Whether to enable KeepAlive cache is best to close during development, otherwise the cache needs to be cleared every time
陈文彬 authored
150
151
  openKeepAlive: true,
vben authored
152
  // Automatic screen lock time, 0 does not lock the screen. Unit minute default 0
陈文彬 authored
153
  lockTime: 0,
vben authored
154
vben authored
155
  // Whether to show breadcrumbs
陈文彬 authored
156
  showBreadCrumb: true,
vben authored
157
vben authored
158
  // Whether to show the breadcrumb icon
159
  showBreadCrumbIcon: false,
陈文彬 authored
160
vben authored
161
  // Use error-handler-plugin
162
  useErrorHandle: isProdMode(),
陈文彬 authored
163
vben authored
164
  // Whether to open back to top
陈文彬 authored
165
166
  useOpenBackTop: true,
vben authored
167
  //  Is it possible to embed iframe pages
陈文彬 authored
168
  canEmbedIFramePage: true,
169
vben authored
170
  // Whether to delete unclosed messages and notify when switching the interface
171
172
  closeMessageOnSwitch: true,
vben authored
173
174
  // 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
175
  removeAllHttpPending: true,
陈文彬 authored
176
177
178
};

export default setting;