|
@@ -35,7 +35,9 @@
|
|
|
<el-table-column prop="id" label="活动ID" width="200"></el-table-column>
|
|
<el-table-column prop="id" label="活动ID" width="200"></el-table-column>
|
|
|
<el-table-column prop="activityName" label="活动名称" width="350"></el-table-column>
|
|
<el-table-column prop="activityName" label="活动名称" width="350"></el-table-column>
|
|
|
<el-table-column prop="typeName" label="活动类型" width="120"></el-table-column>
|
|
<el-table-column prop="typeName" label="活动类型" width="120"></el-table-column>
|
|
|
- <el-table-column prop="categoryName" label="活动分类" width="120"></el-table-column>
|
|
|
|
|
|
|
+ <el-table-column prop="categoryName" label="活动分类" width="180">
|
|
|
|
|
+ <template #default="scope">{{ getCategoryNames(scope.row) }}</template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column prop="" label="报名时间" width="320">
|
|
<el-table-column prop="" label="报名时间" width="320">
|
|
|
<template #default="scope">{{ scope.row.signupStartTime }} - {{ scope.row.signupEndTime }}</template>
|
|
<template #default="scope">{{ scope.row.signupStartTime }} - {{ scope.row.signupEndTime }}</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
@@ -194,11 +196,21 @@ export default {
|
|
|
this.typeOptions = res.data.data.list || []
|
|
this.typeOptions = res.data.data.list || []
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- getCategoryOptions () {
|
|
|
|
|
- this.$http.get('/core/activity/category/page', { params: { page: 1, limit: -1 } }).then(res => {
|
|
|
|
|
- this.categoryOptions = res.data.data.list || []
|
|
|
|
|
- })
|
|
|
|
|
- },
|
|
|
|
|
|
|
+ getCategoryOptions () {
|
|
|
|
|
+ this.$http.get('/core/activity/category/page', { params: { page: 1, limit: -1 } }).then(res => {
|
|
|
|
|
+ this.categoryOptions = res.data.data.list || []
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ getCategoryNames (activity) {
|
|
|
|
|
+ const rawIds = activity.categoryIds || activity.categoryId
|
|
|
|
|
+ if (!rawIds) return activity.categoryName || ''
|
|
|
|
|
+ const ids = String(rawIds).split(',').map(id => id.trim()).filter(Boolean)
|
|
|
|
|
+ const names = ids.map(id => {
|
|
|
|
|
+ const category = this.categoryOptions.find(item => String(item.id) === id)
|
|
|
|
|
+ return category ? category.categoryName : ''
|
|
|
|
|
+ }).filter(Boolean)
|
|
|
|
|
+ return names.length > 0 ? names.join('、') : (activity.categoryName || '')
|
|
|
|
|
+ },
|
|
|
handleAdd () {
|
|
handleAdd () {
|
|
|
this.$router.push({ name: 'activityAdd' })
|
|
this.$router.push({ name: 'activityAdd' })
|
|
|
},
|
|
},
|