diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index d6abf927..1c9fc7d3 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -354,6 +354,10 @@ function fnModalVisibleByVive(userId: string | number) { modalState.from = Object.assign(modalState.from, user); modalState.from.roleIds = roleIds; modalState.from.postIds = postIds; + //筛选是否拥有tenant角色 + modalState.showTenant = user.roles.some( + (role: any) => role.roleKey === 'tenant' + ); // 头像解析 modalState.from.avatar = userStore.fnAvatar(modalState.from.avatar); modalState.title = t('views.system.user.userInfo'); @@ -427,6 +431,11 @@ function fnModalVisibleByEdit(userId?: string | number) { modalState.from = Object.assign(modalState.from, user); modalState.from.roleIds = roleIds; modalState.from.postIds = postIds; + //筛选是否拥有tenant角色 + modalState.showTenant = user.roles.some( + (role: any) => role.roleKey === 'tenant' + ); + modalState.title = t('common.editText') + t('views.system.user.userInfo'); modalState.visibleByEdit = true; @@ -1258,6 +1267,7 @@ onMounted(() => { name="tenantId" :label-col="{ span: 3 }" :label-wrap="true" + v-show="modalState.showTenant" >