File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 27
27
<el-table-column label =" 状态" width =" 60" >
28
28
<template #default =" { row } " >
29
29
<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
+ />
31
36
</div >
32
37
</template >
33
38
</el-table-column >
55
60
</span >
56
61
<span class =" mr-4" >
57
62
<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
+ >
59
69
<el-icon ><Delete /></el-icon >
60
70
</el-button >
61
71
</el-tooltip >
@@ -96,6 +106,17 @@ function searchHandle() {
96
106
getList ()
97
107
}
98
108
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
+
99
120
function editPwdUser(row : any ) {
100
121
UserPwdDialogRef .value .open (row )
101
122
}
You can’t perform that action at this time.
0 commit comments