diff --git a/src/api/martial/activitySchedule.js b/src/api/martial/activitySchedule.js index 81ddcf2..fb3c93d 100644 --- a/src/api/martial/activitySchedule.js +++ b/src/api/martial/activitySchedule.js @@ -196,3 +196,13 @@ export const exportSchedule = (competitionId) => { responseType: 'blob' }) } + +// Export schedule template 2 (competition time format) +export const exportScheduleTemplate2 = (competitionId, venueId, venueName, timeSlot) => { + return request({ + url: '/martial/export/schedule2', + method: 'get', + params: { competitionId, venueId, venueName, timeSlot }, + responseType: 'blob' + }) +} diff --git a/src/router/views/index.js b/src/router/views/index.js index f48f1c9..1bb13c0 100644 --- a/src/router/views/index.js +++ b/src/router/views/index.js @@ -48,7 +48,7 @@ export default [ redirect: '/martial/order/list', children: [ { - path: 'competition/list', + path: 'competition/index', name: '赛事管理', meta: { keepAlive: false, diff --git a/src/views/martial/competition/index.vue b/src/views/martial/competition/index.vue index 4f13a04..21542a4 100644 --- a/src/views/martial/competition/index.vue +++ b/src/views/martial/competition/index.vue @@ -1581,7 +1581,7 @@ export default { handleCreate() { this.$router.push({ - path: '/martial/competition/list', + path: '/martial/competition/index', query: { mode: 'create' } }); }, @@ -1589,21 +1589,21 @@ export default { handleView(row) { console.log(row) this.$router.push({ - path: '/martial/competition/list', + path: '/martial/competition/index', query: { mode: 'view', id: row.id } }); }, handleEdit(row) { this.$router.push({ - path: '/martial/competition/list', + path: '/martial/competition/index', query: { mode: 'edit', id: row.id } }); }, switchToEdit() { this.$router.push({ - path: '/martial/competition/list', + path: '/martial/competition/index', query: { mode: 'edit', id: this.competitionId } }); }, @@ -1882,7 +1882,7 @@ export default { backToList() { this.$router.push({ - path: '/martial/competition/list' + path: '/martial/competition/index' }); // 路由跳转后,在 initPage 中会自动加载列表 }, diff --git a/src/views/martial/project/index.vue b/src/views/martial/project/index.vue index cd15df7..ccc1fec 100644 --- a/src/views/martial/project/index.vue +++ b/src/views/martial/project/index.vue @@ -174,11 +174,7 @@ {{ row.maxParticipants || 0 }} - - - + - - - - - - - @@ -486,7 +464,6 @@ import { exportProjects } from '@/api/martial/project' import { getCompetitionList } from '@/api/martial/competition' -import { getVenuesByCompetition } from '@/api/martial/venue' import { getToken } from '@/utils/auth' import dayjs from 'dayjs' @@ -497,8 +474,6 @@ const tableData = ref([]) const total = ref(0) const selection = ref([]) const competitionList = ref([]) -const venueList = ref([]) -const allVenuesCache = ref(new Map()) // 全局场地缓存 const dialogVisible = ref(false) const detailVisible = ref(false) const dialogTitle = ref('') @@ -520,7 +495,6 @@ const queryParams = reactive({ const form = reactive({ id: null, competitionId: '', - venueId: null, projectCode: '', projectName: '', category: null, @@ -589,20 +563,6 @@ const loadCompetitionList = async () => { } } -// 表单中赛事变更时加载场地列表 -const handleCompetitionChangeInForm = async (competitionId) => { - form.venueId = null - venueList.value = [] - if (competitionId) { - try { - const res = await getVenuesByCompetition(competitionId) - venueList.value = res.data?.data?.records || [] - } catch (error) { - console.error('加载场地列表失败:', error) - } - } -} - // 查询数据 const fetchData = async () => { loading.value = true @@ -623,8 +583,6 @@ const fetchData = async () => { if (res.data && res.data.data) { tableData.value = res.data.data.records || [] total.value = res.data.data.total || 0 - // 加载项目对应的场地信息 - await loadVenuesForProjects(tableData.value) } } catch (error) { ElMessage.error('获取数据失败') @@ -634,24 +592,6 @@ const fetchData = async () => { } } -// 加载项目对应的场地信息 -const loadVenuesForProjects = async (projects) => { - // 获取所有不同的赛事ID - const competitionIds = [...new Set(projects.map(p => p.competitionId).filter(Boolean))] - for (const compId of competitionIds) { - try { - const res = await getVenuesByCompetition(compId) - const venues = res.data?.data?.records || [] - // 缓存场地信息 - venues.forEach(v => { - allVenuesCache.value.set(v.id, v.venueName) - }) - } catch (err) { - console.error('加载场地失败:', err) - } - } -} - // 搜索 const handleSearch = () => { queryParams.current = 1 @@ -689,15 +629,6 @@ const handleEdit = async (row) => { if (row.price !== undefined) { form.registrationFee = row.price } - // 加载该赛事的场地列表 - if (row.competitionId) { - try { - const res = await getVenuesByCompetition(row.competitionId) - venueList.value = res.data?.data?.records || [] - } catch (error) { - console.error('加载场地列表失败:', error) - } - } dialogVisible.value = true } @@ -870,18 +801,6 @@ const getCompetitionName = (competitionId) => { return competition ? competition.competitionName : '-' } -const getVenueName = (venueId) => { - if (!venueId) return '-' - // 先从当前场地列表查找 - let venue = venueList.value.find(item => item.id === venueId) - if (venue) return venue.venueName - // 再从全局缓存查找 - if (allVenuesCache.value.has(venueId)) { - return allVenuesCache.value.get(venueId) - } - return '-' -} - // 格式化日期 const formatDate = (date) => { if (!date) return '-' diff --git a/src/views/martial/project/index.vue.backup b/src/views/martial/project/index.vue.backup new file mode 100644 index 0000000..cd15df7 --- /dev/null +++ b/src/views/martial/project/index.vue.backup @@ -0,0 +1,931 @@ + + + + + diff --git a/src/views/martial/schedule/index.vue b/src/views/martial/schedule/index.vue index d015c1a..32d727b 100644 --- a/src/views/martial/schedule/index.vue +++ b/src/views/martial/schedule/index.vue @@ -276,7 +276,15 @@ @@ -380,7 +388,7 @@ import { ArrowDown, ArrowRight } from '@element-plus/icons-vue' import { getVenuesByCompetition } from '@/api/martial/venue' import { getCompetitionDetail } from '@/api/martial/competition' -import { getScheduleResult, saveAndLockSchedule, saveDraftSchedule, triggerAutoArrange, moveScheduleGroup, exportSchedule } from '@/api/martial/activitySchedule' +import { getScheduleResult, saveAndLockSchedule, saveDraftSchedule, triggerAutoArrange, moveScheduleGroup, exportSchedule, exportScheduleTemplate2 } from '@/api/martial/activitySchedule' import { updateCheckInStatus, getScheduleConfig } from '@/api/martial/schedulePlan' export default { @@ -1148,6 +1156,34 @@ export default { group.items.splice(itemIndex + 1, 0, temp) this.$message.success('下移成功') }, + handleExportCommand(command) { + if (command === 'template1') { + this.handleExport() + } else if (command === 'template2') { + this.handleExportTemplate2() + } + }, + async handleExportTemplate2() { + try { + this.loading = true + const venueId = this.selectedVenueId + const venue = this.venues.find(v => v.id === venueId) + const venueName = venue ? venue.venueName : null + const res = await exportScheduleTemplate2(this.competitionId, venueId, venueName, null) + const blob = new Blob([res.data], { type: 'application/vnd.ms-excel' }) + const link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = `比赛时间_${venueName || '全部场地'}_${this.competitionInfo.competitionName || this.competitionId}.xlsx` + link.click() + window.URL.revokeObjectURL(link.href) + this.$message.success('导出成功') + } catch (error) { + console.error('导出失败:', error) + this.$message.error('导出失败,请稍后重试') + } finally { + this.loading = false + } + }, async handleExport() { try { this.loading = true diff --git a/src/views/martial/score/index.vue b/src/views/martial/score/index.vue index b49a9e2..fb21ee1 100644 --- a/src/views/martial/score/index.vue +++ b/src/views/martial/score/index.vue @@ -94,7 +94,8 @@ @@ -153,12 +154,17 @@
总分: - {{ formatScore(currentDetail.totalScore) }} -
- - (去掉最高分和最低分后的平均分) - -
+ +
@@ -398,7 +404,9 @@ export default { playerNo: score.playerNo || '', judgeScores: [], scoreDetails: [], - totalScore: 0 + totalScore: 0, + chiefJudgeScore: score.chiefJudgeScore, + scoreStatus: score.scoreStatus || 0 }) } @@ -565,6 +573,16 @@ export default { } .total-score { + } + + .pending-score { + color: #e6a23c; + font-weight: 500; + } + + .value.pending { + color: #e6a23c; + font-weight: 500; color: #1b7c5e; font-weight: 700; font-size: 14px;