|
@@ -64,7 +64,6 @@
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 状态列 -->
|
|
<!-- 状态列 -->
|
|
|
<template v-slot:enable="{ row }">
|
|
<template v-slot:enable="{ row }">
|
|
|
-
|
|
|
|
|
<el-switch
|
|
<el-switch
|
|
|
v-if="$hasPermission('sys:account:update')"
|
|
v-if="$hasPermission('sys:account:update')"
|
|
|
v-model="row.enable"
|
|
v-model="row.enable"
|
|
@@ -75,7 +74,7 @@
|
|
|
@change="changeEnable(row)"
|
|
@change="changeEnable(row)"
|
|
|
>
|
|
>
|
|
|
</el-switch>
|
|
</el-switch>
|
|
|
- <span v-else>{{row.enable?'开启':'停用'}}</span>
|
|
|
|
|
|
|
+ <span v-else>{{ row.enable ? '开启' : '停用' }}</span>
|
|
|
</template>
|
|
</template>
|
|
|
<!-- 操作列 -->
|
|
<!-- 操作列 -->
|
|
|
<template v-slot:action="{ row }">
|
|
<template v-slot:action="{ row }">
|
|
@@ -97,13 +96,31 @@
|
|
|
>
|
|
>
|
|
|
重置密码
|
|
重置密码
|
|
|
</el-link>
|
|
</el-link>
|
|
|
|
|
+ <el-popconfirm
|
|
|
|
|
+ class="ele-action"
|
|
|
|
|
+ title="确定要解除绑定吗?"
|
|
|
|
|
+ @confirm="toUnBind(row)"
|
|
|
|
|
+ v-if="$hasPermission('sys:account:unBind') && row.name"
|
|
|
|
|
+ >
|
|
|
|
|
+ <!-- v-if="$hasPermission('sys:account:unBind')" -->
|
|
|
|
|
+ <template v-slot:reference>
|
|
|
|
|
+ <el-link type="primary" icon="el-icon-unlock" :underline="false">
|
|
|
|
|
+ 解绑
|
|
|
|
|
+ </el-link>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-popconfirm>
|
|
|
<el-popconfirm
|
|
<el-popconfirm
|
|
|
class="ele-action"
|
|
class="ele-action"
|
|
|
title="确定要删除此用户吗?"
|
|
title="确定要删除此用户吗?"
|
|
|
@confirm="remove(row)"
|
|
@confirm="remove(row)"
|
|
|
>
|
|
>
|
|
|
<template v-slot:reference>
|
|
<template v-slot:reference>
|
|
|
- <el-link type="danger" v-if="$hasPermission('sys:account:delete')" :underline="false" icon="el-icon-delete">
|
|
|
|
|
|
|
+ <el-link
|
|
|
|
|
+ type="danger"
|
|
|
|
|
+ v-if="$hasPermission('sys:account:delete')"
|
|
|
|
|
+ :underline="false"
|
|
|
|
|
+ icon="el-icon-delete"
|
|
|
|
|
+ >
|
|
|
删除
|
|
删除
|
|
|
</el-link>
|
|
</el-link>
|
|
|
</template>
|
|
</template>
|
|
@@ -117,6 +134,7 @@
|
|
|
:data="current"
|
|
:data="current"
|
|
|
@done="reload"
|
|
@done="reload"
|
|
|
ref="userEdit"
|
|
ref="userEdit"
|
|
|
|
|
+ :organizationList="organizationList"
|
|
|
/>
|
|
/>
|
|
|
<!-- 导入弹窗 -->
|
|
<!-- 导入弹窗 -->
|
|
|
<user-import :visible.sync="showImport" @done="reload" />
|
|
<user-import :visible.sync="showImport" @done="reload" />
|
|
@@ -133,6 +151,7 @@ import {
|
|
|
deleteUsers,
|
|
deleteUsers,
|
|
|
resetPassword
|
|
resetPassword
|
|
|
} from '@/api/system/user';
|
|
} from '@/api/system/user';
|
|
|
|
|
+import { unbindLoginName, listOrganizations } from '@/api/system/organization';
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'SystemUser',
|
|
name: 'SystemUser',
|
|
@@ -196,12 +215,12 @@ export default {
|
|
|
showOverflowTooltip: true,
|
|
showOverflowTooltip: true,
|
|
|
minWidth: 110,
|
|
minWidth: 110,
|
|
|
formatter: (_row, _column, cellValue) => {
|
|
formatter: (_row, _column, cellValue) => {
|
|
|
- let names=[]
|
|
|
|
|
- _row.groupRoleList.forEach(item=>{
|
|
|
|
|
- names.push(...item.roleVOList.map(val=>val.name))
|
|
|
|
|
- })
|
|
|
|
|
- console.log(cellValue,'cellValue')
|
|
|
|
|
- return names.toString()
|
|
|
|
|
|
|
+ let names = [];
|
|
|
|
|
+ _row.groupRoleList.forEach((item) => {
|
|
|
|
|
+ names.push(...item.roleVOList.map((val) => val.name));
|
|
|
|
|
+ });
|
|
|
|
|
+ console.log(cellValue, 'cellValue');
|
|
|
|
|
+ return names.toString();
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
@@ -227,7 +246,7 @@ export default {
|
|
|
{
|
|
{
|
|
|
columnKey: 'action',
|
|
columnKey: 'action',
|
|
|
label: '操作',
|
|
label: '操作',
|
|
|
- width: 220,
|
|
|
|
|
|
|
+ width: 280,
|
|
|
align: 'center',
|
|
align: 'center',
|
|
|
resizable: false,
|
|
resizable: false,
|
|
|
slot: 'action',
|
|
slot: 'action',
|
|
@@ -241,14 +260,35 @@ export default {
|
|
|
// 是否显示编辑弹窗
|
|
// 是否显示编辑弹窗
|
|
|
showEdit: false,
|
|
showEdit: false,
|
|
|
// 是否显示导入弹窗
|
|
// 是否显示导入弹窗
|
|
|
- showImport: false
|
|
|
|
|
|
|
+ showImport: false,
|
|
|
|
|
+ organizationList: []
|
|
|
};
|
|
};
|
|
|
},
|
|
},
|
|
|
|
|
+ created() {
|
|
|
|
|
+ this.query();
|
|
|
|
|
+ },
|
|
|
methods: {
|
|
methods: {
|
|
|
/* 表格数据源 */
|
|
/* 表格数据源 */
|
|
|
datasource({ page, limit, where, order }) {
|
|
datasource({ page, limit, where, order }) {
|
|
|
return pageUsers({ ...where, ...order, pageNum: page, size: limit });
|
|
return pageUsers({ ...where, ...order, pageNum: page, size: limit });
|
|
|
},
|
|
},
|
|
|
|
|
+ /* 查询 */
|
|
|
|
|
+ query() {
|
|
|
|
|
+ listOrganizations()
|
|
|
|
|
+ .then((list) => {
|
|
|
|
|
+ let _list = list.filter((i) => i.name != '超级管理员');
|
|
|
|
|
+
|
|
|
|
|
+ this.organizationList = this.$util.toTreeData({
|
|
|
|
|
+ data: _list,
|
|
|
|
|
+ idField: 'id',
|
|
|
|
|
+ parentIdField: 'parentId'
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((e) => {
|
|
|
|
|
+ this.loading = false;
|
|
|
|
|
+ // this.$message.error(e.message);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
async changeEnable(row) {
|
|
async changeEnable(row) {
|
|
|
let params = { ...row };
|
|
let params = { ...row };
|
|
|
params.roleId = row.roleList.map((d) => d.id);
|
|
params.roleId = row.roleList.map((d) => d.id);
|
|
@@ -274,6 +314,20 @@ export default {
|
|
|
this.$refs.userEdit.$refs.form &&
|
|
this.$refs.userEdit.$refs.form &&
|
|
|
this.$refs.userEdit.$refs.form.clearValidate();
|
|
this.$refs.userEdit.$refs.form.clearValidate();
|
|
|
},
|
|
},
|
|
|
|
|
+ // 解除绑定
|
|
|
|
|
+ toUnBind(row) {
|
|
|
|
|
+ const loading = this.$loading({ lock: true });
|
|
|
|
|
+ unbindLoginName(row.mainUserId)
|
|
|
|
|
+ .then((res) => {
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ this.$message.success('解绑成功');
|
|
|
|
|
+ this.reload();
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch((e) => {
|
|
|
|
|
+ loading.close();
|
|
|
|
|
+ // this.$message.error(e.message);
|
|
|
|
|
+ });
|
|
|
|
|
+ },
|
|
|
/* 打开导入弹窗 */
|
|
/* 打开导入弹窗 */
|
|
|
openImport() {
|
|
openImport() {
|
|
|
this.showImport = true;
|
|
this.showImport = true;
|