bug
Codex Assistant
2025-11-05 3714621173c606c4c58439ed8941100ce9ddea14
web/src/views/next-list.vue
@@ -27,7 +27,6 @@
          <el-icon><Search /></el-icon>
          搜索
        </el-button>
        <el-button @click="resetSearch">重置</el-button>
      </div>
    </div>
@@ -222,6 +221,7 @@
import { ElMessage, ElMessageBox } from 'element-plus'
import { Search, TrophyBase, InfoFilled } from '@element-plus/icons-vue'
import PromotionApi from '@/api/promotion'
import { getActivity } from '@/api/activity'
const router = useRouter()
@@ -276,8 +276,15 @@
      size: pagination.size
    })
    
    competitions.value = data || []
    pagination.total = data ? data.length : 0
    // 处理分页响应对象
    if (data && data.content) {
      competitions.value = data.content
      pagination.total = parseInt(data.totalElements) || 0
    } else {
      // 兼容旧的返回格式(如果后端还没更新)
      competitions.value = data || []
      pagination.total = data ? data.length : 0
    }
  } catch (error) {
    console.error('获取比赛晋级列表失败:', error)
    ElMessage.error('获取比赛数据失败: ' + (error.message || '未知错误'))
@@ -393,6 +400,8 @@
  selectedParticipants.value = selection
}
// 确认晋级
const confirmPromotion = async () => {
  if (selectedParticipants.value.length === 0) {
@@ -418,10 +427,10 @@
      const participantIds = selectedParticipants.value.map(p => p.id)
      
      const result = await PromotionApi.promoteParticipants(
        selectedCompetition.value.id,
        participantIds,
        null // 目标阶段ID,这里可以根据需要设置
      )
          selectedCompetition.value.competitionId, // 主比赛ID
          participantIds,
          selectedCompetition.value.id // 当前阶段ID作为目标阶段ID
        )
      
      if (result && result.success) {
        ElMessage.success(result.message || `成功晋级 ${result.promotedCount} 名人员`)
@@ -558,7 +567,7 @@
.search-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  justify-content: flex-end;
  margin-bottom: 20px;
  padding: 16px;
  background-color: #f9fafb;