delete user

This commit is contained in:
wang-liang0615 2023-08-16 10:09:25 +08:00
parent 92bff08b84
commit 3989859945
1 changed files with 15 additions and 11 deletions

View File

@ -16,6 +16,7 @@
class="ops-stripe-table" class="ops-stripe-table"
:columns="tableColumns" :columns="tableColumns"
:data="tableData" :data="tableData"
show-overflow
highlight-hover-row highlight-hover-row
:height="`${windowHeight - 165}px`" :height="`${windowHeight - 165}px`"
size="small" size="small"
@ -24,15 +25,17 @@
<a-icon type="lock" v-if="row.block" /> <a-icon type="lock" v-if="row.block" />
</template> </template>
<template #action_default="{row}"> <template #action_default="{row}">
<template> <a-space>
<a :disabled="isAclAdmin ? false : true" @click="handleEdit(row)"> <a :disabled="isAclAdmin ? false : true" @click="handleEdit(row)">
<a-icon type="edit" /> <a-icon type="edit" />
</a> </a>
<a-divider type="vertical" />
<a-tooltip title="权限汇总"> <a-tooltip title="权限汇总">
<a @click="handlePermCollect(row)"><a-icon type="solution"/></a> <a @click="handlePermCollect(row)"><a-icon type="solution"/></a>
</a-tooltip> </a-tooltip>
</template> <a-popconfirm :title="`确认删除【${row.nickname || row.username}】?`" @confirm="deleteUser(row.uid)">
<a :style="{ color: 'red' }"><ops-icon type="icon-xianxing-delete"/></a>
</a-popconfirm>
</a-space>
</template> </template>
</vxe-grid> </vxe-grid>
</a-spin> </a-spin>
@ -73,11 +76,14 @@ export default {
title: '加入时间', title: '加入时间',
field: 'date_joined', field: 'date_joined',
minWidth: '160px', minWidth: '160px',
align: 'center',
sortable: true,
}, },
{ {
title: '锁定', title: '锁定',
field: 'block', field: 'block',
minWidth: '100px', width: '150px',
align: 'center',
slots: { slots: {
default: 'block_default', default: 'block_default',
}, },
@ -85,8 +91,9 @@ export default {
{ {
title: '操作', title: '操作',
field: 'action', field: 'action',
minWidth: '180px', width: '150px',
fixed: 'right', fixed: 'right',
align: 'center',
slots: { slots: {
default: 'action_default', default: 'action_default',
}, },
@ -155,9 +162,6 @@ export default {
handleEdit(record) { handleEdit(record) {
this.$refs.userForm.handleEdit(record) this.$refs.userForm.handleEdit(record)
}, },
handleDelete(record) {
this.deleteUser(record.uid)
},
handleOk() { handleOk() {
this.searchName = '' this.searchName = ''
this.search() this.search()
@ -165,9 +169,9 @@ export default {
handleCreate() { handleCreate() {
this.$refs.userForm.handleCreate() this.$refs.userForm.handleCreate()
}, },
deleteUser(attrId) { deleteUser(uid) {
deleteUserById(attrId).then((res) => { deleteUserById(uid).then((res) => {
this.$message.success(`删除成功`) this.$message.success(`删除成功`)
this.handleOk() this.handleOk()
}) })
}, },