feat(judgeInvite): 增加场地过滤条件
This commit is contained in:
@@ -347,6 +347,7 @@ const judgeDialogVisible = ref(false)
|
||||
|
||||
// 场地和项目列表
|
||||
const venueList = ref([])
|
||||
const filterVenueList = ref([])
|
||||
const projectList = ref([])
|
||||
|
||||
// 导入表单
|
||||
@@ -381,7 +382,8 @@ const queryParams = reactive({
|
||||
competitionId: null,
|
||||
judgeName: '',
|
||||
judgeLevel: '',
|
||||
inviteStatus: ''
|
||||
inviteStatus: '',
|
||||
venueId: null
|
||||
})
|
||||
|
||||
// 加载赛事列表
|
||||
@@ -417,11 +419,31 @@ const loadCompetitionList = async () => {
|
||||
}
|
||||
|
||||
// 赛事切换
|
||||
const handleCompetitionChange = (competitionId) => {
|
||||
const handleCompetitionChange = async (competitionId) => {
|
||||
// 重置场地筛选
|
||||
queryParams.venueId = null
|
||||
// 加载该赛事的场地列表用于筛选
|
||||
await loadFilterVenueList()
|
||||
fetchData()
|
||||
loadStatistics()
|
||||
}
|
||||
|
||||
// 加载筛选用的场地列表
|
||||
const loadFilterVenueList = async () => {
|
||||
if (!queryParams.competitionId) {
|
||||
filterVenueList.value = []
|
||||
return
|
||||
}
|
||||
try {
|
||||
const res = await getVenuesByCompetition(queryParams.competitionId)
|
||||
const venueData = res.data?.data || res.data || {}
|
||||
filterVenueList.value = venueData.records || []
|
||||
} catch (error) {
|
||||
console.error('加载场地列表失败:', error)
|
||||
filterVenueList.value = []
|
||||
}
|
||||
}
|
||||
|
||||
// 加载统计数据
|
||||
const loadStatistics = async () => {
|
||||
if (queryParams.competitionId === null || queryParams.competitionId === '') return
|
||||
@@ -472,7 +494,8 @@ const handleReset = () => {
|
||||
size: 10,
|
||||
judgeName: '',
|
||||
judgeLevel: '',
|
||||
inviteStatus: ''
|
||||
inviteStatus: '',
|
||||
venueId: null
|
||||
})
|
||||
fetchData()
|
||||
}
|
||||
@@ -904,8 +927,12 @@ const fallbackCopyToClipboard = (text, label) => {
|
||||
}
|
||||
|
||||
// 挂载
|
||||
onMounted(() => {
|
||||
loadCompetitionList()
|
||||
onMounted(async () => {
|
||||
await loadCompetitionList()
|
||||
// 加载筛选用的场地列表
|
||||
if (queryParams.competitionId) {
|
||||
await loadFilterVenueList()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user