projectSetting.ts 4.5 KB
Newer Older
陈文彬 已提交
1 2
import type { ProjectConfig } from '/@/types/config';

V
vben 已提交
3
import { MenuTypeEnum, MenuModeEnum, TriggerEnum } from '/@/enums/menuEnum';
V
vben 已提交
4
import { CacheTypeEnum } from '/@/enums/cacheEnum';
V
vben 已提交
5
import { ContentEnum, PermissionModeEnum, ThemeEnum, RouterTransitionEnum } from '/@/enums/appEnum';
6
import { primaryColor } from '../../build/config/lessModifyVars';
7
import { isProdMode } from '/@/utils/env';
V
vben 已提交
8

V
vben 已提交
9
// ! You need to clear the browser cache after the change
陈文彬 已提交
10 11 12
const setting: ProjectConfig = {
  // Whether to show the configuration button
  showSettingButton: true,
V
vben 已提交
13

V
vben 已提交
14
  // Permission mode
15
  permissionMode: PermissionModeEnum.ROLE,
V
vben 已提交
16

V
vben 已提交
17 18 19
  // Permission-related cache is stored in sessionStorage or localStorage
  permissionCacheType: CacheTypeEnum.LOCAL,

V
vben 已提交
20 21 22 23 24
  // color
  // TODO Theme color
  themeColor: primaryColor,

  // Website gray mode, open for possible mourning dates
陈文彬 已提交
25
  grayMode: false,
V
vben 已提交
26

V
vben 已提交
27
  // Color Weakness Mode
陈文彬 已提交
28
  colorWeak: false,
29

V
vben 已提交
30
  // Whether to cancel the menu, the top, the multi-tab page display, for possible embedded in other systems
陈文彬 已提交
31
  fullContent: false,
V
vben 已提交
32

陈文彬 已提交
33 34
  // content mode
  contentMode: ContentEnum.FULL,
V
vben 已提交
35

V
vben 已提交
36
  // Whether to display the logo
陈文彬 已提交
37 38
  showLogo: true,

V
vben 已提交
39
  // Whether to show footer
V
vben 已提交
40 41
  showFooter: true,

V
vben 已提交
42 43
  // locale setting
  locale: {
V
vben 已提交
44
    show: true,
V
vben 已提交
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
陈文彬 已提交
54
  headerSetting: {
V
vben 已提交
55 56
    // header bg color
    bgColor: '#ffffff',
V
vben 已提交
57
    // Fixed at the top
陈文彬 已提交
58
    fixed: true,
V
vben 已提交
59
    // Whether to show top
陈文彬 已提交
60 61
    show: true,
    // theme
V
vben 已提交
62
    theme: ThemeEnum.LIGHT,
V
vben 已提交
63
    // Whether to enable the lock screen function
V
vben 已提交
64
    useLockPage: true,
V
vben 已提交
65
    // Whether to show the refresh button
陈文彬 已提交
66
    showRedo: true,
V
vben 已提交
67
    // Whether to show the full screen button
陈文彬 已提交
68
    showFullScreen: true,
V
vben 已提交
69
    // Whether to show the document button
陈文彬 已提交
70
    showDoc: true,
V
vben 已提交
71
    // Whether to show the notification button
C
chen-xt 已提交
72
    showNotice: true,
陈文彬 已提交
73
  },
V
vben 已提交
74

V
vben 已提交
75
  // Menu configuration
陈文彬 已提交
76
  menuSetting: {
V
vben 已提交
77 78
    // sidebar menu bg color
    bgColor: '#273352',
V
vben 已提交
79
    //  Whether to fix the left menu
V
vben 已提交
80
    fixed: true,
V
vben 已提交
81
    // Menu collapse
陈文彬 已提交
82
    collapsed: false,
V
vben 已提交
83
    // Whether to display the menu name when folding the menu
V
vben 已提交
84
    collapsedShowTitle: false,
V
vben 已提交
85 86
    // 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
V
vben 已提交
87
    canDrag: false,
V
vben 已提交
88
    // Whether to show no dom
陈文彬 已提交
89
    show: true,
V
vben 已提交
90
    // Whether to show dom
V
vben 已提交
91
    hidden: true,
V
vben 已提交
92
    // Whether to show search box
陈文彬 已提交
93
    showSearch: true,
V
vben 已提交
94
    // Menu width
V
vben 已提交
95
    menuWidth: 210,
V
vben 已提交
96
    // Menu mode
陈文彬 已提交
97
    mode: MenuModeEnum.INLINE,
V
vben 已提交
98
    // Menu type
陈文彬 已提交
99
    type: MenuTypeEnum.SIDEBAR,
V
vben 已提交
100
    // Menu theme
V
vben 已提交
101
    theme: ThemeEnum.DARK,
V
vben 已提交
102
    // Split menu
陈文彬 已提交
103
    split: false,
V
vben 已提交
104
    // Top menu layout
V
vben 已提交
105
    topMenuAlign: 'center',
V
vben 已提交
106
    // Hide the search box when the menu is collapsed
V
vben 已提交
107
    collapsedShowSearch: false,
V
vben 已提交
108
    // Fold trigger position
V
vben 已提交
109
    trigger: TriggerEnum.HEADER,
V
vben 已提交
110
    // Turn on accordion mode, only show a menu
V
vben 已提交
111
    accordion: true,
陈文彬 已提交
112
  },
V
vben 已提交
113

V
vben 已提交
114
  // Multi-label
陈文彬 已提交
115
  multiTabsSetting: {
V
vben 已提交
116
    // Turn on
陈文彬 已提交
117
    show: true,
V
vben 已提交
118 119
    // Is it possible to drag and drop sorting tabs
    canDrag: true,
V
vben 已提交
120
    // Turn on quick actions
陈文彬 已提交
121 122
    showQuick: true,
  },
V
vben 已提交
123

V
vben 已提交
124 125 126 127 128 129 130 131 132 133 134 135 136 137
  // 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
V
vben 已提交
138
    openNProgress: false,
V
vben 已提交
139 140 141
  },

  // Whether to enable KeepAlive cache is best to close during development, otherwise the cache needs to be cleared every time
陈文彬 已提交
142 143
  openKeepAlive: true,

V
vben 已提交
144
  // Automatic screen lock time, 0 does not lock the screen. Unit minute default 0
陈文彬 已提交
145
  lockTime: 0,
V
vben 已提交
146

V
vben 已提交
147
  // Whether to show breadcrumbs
陈文彬 已提交
148
  showBreadCrumb: true,
V
vben 已提交
149

V
vben 已提交
150
  // Whether to show the breadcrumb icon
Z
ZhaoBin 已提交
151
  showBreadCrumbIcon: false,
陈文彬 已提交
152

V
vben 已提交
153
  // Use error-handler-plugin
V
vben 已提交
154
  useErrorHandle: isProdMode(),
陈文彬 已提交
155

V
vben 已提交
156
  // Whether to open back to top
陈文彬 已提交
157 158
  useOpenBackTop: true,

V
vben 已提交
159
  //  Is it possible to embed iframe pages
陈文彬 已提交
160
  canEmbedIFramePage: true,
161

V
vben 已提交
162
  // Whether to delete unclosed messages and notify when switching the interface
163 164
  closeMessageOnSwitch: true,

V
vben 已提交
165 166
  // 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
167
  removeAllHttpPending: true,
陈文彬 已提交
168 169 170
};

export default setting;