diff --git a/src/views/martial/competition/index.vue b/src/views/martial/competition/index.vue
index 44bb8e9..4f13a04 100644
--- a/src/views/martial/competition/index.vue
+++ b/src/views/martial/competition/index.vue
@@ -1003,7 +1003,7 @@ export default {
propsHttp: {
res: 'data',
},
- headers: { 'Blade-Auth': 'bearer ' + getToken() },
+
action: '/blade-resource/oss/endpoint/put-file'
}
]
@@ -1335,7 +1335,8 @@ export default {
venueCode: item.venueCode,
capacity: item.capacity,
location: item.location,
- remark: item.facilities || ''
+ remark: item.facilities || '',
+ venueType: item.venueType || 'indoor'
}));
console.log('✅ 加载的场地列表:', this.formData.venues);
console.log('✅ 场地数量:', this.formData.venues.length);
@@ -1407,6 +1408,7 @@ export default {
handleOpenAttachmentUpload(type) {
this.currentAttachmentType = type;
this.attachmentUploadForm = {};
+ this.attachmentUploadOption.column[0].headers = { "Blade-Auth": "bearer " + getToken() };
this.attachmentUploadDialogVisible = true;
},
@@ -1862,7 +1864,8 @@ export default {
venueCode: venue.venueCode,
capacity: venue.capacity || 100,
location: venue.location || '',
- facilities: venue.remark || ''
+ facilities: venue.remark || '',
+ venueType: venue.venueType || 'indoor'
};
// 如果有 id,说明是编辑已有的场地
diff --git a/src/views/martial/project/index.vue b/src/views/martial/project/index.vue
index e6a440a..cd15df7 100644
--- a/src/views/martial/project/index.vue
+++ b/src/views/martial/project/index.vue
@@ -174,6 +174,11 @@
{{ row.maxParticipants || 0 }}
+
+
+ {{ getVenueName(row.venueId) }}
+
+
{
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('获取数据失败')
@@ -626,6 +634,24 @@ 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
@@ -844,6 +870,18 @@ 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/registration/index.vue b/src/views/martial/registration/index.vue
index 9774158..8009c42 100644
--- a/src/views/martial/registration/index.vue
+++ b/src/views/martial/registration/index.vue
@@ -123,10 +123,11 @@
{{ scope.row.hint }}
-
-
-
-
+
+
+
+
+
@@ -387,39 +388,31 @@ export default {
// 使用缓存的参赛者列表
const participants = await this.getParticipants()
- // 2. 按项目ID分组
- const projectMap = new Map()
+ // 预加载项目信息
+ await this.preloadProjectInfo(participants)
+
+ // 按项目ID分组统计人数
+ const projectAthleteCount = new Map()
participants.forEach(athlete => {
- // 兼容驼峰和下划线命名
const projectId = athlete.projectId || athlete.project_id
if (projectId) {
- if (!projectMap.has(projectId)) {
- projectMap.set(projectId, [])
- }
- projectMap.get(projectId).push(athlete)
+ projectAthleteCount.set(projectId, (projectAthleteCount.get(projectId) || 0) + 1)
}
})
- // 3. 从缓存中获取项目信息并统计(项目信息已经在 loadRegistrationStats 中预加载)
+ // 从缓存中获取项目信息并构建统计数据
const projectStats = []
- for (const [projectId, athleteList] of projectMap) {
+ for (const [projectId, count] of projectAthleteCount) {
const project = this.projectCache.get(projectId)
if (project) {
+ const projectType = project.type || 1 // 1=单人, 2=集体
projectStats.push({
projectName: project.projectName || project.project_name || '未知项目',
- participantCategory: project.category || '',
- teamCount: 1, // 简化处理,设为1
- singleTeamPeople: athleteList.length,
- estimatedDuration: project.estimatedDuration || project.estimated_duration || 0
- })
- } else {
- // 如果缓存中没有(理论上���应该发生),添加基本信息
- projectStats.push({
- projectName: `项目ID:${projectId}`,
- participantCategory: '',
- teamCount: 1,
- singleTeamPeople: athleteList.length,
- estimatedDuration: 0
+ projectType: projectType === 1 ? '单人' : '集体',
+ athleteCount: count,
+ groupCount: projectType === 2 ? count : '-', // 集体项目显示组数,单人显示-
+ estimatedDuration: project.estimatedDuration || project.estimated_duration || 0,
+ projectCode: project.projectCode || project.project_code || ''
})
}
}
@@ -432,7 +425,7 @@ export default {
}
},
- // 加载金额统计(该赛事所有单位的报名金额)
+ // 加载金额统计(该赛事所有单位的报名金额)
async loadAmountStats() {
try {
// 使用缓存的参赛者列表