diff --git a/src/views/martial/registration/index.vue b/src/views/martial/registration/index.vue
index c5983f3..9774158 100644
--- a/src/views/martial/registration/index.vue
+++ b/src/views/martial/registration/index.vue
@@ -101,12 +101,10 @@
{{ scope.row.hint }}
-
-
-
-
-
-
+
+
+
+
+{{ scope.row.total }}
@@ -127,8 +125,8 @@
-
-
+
+
@@ -335,38 +333,55 @@ export default {
const participants = await this.getParticipants()
console.log('参赛人员列表返回:', participants)
+ // 预加载项目信息
+ await this.preloadProjectInfo(participants)
+
// 按单位分组统计
const unitMap = new Map()
participants.forEach(p => {
// 兼容驼峰和下划线命名
const unit = p.organization || p.teamName || p.team_name || '未知单位'
+ const projectId = p.projectId || p.project_id
+ const project = this.projectCache.get(projectId)
+ const projectType = project ? (project.type || 1) : 1 // 1=单人, 2=集体
+
if (!unitMap.has(unit)) {
unitMap.set(unit, {
schoolUnit: unit,
- category: '',
- individual: 0,
- dual: 0,
- team1101: 0,
- workers: 0,
+ singleCount: 0,
+ teamCount: 0,
+ male: 0,
female: 0,
total: 0
})
}
const stat = unitMap.get(unit)
stat.total++
- if (p.gender === 2) stat.female++
+
+ // 按项目类型统计
+ if (projectType === 1) {
+ stat.singleCount++
+ } else {
+ stat.teamCount++
+ }
+
+ // 按性别统计
+ if (p.gender === 1) {
+ stat.male++
+ } else if (p.gender === 2) {
+ stat.female++
+ }
})
this.participantsData = Array.from(unitMap.values())
} catch (err) {
console.error('加载参赛人员统计失败', err)
this.$message.warning('加载参赛人员统计失败')
- // 使用空数组作为默认值
this.participantsData = []
}
},
- // 加载项目时间统计(该赛事的所有项目及参赛人数)
+ // 加载项目时间统计(该赛事的所有项目及参赛人数)
async loadProjectTimeStats() {
try {
// 使用缓存的参赛者列表