style(navigation): 调整侧边栏当前账号卡片为两行布局(第一行两列、第二行三列)

This commit is contained in:
xuans committed 2026-10-17 20:41:18 +08:00
1 parent 7f331951d2
commit 1f0d63992a
5 files changed
+25 -14

No files matched your search

@@ -462,6 +462,7 @@ const { activeSection, activeLabel, sections, selectSection } = useDashboardNavi
:active-section="activeSection"
:sections="sections"
:current-user="currentUser"
:version="status?.version"
@select="selectSection"
@settings="openSettings"
/>
@@ -146,10 +146,17 @@
line-height: 1.4;
}
.navigation-version-label {
color: #94a3b8;
font-size: 11px;
font-weight: 500;
line-height: 1.4;
white-space: nowrap;
}
.navigation-account-row {
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
width: 100%;
min-width: 0;
@@ -13,6 +13,7 @@ defineProps({
activeSection: { type: String, required: true },
sections: { type: Array, required: true },
currentUser: { type: Object, default: null },
version: { type: String, default: "" },
});
defineEmits(["select", "settings"]);
@@ -83,7 +84,15 @@ defineEmits(["select", "settings"]);
<div class="navigation-session">
<div v-if="currentUser" class="navigation-account-card" aria-label="当前登录账号">
<div class="navigation-account-header">
<div class="navigation-account-label">当前账号</div>
<span class="navigation-account-label">当前账号</span>
<span class="navigation-version-label">版本 {{ version || "0.1.0" }}</span>
</div>
<div class="navigation-account-row">
<strong class="navigation-account-name" :title="currentUser.account">{{ currentUser.account || "未命名账号" }}</strong>
<span
class="navigation-role-badge"
:class="`role-${currentUser.role}`"
>{{ roleLabels[currentUser.role] || "未知权限" }}</span>
<button
class="navigation-logout-btn navigation-logout"
type="button"
@@ -100,13 +109,6 @@ defineEmits(["select", "settings"]);
<span class="navigation-logout-sr">{{ loggingOut ? "退出中…" : "退出登录" }}</span>
</button>
</div>
<div class="navigation-account-row">
<strong class="navigation-account-name" :title="currentUser.account">{{ currentUser.account || "未命名账号" }}</strong>
<span
class="navigation-role-badge"
:class="`role-${currentUser.role}`"
>{{ roleLabels[currentUser.role] || "未知权限" }}</span>
</div>
</div>
<div v-else class="navigation-session-anon">
<button
@@ -60,6 +60,7 @@ test("系统设置导航仅对当前已确认的超级管理员显示", async ()
const html = await renderComponent("../Dashboard/DashboardNavigation.vue", {
activeSection: "overview", sections: [],
currentUser: role ? { account: "测试", role } : null,
version: "0.1.0",
roleLabels: workspaceRoleLabels,
loggingOut: false, error: "", logout() {},
});