fix(header): 身份列表回滚为原灰卡片样式,只在卡片底部追加三项菜单
build / build (push) Successful in 1m16s

用户反馈整合后的身份选择观感不符预期,要求保留原「切换身份」样式,
仅在列表下方追加个人信息 / 后台管理 / 退出登录。

回滚内容(对齐原 .roleinfo-wrap .roles-ul li):
- 灰底 #f9f9f9 + 圆角 6px + 左右 8px 外边距 + 列表内 6px 上下留白
- 行高62px(原为 padding 9px 16px 的紧凑行)
- hover 用 color.adjust(#f9f9f9, lightness -5%),恢复 @use "sass:color"
- 勾选圆点回到 20px + margin 0 16px
- .who 恢复 border-bottom 1px #e9e9e9,末行不画(同原:last-child .user-wrap)

保留不变:卡片骨架、标题行、滚动条(max-height 310px + 6px 自绘)、
底部菜单与权限判定。实测 scrollHeight 570 > clientHeight 310 仍正确出滚动条。

验证:vite build 通过;mock 取证 9 条身份溢出滚动正常、1 条不滚动、
菜单行数管理员 2 / 普通用户 1。
This commit is contained in:
chenxing
2026-10-08 15:46:55 +08:00
parent e46df62c0b
commit 97090eb08b
+24 -23
View File
@@ -1,3 +1,4 @@
@use "sass:color";
.default-header {
width: 100%;
height: var(--headerH);
@@ -264,11 +265,12 @@
}
}
/* 身份列表:有最大高度,超出显示滚动条 */
/* 身份列表:沿用原.roleinfo-wrap 的灰卡片形态(2026-10-08 回滚,用户要求保持原角色选择样式) */
.user-card-roles {
max-height: 310px;
overflow-y: scroll;
overscroll-behavior: contain;
padding: 6px 0;
&::-webkit-scrollbar {
width: 6px;
@@ -286,32 +288,42 @@
}
.u-role {
background-color: #f9f9f9;
display: flex;
align-items: center;
padding: 9px 16px;
min-height: 62px;
margin: 0 8px;
border-radius: 6px;
cursor: pointer;
user-select: none;
transition: background 0.15s;
&:hover {
background-color: color.adjust($color: #f9f9f9, $lightness: -5%);
}
&.active {
cursor: default;
background-color: #f9f9f9;
}
> svg {
width: 16px;
height: 16px;
margin-right: 16px;
flex: 0 0 16px;
width: 20px;
height: 20px;
margin: 0 16px;
flex: 0 0 20px;
}
.who {
flex: 1;
flex: auto;
min-width: 0;
padding: 8px 0;
padding: 9px 16px 9px 0;
border-bottom: 1px solid #e9e9e9;
.nm {
display: flex;
align-items: center;
font-size: 15px;
color: #323233;
line-height: 20px;
display: flex;
align-items: center;
.t {
overflow: hidden;
@@ -324,27 +336,16 @@
margin-top: 2px;
font-size: 12px;
color: #656667;
line-height: 17px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
/* 末行不画分隔线(原 .roles-ul li:last-child .user-wrap 同款) */
&:last-child .who {
border-bottom: none;
}
&:hover {
background: #f9f9f9;
}
&.active {
cursor: default;
background: #f9f9f9;
.nm {
font-weight: 500;
}
}
}
.user-card-menu {