|
@@ -40,7 +40,7 @@
|
|
|
<script>
|
|
|
import toolbar from './toolbar';
|
|
|
import mxFilterList from '@/mixins/filterList';
|
|
|
-import { getPage, getCount } from '@/api/system/account';
|
|
|
+import { getPage, getCount, lockAccount } from '@/api/system/account';
|
|
|
|
|
|
export default {
|
|
|
name: 'AccountManagement',
|
|
@@ -107,7 +107,8 @@ export default {
|
|
|
width: '120',
|
|
|
type: 'tag',
|
|
|
fetchTagType: val => 'info',
|
|
|
- tagName: row => row.gender === 0 ? '未知' : row.gender === 1 ? '男' : '女'
|
|
|
+ tagName: row =>
|
|
|
+ row.gender === 0 ? '未知' : row.gender === 1 ? '男' : '女'
|
|
|
},
|
|
|
{
|
|
|
key: 'createAt',
|
|
@@ -121,15 +122,59 @@ export default {
|
|
|
type: 'tag',
|
|
|
fetchTagType: val => (val ? 'danger' : 'info'),
|
|
|
tagName: row => (row.isLocked ? '是' : '否')
|
|
|
+ },
|
|
|
+ {
|
|
|
+ key: 'action',
|
|
|
+ name: '操作',
|
|
|
+ width: '120',
|
|
|
+ render: (h, { row }) => {
|
|
|
+ const action = [];
|
|
|
+ action.push(
|
|
|
+ h(
|
|
|
+ 'el-button',
|
|
|
+ {
|
|
|
+ props: {
|
|
|
+ type: 'text'
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ click: () =>
|
|
|
+ this.$AccountRoleModal({
|
|
|
+ id: row.id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ },
|
|
|
+ '分配角色'
|
|
|
+ )
|
|
|
+ );
|
|
|
+ action.push(
|
|
|
+ h(
|
|
|
+ 'el-button',
|
|
|
+ {
|
|
|
+ props: {
|
|
|
+ type: 'text'
|
|
|
+ },
|
|
|
+ on: {
|
|
|
+ click: () => this.handlerLockAccount(row.id)
|
|
|
+ }
|
|
|
+ },
|
|
|
+ row.isLocked ? '解封' : '禁用'
|
|
|
+ )
|
|
|
+ );
|
|
|
+
|
|
|
+ return h('div', action);
|
|
|
+ }
|
|
|
}
|
|
|
- // {
|
|
|
- // key: 'action',
|
|
|
- // name: '操作',
|
|
|
- // width: '120'
|
|
|
- // }
|
|
|
]
|
|
|
};
|
|
|
},
|
|
|
+
|
|
|
+ created() {
|
|
|
+ this.$g_on('account_reload', this.reload);
|
|
|
+ },
|
|
|
+
|
|
|
+ beforeDestroy() {
|
|
|
+ this.$g_off('account_reload', this.reload);
|
|
|
+ },
|
|
|
methods: {
|
|
|
async pageChange(page) {
|
|
|
this.pagination.page = page;
|
|
@@ -154,6 +199,13 @@ export default {
|
|
|
}
|
|
|
this.loadCallBack(data);
|
|
|
}
|
|
|
+ },
|
|
|
+ async handlerLockAccount(id) {
|
|
|
+ const { success, msg } = await lockAccount(id);
|
|
|
+ if (success) {
|
|
|
+ this.$g_emit('account_reload');
|
|
|
+ this.$success('保存成功!');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
};
|