1
This commit is contained in:
@@ -125,15 +125,25 @@ export default {
|
||||
},
|
||||
'详情'
|
||||
),
|
||||
h(
|
||||
'Button',
|
||||
{
|
||||
props: { type: 'warning', size: 'small' },
|
||||
class: { ml8: true },
|
||||
on: { click: () => this.doDisable(p.row) },
|
||||
},
|
||||
'禁用'
|
||||
),
|
||||
p.row.status === 'disabled'
|
||||
? h(
|
||||
'Button',
|
||||
{
|
||||
props: { type: 'success', size: 'small' },
|
||||
class: { ml8: true },
|
||||
on: { click: () => this.doEnable(p.row) },
|
||||
},
|
||||
'启用'
|
||||
)
|
||||
: h(
|
||||
'Button',
|
||||
{
|
||||
props: { type: 'warning', size: 'small' },
|
||||
class: { ml8: true },
|
||||
on: { click: () => this.doDisable(p.row) },
|
||||
},
|
||||
'禁用'
|
||||
),
|
||||
h(
|
||||
'Button',
|
||||
{
|
||||
@@ -235,6 +245,21 @@ export default {
|
||||
},
|
||||
})
|
||||
},
|
||||
doEnable(row) {
|
||||
this.$Modal.confirm({
|
||||
title: '启用用户',
|
||||
content: '确认重新启用该用户?',
|
||||
onOk: async () => {
|
||||
const res = await userServer.enable({ id: row.id })
|
||||
if (res && res.code === 0) {
|
||||
this.$Message.success('已启用')
|
||||
this.load(1)
|
||||
} else {
|
||||
this.$Message.error((res && res.message) || '操作失败')
|
||||
}
|
||||
},
|
||||
})
|
||||
},
|
||||
doDel(row) {
|
||||
this.$Modal.confirm({
|
||||
title: '删除用户',
|
||||
|
||||
Reference in New Issue
Block a user