| | |
| | | <template> |
| | | <div class="judge-page"> |
| | | <div class="search-bar"> |
| | | <!-- 页面标题区域 --> |
| | | <div class="page-header"> |
| | | <div class="title-section"> |
| | | <h1 class="page-title">评委管理</h1> |
| | | <p class="page-subtitle">管理比赛评委信息,包括评委的基本信息和专业背景</p> |
| | | </div> |
| | | </div> |
| | | |
| | | <!-- 搜索工具栏 --> |
| | | <div class="search-toolbar"> |
| | | <el-input |
| | | v-model="searchQuery" |
| | | placeholder="搜索评委..." |
| | | style="width: 300px; margin-right: 10px" |
| | | style="width: 200px" |
| | | clearable |
| | | @input="handleSearch" |
| | | @clear="handleClear" |
| | | /> |
| | | <el-button type="primary" @click="handleSearch"> |
| | | <el-icon><Search /></el-icon> |
| | | 查询 |
| | | </el-button> |
| | | <el-button type="primary" @click="openAddDialog"> |
| | | <el-icon><Plus /></el-icon> |
| | | 新增评委 |
| | |
| | | <el-table-column prop="description" label="简介" min-width="200" show-overflow-tooltip /> |
| | | |
| | | <!-- 操作列 --> |
| | | <el-table-column label="操作" width="180" align="center"> |
| | | <el-table-column label="操作" width="120" align="center"> |
| | | <template #default="scope"> |
| | | <el-button |
| | | type="primary" |
| | | size="small" |
| | | text |
| | | :icon="Edit" |
| | | @click="editJudge(scope.row)" |
| | | > |
| | | 编辑 |
| | | </el-button> |
| | | class="action-btn edit-btn" |
| | | title="编辑" |
| | | /> |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | text |
| | | :icon="Delete" |
| | | @click="deleteJudge(scope.row.id)" |
| | | > |
| | | 删除 |
| | | </el-button> |
| | | class="action-btn delete-btn" |
| | | title="删除" |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | <script setup lang="ts"> |
| | | import { ref, onMounted } from 'vue' |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { Plus } from '@element-plus/icons-vue' |
| | | import { Plus, Search, Edit, Delete } from '@element-plus/icons-vue' |
| | | import JudgeFormSimple from '@/components/JudgeFormSimple.vue' |
| | | import { JudgeApi } from '@/api/judge' |
| | | |
| | |
| | | } |
| | | |
| | | const handleSearch = () => { |
| | | currentPage.value = 1 |
| | | loadJudges() |
| | | } |
| | | |
| | | const handleClear = () => { |
| | | searchQuery.value = '' |
| | | currentPage.value = 1 |
| | | loadJudges() |
| | | } |
| | |
| | | padding: 20px; |
| | | } |
| | | |
| | | .search-bar { |
| | | /* 页面标题区域 */ |
| | | .page-header { |
| | | margin-bottom: 24px; |
| | | } |
| | | |
| | | .title-section { |
| | | text-align: left; |
| | | } |
| | | |
| | | .page-title { |
| | | font-size: 24px; |
| | | font-weight: 600; |
| | | color: #1f2937; |
| | | margin: 0 0 8px 0; |
| | | } |
| | | |
| | | .page-subtitle { |
| | | font-size: 14px; |
| | | color: #6b7280; |
| | | margin: 0; |
| | | line-height: 1.5; |
| | | } |
| | | |
| | | /* 搜索工具栏 */ |
| | | .search-toolbar { |
| | | display: flex; |
| | | align-items: center; |
| | | justify-content: space-between; |
| | | margin-bottom: 20px; |
| | | padding: 16px; |
| | | background-color: #f9fafb; |
| | | border-radius: 8px; |
| | | border: 1px solid #e5e7eb; |
| | | } |
| | | |
| | | .search-area { |
| | | display: flex; |
| | | align-items: center; |
| | | gap: 12px; |
| | | } |
| | | |
| | | /* 搜索工具栏样式 */ |
| | | .search-toolbar { |
| | | display: flex; |
| | | gap: 12px; |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | margin-bottom: 20px; |
| | | } |
| | | |
| | | /* 搜索按钮 */ |
| | | .search-btn { |
| | | width: 24px !important; |
| | | height: 24px !important; |
| | | min-height: 24px !important; |
| | | padding: 0 !important; |
| | | margin-right: 8px; |
| | | } |
| | | |
| | | /* 操作按钮样式 */ |
| | | .action-btn { |
| | | padding: 8px !important; |
| | | margin: 0 6px; |
| | | border-radius: 6px; |
| | | transition: all 0.2s ease; |
| | | } |
| | | |
| | | .edit-btn { |
| | | color: #3b82f6 !important; |
| | | } |
| | | |
| | | .edit-btn:hover { |
| | | background-color: rgba(59, 130, 246, 0.1) !important; |
| | | transform: scale(1.2); |
| | | } |
| | | |
| | | .delete-btn { |
| | | color: #ef4444 !important; |
| | | } |
| | | |
| | | .delete-btn:hover { |
| | | background-color: rgba(239, 68, 68, 0.1) !important; |
| | | transform: scale(1.2); |
| | | } |
| | | |
| | | .el-pagination { |
| | | display: flex; |
| | | justify-content: center; |
| | | } |
| | | |
| | | /* 响应式适配 */ |
| | | @media (max-width: 768px) { |
| | | .search-toolbar { |
| | | flex-direction: column; |
| | | gap: 12px; |
| | | align-items: stretch; |
| | | } |
| | | |
| | | .search-area { |
| | | justify-content: center; |
| | | } |
| | | } |
| | | </style> |