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

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

View File

@ -3591,10 +3591,10 @@ P0-05 从 `[!]` 调整为 `[~]`,并未标记完成;P0-04 剩余门禁和全
## 2026年10月17日 侧边栏账号卡片两行布局改造(第一行两列:账号与版本号;第二行三列:角色与注销)
- [ ] 增加侧边栏当前账号卡片两行布局需求清单
- [ ] 修改 Dashboard.vue 与 DashboardNavigation.vue 传递 status/版本号信息
- [ ] 改造 DashboardNavigation.vue 布局结构:第一行两列展示当前账号、版本号;第二行三列展示账号名称、角色权限徽标、注销按钮
- [ ] 调整 DashboardNavigation.css 样式实现网格与对齐
- [ ] 运行前端自动化单元测试验证
- [x] 增加侧边栏当前账号卡片两行布局需求清单
- [x] 修改 Dashboard.vue 与 DashboardNavigation.vue 传递 status/版本号信息
- [x] 改造 DashboardNavigation.vue 布局结构:第一行两列展示当前账号、版本号;第二行三列展示账号名称、角色权限徽标、注销按钮
- [x] 调整 DashboardNavigation.css 样式实现网格与对齐
- [x] 运行前端自动化单元测试验证
- [ ] 编译并部署至第一台 Linux 服务器
- [ ] 通过浏览器 MCP 验证页面渲染效果

View File

@ -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"
/>

View File

@ -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;

View File

@ -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

View File

@ -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() {},
});