app.ts 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. import { useCache } from '@/hooks/web/useCache'
  2. const { wsCache } = useCache()
  3. export type LayoutType = 'classic' | 'topLeft' | 'top' | 'cutMenu'
  4. export interface AppState {
  5. breadcrumb: boolean
  6. breadcrumbIcon: boolean
  7. collapse: boolean
  8. hamburger: boolean
  9. screenfull: boolean
  10. size: boolean
  11. locale: boolean
  12. tagsView: boolean
  13. logo: boolean
  14. fixedHeader: boolean
  15. fixedMenu: boolean
  16. greyMode: boolean
  17. layout: LayoutType
  18. title: string
  19. userInfo: string
  20. isDark: boolean
  21. currentSize: ElememtPlusSzie
  22. sizeMap: ElememtPlusSzie[]
  23. mobile: boolean
  24. theme: Recordable
  25. }
  26. export const appModules: AppState = {
  27. breadcrumb: true, // 面包屑
  28. breadcrumbIcon: true, // 面包屑图标
  29. collapse: false, // 折叠菜单
  30. hamburger: true, // 折叠图标
  31. screenfull: true, // 全屏图标
  32. size: true, // 尺寸图标
  33. locale: true, // 多语言图标
  34. tagsView: true, // 标签页
  35. logo: true, // logo
  36. fixedHeader: true, // 固定toolheader
  37. fixedMenu: false, // 固定切割菜单
  38. greyMode: false, // 是否开始灰色模式,用于特殊悼念日
  39. layout: wsCache.get('layout') || 'classic', // layout布局
  40. title: 'ButterflyAdmin', // 标题
  41. userInfo: 'userInfo', // 登录信息存储字段-建议每个项目换一个字段,避免与其他项目冲突
  42. isDark: wsCache.get('isDark') || false, // 是否是暗黑模式
  43. currentSize: wsCache.get('default') || 'default', // 组件尺寸
  44. sizeMap: ['default', 'large', 'small'],
  45. mobile: false, // 是否是移动端
  46. theme: wsCache.get('theme') || {
  47. // 主题色
  48. elColorPrimary: '#409eff',
  49. // 左侧菜单边框颜色
  50. leftMenuBorderColor: 'inherit',
  51. // 左侧菜单背景颜色
  52. leftMenuBgColor: '#001529',
  53. // 左侧菜单浅色背景颜色
  54. leftMenuBgLightColor: '#0f2438',
  55. // 左侧菜单选中背景颜色
  56. leftMenuBgActiveColor: 'var(--el-color-primary)',
  57. // 左侧菜单收起选中背景颜色
  58. leftMenuCollapseBgActiveColor: 'var(--el-color-primary)',
  59. // 左侧菜单字体颜色
  60. leftMenuTextColor: '#bfcbd9',
  61. // 左侧菜单选中字体颜色
  62. leftMenuTextActiveColor: '#fff',
  63. // logo字体颜色
  64. logoTitleTextColor: '#fff',
  65. // logo边框颜色
  66. logoBorderColor: 'inherit',
  67. // 头部背景颜色
  68. topHeaderBgColor: '#fff',
  69. // 头部字体颜色
  70. topHeaderTextColor: 'inherit',
  71. // 头部悬停颜色
  72. topHeaderHoverColor: '#f6f6f6',
  73. // 头部边框颜色
  74. topToolBorderColor: '#eee'
  75. }
  76. }