init: 初始化 dpb 桃育种系统代码库
前后端 + 后端 FastAPI 全量源码、部署脚本与文档。
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
/**
|
||||
* 配置图片资源
|
||||
*
|
||||
* 统一管理设置中心使用的预览图片资源。
|
||||
* 包含主题样式、菜单布局、菜单风格的预览图。
|
||||
*
|
||||
* ## 图片分类
|
||||
*
|
||||
* - themeStyles: 系统主题预览图(亮色/暗色/自动)
|
||||
* - menuLayouts: 菜单布局预览图(左侧/顶部/混合/双栏)
|
||||
* - menuStyles: 菜单风格预览图(设计/暗色/亮色)
|
||||
*
|
||||
* @module config/assets/images
|
||||
* @author FastapiAdmin 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,
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,139 @@
|
||||
/**
|
||||
* 系统全局配置
|
||||
*
|
||||
* 这是系统的核心配置文件,集中管理所有全局配置项。
|
||||
* 包含系统信息、主题样式、菜单布局、颜色方案等所有可配置项。
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 系统信息 - 系统名称等基础信息
|
||||
* - 主题配置 - 亮色/暗色/自动主题的样式配置
|
||||
* - 菜单配置 - 菜单布局、主题、宽度等配置
|
||||
* - 颜色方案 - 系统主色和预设颜色列表
|
||||
* - 快速入口 - 快速入口应用和链接配置
|
||||
* - 顶部栏配置 - 顶部栏功能模块配置
|
||||
*
|
||||
* ## 配置项说明
|
||||
*
|
||||
* - systemInfo: 系统基础信息(名称等)
|
||||
* - systemThemeStyles: 系统主题样式映射
|
||||
* - settingThemeList: 可选的系统主题列表
|
||||
* - menuLayoutList: 可选的菜单布局列表
|
||||
* - themeList: 菜单主题样式列表
|
||||
* - darkMenuStyles: 暗黑模式下的菜单样式
|
||||
* - systemMainColor: 预设的系统主色列表
|
||||
* - fastEnter: 快速入口配置
|
||||
* - headerBar: 顶部栏功能配置
|
||||
*
|
||||
* @module config
|
||||
* @author FastapiAdmin Team
|
||||
*/
|
||||
|
||||
import { configImages } from "./assets/images";
|
||||
import fastEnterConfig from "./modules/fastEnter";
|
||||
import { headerBarConfig } from "./modules/headerBar";
|
||||
import { SystemThemeEnum, MenuTypeEnum, MenuThemeEnum } from "@/enums/appEnum";
|
||||
import type { SystemConfig } from "@/types/config";
|
||||
|
||||
const appConfig: SystemConfig = {
|
||||
// 系统信息
|
||||
systemInfo: {
|
||||
name: "数字化桃育种系统", // 系统名称(兜底默认值,线上以后端 sys_param.sys_name 为准)
|
||||
},
|
||||
// 系统主题
|
||||
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(--fa-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(--fa-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);
|
||||
@@ -0,0 +1,93 @@
|
||||
/**
|
||||
* 全局组件配置
|
||||
*
|
||||
* 统一管理系统级全局组件的注册。
|
||||
* 这些组件会在应用启动时全局注册,可在任何地方使用。
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 组件配置 - 集中管理全局组件的配置信息
|
||||
* - 异步加载 - 使用 defineAsyncComponent 实现按需加载
|
||||
* - 开关控制 - 支持通过 enabled 字段启用/禁用组件
|
||||
* - 配置查询 - 提供工具函数快速查询组件配置
|
||||
*
|
||||
* @module config/component
|
||||
* @author FastapiAdmin Team
|
||||
*/
|
||||
|
||||
import { defineAsyncComponent } from "vue";
|
||||
|
||||
/**
|
||||
* 全局组件配置列表
|
||||
*/
|
||||
export const globalComponentsConfig: GlobalComponentConfig[] = [
|
||||
{
|
||||
name: "设置面板",
|
||||
key: "settings-panel",
|
||||
component: defineAsyncComponent(() => import("@/layouts/fa-settings-panel/index.vue")),
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
name: "全局搜索",
|
||||
key: "global-search",
|
||||
component: defineAsyncComponent(() => import("@/layouts/fa-global-search/index.vue")),
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
name: "锁屏",
|
||||
key: "screen-lock",
|
||||
component: defineAsyncComponent(() => import("@/layouts/fa-screen-lock/index.vue")),
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
name: "聊天窗口",
|
||||
key: "chat-window",
|
||||
component: defineAsyncComponent(() => import("@/layouts/fa-chat-window/index.vue")),
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
name: "礼花效果",
|
||||
key: "fireworks-effect",
|
||||
component: defineAsyncComponent(() => import("@/layouts/fa-fireworks-effect/index.vue")),
|
||||
enabled: true,
|
||||
},
|
||||
{
|
||||
name: "水印效果",
|
||||
key: "watermark",
|
||||
component: defineAsyncComponent(() => import("@/components/others/fa-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);
|
||||
};
|
||||
@@ -0,0 +1,127 @@
|
||||
/**
|
||||
* 快速入口配置
|
||||
* 包含:应用列表、快速链接等配置
|
||||
*/
|
||||
import { WEB_LINKS } from "@utils";
|
||||
import type { FastEnterConfig } from "@/types/config";
|
||||
|
||||
const fastEnterConfig: FastEnterConfig = {
|
||||
// 显示条件(屏幕宽度)
|
||||
minWidth: 1200,
|
||||
// 应用列表
|
||||
applications: [
|
||||
{
|
||||
name: "用户管理",
|
||||
description: "系统用户管理与维护",
|
||||
icon: "ri:user-settings-line",
|
||||
iconColor: "#377dff",
|
||||
enabled: true,
|
||||
order: 1,
|
||||
routeName: "User",
|
||||
},
|
||||
{
|
||||
name: "角色管理",
|
||||
description: "角色权限配置与分配",
|
||||
icon: "ri:shield-user-line",
|
||||
iconColor: "#FF6B35",
|
||||
enabled: true,
|
||||
order: 2,
|
||||
routeName: "Role",
|
||||
},
|
||||
{
|
||||
name: "定价",
|
||||
description: "价格方案与套餐选择",
|
||||
icon: "ri:money-cny-box-line",
|
||||
iconColor: "#FF6B35",
|
||||
enabled: true,
|
||||
order: 3,
|
||||
routeName: "FastlinkPricing",
|
||||
},
|
||||
{
|
||||
name: "聊天",
|
||||
description: "即时通讯功能",
|
||||
icon: "ri:user-line",
|
||||
iconColor: "#13DEB9",
|
||||
enabled: true,
|
||||
order: 4,
|
||||
routeName: "FastlinkFachat",
|
||||
},
|
||||
{
|
||||
name: "官方文档",
|
||||
description: "使用指南与开发文档",
|
||||
icon: "ri:book-open-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: "FastlinkChangeLog",
|
||||
},
|
||||
{
|
||||
name: "操作手册",
|
||||
description: "产品操作指南",
|
||||
icon: "ri:book-2-line",
|
||||
iconColor: "#009688",
|
||||
enabled: true,
|
||||
order: 8,
|
||||
routeName: "FastlinkTutorial",
|
||||
},
|
||||
],
|
||||
// 快速链接
|
||||
quickLinks: [
|
||||
{
|
||||
name: "登录",
|
||||
enabled: true,
|
||||
order: 1,
|
||||
routeName: "Login",
|
||||
},
|
||||
{
|
||||
name: "注册",
|
||||
enabled: true,
|
||||
order: 2,
|
||||
routeName: "Login",
|
||||
},
|
||||
{
|
||||
name: "忘记密码",
|
||||
enabled: true,
|
||||
order: 3,
|
||||
routeName: "Login",
|
||||
},
|
||||
{
|
||||
name: "礼花效果",
|
||||
enabled: true,
|
||||
order: 4,
|
||||
isDialog: true,
|
||||
},
|
||||
{
|
||||
name: "操作日志",
|
||||
enabled: true,
|
||||
order: 5,
|
||||
routeName: "Log",
|
||||
},
|
||||
{
|
||||
name: "个人中心",
|
||||
enabled: true,
|
||||
order: 6,
|
||||
routeName: "FastlinkProfile",
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default Object.freeze(fastEnterConfig);
|
||||
@@ -0,0 +1,392 @@
|
||||
/**
|
||||
* 内置公历节日(自动按年份生成日期)
|
||||
*
|
||||
* 与 `festival.ts` 中的手动配置合并后参与匹配:区间更短优先;区间长度相同时 **手动配置优先于内置**。
|
||||
* 农历春节/中秋等需农历库的可在 `festival.ts` 用手动区间覆盖。
|
||||
*
|
||||
* 含少量「动态公历」规则(感恩节、母亲节、父亲节等按星期推算)。
|
||||
* 缅怀类日期(九一八、国家公祭日等)使用 `skipFireworks: true`,仅顶栏文案、不放礼花。
|
||||
*
|
||||
* @module config/modules/festival.builtin
|
||||
*/
|
||||
|
||||
import hb from "@imgs/ceremony/hb.png";
|
||||
import sd from "@imgs/ceremony/sd.png";
|
||||
import yd from "@imgs/ceremony/yd.png";
|
||||
import type { FestivalConfig } from "@/types/config";
|
||||
|
||||
function pad2(n: number) {
|
||||
return String(n).padStart(2, "0");
|
||||
}
|
||||
|
||||
function ymd(year: number, month: number, day: number): string {
|
||||
return `${year}-${pad2(month)}-${pad2(day)}`;
|
||||
}
|
||||
|
||||
/** month 为 1~12 */
|
||||
function nthWeekdayOfMonth(year: number, month: number, weekday: number, nth: number): number {
|
||||
const month0 = month - 1;
|
||||
let seen = 0;
|
||||
for (let d = 1; d <= 31; d++) {
|
||||
const dt = new Date(year, month0, d);
|
||||
if (dt.getMonth() !== month0) break;
|
||||
if (dt.getDay() === weekday) {
|
||||
seen++;
|
||||
if (seen === nth) return d;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
|
||||
/** 美国感恩节:11 月第四个星期四 */
|
||||
function thanksgivingUsDay(year: number): number {
|
||||
let count = 0;
|
||||
for (let d = 1; d <= 30; d++) {
|
||||
if (new Date(year, 10, d).getDay() === 4) {
|
||||
count++;
|
||||
if (count === 4) return d;
|
||||
}
|
||||
}
|
||||
return 26;
|
||||
}
|
||||
|
||||
/** 单条公历规则(同年同月,不做跨年区间;`endDay` 与 `day` 须同月) */
|
||||
interface SolarRule {
|
||||
name: string;
|
||||
month: number;
|
||||
day: number;
|
||||
endDay?: number;
|
||||
image: string;
|
||||
count?: number;
|
||||
fireworkInterval?: number;
|
||||
scrollText: string;
|
||||
/** 为 true 时不放礼花,仅顶栏文案(适合缅怀、公祭日) */
|
||||
skipFireworks?: boolean;
|
||||
}
|
||||
|
||||
const BUILTIN_SOLAR_RULES: SolarRule[] = [
|
||||
{
|
||||
name: "元旦",
|
||||
month: 1,
|
||||
day: 1,
|
||||
image: yd,
|
||||
count: 5,
|
||||
fireworkInterval: 900,
|
||||
scrollText: "🎊 元旦快乐!新的一年,愿交付顺利、迭代省心。",
|
||||
},
|
||||
{
|
||||
name: "中国人民警察节",
|
||||
month: 1,
|
||||
day: 10,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "👮 人民警察节,向守护平安的人们致敬。",
|
||||
},
|
||||
{
|
||||
name: "情人节",
|
||||
month: 2,
|
||||
day: 14,
|
||||
image: hb,
|
||||
count: 4,
|
||||
fireworkInterval: 1000,
|
||||
scrollText: "💗 情人节快乐,感谢与你并肩写代码、扛上线。",
|
||||
},
|
||||
{
|
||||
name: "妇女节",
|
||||
month: 3,
|
||||
day: 8,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "🌷 节日快乐,致敬每一位闪光的你。",
|
||||
},
|
||||
{
|
||||
name: "植树节",
|
||||
month: 3,
|
||||
day: 12,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "🌳 植树节,愿代码像小树一样扎根生长、枝繁叶茂。",
|
||||
},
|
||||
{
|
||||
name: "消费者权益日",
|
||||
month: 3,
|
||||
day: 15,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "🛡️ 诚信交付、透明沟通,做值得信赖的系统与服务。",
|
||||
},
|
||||
{
|
||||
name: "愚人节",
|
||||
month: 4,
|
||||
day: 1,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "😜 愚人节开心一下~线上变更请以发布单为准哦。",
|
||||
},
|
||||
{
|
||||
name: "清明节",
|
||||
month: 4,
|
||||
day: 4,
|
||||
endDay: 6,
|
||||
image: yd,
|
||||
count: 3,
|
||||
fireworkInterval: 1100,
|
||||
scrollText: "🌿 清明安康,春风遥寄思念;出行与发布请注意安全。",
|
||||
},
|
||||
{
|
||||
name: "世界地球日",
|
||||
month: 4,
|
||||
day: 22,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "🌍 地球日,绿色运维、节约资源,从每一次构建与发布做起。",
|
||||
},
|
||||
{
|
||||
name: "世界读书日",
|
||||
month: 4,
|
||||
day: 23,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "📖 读书日,文档与注释也是团队的财富~",
|
||||
},
|
||||
{
|
||||
name: "劳动节",
|
||||
month: 5,
|
||||
day: 1,
|
||||
endDay: 5,
|
||||
image: yd,
|
||||
count: 4,
|
||||
fireworkInterval: 1000,
|
||||
scrollText: "🛠️ 劳动节快乐!劳逸结合,迭代与健康都要照顾好。",
|
||||
},
|
||||
{
|
||||
name: "青年节",
|
||||
month: 5,
|
||||
day: 4,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "🎓 青年节快乐,保持好奇与折腾的勇气。",
|
||||
},
|
||||
{
|
||||
name: "护士节",
|
||||
month: 5,
|
||||
day: 12,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "💉 国际护士节,致敬白衣天使与每一位守护健康的人。",
|
||||
},
|
||||
{
|
||||
name: "儿童节",
|
||||
month: 6,
|
||||
day: 1,
|
||||
image: yd,
|
||||
count: 4,
|
||||
scrollText: "🎈 儿童节快乐,愿童心常在、Bug 少见。",
|
||||
},
|
||||
{
|
||||
name: "世界环境日",
|
||||
month: 6,
|
||||
day: 5,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "🌱 环境日,绿色机房、高效能耗,可持续迭代。",
|
||||
},
|
||||
{
|
||||
name: "建党节",
|
||||
month: 7,
|
||||
day: 1,
|
||||
image: hb,
|
||||
count: 4,
|
||||
fireworkInterval: 950,
|
||||
scrollText: "🎖️ 不忘初心,牢记使命,祝伟大的党生日快乐。",
|
||||
},
|
||||
{
|
||||
name: "建军节",
|
||||
month: 8,
|
||||
day: 1,
|
||||
image: hb,
|
||||
count: 4,
|
||||
scrollText: "⭐ 八一建军节,致敬人民子弟兵与默默守护的你们。",
|
||||
},
|
||||
{
|
||||
name: "全民健身日",
|
||||
month: 8,
|
||||
day: 8,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "🏃 全民健身日,久坐记得拉伸,健康才是最长迭代。",
|
||||
},
|
||||
{
|
||||
name: "中国人民抗日战争胜利纪念日",
|
||||
month: 9,
|
||||
day: 3,
|
||||
image: hb,
|
||||
count: 4,
|
||||
scrollText: "🇨🇳 铭记胜利,珍爱和平;吾辈当自强,系统当稳健。",
|
||||
},
|
||||
{
|
||||
name: "教师节",
|
||||
month: 9,
|
||||
day: 10,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "📚 教师节快乐,感谢传道授业与代码 Review~",
|
||||
},
|
||||
{
|
||||
name: "九一八事变纪念日",
|
||||
month: 9,
|
||||
day: 18,
|
||||
image: "",
|
||||
count: 3,
|
||||
skipFireworks: true,
|
||||
scrollText: "铭记历史、缅怀先烈。勿忘国耻,吾辈自强。(本日仅展示提示,不播放礼花)",
|
||||
},
|
||||
{
|
||||
name: "烈士纪念日",
|
||||
month: 9,
|
||||
day: 30,
|
||||
image: "",
|
||||
count: 3,
|
||||
skipFireworks: true,
|
||||
scrollText: "人民英雄永垂不朽。缅怀先烈,砥砺前行。(本日仅展示提示,不播放礼花)",
|
||||
},
|
||||
{
|
||||
name: "国庆节",
|
||||
month: 10,
|
||||
day: 1,
|
||||
endDay: 7,
|
||||
image: hb,
|
||||
count: 6,
|
||||
fireworkInterval: 850,
|
||||
scrollText: "🇨🇳 国庆快乐!祝祖国繁荣昌盛,祝你的系统稳如磐石。",
|
||||
},
|
||||
{
|
||||
name: "程序员节",
|
||||
month: 10,
|
||||
day: 24,
|
||||
image: yd,
|
||||
count: 5,
|
||||
fireworkInterval: 900,
|
||||
scrollText: "💻 1024 程序员节快乐!少 Bug、多睡眠,Git 永不冲突~",
|
||||
},
|
||||
{
|
||||
name: "万圣节",
|
||||
month: 10,
|
||||
day: 31,
|
||||
image: sd,
|
||||
count: 3,
|
||||
scrollText: "🎃 Halloween~夜间发布记得多留一道检查。",
|
||||
},
|
||||
{
|
||||
name: "双十一",
|
||||
month: 11,
|
||||
day: 11,
|
||||
image: hb,
|
||||
count: 4,
|
||||
scrollText: "🛒 双十一购物愉快~理性消费,库存与订单接口要顶住峰值哦。",
|
||||
},
|
||||
{
|
||||
name: "国家宪法日",
|
||||
month: 12,
|
||||
day: 4,
|
||||
image: yd,
|
||||
count: 3,
|
||||
scrollText: "📜 国家宪法日,法治同行,合规上线。",
|
||||
},
|
||||
{
|
||||
name: "国家公祭日",
|
||||
month: 12,
|
||||
day: 13,
|
||||
image: "",
|
||||
count: 3,
|
||||
skipFireworks: true,
|
||||
scrollText: "勿忘历史,祈愿和平。缅怀南京大屠杀遇难同胞。(本日仅展示提示,不播放礼花)",
|
||||
},
|
||||
{
|
||||
name: "平安夜",
|
||||
month: 12,
|
||||
day: 24,
|
||||
image: sd,
|
||||
count: 4,
|
||||
fireworkInterval: 950,
|
||||
scrollText: "🍎 平安夜安康,今晚值班的同学辛苦了。",
|
||||
},
|
||||
{
|
||||
name: "圣诞节",
|
||||
month: 12,
|
||||
day: 25,
|
||||
image: sd,
|
||||
count: 4,
|
||||
scrollText: "🎄 Merry Christmas!愿温暖与发布一样准时送达。",
|
||||
},
|
||||
];
|
||||
|
||||
function buildDynamicSolarFestivals(year: number): FestivalConfig[] {
|
||||
const motherDay = nthWeekdayOfMonth(year, 5, 0, 2);
|
||||
const fatherDay = nthWeekdayOfMonth(year, 6, 0, 3);
|
||||
const thanksgiving = thanksgivingUsDay(year);
|
||||
|
||||
const dynamics: SolarRule[] = [
|
||||
{
|
||||
name: "母亲节",
|
||||
month: 5,
|
||||
day: motherDay,
|
||||
image: hb,
|
||||
count: 3,
|
||||
scrollText: "💐 母亲节快乐,感谢每一份牵挂与支持。",
|
||||
},
|
||||
{
|
||||
name: "父亲节",
|
||||
month: 6,
|
||||
day: fatherDay,
|
||||
image: hb,
|
||||
count: 3,
|
||||
scrollText: "👔 父亲节快乐,沉默的爱与可靠的后端一样珍贵。",
|
||||
},
|
||||
{
|
||||
name: "感恩节",
|
||||
month: 11,
|
||||
day: thanksgiving,
|
||||
image: yd,
|
||||
count: 3,
|
||||
fireworkInterval: 1000,
|
||||
scrollText: "🦃 感恩节,感谢并肩的同事与用户信任。",
|
||||
},
|
||||
];
|
||||
|
||||
return dynamics.map((r) => {
|
||||
const date = ymd(year, r.month, r.day);
|
||||
const endDate = r.endDay !== undefined ? ymd(year, r.month, r.endDay) : undefined;
|
||||
return {
|
||||
name: r.name,
|
||||
date,
|
||||
endDate,
|
||||
image: r.image,
|
||||
scrollText: r.scrollText,
|
||||
count: r.count,
|
||||
fireworkInterval: r.fireworkInterval,
|
||||
skipFireworks: r.skipFireworks,
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成本年度内置公历节日配置(可直接与手动 `festivalConfigList` 合并)
|
||||
*/
|
||||
export function buildBuiltinSolarFestivals(year: number): FestivalConfig[] {
|
||||
const staticPart = BUILTIN_SOLAR_RULES.map((r) => {
|
||||
const date = ymd(year, r.month, r.day);
|
||||
const endDate = r.endDay !== undefined ? ymd(year, r.month, r.endDay) : undefined;
|
||||
return {
|
||||
name: r.name,
|
||||
date,
|
||||
endDate,
|
||||
image: r.image,
|
||||
scrollText: r.scrollText,
|
||||
count: r.count,
|
||||
fireworkInterval: r.fireworkInterval,
|
||||
skipFireworks: r.skipFireworks,
|
||||
};
|
||||
});
|
||||
return [...staticPart, ...buildDynamicSolarFestivals(year)];
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
/**
|
||||
* 节日庆祝配置
|
||||
*
|
||||
* 配置系统的节日烟花效果和祝福文本。
|
||||
* 支持单日节日和跨日期节日,可自定义烟花播放次数与连发间隔。
|
||||
* 同一天命中多条时,**日期区间更短**的一条优先生效(例如区间更短的节日条会盖住全年的「系统公告」)。
|
||||
*
|
||||
* ## 配置说明
|
||||
*
|
||||
* - name: 节日名称
|
||||
* - date: 节日开始日期(格式:YYYY-MM-DD)
|
||||
* - endDate: 节日结束日期(可选,用于跨日期节日)
|
||||
* - image: 礼花/烟花图片(需预先 import;空字符串表示默认几何粒子)
|
||||
* - scrollText: 滚动显示的祝福文本
|
||||
* - count: 烟花播放次数(可选,默认为 3 次)
|
||||
* - fireworkInterval: 两次发射间隔毫秒(可选,默认 1000;调小更密集,如雪花连续感)
|
||||
* - skipFireworks: 为 true 时不放烟花,仅显示 scrollText(适合长期顶栏公告)
|
||||
* - scrollText 可使用占位符 {{version}}、{{introduceUrl}}(构建时替换为版本号与演示链接)
|
||||
*
|
||||
* ## 礼花图与快捷键补充
|
||||
*
|
||||
* - `image` 为红包碎屑 hb、雪花 sd、礼花筒 yd 等时,须在下方 import,勿手写路径字符串。
|
||||
* - 全局快捷键:**Ctrl + Shift + P**(Windows / Linux)或 **⌘ + Shift + P**(macOS)立即触发一发礼花;
|
||||
* 若当天命中某条「带礼花」的节日配置则使用该配置的 `image`,否则为几何礼花。
|
||||
* - 实现:`src/layouts/art-fireworks-effect/index.vue`(键盘)、`src/hooks/core/useCeremony.ts`(自动连发)。
|
||||
*
|
||||
* ## 自动公历节日
|
||||
*
|
||||
* `src/config/modules/festival.builtin.ts` 会按**当前年份**生成元旦、劳动节、国庆、圣诞等公历节日及礼花效果;
|
||||
* 与下方 `festivalConfigList` **合并**后参与匹配:日期区间**更短**的优先;区间长度相同时 **本文件中的手动项优先于内置**。
|
||||
* 春节、中秋等农历日期请在本文件用手动 `date` / `endDate` 配置覆盖。
|
||||
*
|
||||
* ## 非节日常驻与周末
|
||||
*
|
||||
* 常驻条目标记 `isResidentBanner: true`(全年区间 + `skipFireworks` 典型)。展示优先级为:
|
||||
* **节日(内置+手动)→ 周末提示 → 常驻**:周六/周日若无其它节日命中,显示周末文案;工作日无节日则回落到常驻。
|
||||
*
|
||||
* ## 注意事项
|
||||
*
|
||||
* - 图片需要预先导入并在配置中引用;新增素材放在 `src/assets/images/ceremony/`,全局画布会预加载
|
||||
* `festivalConfigList` 中所有非空 `image`。
|
||||
* - 跨日期节日会在整个日期范围内生效。
|
||||
* - 每个用户每个自然日「自动礼花」流程只会完整播放一次(由 setting store 按自然日记录)。
|
||||
*
|
||||
* @module config/modules/festival
|
||||
* @author FastapiAdmin Team
|
||||
*/
|
||||
|
||||
import type { FestivalConfig } from "@/types/config";
|
||||
|
||||
export const festivalConfigList: FestivalConfig[] = [
|
||||
/**
|
||||
* 以下为历史示例片段(默认注释),需要时可取消注释并酌情调整日期 / import:
|
||||
*
|
||||
* 五月短区间示例:含当前日期则会出现节日滚动条;烟花需当日首次进入且未在同日标记已播。
|
||||
* 上线前请改成真实活动日期与文案。
|
||||
*/
|
||||
// {
|
||||
// name: "五月温馨提示",
|
||||
// date: "2026-05-04",
|
||||
// endDate: "2026-05-05",
|
||||
// image: yd,
|
||||
// count: 3,
|
||||
// scrollText:
|
||||
// "🎉 五月快乐!FastAPI Admin 祝您工作顺利、迭代顺利。本月请关注备份与安全策略,遇到问题可先查看文档或联系运维。",
|
||||
// },
|
||||
|
||||
/** 单日示例(圣诞节):需取消注释并确保已 import 雪花图 */
|
||||
// {
|
||||
// name: "圣诞节",
|
||||
// date: "2026-12-25",
|
||||
// image: sd,
|
||||
// count: 3,
|
||||
// scrollText:
|
||||
// "Merry Christmas!祝您圣诞快乐,愿节日的欢乐与祝福如雪花般纷至沓来!",
|
||||
// },
|
||||
|
||||
/** 版本公告类跨日期示例(仅文案参考,可按需改写 scrollText) */
|
||||
// {
|
||||
// name: "v3.0 测试阶段",
|
||||
// date: "2026-11-03",
|
||||
// endDate: "2026-11-09",
|
||||
// image: "",
|
||||
// count: 3,
|
||||
// scrollText:
|
||||
// "🚀 系统 v3.0 测试阶段正式开启!测试周期内请关注文档更新与反馈渠道,正式发布敬请期待~",
|
||||
// },
|
||||
];
|
||||
|
||||
export { buildBuiltinSolarFestivals } from "./festival.builtin";
|
||||
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* 顶部栏功能配置
|
||||
*
|
||||
* 统一管理顶部栏各个功能模块的启用状态。
|
||||
* 通过修改此配置文件可以快速启用或禁用顶部栏的功能按钮。
|
||||
*
|
||||
* @module config/headerBar
|
||||
* @author FastapiAdmin Team
|
||||
*/
|
||||
|
||||
import type { HeaderBarFeatureConfig } from "@/types/config";
|
||||
|
||||
/**
|
||||
* 顶部栏功能配置对象
|
||||
*/
|
||||
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: "主题切换功能(明暗主题)",
|
||||
},
|
||||
sizeSelect: {
|
||||
enabled: true,
|
||||
description: "Element Plus 组件尺寸(默认/大/小)",
|
||||
},
|
||||
};
|
||||
|
||||
export default headerBarConfig;
|
||||
@@ -0,0 +1,173 @@
|
||||
/**
|
||||
* 系统设置默认值配置
|
||||
*
|
||||
* 统一管理系统设置的所有默认值
|
||||
*
|
||||
* ## 主要功能
|
||||
*
|
||||
* - 菜单相关默认配置
|
||||
* - 主题相关默认配置
|
||||
* - 界面显示默认配置
|
||||
* - 功能开关默认配置
|
||||
* - 样式相关默认配置
|
||||
*
|
||||
* ## 注意事项
|
||||
*
|
||||
* 1. 修改此文件的配置项时,需要同步更新以下文件:
|
||||
* - src/layouts/fa-settings-panel/widgets/SettingActions.vue(复制配置和重置配置逻辑)
|
||||
* - src/store/modules/setting.ts(Store 状态定义)
|
||||
* 2. 可以通过设置面板的"复制配置"按钮快速生成配置代码
|
||||
* 3. 枚举类型的值需要与 src/enums/appEnum.ts 中的定义保持一致
|
||||
*/
|
||||
|
||||
import AppConfig from "@/config";
|
||||
import { LayoutMode, ComponentSize, SidebarColor, ThemeMode } from "@/enums";
|
||||
import {
|
||||
SystemThemeEnum,
|
||||
MenuTypeEnum,
|
||||
MenuThemeEnum,
|
||||
LanguageEnum,
|
||||
ContainerWidthEnum,
|
||||
} from "@/enums/appEnum";
|
||||
|
||||
const env = import.meta.env;
|
||||
const { pkg } = __APP_INFO__;
|
||||
|
||||
// 检查用户的操作系统是否使用深色模式
|
||||
const prefersDark = window.matchMedia("(prefers-color-scheme: dark)").matches;
|
||||
|
||||
/**
|
||||
* 系统设置默认值配置
|
||||
*/
|
||||
export const SETTING_DEFAULT_CONFIG = {
|
||||
/** 项目名称 */
|
||||
name: pkg.name as string,
|
||||
/** 系统标题 */
|
||||
title: (env.VITE_APP_TITLE as string) || pkg.name,
|
||||
/** 系统版本 */
|
||||
version: pkg.version as string,
|
||||
/** 是否显示设置按钮 */
|
||||
showSettings: true,
|
||||
/** 是否显示菜单搜索 */
|
||||
showMenuSearch: true,
|
||||
/** 是否显示全屏按钮 */
|
||||
showFullscreen: true,
|
||||
/** 是否显示尺寸选择 */
|
||||
showSizeSelect: true,
|
||||
/** 是否显示语言选择 */
|
||||
showLangSelect: true,
|
||||
/** 是否显示通知 */
|
||||
showNotification: true,
|
||||
/** 是否显示标签视图 */
|
||||
showTagsView: true,
|
||||
/** 是否显示应用Logo */
|
||||
showAppLogo: true,
|
||||
/** 布局方式 */
|
||||
layout: LayoutMode.LEFT,
|
||||
/** 主题模式 */
|
||||
theme: prefersDark ? ThemeMode.DARK : ThemeMode.LIGHT,
|
||||
/** 组件大小 */
|
||||
size: ComponentSize.DEFAULT,
|
||||
/** 语言 */
|
||||
language: LanguageEnum.ZH,
|
||||
/** 主题颜色 */
|
||||
themeColor: "#4080FF",
|
||||
/** 是否显示水印 */
|
||||
showWatermark: false,
|
||||
/** 水印内容 */
|
||||
watermarkContent: pkg.name,
|
||||
/** 侧边栏配色方案 */
|
||||
sidebarColorScheme: SidebarColor.CLASSIC_BLUE,
|
||||
/** 项目引导可见性 */
|
||||
guideVisible: false,
|
||||
/** 是否启动引导 */
|
||||
showGuide: true,
|
||||
/** 是否开启AI助手 */
|
||||
aiEnabled: false,
|
||||
/** 是否开启灰色模式 */
|
||||
grayMode: false,
|
||||
/** 页面切换动画 */
|
||||
pageSwitchingAnimation: "fade-slide",
|
||||
/** 菜单类型 */
|
||||
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: true,
|
||||
/** 是否显示设置引导 */
|
||||
showSettingGuide: true,
|
||||
/** 是否显示节日文本 */
|
||||
showFestivalText: false,
|
||||
/** 是否显示水印(新版本字段) */
|
||||
watermarkVisible: false,
|
||||
/** 是否自动关闭 */
|
||||
autoClose: false,
|
||||
/** 是否唯一展开 */
|
||||
uniqueOpened: true,
|
||||
/** 是否色弱模式 */
|
||||
colorWeak: false,
|
||||
/** 是否刷新 */
|
||||
refresh: false,
|
||||
/** 是否加载节日烟花 */
|
||||
holidayFireworksLoaded: false,
|
||||
/** 边框模式 */
|
||||
boxBorderMode: true,
|
||||
/** 页面过渡效果 */
|
||||
pageTransition: "slide-left",
|
||||
/** 标签页样式 */
|
||||
tabStyle: "tab-google",
|
||||
/** 自定义圆角 */
|
||||
customRadius: "0.75",
|
||||
/** 容器宽度 */
|
||||
containerWidth: ContainerWidthEnum.FULL,
|
||||
/** 节日日期 */
|
||||
festivalDate: "",
|
||||
};
|
||||
|
||||
/** 与 Store / App 中使用的默认设置别名(同 SETTING_DEFAULT_CONFIG) */
|
||||
export const defaultSettings = SETTING_DEFAULT_CONFIG;
|
||||
|
||||
/**
|
||||
* 获取设置默认值
|
||||
* @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