fix(web-admin): 对齐门户顶栏 brand 与侧栏右边框,并修复侧栏竖线被遮挡

将侧栏右边框改画在 #app-sidebar 上,内部菜单改为宽度 100%,避免等宽子项盖住边框;顶栏 brand 宽度与侧栏展开宽度对齐。

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
zlwuandCursor committed 2026-07-25 18:15:53 +08:00
1 parent 9b8131fa40
commit c756fbddfc
5 files changed
+32 -15

No files matched your search

+6 -1
View File
@@ -1515,9 +1515,14 @@ body {
background: var(--mint-surface); background: var(--mint-surface);
} }
.app-layout-portal #app-sidebar {
border-right: 1px solid var(--mint-border, #d9e8e2) !important;
}
.app-layout-portal #app-sidebar .layout-sidebar { .app-layout-portal #app-sidebar .layout-sidebar {
height: 100%; height: 100%;
border-right: 1px solid var(--mint-border) !important; /* 避免与 #app-sidebar 双边框;竖线由 aside 绘制,不会被 .menu-left 盖住 */
border-right: none !important;
background: var(--mint-surface); background: var(--mint-surface);
} }
@@ -196,7 +196,8 @@
maxWidth: width, maxWidth: width,
flexShrink: '0', flexShrink: '0',
boxSizing: 'border-box', boxSizing: 'border-box',
borderRight: '1px solid var(--mint-border, #d9e8e2)' // 门户:竖线由 #app-sidebar 绘制,避免被内部等宽 .menu-left 盖住
borderRight: isPortalMenu.value ? 'none' : '1px solid var(--mint-border, #d9e8e2)'
} as Record<string, string> } as Record<string, string>
}) })
@@ -469,18 +470,18 @@
@use './theme'; @use './theme';
.layout-sidebar { .layout-sidebar {
// 侧栏容器宽度固定,内部菜单在容器内完整展示 // 侧栏容器宽度固定,内部菜单在容器内完整展示(用 100% 避免等宽子项盖住容器右边框)
.menu-left-open { .menu-left-open {
width: v-bind(menuopenwidth); width: 100%;
min-width: v-bind(menuopenwidth); min-width: 0;
max-width: v-bind(menuopenwidth); max-width: 100%;
flex-shrink: 0; flex-shrink: 0;
} }
.menu-left-close { .menu-left-close {
width: v-bind(menuclosewidth); width: 100%;
min-width: v-bind(menuclosewidth); min-width: 0;
max-width: v-bind(menuclosewidth); max-width: 100%;
flex-shrink: 0; flex-shrink: 0;
} }
@@ -494,7 +495,7 @@
// 折叠后宽度 // 折叠后宽度
.el-menu--collapse { .el-menu--collapse {
width: v-bind(menuclosewidth); width: 100%;
} }
} }
</style> </style>
@@ -90,7 +90,8 @@
justify-content: space-between; justify-content: space-between;
width: 100%; width: 100%;
height: 56px; height: 56px;
padding: 0 var(--mint-content-padding, 24px); /* 左侧无 padding:brand 区与侧栏同宽,右边框才能纵向对齐 */
padding: 0 var(--mint-content-padding, 24px) 0 0;
user-select: none; user-select: none;
background: var(--mint-primary, #1ca851); background: var(--mint-primary, #1ca851);
border-bottom: 1px solid rgba(255, 255, 255, 0.12); border-bottom: 1px solid rgba(255, 255, 255, 0.12);
@@ -106,12 +107,18 @@
} }
.portal-header-brand { .portal-header-brand {
box-sizing: border-box;
display: flex; display: flex;
flex-shrink: 0; flex-shrink: 0;
gap: 12px; gap: 12px;
align-items: center; align-items: center;
margin-right: 4px; /* +1px:与侧栏 #app-sidebar 外边框(内容宽 + 1px border)纵向对齐 */
width: calc(var(--app-sidebar-open-width, 270px) + 1px);
min-width: calc(var(--app-sidebar-open-width, 270px) + 1px);
max-width: calc(var(--app-sidebar-open-width, 270px) + 1px);
padding-left: var(--mint-content-padding, 24px);
padding-right: 16px; padding-right: 16px;
overflow: hidden;
cursor: pointer; cursor: pointer;
border-right: 1px solid rgba(255, 255, 255, 0.22); border-right: 1px solid rgba(255, 255, 255, 0.22);
} }
@@ -121,8 +128,11 @@
} }
.portal-header-title { .portal-header-title {
max-width: 290px; flex: 1;
min-width: 0;
margin: 0; margin: 0;
overflow: hidden;
text-overflow: ellipsis;
font-size: 16px; font-size: 16px;
font-weight: 700; font-weight: 700;
line-height: 1.35; line-height: 1.35;
+2 -2
View File
@@ -1,11 +1,11 @@
<!-- 布局容器 --> <!-- 布局容器 -->
<template> <template>
<div v-if="isPortalLayout" class="app-layout app-layout-portal"> <div v-if="isPortalLayout" class="app-layout app-layout-portal" :style="appLayoutStyle">
<div id="app-portal-header"> <div id="app-portal-header">
<ArtPortalHeader /> <ArtPortalHeader />
</div> </div>
<div id="app-portal-body" :style="appLayoutStyle"> <div id="app-portal-body">
<aside id="app-sidebar"> <aside id="app-sidebar">
<ArtSidebarMenu /> <ArtSidebarMenu />
</aside> </aside>
@@ -23,6 +23,7 @@
#app-sidebar { #app-sidebar {
flex-shrink: 0; flex-shrink: 0;
height: 100%; height: 100%;
/* 边框画在 aside 上:内部 .menu-left 与侧栏同宽时会盖住 .layout-sidebar 的 border */
border-right: 1px solid var(--mint-border, #d9e8e2); border-right: 1px solid var(--mint-border, #d9e8e2);
background: var(--mint-surface, #fff); background: var(--mint-surface, #fff);
box-sizing: border-box; box-sizing: border-box;