| | |
| | | </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"> |
| | |
| | | <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" |
| | |
| | | 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) |
| | |
| | | } catch (error) { |
| | | ElMessage.error('加载评委列表失败') |
| | | console.error(error) |
| | | } finally { |
| | | loading.value = false |
| | | } |
| | | } |
| | | |
| | |
| | | dialogVisible.value = true |
| | | } |
| | | |
| | | const editJudge = (judge: Judge) => { |
| | | currentJudge.value = { ...judge } |
| | | dialogVisible.value = true |
| | | const editJudge = async (judge: Judge) => { |
| | | try { |
| | | // 调用API获取完整的Judge详情数据 |
| | | 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) => { |