File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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 >
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+
99120function editPwdUser(row : any ) {
100121 UserPwdDialogRef .value .open (row )
101122}
You can’t perform that action at this time.
0 commit comments