From 8827e1bbff26c5c71e0d944339c17edb4b679365 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=91=E5=B9=B4=E6=A2=A6=E4=B8=8E=E7=A0=96?= <2847127106@qq.com> Date: Mon, 23 Sep 2024 10:20:40 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=94=A8=E6=88=B7=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=9A=84=E8=A7=92=E8=89=B2=E9=80=89=E6=8B=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/user/index.vue | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 38235044..d774ddf9 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -232,7 +232,7 @@ + @input="checkRole"/> @@ -414,6 +414,8 @@ export default { dateRange: [], // 岗位选项 postOptions: [], + // 所有部门 + deptListAll: [], // 角色选项 roleOptions: [], roleListAll: [], @@ -515,10 +517,12 @@ export default { /** 查询部门下拉树结构 */ getDeptTree() { listDept(this.queryParams).then(response => { + this.deptListAll = response.data const deptList = response.data.map(dept => { return { id: dept.deptId, label: dept.deptName, + firmCode: dept.firmCode, parentId: dept.parentId, children: null } @@ -572,19 +576,16 @@ export default { this.resetForm("form"); }, // 选择部门筛选角色 - checkRole() { - console.log(this.roleOptions) - console.log(this.roleListAll) + checkRole(vuler) { let firmCode = '' - this.roleListAll.forEach(item => { - if (this.form.deptId === item.deptId) { - firmCode = item.firmCode; + this.deptListAll.forEach(item => { + if (item.deptId == vuler){ + firmCode = item.firmCode } }) - console.log(firmCode) this.roleOptions = this.roleListAll.filter(item => item.firmCode === firmCode); + console.log(firmCode) console.log(this.roleOptions) - console.log(this.roleListAll) }, /** 搜索按钮操作 */ handleQuery() {