新增系统配置入口

This commit is contained in:
ray_wuhao 2023-05-29 17:42:54 +08:00
parent e591a4386d
commit 1e7c53e2f9
5 changed files with 78 additions and 40 deletions

47
cfg.ts
View File

@ -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

View 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',
}

View File

@ -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)',
}

View File

@ -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>)

View File

@ -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"
] ]
} }