From d22944e575056c58b10d919576d32b9402a44560 Mon Sep 17 00:00:00 2001 From: DevOps Date: Tue, 30 Dec 2025 17:16:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(select-event):=20=E6=A0=B9=E6=8D=AE?= =?UTF-8?q?=E5=8F=82=E8=B5=9B=E7=B1=BB=E5=9E=8B=E8=BF=87=E6=BB=A4=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E5=88=97=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 单人赛只显示type=1的项目 - 集体赛只显示type=2的项目 - 修复Issue #5: 单人/集体比赛区分问题 --- src/pages/select-event/select-event.vue | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/src/pages/select-event/select-event.vue b/src/pages/select-event/select-event.vue index 9a30f5d..5c9791d 100644 --- a/src/pages/select-event/select-event.vue +++ b/src/pages/select-event/select-event.vue @@ -39,19 +39,32 @@ export default { onLoad(options) { if (options.eventId) { this.eventId = options.eventId; - this.loadProjectList(options.eventId) } if (options.type) { this.type = options.type; } + // Load project list after type is set + if (this.eventId) { + this.loadProjectList(this.eventId) + } }, methods: { /** - * 加载报名项目列表 + * Load project list filtered by participation type + * @param {String} eventId Competition ID */ async loadProjectList(eventId) { try { - const res = await competitionAPI.getProjectList({ competitionId: eventId }) + const params = { competitionId: eventId } + + // Filter by participation type: single=1, team=2 + if (this.type === 'single') { + params.type = 1 + } else if (this.type === 'team') { + params.type = 2 + } + + const res = await competitionAPI.getProjectList(params) let list = [] if (res.records) { @@ -60,7 +73,6 @@ export default { list = res } - // 数据映射 this.projectList = list.map(item => ({ id: item.id, name: item.name || item.projectName,