更新角色管理相关内容

This commit is contained in:
2026-09-09 15:04:34 +08:00
parent de7225b61e
commit fef0233cc4
24 changed files with 1442 additions and 116 deletions
+56 -1
View File
@@ -3,7 +3,14 @@
<div class="home-top">
<div class="toolbar">
<div class="toolbar-left">
<span class="system-name">系统管理平台</span>
<span class="system-name">云泽管理平台</span>
<template v-if="tenantName">
<span class="tenant-divider"></span>
<span class="tenant-name" :title="tenantName">
<el-icon class="tenant-icon"><OfficeBuilding /></el-icon>
{{ tenantName }}
</span>
</template>
</div>
<div class="toolbar-right">
<el-tooltip content="刷新菜单" placement="bottom">
@@ -144,6 +151,7 @@ import {
RefreshRight,
Sunny,
Moon,
OfficeBuilding,
} from "@element-plus/icons-vue";
import { getTenantList } from "@/api/modules";
@@ -221,6 +229,9 @@ const userName = computed(
);
const userAvatar = computed(() => authStore.user?.avatar || "");
// 当前租户(企业)名称,来自后端 /backend/getCurrentUser 或登录接口返回的 tenant_name
const tenantName = computed(() => authStore.user?.tenant_name || "");
// 处理导航跳转
function handleNavigate(module: ModuleItem) {
const isWebsiteManagement = module.name === "网站管理" || module.path.startsWith("/apps/cms");
@@ -301,6 +312,10 @@ async function loadModules() {
onMounted(() => {
loadModules();
initTheme();
// 兜底:若登录时未带租户名称(老会话/缓存),主动拉取一次以显示企业名称
if (!tenantName.value) {
authStore.fetchCurrentUser();
}
});
</script>
@@ -339,6 +354,32 @@ onMounted(() => {
font-weight: 600;
color: @text-main;
}
.tenant-divider {
width: 1px;
height: 16px;
background: @text-regular;
opacity: 0.25;
margin: 0 4px;
}
.tenant-name {
display: inline-flex;
align-items: center;
gap: 4px;
font-size: 15px;
font-weight: 500;
color: @text-regular;
max-width: 220px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
.tenant-icon {
font-size: 16px;
color: #3973ff;
}
}
}
.toolbar-right {
@@ -738,6 +779,12 @@ onMounted(() => {
}
}
}
.toolbar-left {
.tenant-name {
display: none;
}
}
}
}
@@ -791,6 +838,14 @@ onMounted(() => {
color: #e0e0e0;
}
.toolbar-left .tenant-name {
color: #b0b0b0;
.tenant-icon {
color: #5a8dff;
}
}
.toolbar-right {
.toolbar-btn {
background: #2d2d2d;