Skip to content

Commit 3c59755

Browse files
Merge remote-tracking branch 'origin/main'
2 parents e3e6637 + 151fe12 commit 3c59755

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

ui/src/views/user-manage/index.vue

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@
2727
<el-table-column label="状态" width="60">
2828
<template #default="{ row }">
2929
<div @click.stop>
30-
<el-switch size="small" v-model="row.is_active" />
30+
<el-switch
31+
:disabled="row.role === 'ADMIN'"
32+
size="small"
33+
v-model="row.is_active"
34+
@change="changeState($event, row)"
35+
/>
3136
</div>
3237
</template>
3338
</el-table-column>
@@ -55,7 +60,12 @@
5560
</span>
5661
<span class="mr-4">
5762
<el-tooltip effect="dark" content="删除" placement="top">
58-
<el-button type="primary" text @click.stop="deleteUserManage(row)">
63+
<el-button
64+
:disabled="row.role === 'ADMIN'"
65+
type="primary"
66+
text
67+
@click.stop="deleteUserManage(row)"
68+
>
5969
<el-icon><Delete /></el-icon>
6070
</el-button>
6171
</el-tooltip>
@@ -96,6 +106,17 @@ function searchHandle() {
96106
getList()
97107
}
98108
109+
function changeState(bool: Boolean, row: any) {
110+
const obj = {
111+
is_active: bool
112+
}
113+
const str = bool ? '启用成功' : '禁用成功'
114+
userApi.putUserManage(row.id, obj, loading).then((res) => {
115+
getList()
116+
MsgSuccess(str)
117+
})
118+
}
119+
99120
function editPwdUser(row: any) {
100121
UserPwdDialogRef.value.open(row)
101122
}

0 commit comments

Comments
 (0)