diff --git a/.gitignore b/.gitignore index 7dbd273..4275bcc 100644 --- a/.gitignore +++ b/.gitignore @@ -12,6 +12,13 @@ dist dist-ssr *.local +# 视觉取证 harness(本地临时用,不进 git;与 harness-* 同类) +.vite-card-harness +dist_card_harness +card-harness.html +card-harness.vite.config.ts +src/card-harness-main.ts + yarn.lock .npmrc # Editor directories and files diff --git a/src/assets/styles/header.scss b/src/assets/styles/header.scss index 9fa2b63..45d16ac 100644 --- a/src/assets/styles/header.scss +++ b/src/assets/styles/header.scss @@ -1,4 +1,3 @@ -@use "sass:color"; .default-header { width: 100%; height: var(--headerH); @@ -220,59 +219,165 @@ } } -.roleinfo-wrap { - svg { - width: 20px; - height: 20px; - } - h3.title { - height: 50px; - padding: 12px 16px; - color: #272829; - font-weight: 600; - font-size: 16px; - border-bottom: 1px solid #e8eaec; - display: flex; - align-items: center; - } - .roles-ul { - max-height: 310px; - } - .roles-ul li { - background-color: #f9f9f9; - display: flex; - align-items: center; - height: 62px; - cursor: pointer; - user-select: none; +/* ===== 用户卡片(人像图标唯一入口,2026-10-08)===== + 规格来源:design/05-Header用户卡片整合-切换身份+个人信息+后台管理+退出登录.html + 全部复用既有变量,仅新增卡片骨架与滚动条 */ +.user-card { + width: 260px; + background: #fff; - &:hover { - // background-color: darken(#f9f9f9, 5%); - background-color: color.adjust($color: #f9f9f9, $lightness: -5%); - } + .user-card-hd { + height: 50px; + padding: 0 16px; + display: flex; + align-items: center; + border-bottom: 1px solid #e8eaec; svg { - margin: 0 16px; + width: 20px; + height: 20px; + margin-right: 8px; + } + .ttl { + font-size: 16px; + font-weight: 600; + color: #272829; + } + .close { + margin-left: auto; + width: 22px; + height: 22px; + display: flex; + align-items: center; + justify-content: center; + border-radius: 4px; + color: #9aa0a8; + font-size: 14px; + line-height: 1; + cursor: pointer; + transition: all 0.2s; + + &:hover { + background: #f2f3f5; + color: #5a5f68; + } + } + } + + /* 身份列表:有最大高度,超出显示滚动条 */ + .user-card-roles { + max-height: 310px; + overflow-y: scroll; + overscroll-behavior: contain; + + &::-webkit-scrollbar { + width: 6px; + } + &::-webkit-scrollbar-track { + background: transparent; + } + &::-webkit-scrollbar-thumb { + background: #d4d7dd; + border-radius: 3px; + } + &::-webkit-scrollbar-thumb:hover { + background: #b9bec7; + } + } + + .u-role { + display: flex; + align-items: center; + padding: 9px 16px; + cursor: pointer; + user-select: none; + transition: background 0.15s; + + > svg { + width: 16px; + height: 16px; + margin-right: 16px; + flex: 0 0 16px; } - .user-wrap { - padding: 9px 0; - + .who { + flex: 1; + min-width: 0; + padding: 8px 0; border-bottom: 1px solid #e9e9e9; - flex: auto; - .schname-box { + + .nm { + display: flex; + align-items: center; + font-size: 15px; + color: #323233; + line-height: 20px; + + .t { + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + margin-right: 8px; + } + } + .sch { margin-top: 2px; font-size: 12px; color: #656667; + line-height: 17px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } } - &:last-child .user-wrap { + + &:last-child .who { border-bottom: none; } + &:hover { + background: #f9f9f9; + } + &.active { + cursor: default; + background: #f9f9f9; + + .nm { + font-weight: 500; + } + } } - .roles-ul li.acitve { - cursor: default; - background-color: #f9f9f9; + + .user-card-menu { + border-top: 1px solid #e9e9e9; + + .arw { + width: 16px; + height: 16px; + margin-left: auto; + } + } + + .user-card-logout { + padding: 10px 20px 16px; + + .logout-btn { + width: 100%; + height: 38px; + border-radius: 19px; + background: #fff; + border: 1px solid #e2e5ea; + color: #323233; + font-size: 14px; + font-family: inherit; + cursor: pointer; + transition: all 0.18s; + + &:hover { + border-color: #577afb; + background: #f7f9ff; + color: #577afb; + } + } } } diff --git a/src/components/Header.vue b/src/components/Header.vue index 69f211e..46156db 100644 --- a/src/components/Header.vue +++ b/src/components/Header.vue @@ -20,110 +20,64 @@ - +