初始化
This commit is contained in:
61
saiadmin-artd/src/config/assets/images.ts
Normal file
61
saiadmin-artd/src/config/assets/images.ts
Normal file
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* 配置图片资源
|
||||
*
|
||||
* 统一管理设置中心使用的预览图片资源。
|
||||
* 包含主题样式、菜单布局、菜单风格的预览图。
|
||||
*
|
||||
* ## 图片分类
|
||||
*
|
||||
* - themeStyles: 系统主题预览图(亮色/暗色/自动)
|
||||
* - menuLayouts: 菜单布局预览图(左侧/顶部/混合/双栏)
|
||||
* - menuStyles: 菜单风格预览图(设计/暗色/亮色)
|
||||
*
|
||||
* @module config/assets/images
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
import lightTheme from '@imgs/settings/theme_styles/light.png'
|
||||
import darkTheme from '@imgs/settings/theme_styles/dark.png'
|
||||
import systemTheme from '@imgs/settings/theme_styles/system.png'
|
||||
import verticalLayout from '@imgs/settings/menu_layouts/vertical.png'
|
||||
import horizontalLayout from '@imgs/settings/menu_layouts/horizontal.png'
|
||||
import mixedLayout from '@imgs/settings/menu_layouts/mixed.png'
|
||||
import dualColumnLayout from '@imgs/settings/menu_layouts/dual_column.png'
|
||||
import designStyle from '@imgs/settings/menu_styles/design.png'
|
||||
import darkStyle from '@imgs/settings/menu_styles/dark.png'
|
||||
import lightStyle from '@imgs/settings/menu_styles/light.png'
|
||||
|
||||
/**
|
||||
* 配置中心图片资源对象
|
||||
*/
|
||||
export const configImages = {
|
||||
/** 系统主题预览图 */
|
||||
themeStyles: {
|
||||
/** 亮色主题 */
|
||||
light: lightTheme,
|
||||
/** 暗色主题 */
|
||||
dark: darkTheme,
|
||||
/** 自动主题(跟随系统) */
|
||||
system: systemTheme
|
||||
},
|
||||
/** 菜单布局预览图 */
|
||||
menuLayouts: {
|
||||
/** 左侧菜单 */
|
||||
vertical: verticalLayout,
|
||||
/** 顶部菜单 */
|
||||
horizontal: horizontalLayout,
|
||||
/** 混合菜单 */
|
||||
mixed: mixedLayout,
|
||||
/** 双栏菜单 */
|
||||
dualColumn: dualColumnLayout
|
||||
},
|
||||
/** 菜单风格预览图 */
|
||||
menuStyles: {
|
||||
/** 设计风格 */
|
||||
design: designStyle,
|
||||
/** 暗色风格 */
|
||||
dark: darkStyle,
|
||||
/** 亮色风格 */
|
||||
light: lightStyle
|
||||
}
|
||||
}
|
||||
79
saiadmin-artd/src/config/fastEnter.ts
Normal file
79
saiadmin-artd/src/config/fastEnter.ts
Normal file
@@ -0,0 +1,79 @@
|
||||
/**
|
||||
* 快速入口配置
|
||||
* 包含:应用列表、快速链接等配置
|
||||
*/
|
||||
import { WEB_LINKS } from '@/utils/constants'
|
||||
import type { FastEnterConfig } from '@/types/config'
|
||||
|
||||
const fastEnterConfig: FastEnterConfig = {
|
||||
// 显示条件(屏幕宽度)
|
||||
minWidth: 1200,
|
||||
// 应用列表
|
||||
applications: [
|
||||
{
|
||||
name: '工作台',
|
||||
description: '系统概览与数据统计',
|
||||
icon: 'ri:pie-chart-line',
|
||||
iconColor: '#377dff',
|
||||
enabled: true,
|
||||
order: 1,
|
||||
routeName: 'Console'
|
||||
},
|
||||
{
|
||||
name: '官方文档',
|
||||
description: '使用指南与开发文档',
|
||||
icon: 'ri:bill-line',
|
||||
iconColor: '#ffb100',
|
||||
enabled: true,
|
||||
order: 2,
|
||||
link: WEB_LINKS.DOCS
|
||||
},
|
||||
{
|
||||
name: '技术支持',
|
||||
description: '技术支持与问题反馈',
|
||||
icon: 'ri:user-location-line',
|
||||
iconColor: '#ff6b6b',
|
||||
enabled: true,
|
||||
order: 3,
|
||||
link: WEB_LINKS.COMMUNITY
|
||||
},
|
||||
{
|
||||
name: '哔哩哔哩',
|
||||
description: '技术分享与交流',
|
||||
icon: 'ri:bilibili-line',
|
||||
iconColor: '#FB7299',
|
||||
enabled: true,
|
||||
order: 4,
|
||||
link: WEB_LINKS.BILIBILI
|
||||
}
|
||||
],
|
||||
// 快速链接
|
||||
quickLinks: [
|
||||
{
|
||||
name: '登录',
|
||||
enabled: true,
|
||||
order: 1,
|
||||
routeName: 'Login'
|
||||
},
|
||||
{
|
||||
name: '注册',
|
||||
enabled: true,
|
||||
order: 2,
|
||||
routeName: 'Register'
|
||||
},
|
||||
{
|
||||
name: '忘记密码',
|
||||
enabled: true,
|
||||
order: 3,
|
||||
routeName: 'ForgetPassword'
|
||||
},
|
||||
{
|
||||
name: '个人中心',
|
||||
enabled: true,
|
||||
order: 4,
|
||||
routeName: 'UserCenter'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export default Object.freeze(fastEnterConfig)
|
||||
135
saiadmin-artd/src/config/index.ts
Normal file
135
saiadmin-artd/src/config/index.ts
Normal file
@@ -0,0 +1,135 @@
|
||||
/**
|
||||
* 系统全局配置
|
||||
*
|
||||
* 这是系统的核心配置文件,集中管理所有全局配置项。
|
||||
* 包含系统信息、主题样式、菜单布局、颜色方案等所有可配置项。
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 系统信息 - 系统名称等基础信息
|
||||
* - 主题配置 - 亮色/暗色/自动主题的样式配置
|
||||
* - 菜单配置 - 菜单布局、主题、宽度等配置
|
||||
* - 颜色方案 - 系统主色和预设颜色列表
|
||||
* - 快速入口 - 快速入口应用和链接配置
|
||||
* - 顶部栏配置 - 顶部栏功能模块配置
|
||||
*
|
||||
* ## 配置项说明
|
||||
*
|
||||
* - systemInfo: 系统基础信息(名称等)
|
||||
* - systemThemeStyles: 系统主题样式映射
|
||||
* - settingThemeList: 可选的系统主题列表
|
||||
* - menuLayoutList: 可选的菜单布局列表
|
||||
* - themeList: 菜单主题样式列表
|
||||
* - darkMenuStyles: 暗黑模式下的菜单样式
|
||||
* - systemMainColor: 预设的系统主色列表
|
||||
* - fastEnter: 快速入口配置
|
||||
* - headerBar: 顶部栏功能配置
|
||||
*
|
||||
* @module config
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
import { MenuThemeEnum, MenuTypeEnum, SystemThemeEnum } from '@/enums/appEnum'
|
||||
import { SystemConfig } from '@/types/config'
|
||||
import { configImages } from './assets/images'
|
||||
import fastEnterConfig from './modules/fastEnter'
|
||||
import { headerBarConfig } from './modules/headerBar'
|
||||
|
||||
const appConfig: SystemConfig = {
|
||||
// 系统信息
|
||||
systemInfo: {
|
||||
name: 'SaiAdmin' // 系统名称
|
||||
},
|
||||
// 系统主题
|
||||
systemThemeStyles: {
|
||||
[SystemThemeEnum.LIGHT]: { className: '' },
|
||||
[SystemThemeEnum.DARK]: { className: SystemThemeEnum.DARK }
|
||||
},
|
||||
// 系统主题列表
|
||||
settingThemeList: [
|
||||
{
|
||||
name: 'Light',
|
||||
theme: SystemThemeEnum.LIGHT,
|
||||
color: ['#fff', '#fff'],
|
||||
leftLineColor: '#EDEEF0',
|
||||
rightLineColor: '#EDEEF0',
|
||||
img: configImages.themeStyles.light
|
||||
},
|
||||
{
|
||||
name: 'Dark',
|
||||
theme: SystemThemeEnum.DARK,
|
||||
color: ['#22252A'],
|
||||
leftLineColor: '#3F4257',
|
||||
rightLineColor: '#3F4257',
|
||||
img: configImages.themeStyles.dark
|
||||
},
|
||||
{
|
||||
name: 'System',
|
||||
theme: SystemThemeEnum.AUTO,
|
||||
color: ['#fff', '#22252A'],
|
||||
leftLineColor: '#EDEEF0',
|
||||
rightLineColor: '#3F4257',
|
||||
img: configImages.themeStyles.system
|
||||
}
|
||||
],
|
||||
// 菜单布局列表
|
||||
menuLayoutList: [
|
||||
{ name: 'Left', value: MenuTypeEnum.LEFT, img: configImages.menuLayouts.vertical },
|
||||
{ name: 'Top', value: MenuTypeEnum.TOP, img: configImages.menuLayouts.horizontal },
|
||||
{ name: 'Mixed', value: MenuTypeEnum.TOP_LEFT, img: configImages.menuLayouts.mixed },
|
||||
{ name: 'Dual Column', value: MenuTypeEnum.DUAL_MENU, img: configImages.menuLayouts.dualColumn }
|
||||
],
|
||||
// 菜单主题列表
|
||||
themeList: [
|
||||
{
|
||||
theme: MenuThemeEnum.DESIGN,
|
||||
background: '#FFFFFF',
|
||||
systemNameColor: 'var(--art-gray-800)',
|
||||
iconColor: '#6B6B6B',
|
||||
textColor: '#29343D',
|
||||
img: configImages.menuStyles.design
|
||||
},
|
||||
{
|
||||
theme: MenuThemeEnum.DARK,
|
||||
background: '#191A23',
|
||||
systemNameColor: '#D9DADB',
|
||||
iconColor: '#BABBBD',
|
||||
textColor: '#BABBBD',
|
||||
img: configImages.menuStyles.dark
|
||||
},
|
||||
{
|
||||
theme: MenuThemeEnum.LIGHT,
|
||||
background: '#ffffff',
|
||||
systemNameColor: 'var(--art-gray-800)',
|
||||
iconColor: '#6B6B6B',
|
||||
textColor: '#29343D',
|
||||
img: configImages.menuStyles.light
|
||||
}
|
||||
],
|
||||
// 暗黑模式菜单样式
|
||||
darkMenuStyles: [
|
||||
{
|
||||
theme: MenuThemeEnum.DARK,
|
||||
background: 'var(--default-box-color)',
|
||||
systemNameColor: '#DDDDDD',
|
||||
iconColor: '#BABBBD',
|
||||
textColor: 'rgba(#FFFFFF, 0.7)'
|
||||
}
|
||||
],
|
||||
// 系统主色
|
||||
systemMainColor: [
|
||||
'#5D87FF',
|
||||
'#B48DF3',
|
||||
'#1D84FF',
|
||||
'#60C041',
|
||||
'#38C0FC',
|
||||
'#F9901F',
|
||||
'#FF80C8'
|
||||
] as const,
|
||||
// 快速入口配置
|
||||
fastEnter: fastEnterConfig,
|
||||
// 顶部栏功能配置
|
||||
headerBar: headerBarConfig
|
||||
}
|
||||
|
||||
export default Object.freeze(appConfig)
|
||||
105
saiadmin-artd/src/config/modules/component.ts
Normal file
105
saiadmin-artd/src/config/modules/component.ts
Normal file
@@ -0,0 +1,105 @@
|
||||
/**
|
||||
* 全局组件配置
|
||||
*
|
||||
* 统一管理系统级全局组件的注册。
|
||||
* 这些组件会在应用启动时全局注册,可在任何地方使用。
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 组件配置 - 集中管理全局组件的配置信息
|
||||
* - 异步加载 - 使用 defineAsyncComponent 实现按需加载
|
||||
* - 开关控制 - 支持通过 enabled 字段启用/禁用组件
|
||||
* - 配置查询 - 提供工具函数快速查询组件配置
|
||||
*
|
||||
* @module config/component
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
import { defineAsyncComponent } from 'vue'
|
||||
|
||||
/**
|
||||
* 全局组件配置列表
|
||||
*/
|
||||
export const globalComponentsConfig: GlobalComponentConfig[] = [
|
||||
{
|
||||
name: '设置面板',
|
||||
key: 'settings-panel',
|
||||
component: defineAsyncComponent(
|
||||
() => import('@/components/core/layouts/art-settings-panel/index.vue')
|
||||
),
|
||||
enabled: true
|
||||
},
|
||||
{
|
||||
name: '全局搜索',
|
||||
key: 'global-search',
|
||||
component: defineAsyncComponent(
|
||||
() => import('@/components/core/layouts/art-global-search/index.vue')
|
||||
),
|
||||
enabled: true
|
||||
},
|
||||
{
|
||||
name: '锁屏',
|
||||
key: 'screen-lock',
|
||||
component: defineAsyncComponent(
|
||||
() => import('@/components/core/layouts/art-screen-lock/index.vue')
|
||||
),
|
||||
enabled: true
|
||||
},
|
||||
{
|
||||
name: '聊天窗口',
|
||||
key: 'chat-window',
|
||||
component: defineAsyncComponent(
|
||||
() => import('@/components/core/layouts/art-chat-window/index.vue')
|
||||
),
|
||||
enabled: true
|
||||
},
|
||||
{
|
||||
name: '礼花效果',
|
||||
key: 'fireworks-effect',
|
||||
component: defineAsyncComponent(
|
||||
() => import('@/components/core/layouts/art-fireworks-effect/index.vue')
|
||||
),
|
||||
enabled: true
|
||||
},
|
||||
{
|
||||
name: '水印效果',
|
||||
key: 'watermark',
|
||||
component: defineAsyncComponent(
|
||||
() => import('@/components/core/others/art-watermark/index.vue')
|
||||
),
|
||||
enabled: true
|
||||
}
|
||||
]
|
||||
|
||||
/**
|
||||
* 全局组件配置接口
|
||||
*/
|
||||
export interface GlobalComponentConfig {
|
||||
/** 组件名称 */
|
||||
name: string
|
||||
/** 组件标识 */
|
||||
key: string
|
||||
/** 组件 */
|
||||
component: any
|
||||
/** 是否启用 */
|
||||
enabled?: boolean
|
||||
/** 组件描述 */
|
||||
description?: string
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取启用的全局组件
|
||||
* @returns 已启用的组件配置列表
|
||||
*/
|
||||
export const getEnabledGlobalComponents = () => {
|
||||
return globalComponentsConfig.filter((config) => config.enabled !== false)
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 key 获取组件配置
|
||||
* @param key 组件标识
|
||||
* @returns 组件配置对象
|
||||
*/
|
||||
export const getGlobalComponentByKey = (key: string) => {
|
||||
return globalComponentsConfig.find((config) => config.key === key)
|
||||
}
|
||||
127
saiadmin-artd/src/config/modules/fastEnter.ts
Normal file
127
saiadmin-artd/src/config/modules/fastEnter.ts
Normal file
@@ -0,0 +1,127 @@
|
||||
/**
|
||||
* 快速入口配置
|
||||
* 包含:应用列表、快速链接等配置
|
||||
*/
|
||||
import { WEB_LINKS } from '@/utils/constants'
|
||||
import type { FastEnterConfig } from '@/types/config'
|
||||
|
||||
const fastEnterConfig: FastEnterConfig = {
|
||||
// 显示条件(屏幕宽度)
|
||||
minWidth: 1200,
|
||||
// 应用列表
|
||||
applications: [
|
||||
{
|
||||
name: '工作台',
|
||||
description: '系统概览与数据统计',
|
||||
icon: 'ri:pie-chart-line',
|
||||
iconColor: '#377dff',
|
||||
enabled: true,
|
||||
order: 1,
|
||||
routeName: 'Console'
|
||||
},
|
||||
{
|
||||
name: '分析页',
|
||||
description: '数据分析与可视化',
|
||||
icon: 'ri:game-line',
|
||||
iconColor: '#ff3b30',
|
||||
enabled: true,
|
||||
order: 2,
|
||||
routeName: 'Analysis'
|
||||
},
|
||||
{
|
||||
name: '礼花效果',
|
||||
description: '动画特效展示',
|
||||
icon: 'ri:loader-line',
|
||||
iconColor: '#7A7FFF',
|
||||
enabled: true,
|
||||
order: 3,
|
||||
routeName: 'Fireworks'
|
||||
},
|
||||
{
|
||||
name: '聊天',
|
||||
description: '即时通讯功能',
|
||||
icon: 'ri:user-line',
|
||||
iconColor: '#13DEB9',
|
||||
enabled: true,
|
||||
order: 4,
|
||||
routeName: 'Chat'
|
||||
},
|
||||
{
|
||||
name: '官方文档',
|
||||
description: '使用指南与开发文档',
|
||||
icon: 'ri:bill-line',
|
||||
iconColor: '#ffb100',
|
||||
enabled: true,
|
||||
order: 5,
|
||||
link: WEB_LINKS.DOCS
|
||||
},
|
||||
{
|
||||
name: '技术支持',
|
||||
description: '技术支持与问题反馈',
|
||||
icon: 'ri:user-location-line',
|
||||
iconColor: '#ff6b6b',
|
||||
enabled: true,
|
||||
order: 6,
|
||||
link: WEB_LINKS.COMMUNITY
|
||||
},
|
||||
{
|
||||
name: '更新日志',
|
||||
description: '版本更新与变更记录',
|
||||
icon: 'ri:gamepad-line',
|
||||
iconColor: '#38C0FC',
|
||||
enabled: true,
|
||||
order: 7,
|
||||
routeName: 'ChangeLog'
|
||||
},
|
||||
{
|
||||
name: '哔哩哔哩',
|
||||
description: '技术分享与交流',
|
||||
icon: 'ri:bilibili-line',
|
||||
iconColor: '#FB7299',
|
||||
enabled: true,
|
||||
order: 8,
|
||||
link: WEB_LINKS.BILIBILI
|
||||
}
|
||||
],
|
||||
// 快速链接
|
||||
quickLinks: [
|
||||
{
|
||||
name: '登录',
|
||||
enabled: true,
|
||||
order: 1,
|
||||
routeName: 'Login'
|
||||
},
|
||||
{
|
||||
name: '注册',
|
||||
enabled: true,
|
||||
order: 2,
|
||||
routeName: 'Register'
|
||||
},
|
||||
{
|
||||
name: '忘记密码',
|
||||
enabled: true,
|
||||
order: 3,
|
||||
routeName: 'ForgetPassword'
|
||||
},
|
||||
{
|
||||
name: '定价',
|
||||
enabled: true,
|
||||
order: 4,
|
||||
routeName: 'Pricing'
|
||||
},
|
||||
{
|
||||
name: '个人中心',
|
||||
enabled: true,
|
||||
order: 5,
|
||||
routeName: 'UserCenter'
|
||||
},
|
||||
{
|
||||
name: '留言管理',
|
||||
enabled: true,
|
||||
order: 6,
|
||||
routeName: 'ArticleComment'
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
export default Object.freeze(fastEnterConfig)
|
||||
51
saiadmin-artd/src/config/modules/festival.ts
Normal file
51
saiadmin-artd/src/config/modules/festival.ts
Normal file
@@ -0,0 +1,51 @@
|
||||
/**
|
||||
* 节日庆祝配置
|
||||
*
|
||||
* 配置系统的节日烟花效果和祝福文本。
|
||||
* 支持单日节日和跨日期节日,可自定义烟花播放次数。
|
||||
*
|
||||
* ## 配置说明
|
||||
*
|
||||
* - name: 节日名称
|
||||
* - date: 节日开始日期(格式:YYYY-MM-DD)
|
||||
* - endDate: 节日结束日期(可选,用于跨日期节日)
|
||||
* - image: 烟花图片(需要预先导入)
|
||||
* - scrollText: 滚动显示的祝福文本
|
||||
* - count: 烟花播放次数(可选,默认为 3 次)
|
||||
*
|
||||
* ## 注意事项
|
||||
*
|
||||
* - 图片需要预先导入并在配置中引用
|
||||
* - 跨日期节日会在整个日期范围内生效
|
||||
* - 每个用户每天只会播放一次烟花效果
|
||||
*
|
||||
* @module config/modules/festival
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
import { FestivalConfig } from '@/types/config'
|
||||
|
||||
// 导入烟花图片(根据需要取消注释)
|
||||
// import sd from '@imgs/ceremony/sd.png'
|
||||
// import yd from '@imgs/ceremony/yd.png'
|
||||
|
||||
export const festivalConfigList: FestivalConfig[] = [
|
||||
// 跨日期示例
|
||||
// {
|
||||
// name: 'v3.0 Sass 升级至 TailwindCSS',
|
||||
// date: '2025-11-03',
|
||||
// endDate: '2025-11-09',
|
||||
// image: '',
|
||||
// count: 3,
|
||||
// scrollText:
|
||||
// '🚀 系统 v3.0 测试阶段正式开启!测试周期为 11 月 3 日 - 11 月 16 日,通过 TailwindCSS 重构样式体系、统一 Iconify 图标方案,带来更高效现代的开发体验,正式发布敬请期待~'
|
||||
// }
|
||||
// 单日示例:圣诞节
|
||||
// {
|
||||
// name: '圣诞节',
|
||||
// date: '2024-12-25',
|
||||
// image: sd,
|
||||
// count: 3 // 可选,不设置则使用默认值 3 次
|
||||
// scrollText: 'Merry Christmas!Art Design Pro 祝您圣诞快乐,愿节日的欢乐与祝福如雪花般纷至沓来!',
|
||||
// }
|
||||
]
|
||||
63
saiadmin-artd/src/config/modules/headerBar.ts
Normal file
63
saiadmin-artd/src/config/modules/headerBar.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
/**
|
||||
* 顶部栏功能配置
|
||||
*
|
||||
* 统一管理顶部栏各个功能模块的启用状态。
|
||||
* 通过修改此配置文件可以快速启用或禁用顶部栏的功能按钮。
|
||||
*
|
||||
* @module config/headerBar
|
||||
* @author Art Design Pro Team
|
||||
*/
|
||||
|
||||
import { HeaderBarFeatureConfig } from '@/types'
|
||||
|
||||
/**
|
||||
* 顶部栏功能配置对象
|
||||
*/
|
||||
export const headerBarConfig: HeaderBarFeatureConfig = {
|
||||
menuButton: {
|
||||
enabled: true,
|
||||
description: '控制左侧菜单的展开/收起按钮'
|
||||
},
|
||||
refreshButton: {
|
||||
enabled: true,
|
||||
description: '页面刷新按钮'
|
||||
},
|
||||
fastEnter: {
|
||||
enabled: true,
|
||||
description: '快速入口功能,提供常用应用和链接的快速访问'
|
||||
},
|
||||
breadcrumb: {
|
||||
enabled: true,
|
||||
description: '面包屑导航,显示当前页面路径'
|
||||
},
|
||||
globalSearch: {
|
||||
enabled: true,
|
||||
description: '全局搜索功能,支持快捷键 Ctrl+K 或 Cmd+K'
|
||||
},
|
||||
fullscreen: {
|
||||
enabled: true,
|
||||
description: '全屏切换功能'
|
||||
},
|
||||
notification: {
|
||||
enabled: true,
|
||||
description: '通知中心,显示系统通知和消息'
|
||||
},
|
||||
chat: {
|
||||
enabled: true,
|
||||
description: '聊天功能,提供实时沟通'
|
||||
},
|
||||
language: {
|
||||
enabled: true,
|
||||
description: '多语言切换功能'
|
||||
},
|
||||
settings: {
|
||||
enabled: true,
|
||||
description: '系统设置面板'
|
||||
},
|
||||
themeToggle: {
|
||||
enabled: true,
|
||||
description: '主题切换功能(明暗主题)'
|
||||
}
|
||||
}
|
||||
|
||||
export default headerBarConfig
|
||||
109
saiadmin-artd/src/config/setting.ts
Normal file
109
saiadmin-artd/src/config/setting.ts
Normal file
@@ -0,0 +1,109 @@
|
||||
/**
|
||||
* 系统设置默认值配置
|
||||
*
|
||||
* 统一管理系统设置的所有默认值
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 菜单相关默认配置
|
||||
* - 主题相关默认配置
|
||||
* - 界面显示默认配置
|
||||
* - 功能开关默认配置
|
||||
* - 样式相关默认配置
|
||||
*
|
||||
* ## 注意事项
|
||||
*
|
||||
* 1. 修改此文件的配置项时,需要同步更新以下文件:
|
||||
* - src/components/core/layouts/art-settings-panel/widget/SettingActions.vue(复制配置和重置配置逻辑)
|
||||
* - src/store/modules/setting.ts(Store 状态定义)
|
||||
* 2. 可以通过设置面板的"复制配置"按钮快速生成配置代码
|
||||
* 3. 枚举类型的值需要与 src/enums/appEnum.ts 中的定义保持一致
|
||||
*/
|
||||
|
||||
import AppConfig from '@/config'
|
||||
import { SystemThemeEnum, MenuThemeEnum, MenuTypeEnum, ContainerWidthEnum } from '@/enums/appEnum'
|
||||
|
||||
/**
|
||||
* 系统设置默认值配置
|
||||
*/
|
||||
export const SETTING_DEFAULT_CONFIG = {
|
||||
/** 菜单类型 */
|
||||
menuType: MenuTypeEnum.LEFT,
|
||||
/** 菜单展开宽度 */
|
||||
menuOpenWidth: 230,
|
||||
/** 菜单是否展开 */
|
||||
menuOpen: true,
|
||||
/** 双菜单是否显示文本 */
|
||||
dualMenuShowText: false,
|
||||
/** 系统主题类型 */
|
||||
systemThemeType: SystemThemeEnum.AUTO,
|
||||
/** 系统主题模式 */
|
||||
systemThemeMode: SystemThemeEnum.AUTO,
|
||||
/** 菜单风格 */
|
||||
menuThemeType: MenuThemeEnum.DESIGN,
|
||||
/** 系统主题颜色 */
|
||||
systemThemeColor: AppConfig.systemMainColor[0],
|
||||
/** 是否显示菜单按钮 */
|
||||
showMenuButton: true,
|
||||
/** 是否显示快速入口 */
|
||||
showFastEnter: true,
|
||||
/** 是否显示刷新按钮 */
|
||||
showRefreshButton: true,
|
||||
/** 是否显示面包屑 */
|
||||
showCrumbs: true,
|
||||
/** 是否显示工作台标签 */
|
||||
showWorkTab: true,
|
||||
/** 是否显示语言切换 */
|
||||
showLanguage: true,
|
||||
/** 是否显示进度条 */
|
||||
showNprogress: false,
|
||||
/** 是否显示设置引导 */
|
||||
showSettingGuide: true,
|
||||
/** 是否显示节日文本 */
|
||||
showFestivalText: false,
|
||||
/** 是否显示水印 */
|
||||
watermarkVisible: false,
|
||||
/** 是否自动关闭 */
|
||||
autoClose: false,
|
||||
/** 是否唯一展开 */
|
||||
uniqueOpened: true,
|
||||
/** 是否色弱模式 */
|
||||
colorWeak: false,
|
||||
/** 是否刷新 */
|
||||
refresh: false,
|
||||
/** 是否加载节日烟花 */
|
||||
holidayFireworksLoaded: false,
|
||||
/** 边框模式 */
|
||||
boxBorderMode: true,
|
||||
/** 页面过渡效果 */
|
||||
pageTransition: 'slide-left',
|
||||
/** 标签页样式 */
|
||||
tabStyle: 'tab-default',
|
||||
/** 自定义圆角 */
|
||||
customRadius: '0.75',
|
||||
/** 容器宽度 */
|
||||
containerWidth: ContainerWidthEnum.FULL,
|
||||
/** 节日日期 */
|
||||
festivalDate: ''
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取设置默认值
|
||||
* @returns 设置默认值对象
|
||||
*/
|
||||
export function getSettingDefaults() {
|
||||
return { ...SETTING_DEFAULT_CONFIG }
|
||||
}
|
||||
|
||||
/**
|
||||
* 重置为默认设置
|
||||
* @param currentSettings 当前设置对象
|
||||
*/
|
||||
export function resetToDefaults(currentSettings: Record<string, any>) {
|
||||
const defaults = getSettingDefaults()
|
||||
Object.keys(defaults).forEach((key) => {
|
||||
if (key in currentSettings) {
|
||||
currentSettings[key] = defaults[key as keyof typeof defaults]
|
||||
}
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user