@@ -61,18 +61,25 @@
|
||||
/>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="340" fixed="right">
|
||||
<el-table-column label="操作" width="140" fixed="right">
|
||||
<template #default="{ row }"><div class="table-actions">
|
||||
<!-- 查看 (只读详情): 两角色都有, 跳独立详情页 -->
|
||||
<!-- 查看: 保留为直链 (高频操作) -->
|
||||
<el-link :underline="false" type="primary" @click="goView(row)">查看</el-link>
|
||||
<!-- 编辑: 两角色都有, 跳独立编辑页 -->
|
||||
<el-link :underline="false" type="primary" @click="goEdit(row)">编辑</el-link>
|
||||
<!-- 启用/禁用: 两角色都有 (沿用原行为) -->
|
||||
<el-link :underline="false" :type="isDisabled(row) ? 'success' : 'danger'" @click="onToggleStatus(row)">
|
||||
{{ isDisabled(row) ? '启用' : '禁用' }}
|
||||
</el-link>
|
||||
<!-- 重置密码: 重置为默认 123456 (与新建人员默认密码一致) -->
|
||||
<el-link :underline="false" v-if="row.userId" type="primary" @click="onResetPwd(row)">重置密码</el-link>
|
||||
<!-- 更多: 编辑 + 启用/禁用 折叠到 el-dropdown -->
|
||||
<el-dropdown trigger="click" @command="(cmd) => onMoreAction(cmd, row)">
|
||||
<el-link :underline="false" type="primary" class="more-link">
|
||||
更多<el-icon class="more-icon"><ArrowDown /></el-icon>
|
||||
</el-link>
|
||||
<template #dropdown>
|
||||
<el-dropdown-menu>
|
||||
<el-dropdown-item command="edit">编辑</el-dropdown-item>
|
||||
<el-dropdown-item command="resetPwd" v-if="row.userId">重置密码</el-dropdown-item>
|
||||
<el-dropdown-item :command="isDisabled(row) ? 'enable' : 'disable'">
|
||||
{{ isDisabled(row) ? '启用' : '禁用' }}
|
||||
</el-dropdown-item>
|
||||
</el-dropdown-menu>
|
||||
</template>
|
||||
</el-dropdown>
|
||||
</div></template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -123,7 +130,7 @@ import { ref, reactive, onMounted, computed, watch } from 'vue'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { bizList, bizUpdate, importPerson, downloadImportTemplate, changePersonAdmin, resetPersonPassword } from '@/api/public'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Upload } from '@element-plus/icons-vue'
|
||||
import { Upload, ArrowDown } from '@element-plus/icons-vue'
|
||||
import ImportResultDialog from '@/components/ImportResultDialog.vue'
|
||||
|
||||
const route = useRoute()
|
||||
@@ -262,6 +269,13 @@ function goView(row) {
|
||||
})
|
||||
}
|
||||
|
||||
// 操作列 "更多" 下拉: 分发编辑/重置密码/启用/禁用
|
||||
function onMoreAction(cmd, row) {
|
||||
if (cmd === 'edit') return goEdit(row)
|
||||
if (cmd === 'resetPwd') return onResetPwd(row)
|
||||
if (cmd === 'enable' || cmd === 'disable') return onToggleStatus(row)
|
||||
}
|
||||
|
||||
// ========== 批量导入 ==========
|
||||
const importOpen = ref(false)
|
||||
const importing = ref(false)
|
||||
@@ -404,4 +418,8 @@ watch(() => route.fullPath, () => {
|
||||
/* 表格字号收紧 */
|
||||
:deep(.el-table) { font-size: 12px !important; }
|
||||
}
|
||||
|
||||
/* 操作列 "更多" 下拉样式 (桌面 + 移动端共用) */
|
||||
.more-link { display: inline-flex; align-items: center; gap: 2px; }
|
||||
.more-icon { font-size: 12px; }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user