Remove org chart from user avatar popover

This commit is contained in:
2026-06-10 18:54:26 +08:00
parent 8919a88461
commit 409916bbe9
2 changed files with 1 additions and 60 deletions
@@ -3,20 +3,15 @@ import type { User } from '#/api/core/user';
import { computed, onMounted, ref, watch } from 'vue';
import { Network } from '@vben/icons';
import { ElAvatar, ElPopover, ElTooltip } from 'element-plus';
import { ElAvatar, ElPopover } from 'element-plus';
import { getUserDetailApi } from '#/api/core/user';
import DeptTag from '#/components/dept-tag/index.vue';
import PostTag from '#/components/post-tag/index.vue';
import RoleTag from '#/components/role-tag/index.vue';
import { getFileUrl } from '#/composables/useFileUrl';
import { $t } from '#/locales';
import { generateAvatarGradient, generateAvatarText } from '#/utils/avatar';
import UserProfileDialog from './UserProfileDialog.vue';
defineOptions({
name: 'UserAvatar',
});
@@ -98,14 +93,6 @@ const userDetail = ref<User>();
const loading = ref(false);
const hasLoaded = ref(false);
// 用户详情 Dialog
const profileDialogVisible = ref(false);
function openProfileDialog() {
popoverVisible.value = false;
profileDialogVisible.value = true;
}
// 获取有效的 ID
const effectiveUserId = computed(() => {
return props.userId || props.user?.id;
@@ -333,18 +320,6 @@ watch(
<div class="user-name">{{ userDetail.name }}</div>
<div class="user-username">@{{ userDetail.username }}</div>
</div>
<!-- 操作按钮 -->
<div class="user-actions">
<ElTooltip
:content="$t('user-avatar.profile.organization')"
placement="top"
>
<button class="action-btn" @click="openProfileDialog">
<Network :size="15" />
</button>
</ElTooltip>
</div>
</div>
<!-- 详细信息 -->
@@ -417,13 +392,6 @@ watch(
</div>
</ElPopover>
<!-- 用户详情 Dialog -->
<UserProfileDialog
v-if="effectiveUserId"
v-model="profileDialogVisible"
:user-id="effectiveUserId"
/>
<!-- Popover -->
<div
v-if="!(showPopover && effectiveUserId)"
@@ -738,32 +706,6 @@ watch(
}
}
.user-actions {
display: flex;
gap: 6px;
padding: 8px 0;
.action-btn {
display: flex;
align-items: center;
justify-content: center;
width: 30px;
height: 30px;
padding: 0;
color: var(--el-text-color-secondary);
// background: var(--el-fill-color-light);
border: none;
border-radius: 6px;
cursor: pointer;
transition: all 0.2s;
&:hover {
color: var(--el-color-primary);
background: var(--el-color-primary-light-9);
}
}
}
.user-details {
padding-top: 12px;