| | |
| | | placeholder="请输入员工名称" |
| | | style="width: 200px" |
| | | clearable |
| | | @keyup.enter="handleSearch" |
| | | > |
| | | <template #prefix> |
| | | <el-icon><Search /></el-icon> |
| | | </template> |
| | | </el-input> |
| | | /> |
| | | <el-button type="primary" @click="handleSearch"> |
| | | <el-icon><Search /></el-icon> |
| | | 搜索 |
| | | 查询 |
| | | </el-button> |
| | | <el-button type="success" @click="handleAdd"> |
| | | <el-button type="primary" @click="handleAdd"> |
| | | <el-icon><Plus /></el-icon> |
| | | 新增员工 |
| | | </el-button> |
| | |
| | | {{ formatDateTime(row.createTime) }} |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="操作" width="150" fixed="right"> |
| | | <el-table-column label="操作" width="120" fixed="right"> |
| | | <template #default="{ row }"> |
| | | <div class="table-actions"> |
| | | <el-button type="warning" size="small" @click="handleEdit(row)"> |
| | | 编辑 |
| | | </el-button> |
| | | <el-button type="danger" size="small" @click="handleDelete(row)"> |
| | | 删除 |
| | | </el-button> |
| | | <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> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <script setup lang="ts"> |
| | | import { reactive, ref, onMounted } from 'vue' |
| | | 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' |
| | | |
| | |
| | | gap: 12px; |
| | | margin-bottom: 20px; |
| | | align-items: center; |
| | | justify-content: flex-end; |
| | | } |
| | | |
| | | .table-actions { |