From da3d712e97a28a7a62f378caa43bfab1be79d9a5 Mon Sep 17 00:00:00 2001 From: lai <371757574@qq.com> Date: Fri, 27 Sep 2024 14:22:21 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E6=9B=B4=E6=96=B0=E7=A7=9F?= =?UTF-8?q?=E6=88=B7=E6=A0=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/system/user/index.vue | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 261eefc7..100607bc 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -431,6 +431,8 @@ function fnModalVisibleByEdit(userId?: string | number) { (role: any) => role.roleKey === 'tenant' ); + if(modalState.showTenant) fnGetDeptTree(); + modalState.title = t('common.editText') + t('views.system.user.userInfo'); modalState.visibleByEdit = true; @@ -497,7 +499,7 @@ function fnModalCancel() { modalStateFrom.resetFields(); modalState.options.roles = []; modalState.options.posts = []; - modalState.showTenant=false; + modalState.showTenant = false; } /** @@ -777,8 +779,8 @@ let deptTreeData = ref([]); /**查询部门下拉树结构 */ function fnGetDeptTree() { - if (deptTreeData.value.length > 0) return; - listTenant({ parentId: 0 }).then(res => { + deptTreeData.value=[]; //reSet + listTenant({ parentId: 0 }).then(res => { if (res.code === RESULT_CODE_SUCCESS && Array.isArray(res.data)) { res.data.forEach((item: any) => { if (item.parentId === '0') { @@ -797,6 +799,8 @@ function fnGetDeptTree() { function handleChange(value: any, options: any) { modalState.from.roleIds = [value]; modalState.showTenant = options.roleKey === 'tenant'; + // 获取租户树结构数据 + if (modalState.showTenant) fnGetDeptTree(); } onMounted(() => { @@ -814,8 +818,6 @@ onMounted(() => { }); // 获取列表数据 fnGetList(); - // 获取部门树结构数据 - fnGetDeptTree(); });