|
|
|
|
@ -4,163 +4,84 @@ |
|
|
|
|
<div class="box"> |
|
|
|
|
<el-scrollbar> |
|
|
|
|
<basic-container> |
|
|
|
|
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick"/> |
|
|
|
|
<avue-tree :option="treeOption" :data="treeData" @node-click="nodeClick" /> |
|
|
|
|
</basic-container> |
|
|
|
|
</el-scrollbar> |
|
|
|
|
</div> |
|
|
|
|
</el-col> |
|
|
|
|
<el-col :span="19"> |
|
|
|
|
<basic-container> |
|
|
|
|
<avue-crud :option="option" |
|
|
|
|
:search.sync="search" |
|
|
|
|
:table-loading="loading" |
|
|
|
|
:data="data" |
|
|
|
|
ref="crud" |
|
|
|
|
v-model="form" |
|
|
|
|
:permission="permissionList" |
|
|
|
|
@row-del="rowDel" |
|
|
|
|
@row-update="rowUpdate" |
|
|
|
|
@row-save="rowSave" |
|
|
|
|
:before-open="beforeOpen" |
|
|
|
|
:page.sync="page" |
|
|
|
|
@search-change="searchChange" |
|
|
|
|
@search-reset="searchReset" |
|
|
|
|
@selection-change="selectionChange" |
|
|
|
|
@current-change="currentChange" |
|
|
|
|
@size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" |
|
|
|
|
@on-load="onLoad"> |
|
|
|
|
<avue-crud :option="option" :search.sync="search" :table-loading="loading" :data="data" ref="crud" |
|
|
|
|
v-model="form" :permission="permissionList" @row-del="rowDel" @row-update="rowUpdate" @row-save="rowSave" |
|
|
|
|
:before-open="beforeOpen" :page.sync="page" @search-change="searchChange" @search-reset="searchReset" |
|
|
|
|
@selection-change="selectionChange" @current-change="currentChange" @size-change="sizeChange" |
|
|
|
|
@refresh-change="refreshChange" @on-load="onLoad"> |
|
|
|
|
<template slot="menuLeft"> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
size="small" |
|
|
|
|
v-if="permission.user_add && !auditMode" |
|
|
|
|
icon="el-icon-plus" |
|
|
|
|
<el-button type="primary" size="small" v-if="permission.user_add && !auditMode" icon="el-icon-plus" |
|
|
|
|
@click="$refs.crud.rowAdd()">新 增 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="danger" |
|
|
|
|
size="small" |
|
|
|
|
plain |
|
|
|
|
icon="el-icon-delete" |
|
|
|
|
v-if="permission.user_delete && !auditMode" |
|
|
|
|
@click="handleDelete">删 除 |
|
|
|
|
<el-button type="danger" size="small" plain icon="el-icon-delete" |
|
|
|
|
v-if="permission.user_delete && !auditMode" @click="handleDelete">删 除 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
size="small" |
|
|
|
|
plain |
|
|
|
|
icon="el-icon-s-operation" |
|
|
|
|
v-if="userInfo.role_name.includes('admin') && !auditMode" |
|
|
|
|
@click="handleAudit">审 核 |
|
|
|
|
<el-button type="primary" size="small" plain icon="el-icon-s-operation" |
|
|
|
|
v-if="userInfo.role_name.includes('admin') && !auditMode" @click="handleAudit">审 核 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="success" |
|
|
|
|
size="small" |
|
|
|
|
plain |
|
|
|
|
icon="el-icon-check" |
|
|
|
|
v-if="userInfo.role_name.includes('admin') && auditMode" |
|
|
|
|
@click="handleAuditPass">通 过 |
|
|
|
|
<el-button type="success" size="small" plain icon="el-icon-check" |
|
|
|
|
v-if="userInfo.role_name.includes('admin') && auditMode" @click="handleAuditPass">通 过 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="danger" |
|
|
|
|
size="small" |
|
|
|
|
plain |
|
|
|
|
icon="el-icon-close" |
|
|
|
|
v-if="userInfo.role_name.includes('admin') && auditMode" |
|
|
|
|
@click="handleAuditRefuse">拒 绝 |
|
|
|
|
<el-button type="danger" size="small" plain icon="el-icon-close" |
|
|
|
|
v-if="userInfo.role_name.includes('admin') && auditMode" @click="handleAuditRefuse">拒 绝 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
size="small" |
|
|
|
|
plain |
|
|
|
|
icon="el-icon-refresh-left" |
|
|
|
|
v-if="userInfo.role_name.includes('admin') && auditMode" |
|
|
|
|
@click="handleAuditBack">返 回 |
|
|
|
|
<el-button type="primary" size="small" plain icon="el-icon-refresh-left" |
|
|
|
|
v-if="userInfo.role_name.includes('admin') && auditMode" @click="handleAuditBack">返 回 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="info" |
|
|
|
|
size="small" |
|
|
|
|
plain |
|
|
|
|
v-if="permission.user_role && !auditMode" |
|
|
|
|
icon="el-icon-user" |
|
|
|
|
<el-button type="info" size="small" plain v-if="permission.user_role && !auditMode" icon="el-icon-user" |
|
|
|
|
@click="handleGrant">角色配置 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="info" |
|
|
|
|
size="small" |
|
|
|
|
plain |
|
|
|
|
v-if="permission.user_reset && !auditMode" |
|
|
|
|
icon="el-icon-refresh" |
|
|
|
|
<el-button type="info" size="small" plain v-if="permission.user_reset && !auditMode" icon="el-icon-refresh" |
|
|
|
|
@click="handleReset">密码重置 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="info" |
|
|
|
|
size="small" |
|
|
|
|
plain |
|
|
|
|
v-if="userInfo.role_name.includes('admin') && !auditMode" |
|
|
|
|
icon="el-icon-setting" |
|
|
|
|
@click="handlePlatform">平台配置 |
|
|
|
|
<el-button type="info" size="small" plain v-if="userInfo.role_name.includes('admin') && !auditMode" |
|
|
|
|
icon="el-icon-setting" @click="handlePlatform">平台配置 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="info" |
|
|
|
|
size="small" |
|
|
|
|
plain |
|
|
|
|
v-if="userInfo.role_name.includes('admin') && !auditMode" |
|
|
|
|
icon="el-icon-coordinate" |
|
|
|
|
@click="handleLock">账号解封 |
|
|
|
|
<el-button type="info" size="small" plain v-if="userInfo.role_name.includes('admin') && !auditMode" |
|
|
|
|
icon="el-icon-coordinate" @click="handleLock">账号解封 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="success" |
|
|
|
|
size="small" |
|
|
|
|
plain |
|
|
|
|
v-if="userInfo.role_name.includes('admin') && !auditMode" |
|
|
|
|
icon="el-icon-upload2" |
|
|
|
|
@click="handleImport">导入 |
|
|
|
|
<el-button type="success" size="small" plain v-if="userInfo.role_name.includes('admin') && !auditMode" |
|
|
|
|
icon="el-icon-upload2" @click="handleImport">导入 |
|
|
|
|
</el-button> |
|
|
|
|
<el-button type="warning" |
|
|
|
|
size="small" |
|
|
|
|
plain |
|
|
|
|
v-if="userInfo.role_name.includes('admin') && !auditMode" |
|
|
|
|
icon="el-icon-download" |
|
|
|
|
@click="handleExport">导出 |
|
|
|
|
<el-button type="warning" size="small" plain v-if="userInfo.role_name.includes('admin') && !auditMode" |
|
|
|
|
icon="el-icon-download" @click="handleExport">导出 |
|
|
|
|
</el-button> |
|
|
|
|
</template> |
|
|
|
|
<template slot-scope="{row}" |
|
|
|
|
slot="tenantName"> |
|
|
|
|
<el-tag>{{row.tenantName}}</el-tag> |
|
|
|
|
<template slot-scope="{row}" slot="tenantName"> |
|
|
|
|
<el-tag>{{ row.tenantName }}</el-tag> |
|
|
|
|
</template> |
|
|
|
|
<template slot-scope="{row}" |
|
|
|
|
slot="roleName"> |
|
|
|
|
<el-tag>{{row.roleName}}</el-tag> |
|
|
|
|
<template slot-scope="{row}" slot="roleName"> |
|
|
|
|
<el-tag>{{ row.roleName }}</el-tag> |
|
|
|
|
</template> |
|
|
|
|
<template slot-scope="{row}" |
|
|
|
|
slot="deptName"> |
|
|
|
|
<el-tag>{{row.deptName}}</el-tag> |
|
|
|
|
<template slot-scope="{row}" slot="deptName"> |
|
|
|
|
<el-tag>{{ row.deptName }}</el-tag> |
|
|
|
|
</template> |
|
|
|
|
<template slot-scope="{row}" |
|
|
|
|
slot="userTypeName"> |
|
|
|
|
<el-tag>{{row.userTypeName}}</el-tag> |
|
|
|
|
<template slot-scope="{row}" slot="userTypeName"> |
|
|
|
|
<el-tag>{{ row.userTypeName }}</el-tag> |
|
|
|
|
</template> |
|
|
|
|
<template slot-scope="{row}" |
|
|
|
|
slot="isMaintenanceClient" v-if="row.isMaintenanceClient != -1"> |
|
|
|
|
<el-tag>{{row.isMaintenanceClient == 0 ? '维修客户' : row.isMaintenanceClient == 1 ? '维保客户' : ''}}</el-tag> |
|
|
|
|
<template slot-scope="{row}" slot="isMaintenanceClient" v-if="row.isMaintenanceClient != -1"> |
|
|
|
|
<el-tag>{{ row.isMaintenanceClient == 0 ? '维修客户' : row.isMaintenanceClient == 1 ? '维保客户' : '' }}</el-tag> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
<el-dialog title="用户角色配置" |
|
|
|
|
append-to-body |
|
|
|
|
:visible.sync="roleBox" |
|
|
|
|
width="345px"> |
|
|
|
|
<el-dialog title="用户角色配置" append-to-body :visible.sync="roleBox" width="345px"> |
|
|
|
|
|
|
|
|
|
<el-tree :data="roleGrantList" |
|
|
|
|
show-checkbox |
|
|
|
|
check-strictly |
|
|
|
|
default-expand-all |
|
|
|
|
node-key="id" |
|
|
|
|
ref="treeRole" |
|
|
|
|
:default-checked-keys="roleTreeObj" |
|
|
|
|
:props="props"> |
|
|
|
|
<el-tree :data="roleGrantList" show-checkbox check-strictly default-expand-all node-key="id" ref="treeRole" |
|
|
|
|
:default-checked-keys="roleTreeObj" :props="props"> |
|
|
|
|
</el-tree> |
|
|
|
|
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
<el-button @click="roleBox = false">取 消</el-button> |
|
|
|
|
<el-button type="primary" |
|
|
|
|
@click="submitRole">确 定</el-button> |
|
|
|
|
<el-button type="primary" @click="submitRole">确 定</el-button> |
|
|
|
|
</span> |
|
|
|
|
</el-dialog> |
|
|
|
|
<el-dialog title="用户数据导入" |
|
|
|
|
append-to-body |
|
|
|
|
:visible.sync="excelBox" |
|
|
|
|
width="555px"> |
|
|
|
|
<el-dialog title="用户数据导入" append-to-body :visible.sync="excelBox" width="555px"> |
|
|
|
|
<avue-form :option="excelOption" v-model="excelForm" :upload-after="uploadAfter"> |
|
|
|
|
<template slot="excelTemplate"> |
|
|
|
|
<el-button type="primary" @click="handleTemplate"> |
|
|
|
|
@ -169,32 +90,18 @@ |
|
|
|
|
</template> |
|
|
|
|
</avue-form> |
|
|
|
|
</el-dialog> |
|
|
|
|
<el-dialog title="用户平台配置" |
|
|
|
|
append-to-body |
|
|
|
|
:visible.sync="platformBox"> |
|
|
|
|
<avue-crud :option="platformOption" |
|
|
|
|
:table-loading="platformLoading" |
|
|
|
|
:data="platformData" |
|
|
|
|
ref="platformCrud" |
|
|
|
|
v-model="platformForm" |
|
|
|
|
:before-open="platformBeforeOpen" |
|
|
|
|
:page.sync="platformPage" |
|
|
|
|
:permission="platformPermissionList" |
|
|
|
|
@row-update="platformRowUpdate" |
|
|
|
|
@search-change="platformSearchChange" |
|
|
|
|
@search-reset="platformSearchReset" |
|
|
|
|
@selection-change="platformSelectionChange" |
|
|
|
|
@current-change="platformCurrentChange" |
|
|
|
|
@size-change="platformSizeChange" |
|
|
|
|
@refresh-change="platformRefreshChange" |
|
|
|
|
@on-load="platformOnLoad"> |
|
|
|
|
<template slot-scope="{row}" |
|
|
|
|
slot="tenantName"> |
|
|
|
|
<el-tag>{{row.tenantName}}</el-tag> |
|
|
|
|
<el-dialog title="用户平台配置" append-to-body :visible.sync="platformBox"> |
|
|
|
|
<avue-crud :option="platformOption" :table-loading="platformLoading" :data="platformData" ref="platformCrud" |
|
|
|
|
v-model="platformForm" :before-open="platformBeforeOpen" :page.sync="platformPage" |
|
|
|
|
:permission="platformPermissionList" @row-update="platformRowUpdate" @search-change="platformSearchChange" |
|
|
|
|
@search-reset="platformSearchReset" @selection-change="platformSelectionChange" |
|
|
|
|
@current-change="platformCurrentChange" @size-change="platformSizeChange" |
|
|
|
|
@refresh-change="platformRefreshChange" @on-load="platformOnLoad"> |
|
|
|
|
<template slot-scope="{row}" slot="tenantName"> |
|
|
|
|
<el-tag>{{ row.tenantName }}</el-tag> |
|
|
|
|
</template> |
|
|
|
|
<template slot-scope="{row}" |
|
|
|
|
slot="userTypeName"> |
|
|
|
|
<el-tag>{{row.userTypeName}}</el-tag> |
|
|
|
|
<template slot-scope="{row}" slot="userTypeName"> |
|
|
|
|
<el-tag>{{ row.userTypeName }}</el-tag> |
|
|
|
|
</template> |
|
|
|
|
</avue-crud> |
|
|
|
|
</el-dialog> |
|
|
|
|
@ -204,7 +111,7 @@ |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
|
<script> |
|
|
|
|
import { |
|
|
|
|
import { |
|
|
|
|
getList, |
|
|
|
|
getUser, |
|
|
|
|
getUserPlatform, |
|
|
|
|
@ -215,21 +122,21 @@ |
|
|
|
|
grant, |
|
|
|
|
resetPassword, unlock, |
|
|
|
|
auditPass, auditRefuse |
|
|
|
|
} from "@/api/system/user"; |
|
|
|
|
import {exportBlob} from "@/api/common"; |
|
|
|
|
import {getDeptTree, getDeptLazyTree} from "@/api/system/dept"; |
|
|
|
|
import {getRoleTree} from "@/api/system/role"; |
|
|
|
|
import {getPostList} from "@/api/system/post"; |
|
|
|
|
import {mapGetters} from "vuex"; |
|
|
|
|
import website from '@/config/website'; |
|
|
|
|
import {getToken} from '@/util/auth'; |
|
|
|
|
import {downloadXls} from "@/util/util"; |
|
|
|
|
import {dateNow} from "@/util/date"; |
|
|
|
|
import NProgress from 'nprogress'; |
|
|
|
|
import 'nprogress/nprogress.css'; |
|
|
|
|
import func from "@/util/func"; |
|
|
|
|
} from "@/api/system/user"; |
|
|
|
|
import { exportBlob } from "@/api/common"; |
|
|
|
|
import { getDeptTree, getDeptLazyTree } from "@/api/system/dept"; |
|
|
|
|
import { getRoleTree } from "@/api/system/role"; |
|
|
|
|
import { getPostList } from "@/api/system/post"; |
|
|
|
|
import { mapGetters } from "vuex"; |
|
|
|
|
import website from '@/config/website'; |
|
|
|
|
import { getToken } from '@/util/auth'; |
|
|
|
|
import { downloadXls } from "@/util/util"; |
|
|
|
|
import { dateNow } from "@/util/date"; |
|
|
|
|
import NProgress from 'nprogress'; |
|
|
|
|
import 'nprogress/nprogress.css'; |
|
|
|
|
import func from "@/util/func"; |
|
|
|
|
|
|
|
|
|
export default { |
|
|
|
|
export default { |
|
|
|
|
data() { |
|
|
|
|
const validatePass = (rule, value, callback) => { |
|
|
|
|
if (value === '') { |
|
|
|
|
@ -249,7 +156,7 @@ |
|
|
|
|
}; |
|
|
|
|
return { |
|
|
|
|
form: {}, |
|
|
|
|
search:{}, |
|
|
|
|
search: {}, |
|
|
|
|
roleBox: false, |
|
|
|
|
excelBox: false, |
|
|
|
|
platformBox: false, |
|
|
|
|
@ -439,7 +346,7 @@ |
|
|
|
|
hide: true, |
|
|
|
|
editDisplay: false, |
|
|
|
|
viewDisplay: false, |
|
|
|
|
rules: [{required: true, validator: validatePass, trigger: 'blur'}] |
|
|
|
|
rules: [{ required: true, validator: validatePass, trigger: 'blur' }] |
|
|
|
|
}, |
|
|
|
|
{ |
|
|
|
|
label: '确认密码', |
|
|
|
|
@ -447,7 +354,7 @@ |
|
|
|
|
hide: true, |
|
|
|
|
editDisplay: false, |
|
|
|
|
viewDisplay: false, |
|
|
|
|
rules: [{required: true, validator: validatePass2, trigger: 'blur'}] |
|
|
|
|
rules: [{ required: true, validator: validatePass2, trigger: 'blur' }] |
|
|
|
|
}, |
|
|
|
|
] |
|
|
|
|
}, |
|
|
|
|
@ -812,6 +719,14 @@ |
|
|
|
|
row.deptId = func.join(row.deptId); |
|
|
|
|
row.roleId = func.join(row.roleId); |
|
|
|
|
row.postId = func.join(row.postId); |
|
|
|
|
if (row.deptId.split(',').length > 1) { |
|
|
|
|
this.$message({ |
|
|
|
|
type: "error", |
|
|
|
|
message: "所属部门只能选择一个!" |
|
|
|
|
}); |
|
|
|
|
loading(); |
|
|
|
|
return false |
|
|
|
|
} |
|
|
|
|
update(row).then(() => { |
|
|
|
|
this.initFlag = false; |
|
|
|
|
this.onLoad(this.page); |
|
|
|
|
@ -1121,19 +1036,19 @@ |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}; |
|
|
|
|
}; |
|
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
<style> |
|
|
|
|
.box { |
|
|
|
|
.box { |
|
|
|
|
height: 800px; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.el-scrollbar { |
|
|
|
|
.el-scrollbar { |
|
|
|
|
height: 100%; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
.box .el-scrollbar__wrap { |
|
|
|
|
.box .el-scrollbar__wrap { |
|
|
|
|
overflow: scroll; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
</style> |
|
|
|
|
|