mirror of
https://github.com/1Panel-dev/MaxKB.git
synced 2025-12-26 01:33:05 +00:00
feat: 用户管理
This commit is contained in:
parent
75dc0ed782
commit
151fe12242
|
|
@ -27,7 +27,12 @@
|
|||
<el-table-column label="状态" width="60">
|
||||
<template #default="{ row }">
|
||||
<div @click.stop>
|
||||
<el-switch size="small" v-model="row.is_active" />
|
||||
<el-switch
|
||||
:disabled="row.role === 'ADMIN'"
|
||||
size="small"
|
||||
v-model="row.is_active"
|
||||
@change="changeState($event, row)"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
|
@ -55,7 +60,12 @@
|
|||
</span>
|
||||
<span class="mr-4">
|
||||
<el-tooltip effect="dark" content="删除" placement="top">
|
||||
<el-button type="primary" text @click.stop="deleteUserManage(row)">
|
||||
<el-button
|
||||
:disabled="row.role === 'ADMIN'"
|
||||
type="primary"
|
||||
text
|
||||
@click.stop="deleteUserManage(row)"
|
||||
>
|
||||
<el-icon><Delete /></el-icon>
|
||||
</el-button>
|
||||
</el-tooltip>
|
||||
|
|
@ -96,6 +106,17 @@ function searchHandle() {
|
|||
getList()
|
||||
}
|
||||
|
||||
function changeState(bool: Boolean, row: any) {
|
||||
const obj = {
|
||||
is_active: bool
|
||||
}
|
||||
const str = bool ? '启用成功' : '禁用成功'
|
||||
userApi.putUserManage(row.id, obj, loading).then((res) => {
|
||||
getList()
|
||||
MsgSuccess(str)
|
||||
})
|
||||
}
|
||||
|
||||
function editPwdUser(row: any) {
|
||||
UserPwdDialogRef.value.open(row)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue