vue-vben-admin/types/config.d.ts

162 lines
4.3 KiB
TypeScript
Raw Permalink Normal View History

import { MenuTypeEnum, MenuModeEnum, TriggerEnum, MixSidebarTriggerEnum } from '/@/enums/menuEnum';
import {
ContentEnum,
PermissionModeEnum,
ThemeEnum,
RouterTransitionEnum,
SettingButtonPositionEnum,
SessionTimeoutProcessingEnum,
} from '/@/enums/appEnum';
2021-02-25 20:17:08 +08:00
2020-11-25 21:26:10 +08:00
import { CacheTypeEnum } from '/@/enums/cacheEnum';
2020-11-23 00:35:15 +08:00
export type LocaleType = 'zh_CN' | 'en' | 'ru' | 'ja' | 'ko';
2020-09-28 20:19:10 +08:00
export interface MenuSetting {
2020-11-24 22:59:29 +08:00
bgColor: string;
fixed: boolean;
2020-09-28 20:19:10 +08:00
collapsed: boolean;
2020-11-25 22:28:58 +08:00
canDrag: boolean;
2020-09-28 20:19:10 +08:00
show: boolean;
2020-11-06 22:41:00 +08:00
hidden: boolean;
2020-09-28 20:19:10 +08:00
split: boolean;
menuWidth: number;
mode: MenuModeEnum;
type: MenuTypeEnum;
2020-11-18 22:41:59 +08:00
theme: ThemeEnum;
2020-09-28 20:19:10 +08:00
topMenuAlign: 'start' | 'center' | 'end';
2020-11-06 22:41:00 +08:00
trigger: TriggerEnum;
2020-11-10 22:45:39 +08:00
accordion: boolean;
2020-12-21 23:38:16 +08:00
closeMixSidebarOnChange: boolean;
2020-12-22 23:18:50 +08:00
collapsedShowTitle: boolean;
mixSideTrigger: MixSidebarTriggerEnum;
mixSideFixed: boolean;
2020-09-28 20:19:10 +08:00
}
export interface MultiTabsSetting {
2021-04-10 21:18:35 +08:00
cache: boolean;
2020-09-28 20:19:10 +08:00
show: boolean;
showQuick: boolean;
2020-11-25 22:28:58 +08:00
canDrag: boolean;
2020-12-15 00:13:23 +08:00
showRedo: boolean;
2021-01-06 20:10:16 +08:00
showFold: boolean;
2020-09-28 20:19:10 +08:00
}
export interface HeaderSetting {
2020-11-24 22:59:29 +08:00
bgColor: string;
2020-09-28 20:19:10 +08:00
fixed: boolean;
show: boolean;
2020-11-18 22:41:59 +08:00
theme: ThemeEnum;
2021-02-25 20:17:08 +08:00
// Turn on full screen
2020-09-28 20:19:10 +08:00
showFullScreen: boolean;
2021-02-25 20:17:08 +08:00
// Whether to show the lock screen
2020-09-28 20:19:10 +08:00
useLockPage: boolean;
2021-02-25 20:17:08 +08:00
// Show document button
2020-09-28 20:19:10 +08:00
showDoc: boolean;
2021-02-25 20:17:08 +08:00
// Show message center button
2020-10-21 21:15:06 +08:00
showNotice: boolean;
2020-12-10 23:58:11 +08:00
showSearch: boolean;
2020-09-28 20:19:10 +08:00
}
2020-11-23 00:35:15 +08:00
export interface LocaleSetting {
showPicker: boolean;
2020-11-23 00:35:15 +08:00
// Current language
locale: LocaleType;
2020-11-23 00:35:15 +08:00
// default language
fallback: LocaleType;
// available Locales
availableLocales: LocaleType[];
}
2020-11-25 00:43:33 +08:00
export interface TransitionSetting {
// Whether to open the page switching animation
enable: boolean;
// Route basic switching animation
basicTransition: RouterTransitionEnum;
// Whether to open page switching loading
openPageLoading: boolean;
// Whether to open the top progress bar
openNProgress: boolean;
}
2020-09-28 20:19:10 +08:00
export interface ProjectConfig {
2021-02-25 20:17:08 +08:00
// Storage location of permission related information
2020-11-25 21:26:10 +08:00
permissionCacheType: CacheTypeEnum;
2021-02-25 20:17:08 +08:00
// Whether to show the configuration button
2020-09-28 20:19:10 +08:00
showSettingButton: boolean;
2021-04-07 23:14:51 +08:00
// Whether to show the theme switch button
showDarkModeToggle: boolean;
2021-02-25 20:17:08 +08:00
// Configure where the button is displayed
settingButtonPosition: SettingButtonPositionEnum;
2021-02-25 20:17:08 +08:00
// Permission mode
2020-09-28 20:19:10 +08:00
permissionMode: PermissionModeEnum;
// Session timeout processing
sessionTimeoutProcessing: SessionTimeoutProcessingEnum;
2021-02-25 20:17:08 +08:00
// Website gray mode, open for possible mourning dates
2020-09-28 20:19:10 +08:00
grayMode: boolean;
2021-02-25 20:17:08 +08:00
// Whether to turn on the color weak mode
2020-09-28 20:19:10 +08:00
colorWeak: boolean;
2021-02-25 20:17:08 +08:00
// Theme color
2020-09-28 20:19:10 +08:00
themeColor: string;
2021-02-25 20:17:08 +08:00
// The main interface is displayed in full screen, the menu is not displayed, and the top
2020-09-28 20:19:10 +08:00
fullContent: boolean;
2021-02-25 20:17:08 +08:00
// content width
2020-09-28 20:19:10 +08:00
contentMode: ContentEnum;
2021-02-25 20:17:08 +08:00
// Whether to display the logo
2020-09-28 20:19:10 +08:00
showLogo: boolean;
2021-02-25 20:17:08 +08:00
// Whether to show the global footer
2020-11-24 22:59:29 +08:00
showFooter: boolean;
2020-09-28 20:19:10 +08:00
// menuType: MenuTypeEnum;
2021-02-25 20:17:08 +08:00
headerSetting: HeaderSetting;
// menuSetting
2020-09-28 20:19:10 +08:00
menuSetting: MenuSetting;
2021-02-25 20:17:08 +08:00
// Multi-tab settings
2020-09-28 20:19:10 +08:00
multiTabsSetting: MultiTabsSetting;
2021-02-25 20:17:08 +08:00
// Animation configuration
2020-11-25 00:43:33 +08:00
transitionSetting: TransitionSetting;
2021-02-25 20:17:08 +08:00
// pageLayout whether to enable keep-alive
2020-09-28 20:19:10 +08:00
openKeepAlive: boolean;
2021-02-25 20:17:08 +08:00
// Lock screen time
2020-09-28 20:19:10 +08:00
lockTime: number;
2021-02-25 20:17:08 +08:00
// Show breadcrumbs
2020-09-28 20:19:10 +08:00
showBreadCrumb: boolean;
2021-02-25 20:17:08 +08:00
// Show breadcrumb icon
showBreadCrumbIcon: boolean;
2021-02-25 20:17:08 +08:00
// Use error-handler-plugin
2020-09-28 20:19:10 +08:00
useErrorHandle: boolean;
2021-02-25 20:17:08 +08:00
// Whether to open back to top
2020-09-28 20:19:10 +08:00
useOpenBackTop: boolean;
2021-02-25 20:17:08 +08:00
// Is it possible to embed iframe pages
2020-09-28 20:19:10 +08:00
canEmbedIFramePage: boolean;
2021-02-25 20:17:08 +08:00
// Whether to delete unclosed messages and notify when switching the interface
closeMessageOnSwitch: boolean;
2021-02-25 20:17:08 +08:00
// Whether to cancel the http request that has been sent but not responded when switching the interface.
removeAllHttpPending: boolean;
2020-09-28 20:19:10 +08:00
}
export interface GlobConfig {
2021-02-25 20:17:08 +08:00
// Site title
2020-09-28 20:19:10 +08:00
title: string;
2021-02-25 20:17:08 +08:00
// Service interface url
2020-09-28 20:19:10 +08:00
apiUrl: string;
2021-02-25 20:17:08 +08:00
// Upload url
2020-12-08 22:18:20 +08:00
uploadUrl?: string;
2021-02-25 20:17:08 +08:00
// Service interface url prefix
2020-09-28 20:19:10 +08:00
urlPrefix?: string;
2021-02-25 20:17:08 +08:00
// Project abbreviation
2020-09-28 20:19:10 +08:00
shortName: string;
}
export interface GlobEnvConfig {
2021-02-25 20:17:08 +08:00
// Site title
2020-10-10 21:28:43 +08:00
VITE_GLOB_APP_TITLE: string;
2021-02-25 20:17:08 +08:00
// Service interface url
2020-10-10 21:28:43 +08:00
VITE_GLOB_API_URL: string;
2021-02-25 20:17:08 +08:00
// Service interface url prefix
2020-10-10 21:28:43 +08:00
VITE_GLOB_API_URL_PREFIX?: string;
2021-02-25 20:17:08 +08:00
// Project abbreviation
2020-10-10 21:28:43 +08:00
VITE_GLOB_APP_SHORT_NAME: string;
2021-02-25 20:17:08 +08:00
// Upload url
2020-12-08 22:18:20 +08:00
VITE_GLOB_UPLOAD_URL?: string;
2020-09-28 20:19:10 +08:00
}