From cc6fabe57603a8abafb059307cea7adb076f336d Mon Sep 17 00:00:00 2001 From: DevOps Date: Fri, 26 Dec 2025 15:45:10 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E8=A3=81=E5=88=A4=E9=82=80=E8=AF=B7?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E5=8A=9F=E8=83=BD=E6=B7=BB=E5=8A=A0=E5=9C=BA?= =?UTF-8?q?=E5=9C=B0=E5=92=8C=E9=A1=B9=E7=9B=AE=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 导入对话框添加场地下拉选择 - 导入对话框添加项目多选 - 调用API时传递venueId和projects参数 🤖 Generated with Claude Code Co-Authored-By: Claude Opus 4.5 --- src/views/martial/judgeInvite/index.vue | 96 +++++++++++++++++++++++++ vite.config.js | 3 +- 2 files changed, 98 insertions(+), 1 deletion(-) diff --git a/src/views/martial/judgeInvite/index.vue b/src/views/martial/judgeInvite/index.vue index 3950b8d..a7044df 100644 --- a/src/views/martial/judgeInvite/index.vue +++ b/src/views/martial/judgeInvite/index.vue @@ -185,6 +185,42 @@ width="900px" :close-on-click-modal="false" > + + + + + + + + + + + + + + @@ -303,6 +339,8 @@ import { removeInvite } from '@/api/martial/judgeInvite' import { getCompetitionList } from '@/api/martial/competition' +import { getVenuesByCompetition } from '@/api/martial/venue' +import { getProjectsByCompetition } from '@/api/martial/project' import { getRefereeList } from '@/api/martial/referee' import dayjs from 'dayjs' @@ -316,6 +354,16 @@ const competitionLoading = ref(false) // 赛事列表加载状态 // 裁判选择对话框 const judgeDialogVisible = ref(false) + +// 场地和项目列表 +const venueList = ref([]) +const projectList = ref([]) + +// 导入表单 +const importForm = reactive({ + venueId: null, + projectIds: [] +}) const judgeLoading = ref(false) const judgeList = ref([]) const judgeTotal = ref(0) @@ -454,12 +502,48 @@ const handleImportFromPool = async () => { return } + // 重置导入表单 + importForm.venueId = null + importForm.projectIds = [] + + // 加载场地和项目列表 + await loadVenueAndProjectList() + // 打开裁判选择对话框 judgeDialogVisible.value = true selectedJudges.value = [] loadJudgeList() } +// 加载场地和项目列表 +const loadVenueAndProjectList = async () => { + try { + // 并行加载场地和项目 + const [venueRes, projectRes] = await Promise.all([ + getVenuesByCompetition(queryParams.competitionId), + getProjectsByCompetition(queryParams.competitionId) + ]) + + // 处理场地数据 + const venueData = venueRes.data?.data || venueRes.data || {} + venueList.value = venueData.records || [] + + // 处理项目数据 + const projectData = projectRes.data?.data || projectRes.data || {} + projectList.value = projectData.records || [] + + if (venueList.value.length === 0) { + ElMessage.warning('该赛事暂无场地,请先添加场地') + } + if (projectList.value.length === 0) { + ElMessage.warning('该赛事暂无项目,请先添加项目') + } + } catch (error) { + console.error('加载场地/项目列表失败:', error) + ElMessage.error('加载场地/项目列表失败') + } +} + // 加载裁判列表 const loadJudgeList = async () => { judgeLoading.value = true @@ -523,6 +607,16 @@ const handleConfirmImport = async () => { return } + // 验证场地和项目 + if (!importForm.venueId) { + ElMessage.warning('请选择分配的场地') + return + } + if (!importForm.projectIds || importForm.projectIds.length === 0) { + ElMessage.warning('请选择分配的项目') + return + } + try { await ElMessageBox.confirm( `确定为选中的 ${selectedJudges.value.length} 位裁判生成邀请码吗?`, @@ -541,6 +635,8 @@ const handleConfirmImport = async () => { competitionId: queryParams.competitionId, judgeIds: judgeIds, role: 'judge', + venueId: importForm.venueId, + projects: JSON.stringify(importForm.projectIds), expireDays: 30 }) diff --git a/vite.config.js b/vite.config.js index 56afff1..c8d55ac 100644 --- a/vite.config.js +++ b/vite.config.js @@ -14,7 +14,8 @@ export default ({ mode, command }) => { __INTLIFY_PROD_DEVTOOLS__: false, }, server: { - port: 2888, + port: 8083, + host: '0.0.0.0', proxy: { '/api': { target: 'http://localhost:8123',