|
@@ -15,6 +15,7 @@
|
|
|
@sizeChange="sizeChange"
|
|
|
:isAdd="true"
|
|
|
@add="openPopup"
|
|
|
+ :operationsDefaultLength="6"
|
|
|
/>
|
|
|
<popup-edit
|
|
|
:isShow="isDtlShow"
|
|
@@ -73,16 +74,41 @@ export default {
|
|
|
{ label: '更新时间', prop: 'update_at' },
|
|
|
// { label: '系统', prop: 'is_admin', type: 'tag', tags: arrToObj(this.$dictData.sys_yesno), tagTypeObj: {'1': 'success', '2': 'danger'} },
|
|
|
{ label: '系统', prop: 'is_admin' },
|
|
|
- { label: '操作', width: 120, type: 'handle2', operations:
|
|
|
+ { label: '操作', width: 180, type: 'handle2', operations:
|
|
|
[
|
|
|
{ label: '编辑', func: this.openPopup, btnType: 'primary' },
|
|
|
{ label: '删除', func: this.delHandle, btnType: 'danger' },
|
|
|
+ { labelFor: 'is_admin', func: this.adminHandle,
|
|
|
+ labelConfig: {
|
|
|
+ texts: {
|
|
|
+ 1: 'NO',
|
|
|
+ 2: 'YES'
|
|
|
+ },
|
|
|
+ btnTypes: {
|
|
|
+ 1: 'danger',
|
|
|
+ 2: 'success'
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
]
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ adminHandle (row) {
|
|
|
+ const is_admin = Number(row.is_admin) === 1 ? 2 : 1
|
|
|
+ const msgText = Number(row.is_admin) === 1 ? '禁用' : '设置'
|
|
|
+ this.$msg(`确定把${row.nickname}${msgText}为超级管理员吗?`, 'confirm', ()=> {
|
|
|
+ this.$api.user.admuseradmin({
|
|
|
+ id: row.id,
|
|
|
+ is_admin
|
|
|
+ }).then(data => {
|
|
|
+ this.$msgs(`${msgText}成功!`)
|
|
|
+ this.fetchData()
|
|
|
+ })
|
|
|
+ }, null, true)
|
|
|
+ },
|
|
|
delHandle(row) {
|
|
|
this.$msg(`您确定要删除该用户吗?`, 'confirm', () => {
|
|
|
this.$api.user.admuserdel({
|