mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2025-05-22 12:55:18 +08:00
新增系统配置入口
This commit is contained in:
parent
e591a4386d
commit
1e7c53e2f9
47
cfg.ts
47
cfg.ts
@ -43,6 +43,12 @@ import {
|
|||||||
buildOptions,
|
buildOptions,
|
||||||
mixinCSSPlugin,
|
mixinCSSPlugin,
|
||||||
} from './vite-plugin/index'
|
} from './vite-plugin/index'
|
||||||
|
import { APP_PRIMARY_COLOR } from './src/appConfig/designConfig'
|
||||||
|
import {
|
||||||
|
PRE_LOADING_CONFIG,
|
||||||
|
ROOT_ROUTE,
|
||||||
|
SIDE_BAR_LOGO,
|
||||||
|
} from './src/appConfig/appConfig'
|
||||||
|
|
||||||
import type { AppConfigExport } from './src/types/cfg'
|
import type { AppConfigExport } from './src/types/cfg'
|
||||||
|
|
||||||
@ -50,44 +56,11 @@ const config: AppConfigExport = {
|
|||||||
/** 公共基础路径配置, 如果为空则会默认以 '/' 填充 */
|
/** 公共基础路径配置, 如果为空则会默认以 '/' 填充 */
|
||||||
base: '/ray-template/',
|
base: '/ray-template/',
|
||||||
/** 配置首屏加载信息 */
|
/** 配置首屏加载信息 */
|
||||||
preloadingConfig: {
|
preloadingConfig: PRE_LOADING_CONFIG,
|
||||||
title: 'Ray Template',
|
|
||||||
tagColor: '#ff6700',
|
|
||||||
titleColor: '#2d8cf0',
|
|
||||||
},
|
|
||||||
/** 默认主题色(不可省略, 必填), 也用于 ejs 注入 */
|
/** 默认主题色(不可省略, 必填), 也用于 ejs 注入 */
|
||||||
appPrimaryColor: {
|
appPrimaryColor: APP_PRIMARY_COLOR,
|
||||||
/** 主题色 */
|
rootRoute: ROOT_ROUTE,
|
||||||
primaryColor: '#2d8cf0',
|
sideBarLogo: SIDE_BAR_LOGO,
|
||||||
/** 主题辅助色(用于整体 hover、active 等之类颜色) */
|
|
||||||
primaryFadeColor: 'rgba(45, 140, 240, 0.3)',
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 配置根页面
|
|
||||||
* 该项目所有重定向至首页, 都依赖该配置项
|
|
||||||
*
|
|
||||||
* 如果修改了该项目的首页路由配置, 需要更改该配置项, 以免重定向首页操作出现错误
|
|
||||||
*/
|
|
||||||
rootRoute: {
|
|
||||||
name: 'dashboard',
|
|
||||||
path: '/dashboard',
|
|
||||||
},
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* icon: LOGO 图标, 依赖 `RayIcon` 实现(如果为空则不会渲染图标)
|
|
||||||
* title: LOGO 标题
|
|
||||||
* url: 点击跳转地址, 如果不配置该属性, 则不会触发跳转
|
|
||||||
* jumpType: 跳转类型(station: 项目内跳转, outsideStation: 新页面打开)
|
|
||||||
*
|
|
||||||
* 如果不设置该属性或者为空, 则不会渲染 LOGO
|
|
||||||
*/
|
|
||||||
sideBarLogo: {
|
|
||||||
icon: 'ray',
|
|
||||||
title: 'Ray Template',
|
|
||||||
url: '/dashboard',
|
|
||||||
jumpType: 'station',
|
|
||||||
},
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* 预处理全局需要注入的 css 文件
|
* 预处理全局需要注入的 css 文件
|
||||||
|
53
src/appConfig/appConfig.ts
Normal file
53
src/appConfig/appConfig.ts
Normal file
@ -0,0 +1,53 @@
|
|||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author Ray <https://github.com/XiaoDaiGua-Ray>
|
||||||
|
*
|
||||||
|
* @date 2023-05-23
|
||||||
|
*
|
||||||
|
* @workspace ray-template
|
||||||
|
*
|
||||||
|
* @remark 今天也是元气满满撸代码的一天
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** 系统配置 */
|
||||||
|
|
||||||
|
import type {
|
||||||
|
LayoutSideBarLogo,
|
||||||
|
PreloadingConfig,
|
||||||
|
RootRoute,
|
||||||
|
} from '../types/cfg'
|
||||||
|
|
||||||
|
/** 首屏加载信息配置 */
|
||||||
|
export const PRE_LOADING_CONFIG: PreloadingConfig = {
|
||||||
|
title: 'Ray Template',
|
||||||
|
tagColor: '#ff6700',
|
||||||
|
titleColor: '#2d8cf0',
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 配置根页面
|
||||||
|
* 该项目所有重定向至首页, 都依赖该配置项
|
||||||
|
*
|
||||||
|
* 如果修改了该项目的首页路由配置, 需要更改该配置项, 以免重定向首页操作出现错误
|
||||||
|
*/
|
||||||
|
export const ROOT_ROUTE: RootRoute = {
|
||||||
|
name: 'Dashboard',
|
||||||
|
path: '/dashboard',
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* icon: LOGO 图标, 依赖 `RayIcon` 实现(如果为空则不会渲染图标)
|
||||||
|
* title: LOGO 标题
|
||||||
|
* url: 点击跳转地址, 如果不配置该属性, 则不会触发跳转
|
||||||
|
* jumpType: 跳转类型(station: 项目内跳转, outsideStation: 新页面打开)
|
||||||
|
*
|
||||||
|
* 如果不设置该属性或者为空, 则不会渲染 LOGO
|
||||||
|
*/
|
||||||
|
export const SIDE_BAR_LOGO: LayoutSideBarLogo = {
|
||||||
|
icon: 'ray',
|
||||||
|
title: 'Ray Template',
|
||||||
|
url: '/dashboard',
|
||||||
|
jumpType: 'station',
|
||||||
|
}
|
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
/** 系统颜色风格配置入口 */
|
/** 系统颜色风格配置入口 */
|
||||||
|
|
||||||
|
import type { AppPrimaryColor } from '../types/cfg'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* 系统主题颜色预设色盘
|
* 系统主题颜色预设色盘
|
||||||
@ -26,3 +28,11 @@ export const APP_THEME_COLOR = [
|
|||||||
'#ff9800',
|
'#ff9800',
|
||||||
'#18A058',
|
'#18A058',
|
||||||
]
|
]
|
||||||
|
|
||||||
|
/** 系统主题色 */
|
||||||
|
export const APP_PRIMARY_COLOR: AppPrimaryColor = {
|
||||||
|
/** 主题色 */
|
||||||
|
primaryColor: '#2d8cf0',
|
||||||
|
/** 主题辅助色(用于整体 hover、active 等之类颜色) */
|
||||||
|
primaryFadeColor: 'rgba(45, 140, 240, 0.3)',
|
||||||
|
}
|
||||||
|
@ -2,9 +2,10 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||||
import type { RouteRecordRaw } from 'vue-router'
|
import type { RouteRecordRaw } from 'vue-router'
|
||||||
import type { Recordable } from '@/types/type-utils'
|
import type { Recordable } from '@/types/type-utils'
|
||||||
|
import type { DefineComponent } from 'vue'
|
||||||
|
|
||||||
export type Component<T = any> =
|
export type Component<T = any> =
|
||||||
| ReturnType<typeof defineComponent>
|
| DefineComponent<{}, {}, any>
|
||||||
| (() => Promise<typeof import('*.vue')>)
|
| (() => Promise<typeof import('*.vue')>)
|
||||||
| (() => Promise<T>)
|
| (() => Promise<T>)
|
||||||
|
|
||||||
|
@ -11,8 +11,9 @@
|
|||||||
"vite-plugin/index.ts",
|
"vite-plugin/index.ts",
|
||||||
"vite-plugin/type.ts",
|
"vite-plugin/type.ts",
|
||||||
"cfg.ts",
|
"cfg.ts",
|
||||||
"src/types/cfg.ts",
|
"src/types/*.ts",
|
||||||
"package.json",
|
"package.json",
|
||||||
"vite-env.d.ts"
|
"vite-env.d.ts",
|
||||||
|
"src/appConfig/*.ts"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user