From 8e7bb90c60ec5c8ed0396d441041fe552a6964fc Mon Sep 17 00:00:00 2001
From: Z-WICK <2289431216@qq.com>
Date: Tue, 6 Jan 2026 11:47:56 +0800
Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8A=A5=E5=90=8D?=
=?UTF-8?q?=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=E6=96=87=E6=A1=88=E5=92=8C?=
=?UTF-8?q?=E7=BB=9F=E8=AE=A1=E9=80=BB=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修正错误文案: 单位型号人数 → 报名人数, 剩下显时(公共) → 预计时长(分钟)
- 重新设计参赛人数统计表格: 单位/单人项目/集体项目/男/女/合计
- 修复统计逻辑按项目类型和性别正确统计
Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
---
src/views/martial/registration/index.vue | 47 ++++++++++++++++--------
1 file changed, 31 insertions(+), 16 deletions(-)
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 {
// 使用缓存的参赛者列表