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

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

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

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

V
vben 已提交
16 17 18 19 20
  // color
  // TODO Theme color
  themeColor: primaryColor,

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

V
vben 已提交
23
  // Color Weakness Mode
陈文彬 已提交
24
  colorWeak: false,
25

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

陈文彬 已提交
29 30
  // content mode
  contentMode: ContentEnum.FULL,
V
vben 已提交
31

V
vben 已提交
32
  // Whether to display the logo
陈文彬 已提交
33 34
  showLogo: true,

V
vben 已提交
35
  // Whether to show footer
V
vben 已提交
36 37
  showFooter: true,

V
vben 已提交
38 39 40 41 42 43 44 45 46 47 48
  // locale setting
  locale: {
    // Locale
    lang: 'zh_CN',
    // Default locale
    fallback: 'zh_CN',
    // available Locales
    availableLocales: ['zh_CN', 'en'],
  },

  // Header configuration
陈文彬 已提交
49
  headerSetting: {
V
vben 已提交
50 51
    // header bg color
    bgColor: '#ffffff',
V
vben 已提交
52
    // Fixed at the top
陈文彬 已提交
53
    fixed: true,
V
vben 已提交
54
    // Whether to show top
陈文彬 已提交
55 56
    show: true,
    // theme
V
vben 已提交
57
    theme: ThemeEnum.LIGHT,
V
vben 已提交
58
    // Whether to enable the lock screen function
V
vben 已提交
59
    useLockPage: true,
V
vben 已提交
60
    // Whether to show the refresh button
陈文彬 已提交
61
    showRedo: true,
V
vben 已提交
62
    // Whether to show the full screen button
陈文彬 已提交
63
    showFullScreen: true,
V
vben 已提交
64
    // Whether to show the document button
陈文彬 已提交
65
    showDoc: true,
V
vben 已提交
66
    // Whether to show the notification button
C
chen-xt 已提交
67
    showNotice: true,
陈文彬 已提交
68
  },
V
vben 已提交
69

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

V
vben 已提交
109
  // Multi-label
陈文彬 已提交
110
  multiTabsSetting: {
V
vben 已提交
111
    // Turn on
陈文彬 已提交
112
    show: true,
V
vben 已提交
113
    // Turn on quick actions
陈文彬 已提交
114
    showQuick: true,
V
vben 已提交
115
    // Maximum number of tab cache
陈文彬 已提交
116 117
    max: 12,
  },
V
vben 已提交
118

V
vben 已提交
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136
  // 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
    openNProgress: true,
  },

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

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

V
vben 已提交
142
  // Whether to show breadcrumbs
陈文彬 已提交
143
  showBreadCrumb: true,
V
vben 已提交
144

V
vben 已提交
145
  // Whether to show the breadcrumb icon
Z
ZhaoBin 已提交
146
  showBreadCrumbIcon: false,
陈文彬 已提交
147

V
vben 已提交
148
  // Use error-handler-plugin
V
vben 已提交
149
  useErrorHandle: isProdMode(),
陈文彬 已提交
150

V
vben 已提交
151
  // Whether to open back to top
陈文彬 已提交
152 153
  useOpenBackTop: true,

V
vben 已提交
154
  //  Is it possible to embed iframe pages
陈文彬 已提交
155
  canEmbedIFramePage: true,
156

V
vben 已提交
157
  // Whether to delete unclosed messages and notify when switching the interface
158 159
  closeMessageOnSwitch: true,

V
vben 已提交
160 161
  // 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
162
  removeAllHttpPending: true,
陈文彬 已提交
163 164 165
};

export default setting;