From 3250de382a113c089d6d21153f129fce06c9c65e Mon Sep 17 00:00:00 2001 From: chenxing Date: Thu, 8 Oct 2026 16:09:34 +0800 Subject: [PATCH] =?UTF-8?q?fix(header):=20=E5=8E=BB=E6=8E=89=E8=BA=AB?= =?UTF-8?q?=E4=BB=BD=E5=88=97=E8=A1=A8=E4=B8=8A=E6=93=85=E8=87=AA=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=9A=84=20padding/margin/=E5=9C=86=E8=A7=92=EF=BC=8C?= =?UTF-8?q?=E5=AE=8C=E5=85=A8=E5=AF=B9=E9=BD=90=E5=8E=9F=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 上一轮回滚时虽已恢复灰卡片形态,但额外加了列表 padding 6px、行的 margin 0 8px 与 border-radius 6px,导致与原「切换身份」观感仍有出入。本次全部移除。 移除(非原样式): - .user-card-roles 的 padding: 6px 0 - .u-role 的 margin: 0 8px 与 border-radius: 6px - .who 的 min-width/ellipsis 系列 恢复(原样式组成部分): - .user-card 顶层 svg{20px},等价原 .roleinfo-wrap 首段声明(原圆点尺寸就靠它, 上一版只写了 margin 导致圆点尺寸失去约束) - .u-role 用 height: 62px 替代 min-height - .who 回到 .user-wrap 的 padding: 9px 0 + flex: auto - .nm 内 .t 间距回到 mr-10 实测 9 条身份 scrollHeight=558(9 × 62px,整数倍⇒ 确认已无任何额外间距), 仍正确出滚动条;1 条时 62=62 不滚动。菜单行数管理员 2 / 普通用户 1 不变。 --- src/assets/styles/header.scss | 35 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 23 deletions(-) diff --git a/src/assets/styles/header.scss b/src/assets/styles/header.scss index b93310f..d432742 100644 --- a/src/assets/styles/header.scss +++ b/src/assets/styles/header.scss @@ -227,6 +227,12 @@ width: 260px; background: #fff; + /* 原 .roleinfo-wrap 顶层同款:圆点与标题图标统一 20px */ + svg { + width: 20px; + height: 20px; + } + .user-card-hd { height: 50px; padding: 0 16px; @@ -235,8 +241,6 @@ border-bottom: 1px solid #e8eaec; svg { - width: 20px; - height: 20px; margin-right: 8px; } .ttl { @@ -265,12 +269,11 @@ } } - /* 身份列表:沿用原.roleinfo-wrap 的灰卡片形态(2026-10-08 回滚,用户要求保持原角色选择样式) */ + /* 身份列表:完全沿用原 .roleinfo-wrap 的灰卡片形态,不加任何额外 padding/margin/圆角 */ .user-card-roles { max-height: 310px; overflow-y: scroll; overscroll-behavior: contain; - padding: 6px 0; &::-webkit-scrollbar { width: 6px; @@ -291,9 +294,7 @@ background-color: #f9f9f9; display: flex; align-items: center; - min-height: 62px; - margin: 0 8px; - border-radius: 6px; + height: 62px; cursor: pointer; user-select: none; @@ -305,44 +306,32 @@ background-color: #f9f9f9; } - > svg { - width: 20px; - height: 20px; + svg { margin: 0 16px; - flex: 0 0 20px; } .who { - flex: auto; - min-width: 0; - padding: 9px 16px 9px 0; + padding: 9px 0; border-bottom: 1px solid #e9e9e9; + flex: auto; .nm { font-size: 15px; color: #323233; - line-height: 20px; display: flex; align-items: center; .t { - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; - margin-right: 8px; + margin-right: 10px; } } .sch { margin-top: 2px; font-size: 12px; color: #656667; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; } } - /* 末行不画分隔线(原 .roles-ul li:last-child .user-wrap 同款) */ &:last-child .who { border-bottom: none; }