Administrator 94dbd0d34c refactor: 将记分板功能模块化为可复用组件
- 创建 app/modules/scoreboard 模块目录
- 添加配置常量 (EVENT_CATEGORIES, TEAM_GROUPS, EVENT_TYPES)
- 添加 API 工具函数 (fetchEvents, fetchTeams, fetchResults 等)
- 添加可复用组件 (ModuleLayout, StatCard, DataTable)
- 添加模块导出文件 (mod.ts)
- 添加模块使用文档 (README.md)
- 更新首页使用模块 API 函数

后续可通过 import { xxx } from '~/modules/scoreboard' 导入使用
2026-03-17 22:33:01 +08:00

78 lines
1.7 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/**
* 运动会记分板系统模块
*
* 此模块提供完整的运动会管理功能
* 可作为独立模块集成到更大的系统中
*/
// 模块配置
export const scoreboardModule = {
name: 'scoreboard',
version: '1.0.0',
description: '运动会记分板管理模块'
}
// 比赛类别配置
export const EVENT_CATEGORIES = {
FIELD: '田赛',
TRACK: '径赛',
TEAM: '团体赛'
} as const
// 组别配置
export const TEAM_GROUPS = {
TEACHER: '教师组',
AVIATION: '航空班组',
SPORTS: '体育班组',
CULTURE_A: '文化班甲组',
CULTURE_B: '文化班乙组'
} as const
// 项目配置
export const EVENT_TYPES = {
[EVENT_CATEGORIES.FIELD]: [
{ name: '跳高', unit: '米' },
{ name: '跳远', unit: '米' },
{ name: '掷铅球', unit: '米' }
],
[EVENT_CATEGORIES.TRACK]: [
{ name: '100m', unit: '秒' },
{ name: '200m', unit: '秒' },
{ name: '400m', unit: '秒' },
{ name: '4×100m', unit: '秒' },
{ name: '4×400m', unit: '秒' },
{ name: '20×50m', unit: '秒' }
],
[EVENT_CATEGORIES.TEAM]: [
{ name: '旱地龙舟', unit: '秒' },
{ name: '跳长绳', unit: '次' },
{ name: '折返跑', unit: '秒' }
]
}
// 积分规则
export const SCORING_RULES = {
GOLD: { rank: 1, points: 7, medal: 'gold' },
SILVER: { rank: 2, points: 5, medal: 'silver' },
BRONZE: { rank: 3, points: 3, medal: 'bronze' }
}
// API 路由
export const API_ROUTES = {
EVENTS: '/api/events',
TEAMS: '/api/teams',
RESULTS: '/api/results',
SCOREBOARD: '/api/scoreboard',
CONFIG: '/api/config',
SEED: '/api/seed'
} as const
// 页面路由
export const PAGE_ROUTES = {
HOME: '/',
EVENTS: '/events',
TEAMS: '/teams',
RESULTS: '/results',
SCOREBOARD: '/scoreboard'
} as const