gohttpdUi/src/config/app.ts

83 lines
2.5 KiB
TypeScript
Raw Normal View History

2022-01-05 17:02:25 +08:00
import { useCache } from '@/hooks/web/useCache'
const { wsCache } = useCache()
2022-01-21 16:17:40 +08:00
export type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu'
2022-01-05 17:02:25 +08:00
export interface AppState {
2022-01-18 16:22:47 +08:00
breadcrumb: boolean
breadcrumbIcon: boolean
2022-01-12 16:44:57 +08:00
collapse: boolean
2022-01-18 16:22:47 +08:00
hamburger: boolean
screenfull: boolean
size: boolean
locale: boolean
tagsView: boolean
logo: boolean
2022-01-19 16:29:35 +08:00
fixedHeader: boolean
2022-01-18 16:22:47 +08:00
greyMode: boolean
pageLoading: boolean
2022-01-05 17:02:25 +08:00
layout: LayoutType
title: string
userInfo: string
isDark: boolean
2022-01-18 16:22:47 +08:00
currentSize: ElememtPlusSzie
2022-01-05 17:02:25 +08:00
sizeMap: ElememtPlusSzie[]
mobile: boolean
2022-01-18 16:22:47 +08:00
theme: Recordable
2022-01-05 17:02:25 +08:00
}
export const appModules: AppState = {
userInfo: 'userInfo', // 登录信息存储字段-建议每个项目换一个字段,避免与其他项目冲突
sizeMap: ['default', 'large', 'small'],
mobile: false, // 是否是移动端
title: 'ButterflyAdmin', // 标题
pageLoading: false, // 路由跳转loading
2022-01-18 16:22:47 +08:00
breadcrumb: true, // 面包屑
breadcrumbIcon: true, // 面包屑图标
collapse: false, // 折叠菜单
hamburger: true, // 折叠图标
screenfull: true, // 全屏图标
size: true, // 尺寸图标
locale: true, // 多语言图标
tagsView: true, // 标签页
logo: true, // logo
2022-01-19 16:29:35 +08:00
fixedHeader: true, // 固定toolheader
2022-01-18 16:22:47 +08:00
greyMode: false, // 是否开始灰色模式,用于特殊悼念日
2022-01-19 16:29:35 +08:00
layout: wsCache.get('layout') || 'classic', // layout布局
2022-01-05 17:02:25 +08:00
isDark: wsCache.get('isDark') || false, // 是否是暗黑模式
2022-01-18 16:22:47 +08:00
currentSize: wsCache.get('default') || 'default', // 组件尺寸
theme: wsCache.get('theme') || {
// 主题色
elColorPrimary: '#409eff',
// 左侧菜单边框颜色
leftMenuBorderColor: 'inherit',
// 左侧菜单背景颜色
leftMenuBgColor: '#001529',
// 左侧菜单浅色背景颜色
leftMenuBgLightColor: '#0f2438',
// 左侧菜单选中背景颜色
leftMenuBgActiveColor: 'var(--el-color-primary)',
// 左侧菜单收起选中背景颜色
leftMenuCollapseBgActiveColor: 'var(--el-color-primary)',
// 左侧菜单字体颜色
leftMenuTextColor: '#bfcbd9',
// 左侧菜单选中字体颜色
leftMenuTextActiveColor: '#fff',
// logo字体颜色
logoTitleTextColor: '#fff',
// logo边框颜色
2022-01-19 16:29:35 +08:00
logoBorderColor: 'inherit',
// 头部背景颜色
topHeaderBgColor: '#fff',
// 头部字体颜色
topHeaderTextColor: 'inherit',
// 头部悬停颜色
2022-01-21 16:17:40 +08:00
topHeaderHoverColor: '#f6f6f6',
// 头部边框颜色
topToolBorderColor: '#eee'
2022-01-18 16:22:47 +08:00
}
2022-01-05 17:02:25 +08:00
}