File was renamed from web/src/views/employee/index.vue |
| | |
| | | {{ formatDateTime(row.createTime) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="120" fixed="right"> |
| | | <el-table-column label="操作" width="120" fixed="right" align="center"> |
| | | <template #default="{ row }"> |
| | | <div class="table-actions"> |
| | | <el-button type="warning" size="small" @click="handleEdit(row)" :icon="Edit" circle title="编辑"></el-button> |
| | | <el-button type="danger" size="small" @click="handleDelete(row)" :icon="Delete" circle title="删除"></el-button> |
| | | <el-button |
| | | text |
| | | :icon="Edit" |
| | | size="small" |
| | | @click="handleEdit(row)" |
| | | class="action-btn edit-btn" |
| | | title="编辑" |
| | | /> |
| | | <el-button |
| | | text |
| | | :icon="Delete" |
| | | size="small" |
| | | @click="handleDelete(row)" |
| | | class="action-btn delete-btn" |
| | | title="删除" |
| | | /> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | import { ElMessage, ElMessageBox } from 'element-plus' |
| | | import { Search, Plus, Edit, Delete } from '@element-plus/icons-vue' |
| | | import { employeeApi, type Employee } from '@/api/employee' |
| | | import EmployeeForm from './EmployeeForm.vue' |
| | | import EmployeeForm from './employee-detail.vue' |
| | | |
| | | const loading = ref(false) |
| | | const formVisible = ref(false) |
| | |
| | | // 获取角色标签类型 |
| | | const getRoleType = (roleId: string) => { |
| | | const typeMap: Record<string, string> = { |
| | | 'ADMIN': 'danger', |
| | | 'MANAGER': 'warning', |
| | | 'STAFF': 'primary', |
| | | 'REVIEWER': 'success' |
| | | 'SUPER_ADMIN': 'danger', |
| | | 'AUDITOR': 'warning', |
| | | 'JUDGE_MANAGER': 'success', |
| | | 'PLAYER': 'primary' |
| | | } |
| | | return typeMap[roleId] || 'info' |
| | | } |
| | |
| | | // 获取角色文本 |
| | | const getRoleText = (roleId: string) => { |
| | | const textMap: Record<string, string> = { |
| | | 'ADMIN': '管理员', |
| | | 'MANAGER': '经理', |
| | | 'STAFF': '工作人员', |
| | | 'REVIEWER': '审核员' |
| | | 'SUPER_ADMIN': '超级管理员', |
| | | 'AUDITOR': '平台工作人员', |
| | | 'JUDGE_MANAGER': '评委', |
| | | 'PLAYER': '参赛人员' |
| | | } |
| | | return textMap[roleId] || roleId |
| | | } |
| | |
| | | .table-actions { |
| | | display: flex; |
| | | gap: 8px; |
| | | flex-wrap: wrap; |
| | | justify-content: center; |
| | | align-items: center; |
| | | flex-wrap: nowrap; // 确保不换行 |
| | | |
| | | .action-btn { |
| | | &.edit-btn { |
| | | color: #409eff; |
| | | |
| | | &:hover { |
| | | color: #66b1ff; |
| | | } |
| | | } |
| | | |
| | | &.delete-btn { |
| | | color: #f56c6c; |
| | | |
| | | &:hover { |
| | | color: #f78989; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | .pagination { |