批量修复,增加组织架构

This commit is contained in:
2025-11-04 17:35:01 +08:00
parent 86c4060843
commit a7bde8bb72
29 changed files with 5200 additions and 88 deletions
+36
View File
@@ -38,6 +38,7 @@
<el-dropdown trigger="click" @command="handleCommand">
<span class="el-dropdown-link" style="cursor: pointer;">
<img :src="getImageUrl('user')" class="user" />
<span class="user-name">{{ displayName }}</span>
</span>
<template #dropdown>
<el-dropdown-menu>
@@ -207,6 +208,25 @@ const getImageUrl = (user) => {
return new URL(`/src/assets/images/default_avatar.png`, import.meta.url).href;
};
// 计算显示名称:优先显示昵称(用户)或姓名(员工),否则显示用户名
const displayName = computed(() => {
const user = authStore.user;
if (!user) return '';
// 如果是员工登录,优先显示name
if (user.type === 'employee' && user.name) {
return user.name;
}
// 如果是用户登录,优先显示nickname
if (user.nickname) {
return user.nickname;
}
// 最后显示username
return user.username || '';
});
const handleCollapse = () => {
store.state.isCollapse = !store.state.isCollapse;
};
@@ -390,6 +410,22 @@ onUnmounted(() => {
display: flex;
align-items: center;
cursor: pointer;
gap: 12px;
.user-name {
font-size: 14px;
color: var(--el-text-color-primary);
font-weight: 500;
white-space: nowrap;
max-width: 120px;
overflow: hidden;
text-overflow: ellipsis;
// 亮色主题下使用白色
html:not(.dark) & {
color: #ffffff;
}
}
}
}