From 49c1cd81c60d95316aff8cac51bc4bdf23772017 Mon Sep 17 00:00:00 2001 From: DevOps Date: Thu, 8 Jan 2026 15:46:48 +0800 Subject: [PATCH] =?UTF-8?q?=E9=87=8D=E6=9E=84=E9=A1=B93:=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E8=A1=A8=E5=8F=B7=E7=94=9F=E6=88=90=E5=92=8C=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在编排页面项目头部添加表号显示 - 实现generateTableNo方法,格式为: 场地(1位)+时段(1位)+序号(2位) - 时段规则: 上午=1, 下午=2 - 序号在同场地同时段中按id排序确定 Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com> --- src/views/martial/schedule/index.vue | 49 ++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/src/views/martial/schedule/index.vue b/src/views/martial/schedule/index.vue index 32d727b..1e8dcbc 100644 --- a/src/views/martial/schedule/index.vue +++ b/src/views/martial/schedule/index.vue @@ -87,6 +87,7 @@ {{ getTeamCount(group) }}队 {{ group.items?.length || 0 }}组 {{ group.code }} + 表号: {{ generateTableNo(group) }}
v.id === group.venueId || String(v.id) === String(group.venueId)) + if (venue && venue.venueName) { + // 从场地名称提取数字 + const match = venue.venueName.match(/\d+/) + if (match) { + venueNo = parseInt(match[0]) + } + } + } + + // 2. 获取时段:上午=1, 下午=2 + let period = 1 + if (group.timeSlot) { + const hour = parseInt(group.timeSlot.split(':')[0]) + period = hour < 12 ? 1 : 2 + } + + // 3. 获取序号:在同场地同时段中的顺序 + const sameSlotGroups = this.competitionGroups.filter(g => { + const gVenueMatch = String(g.venueId) === String(group.venueId) + if (!gVenueMatch) return false + const gHour = parseInt((g.timeSlot || '08:30').split(':')[0]) + const gPeriod = gHour < 12 ? 1 : 2 + return gPeriod === period + }) + // 按id排序保持稳定顺序 + sameSlotGroups.sort((a, b) => (a.id || 0) - (b.id || 0)) + const orderIndex = sameSlotGroups.findIndex(g => g.id === group.id) + 1 + + // 4. 格式化: 场地(1位) + 时段(1位) + 序号(2位) + return `${venueNo}${period}${String(orderIndex).padStart(2, '0')}` + }, + // 检查项目是否展开 isProjectExpanded(groupId) { return this.expandedProjects[groupId] === true @@ -1457,6 +1496,16 @@ export default { color: #606266; font-size: 13px; } + + .project-table-no { + color: #409EFF; + font-size: 13px; + font-weight: 500; + margin-left: 10px; + padding: 2px 8px; + background-color: #ecf5ff; + border-radius: 4px; + } } .project-actions {