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

67 lines
1011 B
Vue

<template>
<el-card class="stat-card">
<div class="stat-content">
<el-icon class="stat-icon" :color="color">
<component :is="icon" />
</el-icon>
<div class="stat-info">
<div class="stat-value">{{ value }}</div>
<div class="stat-label">{{ label }}</div>
</div>
</div>
</el-card>
</template>
<script setup lang="ts">
interface Props {
icon: string
label: string
value?: string | number
color?: string
}
withDefaults(defineProps<Props>(), {
value: '0',
color: '#409eff'
})
</script>
<style scoped>
.stat-card {
text-align: center;
}
.stat-content {
display: flex;
align-items: center;
justify-content: center;
gap: 15px;
}
.stat-icon {
font-size: 40px;
}
.stat-value {
font-size: 32px;
font-weight: bold;
color: #303133;
}
.stat-label {
font-size: 14px;
color: #909399;
margin-top: 5px;
}
@media (max-width: 900px) {
.stat-value {
font-size: 24px;
}
.stat-icon {
font-size: 28px;
}
}
</style>