完成租户的部门用户权限管理
parent
7bddb24d08
commit
57ce2e523c
|
@ -105,6 +105,7 @@
|
||||||
<el-table-column align="center" type="selection" width="55"/>
|
<el-table-column align="center" type="selection" width="55"/>
|
||||||
<el-table-column label="角色编号" prop="roleId" width="120"/>
|
<el-table-column label="角色编号" prop="roleId" width="120"/>
|
||||||
<el-table-column :show-overflow-tooltip="true" label="角色名称" prop="roleName" width="150"/>
|
<el-table-column :show-overflow-tooltip="true" label="角色名称" prop="roleName" width="150"/>
|
||||||
|
<el-table-column v-show="getEntCode() === 'FIRM'" align="center" label="租户编码" prop="firmCode"/>
|
||||||
<el-table-column :show-overflow-tooltip="true" label="权限字符" prop="roleKey" width="150"/>
|
<el-table-column :show-overflow-tooltip="true" label="权限字符" prop="roleKey" width="150"/>
|
||||||
<el-table-column label="显示顺序" prop="roleSort" width="100"/>
|
<el-table-column label="显示顺序" prop="roleSort" width="100"/>
|
||||||
<el-table-column align="center" label="状态" width="100">
|
<el-table-column align="center" label="状态" width="100">
|
||||||
|
@ -277,6 +278,7 @@ import {
|
||||||
updateRole
|
updateRole
|
||||||
} from "@/api/system/role";
|
} from "@/api/system/role";
|
||||||
import {roleMenuTreeselect, treeselect as menuTreeselect} from "@/api/system/menu";
|
import {roleMenuTreeselect, treeselect as menuTreeselect} from "@/api/system/menu";
|
||||||
|
import {getEntCode} from "@/utils/auth";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Role",
|
name: "Role",
|
||||||
|
@ -368,6 +370,7 @@ export default {
|
||||||
this.getList();
|
this.getList();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getEntCode,
|
||||||
/** 查询角色列表 */
|
/** 查询角色列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
|
|
@ -26,6 +26,7 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column :reserve-selection="true" type="selection" width="55"></el-table-column>
|
<el-table-column :reserve-selection="true" type="selection" width="55"></el-table-column>
|
||||||
<el-table-column align="center" label="角色编号" prop="roleId"/>
|
<el-table-column align="center" label="角色编号" prop="roleId"/>
|
||||||
|
<el-table-column v-show="getEntCode() === 'FIRM'" align="center" label="租户编码" prop="firmCode"/>
|
||||||
<el-table-column align="center" label="角色名称" prop="roleName"/>
|
<el-table-column align="center" label="角色名称" prop="roleName"/>
|
||||||
<el-table-column align="center" label="权限字符" prop="roleKey"/>
|
<el-table-column align="center" label="权限字符" prop="roleKey"/>
|
||||||
<el-table-column align="center" label="创建时间" prop="createTime" width="180">
|
<el-table-column align="center" label="创建时间" prop="createTime" width="180">
|
||||||
|
@ -48,6 +49,7 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {getAuthRole, updateAuthRole} from "@/api/system/user";
|
import {getAuthRole, updateAuthRole} from "@/api/system/user";
|
||||||
|
import {getEntCode} from "@/utils/auth";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "AuthRole",
|
name: "AuthRole",
|
||||||
|
@ -87,6 +89,7 @@ export default {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getEntCode,
|
||||||
/** 单击选中行数据 */
|
/** 单击选中行数据 */
|
||||||
clickRow(row) {
|
clickRow(row) {
|
||||||
this.$refs.table.toggleRowSelection(row);
|
this.$refs.table.toggleRowSelection(row);
|
||||||
|
|
|
@ -151,6 +151,7 @@
|
||||||
prop="nickName"/>
|
prop="nickName"/>
|
||||||
<el-table-column v-if="columns[3].visible" key="deptName" :show-overflow-tooltip="true" align="center" label="部门"
|
<el-table-column v-if="columns[3].visible" key="deptName" :show-overflow-tooltip="true" align="center" label="部门"
|
||||||
prop="dept.deptName"/>
|
prop="dept.deptName"/>
|
||||||
|
<el-table-column v-show="getEntCode() === 'FIRM'" align="center" label="租户编码" prop="firmCode"/>
|
||||||
<el-table-column v-if="columns[4].visible" key="phonenumber" align="center" label="手机号码"
|
<el-table-column v-if="columns[4].visible" key="phonenumber" align="center" label="手机号码"
|
||||||
prop="phonenumber" width="120"/>
|
prop="phonenumber" width="120"/>
|
||||||
<el-table-column v-if="columns[5].visible" key="status" align="center" label="状态">
|
<el-table-column v-if="columns[5].visible" key="status" align="center" label="状态">
|
||||||
|
@ -228,7 +229,10 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="归属部门" prop="deptId">
|
<el-form-item label="归属部门" prop="deptId">
|
||||||
<treeselect v-model="form.deptId" :options="deptOptions" :show-count="true" placeholder="请选择归属部门"/>
|
<treeselect v-model="form.deptId" :options="deptOptions"
|
||||||
|
:show-count="true"
|
||||||
|
placeholder="请选择归属部门"
|
||||||
|
@change="checkRole()"/>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
|
@ -371,7 +375,7 @@ import {
|
||||||
resetUserPwd,
|
resetUserPwd,
|
||||||
updateUser
|
updateUser
|
||||||
} from "@/api/system/user";
|
} from "@/api/system/user";
|
||||||
import {getToken} from "@/utils/auth";
|
import {getEntCode, getToken, setEntCode} from "@/utils/auth";
|
||||||
import Treeselect from "@riophae/vue-treeselect";
|
import Treeselect from "@riophae/vue-treeselect";
|
||||||
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
||||||
import {listDept} from "@/api/system/dept";
|
import {listDept} from "@/api/system/dept";
|
||||||
|
@ -412,6 +416,7 @@ export default {
|
||||||
postOptions: [],
|
postOptions: [],
|
||||||
// 角色选项
|
// 角色选项
|
||||||
roleOptions: [],
|
roleOptions: [],
|
||||||
|
roleListAll: [],
|
||||||
// 表单参数
|
// 表单参数
|
||||||
form: {},
|
form: {},
|
||||||
defaultProps: {
|
defaultProps: {
|
||||||
|
@ -496,6 +501,7 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getEntCode,
|
||||||
/** 查询用户列表 */
|
/** 查询用户列表 */
|
||||||
getList() {
|
getList() {
|
||||||
this.loading = true;
|
this.loading = true;
|
||||||
|
@ -565,6 +571,21 @@ export default {
|
||||||
};
|
};
|
||||||
this.resetForm("form");
|
this.resetForm("form");
|
||||||
},
|
},
|
||||||
|
// 选择部门筛选角色
|
||||||
|
checkRole() {
|
||||||
|
console.log(this.roleOptions)
|
||||||
|
console.log(this.roleListAll)
|
||||||
|
let firmCode = ''
|
||||||
|
this.roleListAll.forEach(item => {
|
||||||
|
if (this.form.deptId === item.deptId) {
|
||||||
|
firmCode = item.firmCode;
|
||||||
|
}
|
||||||
|
})
|
||||||
|
console.log(firmCode)
|
||||||
|
this.roleOptions = this.roleListAll.filter(item => item.firmCode === firmCode);
|
||||||
|
console.log(this.roleOptions)
|
||||||
|
console.log(this.roleListAll)
|
||||||
|
},
|
||||||
/** 搜索按钮操作 */
|
/** 搜索按钮操作 */
|
||||||
handleQuery() {
|
handleQuery() {
|
||||||
this.queryParams.pageNum = 1;
|
this.queryParams.pageNum = 1;
|
||||||
|
@ -602,7 +623,8 @@ export default {
|
||||||
this.reset();
|
this.reset();
|
||||||
getUser().then(response => {
|
getUser().then(response => {
|
||||||
this.postOptions = response.data.posts;
|
this.postOptions = response.data.posts;
|
||||||
this.roleOptions = response.data.roles;
|
this.roleOptions = response.data.roles.filter(item => item.firmCode === getEntCode());
|
||||||
|
this.roleListAll = response.data.roles;
|
||||||
this.open = true;
|
this.open = true;
|
||||||
this.title = "添加用户";
|
this.title = "添加用户";
|
||||||
this.form.password = this.initPassword;
|
this.form.password = this.initPassword;
|
||||||
|
|
|
@ -41,14 +41,14 @@ module.exports = {
|
||||||
['^' + process.env.VUE_APP_BASE_API]: ''
|
['^' + process.env.VUE_APP_BASE_API]: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'/browser': {
|
// '/browser': {
|
||||||
target:'http://192.168.138.130:12800',//这里是路由和报错报告的代理
|
// target:'http://192.168.138.130:12800',//这里是路由和报错报告的代理
|
||||||
changeOrigin: true
|
// changeOrigin: true
|
||||||
},
|
// },
|
||||||
'/v3':{
|
// '/v3':{
|
||||||
target:'http://192.168.138.130:12800',
|
// target:'http://192.168.138.130:12800',
|
||||||
changeOrigin: true//这里是追踪报告的代理
|
// changeOrigin: true//这里是追踪报告的代理
|
||||||
}
|
// }
|
||||||
},
|
},
|
||||||
disableHostCheck: true
|
disableHostCheck: true
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue