部门角色登录时 组织架构列表只显示他自己的部门

main
wanglei 2 months ago
parent 421b3366cb
commit 718f705908

@ -15,6 +15,7 @@ const user = {
pcId: null,
itemIds: null,
voteIds: null,
deptId: null,
roles: [],
permissions: []
},
@ -44,6 +45,9 @@ const user = {
SET_VOTEIDS: (state, voteIds) => {
state.voteIds = voteIds
},
SET_DEPTID: (state, deptId) => {
state.deptId = deptId
},
SET_ROLES: (state, roles) => {
state.roles = roles
},
@ -92,6 +96,7 @@ const user = {
commit('SET_PCID', user.pcId)
commit('SET_ITEMIDS', user.itemIds)
commit('SET_VOTEIDS', user.voteIds)
commit('SET_DEPTID', user.deptId)
/* 初始密码提示 */
/*if(res.isDefaultModifyPwd) {
MessageBox.confirm('您的密码还是初始密码,请修改密码!', '安全提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => {

@ -1,6 +1,6 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-if="!isQueryDept" v-show="showSearch">
<el-form-item label="部门名称" prop="deptName">
<el-input
v-model="queryParams.deptName"
@ -114,7 +114,7 @@
<el-row>
<el-col :span="24" v-if="form.parentId !== 0">
<el-form-item label="上级部门" prop="parentId">
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" />
<treeselect v-model="form.parentId" :options="deptOptions" :normalizer="normalizer" placeholder="选择上级部门" :disabled="isQueryDept"/>
</el-form-item>
</el-col>
</el-row>
@ -230,6 +230,7 @@ export default {
components: { Treeselect },
data() {
return {
isQueryDept: false,
//
loading: true,
//
@ -249,6 +250,7 @@ export default {
//
queryParams: {
deptName: undefined,
deptId: undefined,
status: undefined
},
//
@ -299,6 +301,11 @@ export default {
}
},
created() {
let userInfo = this.$store.state.user;
if(userInfo.roles.length===1 && userInfo.roles[0]==='deptRole'){
this.isQueryDept = true;
this.queryParams.deptId = userInfo.deptId
}
this.getList()
},
methods: {

Loading…
Cancel
Save