diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 0c7f4745..907fb533 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -369,7 +369,6 @@ function fnModalVisibleByVive(userId: string | number) { * @param userId 用户编号ID, 不传为新增 */ function fnModalVisibleByEdit(userId?: string | number) { - fnGetDeptTree(); // 获取部门树 if (!userId) { modalStateFrom.resetFields(); if (modalState.confirmLoading) return; @@ -398,6 +397,7 @@ function fnModalVisibleByEdit(userId?: string | number) { modalState.from.postIds = postIds; modalState.title = t('common.addText') + t('views.system.user.userInfo'); + fnGetDeptTree(); // 获取部门树 modalState.visibleByEdit = true; } else { message.error(t('views.system.user.tipRowErr'), 2); @@ -798,6 +798,7 @@ function fnGetDeptTree() { }) .finally(() => { //若长度为0 删除租户选项 + //deptTreeData.value=[]; if (deptTreeData.value.length === 0) { const index = modalState.options.roles.findIndex( (role: any) => role.roleKey === 'tenant'