From c4938f6f4e839890b032c75c7a57333a6a9157a9 Mon Sep 17 00:00:00 2001
From: peng <peng.com>
Date: 星期四, 06 十一月 2025 17:06:10 +0800
Subject: [PATCH] 添加新闻功能

---
 web/src/views/next-list.vue |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/web/src/views/next-list.vue b/web/src/views/next-list.vue
index addeb22..4158bf8 100644
--- a/web/src/views/next-list.vue
+++ b/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, // 涓绘瘮璧汭D
+          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;

--
Gitblit v1.8.0