From ba012ebdf774a5667567f76209a11ba26f22e298 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=89=E5=AE=89=E5=90=9B?= <2746727141@qq.com> Date: Thu, 28 Mar 2024 22:27:31 +0800 Subject: [PATCH] =?UTF-8?q?feat=20commit=20=E5=85=A5=E9=A9=BB=E4=BC=81?= =?UTF-8?q?=E4=B8=9A=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6,=E5=85=A5?= =?UTF-8?q?=E9=A9=BB=E4=BC=81=E4=B8=9A=E7=9A=84=E4=BC=81=E4=B8=9A=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD,=E7=94=A8=E6=88=B7=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/system/user.js | 2 +- src/store/modules/user.js | 3 ++- src/views/system/user/index.vue | 16 ++++++++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/api/system/user.js b/src/api/system/user.js index 89d3972..e10eabc 100644 --- a/src/api/system/user.js +++ b/src/api/system/user.js @@ -127,7 +127,7 @@ export function updateAuthRole(data) { } // 查询部门下拉树结构 -export function deptTreeSelect() { +export function deptTreeSelect(data) { return request({ url: '/system/user/deptTree', method: 'get' diff --git a/src/store/modules/user.js b/src/store/modules/user.js index 3f7e8a4..e565042 100644 --- a/src/store/modules/user.js +++ b/src/store/modules/user.js @@ -36,6 +36,7 @@ const user = { state.permissions = permissions }, SET_COMPANY: (state, companySign) => { + state.companySign = companySign Cookies.set('companySign', companySign) } }, @@ -65,7 +66,7 @@ const user = { GetInfo({commit, state}) { return new Promise((resolve, reject) => { getInfo().then(res => { - debugger + // debugger const user = res.data.user const avatar = (user.avatar == "" || user.avatar == null) ? require("@/assets/images/profile.jpg") : user.avatar; if (res.data.roles && res.data.roles.length > 0) { // 验证返回的roles是否是一个非空数组 diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index ceaaffb..09e93cb 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -399,7 +399,7 @@ export default { // 弹出层标题 title: "", // 部门树选项 - deptOptions: undefined, + deptOptions: [], // 是否显示弹出层 open: false, // 部门名称 @@ -489,8 +489,7 @@ export default { } }, created() { - this.getList(); - this.getDeptTree(); + this.getDeptTree(1); this.getConfigKey("sys.user.initPassword").then(response => { this.initPassword = response.data.msg; }); @@ -507,10 +506,19 @@ export default { ); }, /** 查询部门下拉树结构 */ - getDeptTree() { + getDeptTree(num) { + // debugger deptTreeSelect().then(response => { this.deptOptions = response.data; + if (1 === num){ + this.queryParams.deptId = response.data[0].id; + this.getList(); + } }); + // if (1 === num){ + // this.queryParams = this.deptOptions[0].id; + // this.getList(); + // } }, // 筛选节点 filterNode(value, data) {