From 9f8395fab13ca4b230a0f7d62636e209745c91d4 Mon Sep 17 00:00:00 2001
From: lrj <owen.stl@gmail.com>
Date: 星期日, 28 九月 2025 14:16:18 +0800
Subject: [PATCH] feat: 完善注册流程的文件上传功能

---
 web/src/views/judge/index.vue |   25 ++++++++++++++++++++-----
 1 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/web/src/views/judge/index.vue b/web/src/views/judge/index.vue
index 78b217a..8d700be 100644
--- a/web/src/views/judge/index.vue
+++ b/web/src/views/judge/index.vue
@@ -14,7 +14,7 @@
       </el-button>
     </div>
 
-    <el-table :data="judges" style="width: 100%; margin-top: 20px">
+    <el-table :data="judges" style="width: 100%; margin-top: 20px" v-loading="loading">
       <!-- 澶村儚鍒� - 绗竴鍒� -->
       <el-table-column label="澶村儚" width="80" align="center">
         <template #default="scope">
@@ -43,7 +43,7 @@
       <el-table-column prop="description" label="绠�浠�" min-width="200" show-overflow-tooltip />
       
       <!-- 鎿嶄綔鍒� -->
-      <el-table-column label="鎿嶄綔" width="150" align="center">
+      <el-table-column label="鎿嶄綔" width="180" align="center">
         <template #default="scope">
           <el-button
             type="primary"
@@ -107,9 +107,11 @@
 const total = ref(0)
 const dialogVisible = ref(false)
 const currentJudge = ref<Judge | null>(null)
+const loading = ref(false)
 
 const loadJudges = async () => {
   try {
+    loading.value = true
     let judgeList = []
     if (searchQuery.value) {
       judgeList = await JudgeApi.searchJudges(searchQuery.value)
@@ -125,6 +127,8 @@
   } catch (error) {
     ElMessage.error('鍔犺浇璇勫鍒楄〃澶辫触')
     console.error(error)
+  } finally {
+    loading.value = false
   }
 }
 
@@ -148,9 +152,20 @@
   dialogVisible.value = true
 }
 
-const editJudge = (judge: Judge) => {
-  currentJudge.value = { ...judge }
-  dialogVisible.value = true
+const editJudge = async (judge: Judge) => {
+  try {
+    // 璋冪敤API鑾峰彇瀹屾暣鐨凧udge璇︽儏鏁版嵁
+    const judgeDetail = await JudgeApi.getJudge(judge.id)
+    if (judgeDetail) {
+      currentJudge.value = judgeDetail
+      dialogVisible.value = true
+    } else {
+      ElMessage.error('鑾峰彇璇勫璇︽儏澶辫触')
+    }
+  } catch (error) {
+    ElMessage.error('鑾峰彇璇勫璇︽儏澶辫触')
+    console.error(error)
+  }
 }
 
 const deleteJudge = async (id: string) => {

--
Gitblit v1.8.0