| | |
| | | <el-descriptions-item label="报名截止时间">{{ formatDateTime(activity.signupDeadline) }}</el-descriptions-item> |
| | | <el-descriptions-item label="比赛开始时间">{{ formatDateTime(activity.matchTime) }}</el-descriptions-item> |
| | | <el-descriptions-item label="比赛地址">{{ activity.address || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="人数">{{ activity.playerMax || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="当前报名人数">{{ activity.playerCount || 0 }}</el-descriptions-item> |
| | | <el-descriptions-item label="评分模板"> |
| | | {{ activity.ratingScheme ? activity.ratingScheme.name : '-' }} |
| | | </el-descriptions-item> |
| | |
| | | <!-- 比赛阶段 --> |
| | | <div v-if="activity.stages && activity.stages.length > 0" class="stages-section"> |
| | | <h3>比赛阶段</h3> |
| | | <el-table :data="activity.stages" style="width: 100%"> |
| | | <el-table-column prop="name" label="阶段名称" min-width="150" /> |
| | | <el-table :data="sortedStages" style="width: 100%" table-layout="auto"> |
| | | <el-table-column prop="sortOrder" label="顺序" width="80" align="center" /> |
| | | <el-table-column prop="name" label="阶段名称" width="200" show-overflow-tooltip /> |
| | | <el-table-column prop="matchTime" label="开始时间" width="180"> |
| | | <template #default="{ row }"> |
| | | {{ formatDateTime(row.matchTime) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="address" label="地址" min-width="150"> |
| | | <el-table-column prop="address" label="地址" min-width="120" show-overflow-tooltip> |
| | | <template #default="{ row }"> |
| | | {{ row.address || '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="playerMax" label="最大人数" width="100"> |
| | | <template #default="{ row }"> |
| | | {{ row.playerMax || '-' }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="playerCount" label="实际人数" width="100"> |
| | | <template #default="{ row }"> |
| | | {{ row.playerCount || 0 }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="stateName" label="状态" width="100"> |
| | |
| | | <el-tag :type="getStateType(row.state)">{{ row.stateName }}</el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="200"> |
| | | <el-table-column label="操作" width="220" fixed="right"> |
| | | <template #default="{ row }"> |
| | | <el-button size="small" @click="viewStageDetail(row)">查看详情</el-button> |
| | | <el-button size="small" type="warning" @click="closeStage(row)" v-if="row.state === 1">关闭</el-button> |
| | | <el-button size="small" type="danger" @click="deleteStage(row)">删除</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | </div> |
| | | |
| | | <!-- 评委信息 --> |
| | | <div v-if="activity.judges && activity.judges.length > 0" class="judges-section"> |
| | | <h3>评委信息</h3> |
| | | <el-table :data="activity.judges" style="width: 100%"> |
| | | <el-table-column prop="name" label="评委姓名" min-width="120" /> |
| | | <el-table-column prop="phone" label="联系电话" width="150" /> |
| | | <el-table-column prop="description" label="简介" min-width="200" show-overflow-tooltip /> |
| | | <el-table-column label="负责阶段" min-width="200"> |
| | | <template #default="{ row }"> |
| | | <el-tag |
| | | v-for="stageId in row.stageIds" |
| | | :key="stageId" |
| | | size="small" |
| | | style="margin-right: 5px;" |
| | | > |
| | | {{ getStageName(stageId) }} |
| | | </el-tag> |
| | | <el-tag v-if="!row.stageIds || row.stageIds.length === 0" type="info" size="small"> |
| | | 全部阶段 |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | </el-descriptions-item> |
| | | <el-descriptions-item label="开始时间">{{ formatDateTime(selectedStage.matchTime) }}</el-descriptions-item> |
| | | <el-descriptions-item label="地址">{{ selectedStage.address || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="人数">{{ selectedStage.playerMax || '-' }}</el-descriptions-item> |
| | | <el-descriptions-item label="评分模板"> |
| | | {{ selectedStage.ratingScheme ? selectedStage.ratingScheme.name : '继承比赛模板' }} |
| | | </el-descriptions-item> |
| | |
| | | </template> |
| | | |
| | | <script setup> |
| | | import { ref, onMounted } from 'vue' |
| | | import { ref, onMounted, computed } from 'vue' |
| | | import { useRouter, useRoute } from 'vue-router' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { getActivity } from '@/api/activity' |
| | |
| | | const activity = ref(null) |
| | | const stageDialogVisible = ref(false) |
| | | const selectedStage = ref(null) |
| | | |
| | | // 计算属性 |
| | | const sortedStages = computed(() => { |
| | | if (!activity.value || !activity.value.stages) return [] |
| | | return [...activity.value.stages].sort((a, b) => { |
| | | const orderA = a.sortOrder || 999 |
| | | const orderB = b.sortOrder || 999 |
| | | return orderA - orderB |
| | | }) |
| | | }) |
| | | |
| | | // 加载比赛详情 |
| | | const loadActivity = async () => { |
| | |
| | | |
| | | // 操作处理 |
| | | const handleEdit = () => { |
| | | router.push(`/activity/form/${route.params.id}`) |
| | | router.push(`/activity/edit/${route.params.id}`) |
| | | } |
| | | |
| | | const goBack = () => { |
| | |
| | | } |
| | | } |
| | | |
| | | const getStageName = (stageId) => { |
| | | if (!activity.value) return '未知阶段' |
| | | |
| | | // 只检查比赛阶段 |
| | | if (activity.value.stages) { |
| | | const stage = activity.value.stages.find(s => s.id === stageId) |
| | | if (stage) { |
| | | return stage.name |
| | | } |
| | | } |
| | | |
| | | return '未知阶段' |
| | | } |
| | | |
| | | // 生命周期 |
| | | onMounted(() => { |
| | | loadActivity() |
| | |
| | | color: #303133; |
| | | } |
| | | |
| | | .judges-section { |
| | | margin-top: 30px; |
| | | } |
| | | |
| | | .judges-section h3 { |
| | | margin-bottom: 15px; |
| | | color: #303133; |
| | | } |
| | | |
| | | .players-section { |
| | | margin-top: 30px; |
| | | } |