diff --git a/src/api/martial/activitySchedule.js b/src/api/martial/activitySchedule.js index 866aea4..81ddcf2 100644 --- a/src/api/martial/activitySchedule.js +++ b/src/api/martial/activitySchedule.js @@ -183,3 +183,16 @@ export const saveDispatch = (data) => { data }) } + +/** + * 导出赛程表 + * @param {Number} competitionId - 赛事ID + */ +export const exportSchedule = (competitionId) => { + return request({ + url: '/martial/export/schedule', + method: 'get', + params: { competitionId }, + responseType: 'blob' + }) +} diff --git a/src/views/martial/order/index.vue.bak b/src/views/martial/order/index.vue.bak new file mode 100644 index 0000000..60b8c4f --- /dev/null +++ b/src/views/martial/order/index.vue.bak @@ -0,0 +1,355 @@ + + + + + diff --git a/src/views/martial/participant/index.vue.bak b/src/views/martial/participant/index.vue.bak new file mode 100644 index 0000000..b260bb8 --- /dev/null +++ b/src/views/martial/participant/index.vue.bak @@ -0,0 +1,990 @@ + + + + + diff --git a/src/views/martial/schedule/index.vue b/src/views/martial/schedule/index.vue index 0f3a22a..1498dd7 100644 --- a/src/views/martial/schedule/index.vue +++ b/src/views/martial/schedule/index.vue @@ -380,7 +380,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 } from '@/api/martial/activitySchedule' +import { getScheduleResult, saveAndLockSchedule, saveDraftSchedule, triggerAutoArrange, moveScheduleGroup, exportSchedule } from '@/api/martial/activitySchedule' export default { name: 'MartialScheduleList', @@ -1113,8 +1113,23 @@ export default { group.items.splice(itemIndex + 1, 0, temp) this.$message.success('下移成功') }, - handleExport() { - this.$message.success('导出功能开发中') + async handleExport() { + try { + this.loading = true + const res = await exportSchedule(this.competitionId) + const blob = new Blob([res], { type: 'application/vnd.ms-excel' }) + const link = document.createElement('a') + link.href = window.URL.createObjectURL(blob) + link.download = `赛程表_${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 + } }, handleConfirm() { this.confirmDialogVisible = true diff --git a/src/views/martial/schedule/index.vue.bak b/src/views/martial/schedule/index.vue.bak new file mode 100644 index 0000000..78ed40f --- /dev/null +++ b/src/views/martial/schedule/index.vue.bak @@ -0,0 +1,1019 @@ + + + + +