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

3
import { MenuTypeEnum, MenuModeEnum, TriggerEnum, MixSidebarTriggerEnum } from '/@/enums/menuEnum';
V
vben 已提交
4
import { CacheTypeEnum } from '/@/enums/cacheEnum';
V
vben 已提交
5
import { ContentEnum, PermissionModeEnum, ThemeEnum, RouterTransitionEnum } from '/@/enums/appEnum';
V
vben 已提交
6
import { primaryColor, themeMode } from '../../build/config/themeConfig';
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
V
vben 已提交
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
  // color
  // TODO Theme color
  themeColor: primaryColor,
V
vben 已提交
23 24
  // TODO dark theme
  themeMode: themeMode,
V
vben 已提交
25 26

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

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

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

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

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

V
vben 已提交
41
  // Whether to show footer
42
  showFooter: false,
V
vben 已提交
43

V
vben 已提交
44 45
  // locale setting
  locale: {
V
vben 已提交
46
    show: true,
V
vben 已提交
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
陈文彬 已提交
56
  headerSetting: {
V
vben 已提交
57 58
    // header bg color
    bgColor: '#ffffff',
V
vben 已提交
59
    // Fixed at the top
陈文彬 已提交
60
    fixed: true,
V
vben 已提交
61
    // Whether to show top
陈文彬 已提交
62 63
    show: true,
    // theme
V
vben 已提交
64
    theme: ThemeEnum.LIGHT,
V
vben 已提交
65
    // Whether to enable the lock screen function
V
vben 已提交
66
    useLockPage: true,
V
vben 已提交
67

V
vben 已提交
68
    // Whether to show the full screen button
陈文彬 已提交
69
    showFullScreen: true,
V
vben 已提交
70
    // Whether to show the document button
陈文彬 已提交
71
    showDoc: true,
V
vben 已提交
72
    // Whether to show the notification button
C
chen-xt 已提交
73
    showNotice: true,
V
vben 已提交
74 75
    // Whether to display the menu search
    showSearch: true,
陈文彬 已提交
76
  },
V
vben 已提交
77

V
vben 已提交
78
  // Menu configuration
陈文彬 已提交
79
  menuSetting: {
V
vben 已提交
80
    // sidebar menu bg color
V
vben 已提交
81
    bgColor: '#001529',
V
vben 已提交
82
    //  Whether to fix the left menu
V
vben 已提交
83
    fixed: true,
V
vben 已提交
84
    // Menu collapse
陈文彬 已提交
85
    collapsed: false,
V
vben 已提交
86 87
    // Whether to display the menu name when folding the menu
    collapsedShowTitle: false,
V
vben 已提交
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,
V
vben 已提交
91
    // Whether to show no dom
陈文彬 已提交
92
    show: true,
V
vben 已提交
93
    // Whether to show dom
V
vben 已提交
94
    hidden: false,
V
vben 已提交
95
    // Menu width
V
vben 已提交
96
    menuWidth: 210,
V
vben 已提交
97
    // Menu mode
陈文彬 已提交
98
    mode: MenuModeEnum.INLINE,
V
vben 已提交
99
    // Menu type
陈文彬 已提交
100
    type: MenuTypeEnum.SIDEBAR,
V
vben 已提交
101
    // Menu theme
V
vben 已提交
102
    theme: ThemeEnum.DARK,
V
vben 已提交
103
    // Split menu
陈文彬 已提交
104
    split: false,
V
vben 已提交
105
    // Top menu layout
V
vben 已提交
106
    topMenuAlign: 'center',
V
vben 已提交
107
    // Fold trigger position
V
vben 已提交
108
    trigger: TriggerEnum.HEADER,
V
vben 已提交
109
    // Turn on accordion mode, only show a menu
V
vben 已提交
110
    accordion: true,
V
vben 已提交
111 112
    // Switch page to close menu
    closeMixSidebarOnChange: false,
V
vben 已提交
113
    // Module opening method ‘click’ |'hover'
114
    mixSideTrigger: MixSidebarTriggerEnum.CLICK,
115 116
    // Fixed expanded menu
    mixSideFixed: false,
陈文彬 已提交
117
  },
V
vben 已提交
118

V
vben 已提交
119
  // Multi-label
陈文彬 已提交
120
  multiTabsSetting: {
V
vben 已提交
121
    // Turn on
陈文彬 已提交
122
    show: true,
V
vben 已提交
123 124
    // Is it possible to drag and drop sorting tabs
    canDrag: true,
V
vben 已提交
125
    // Turn on quick actions
陈文彬 已提交
126
    showQuick: true,
V
vben 已提交
127 128 129

    // Whether to show the refresh button
    showRedo: true,
V
vben 已提交
130 131
    // Whether to show the collapse button
    showFold: true,
陈文彬 已提交
132
  },
V
vben 已提交
133

V
vben 已提交
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
V
vben 已提交
148
    openNProgress: false,
V
vben 已提交
149 150 151
  },

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

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

V
vben 已提交
157
  // Whether to show breadcrumbs
陈文彬 已提交
158
  showBreadCrumb: true,
V
vben 已提交
159

V
vben 已提交
160
  // Whether to show the breadcrumb icon
Z
ZhaoBin 已提交
161
  showBreadCrumbIcon: false,
陈文彬 已提交
162

V
vben 已提交
163
  // Use error-handler-plugin
V
vben 已提交
164
  useErrorHandle: isProdMode(),
陈文彬 已提交
165

V
vben 已提交
166
  // Whether to open back to top
陈文彬 已提交
167 168
  useOpenBackTop: true,

V
vben 已提交
169
  //  Is it possible to embed iframe pages
陈文彬 已提交
170
  canEmbedIFramePage: true,
171

V
vben 已提交
172
  // Whether to delete unclosed messages and notify when switching the interface
173 174
  closeMessageOnSwitch: true,

V
vben 已提交
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
V
vben 已提交
177
  removeAllHttpPending: false,
陈文彬 已提交
178 179 180
};

export default setting;