From e1f13dae0d9f2df429e68d2e5f6b832ce2a0449c Mon Sep 17 00:00:00 2001 From: Z-WICK <2289431216@qq.com> Date: Fri, 9 Jan 2026 17:42:48 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E7=BC=96=E6=8E=92?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 项目列表分组类别显示男子/女子/混合标签 2. 编排页时间段只显示有比赛的时段 3. 集体项目显示队数和组数 4. 单人项目显示1组 Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- src/views/martial/project/index.vue | 5 ++- src/views/martial/schedule/index.vue | 48 ++++++++++++++++++++++++++-- 2 files changed, 50 insertions(+), 3 deletions(-) diff --git a/src/views/martial/project/index.vue b/src/views/martial/project/index.vue index 3c433d9..973d1ed 100644 --- a/src/views/martial/project/index.vue +++ b/src/views/martial/project/index.vue @@ -135,7 +135,10 @@ diff --git a/src/views/martial/schedule/index.vue b/src/views/martial/schedule/index.vue index 1e8dcbc..6680411 100644 --- a/src/views/martial/schedule/index.vue +++ b/src/views/martial/schedule/index.vue @@ -84,8 +84,8 @@ {{ groupIndex + 1 }}、 {{ group.title }} {{ group.type }} - {{ getTeamCount(group) }}队 - {{ group.items?.length || 0 }}组 + {{ group.type === '集体' ? getTeamCount(group) + '队' : '1组' }} + {{ group.type === '集体' ? getTeamCount(group) + '组' : '' }} {{ group.code }} 表号: {{ generateTableNo(group) }} @@ -883,6 +883,49 @@ export default { console.log('生成的时间段:', this.timeSlots) }, + // 根据实际编排数据更新显示的时间段(只显示有比赛的时段) + updateTimeSlotsFromGroups() { + if (!this.competitionGroups || this.competitionGroups.length === 0) { + return + } + // 从分组数据中提取实际使用的时段索引 + const usedTimeSlotIndexes = new Set() + this.competitionGroups.forEach(group => { + if (group.timeSlotIndex !== null && group.timeSlotIndex !== undefined) { + usedTimeSlotIndexes.add(group.timeSlotIndex) + } + }) + if (usedTimeSlotIndexes.size === 0) { + return + } + // 保存原始时段用于映射 + const allSlots = [...this.timeSlots] + const filteredSlots = [] + const indexMapping = {} + let newIndex = 0 + allSlots.forEach((slot, oldIndex) => { + if (usedTimeSlotIndexes.has(oldIndex)) { + filteredSlots.push(slot) + indexMapping[oldIndex] = newIndex + newIndex++ + } + }) + // 更新分组的时段索引 + this.competitionGroups.forEach(group => { + if (group.timeSlotIndex !== null && group.timeSlotIndex !== undefined) { + const newIdx = indexMapping[group.timeSlotIndex] + if (newIdx !== undefined) { + group.timeSlotIndex = newIdx + } + } + }) + this.timeSlots = filteredSlots + console.log("过滤后的时间段:", this.timeSlots) + if (this.selectedTime >= this.timeSlots.length) { + this.selectedTime = 0 + } + }, + // 加载场地列表 async loadVenues() { try { @@ -972,6 +1015,7 @@ export default { console.log('解析后的competitionGroups:', this.competitionGroups) console.log('当前selectedVenueId:', this.selectedVenueId) console.log('当前selectedTime:', this.selectedTime) + this.updateTimeSlotsFromGroups() this.$message.success(data.isDraft ? '已加载草稿数据' : '已加载编排数据') } else { // 后端还没有数据,使用默认数据进行展示