重构客户端左侧导航

This commit is contained in:
baiyanyun
2026-06-30 15:49:58 +08:00
parent 5d87c9eee7
commit a574b2c661
5 changed files with 717 additions and 445 deletions

View File

@@ -0,0 +1,321 @@
.sidebar {
width: 240px;
min-width: 240px;
height: 100%;
display: flex;
flex-direction: column;
background: #f1f2ef;
border-right: 1px solid #deded9;
color: #1f211f;
}
.brand {
height: 122px;
display: grid;
grid-template-columns: 38px 1fr 34px;
align-items: center;
gap: 10px;
padding: 26px 12px 18px 20px;
}
.brandLogo {
width: 36px;
height: 36px;
border-radius: 8px;
object-fit: cover;
box-shadow: 0 8px 18px rgba(217, 116, 74, 0.18);
}
.brandText {
min-width: 0;
}
.brandName {
font-size: 15px;
line-height: 22px;
font-weight: 700;
color: #20211f;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.brandSubTitle {
margin-top: 1px;
font-size: 9px;
line-height: 12px;
font-weight: 600;
color: #a09d98;
letter-spacing: 0;
white-space: nowrap;
}
.historyTrigger {
width: 30px;
height: 30px;
border: 0;
border-radius: 8px;
display: inline-flex;
align-items: center;
justify-content: center;
background: #e4e4df;
color: #656661;
cursor: pointer;
transition:
background-color 0.16s ease,
color 0.16s ease;
}
.historyTrigger:hover {
background: #dadad4;
color: #252622;
}
.nav {
flex: 1;
min-height: 0;
overflow-y: auto;
padding: 0 11px 16px;
}
.navSection {
padding-bottom: 12px;
margin-bottom: 12px;
border-bottom: 1px solid #deded8;
}
.navSection:last-child {
border-bottom: 0;
margin-bottom: 0;
}
.sectionTitle {
height: 20px;
display: flex;
align-items: center;
padding: 0 2px;
font-size: 11px;
line-height: 16px;
color: #8e8b84;
}
.navItem {
position: relative;
width: 100%;
height: 34px;
border: 0;
border-radius: 6px;
display: flex;
align-items: center;
gap: 12px;
padding: 0 10px;
background: transparent;
color: #5e5d58;
font: inherit;
text-align: left;
cursor: pointer;
transition:
background-color 0.16s ease,
color 0.16s ease;
}
.navItem:hover {
background: #e8e8e2;
color: #2d2d29;
}
.navItemActive {
background: #eaded7;
color: #d66c47;
font-weight: 600;
}
.navItemActive::after {
content: "";
position: absolute;
top: 8px;
right: 10px;
width: 3px;
height: 18px;
border-radius: 2px;
background: #df7653;
}
.navIcon {
width: 18px;
min-width: 18px;
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 15px;
}
.navLabel {
flex: 1;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 13px;
}
.navBadge {
max-width: 46px;
height: 18px;
display: inline-flex;
align-items: center;
justify-content: center;
padding: 0 7px;
border-radius: 9px;
background: #e6f0ff;
color: #4d8dea;
font-size: 11px;
font-weight: 600;
white-space: nowrap;
}
.navBadgeSuccess {
max-width: 52px;
background: #dff5e7;
color: #16b268;
}
.footer {
padding: 12px 11px 14px;
border-top: 1px solid #deded8;
}
.userCard {
height: 52px;
display: flex;
align-items: center;
gap: 10px;
padding: 8px 10px;
border: 1px solid #deded8;
border-radius: 8px;
background: #f6f7f4;
}
.avatar {
width: 32px;
height: 32px;
border-radius: 50%;
display: inline-flex;
align-items: center;
justify-content: center;
background: linear-gradient(135deg, #ec9a67, #df7653);
color: #ffffff;
font-size: 13px;
font-weight: 700;
}
.userMeta {
flex: 1;
min-width: 0;
}
.userName {
color: #252622;
font-size: 13px;
line-height: 18px;
font-weight: 700;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.userEmail {
color: #8e8b84;
font-size: 11px;
line-height: 16px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.onlineDot {
width: 6px;
height: 6px;
border-radius: 50%;
background: #b8b8b0;
}
.onlineDotActive {
background: #21bf63;
}
.logoutButton {
width: 100%;
height: 34px;
border: 0;
border-radius: 7px;
display: flex;
align-items: center;
gap: 8px;
margin-top: 9px;
padding: 0 12px;
background: #f1e3df;
color: #e64f45;
font: inherit;
font-size: 13px;
font-weight: 600;
cursor: pointer;
transition:
background-color 0.16s ease,
color 0.16s ease;
}
.logoutButton:hover {
background: #ead4cf;
color: #c8342e;
}
.historyPopover :global(.ant-popover-inner) {
padding: 8px;
border-radius: 10px;
box-shadow: 0 12px 28px rgba(22, 24, 26, 0.12);
}
.historyPopover :global(.ant-popover-arrow) {
display: none;
}
.historyMenu {
width: 176px;
}
.historyTitle {
padding: 4px 8px 8px;
color: #8e8b84;
font-size: 12px;
font-weight: 600;
}
.historyItem {
width: 100%;
height: 32px;
border: 0;
border-radius: 7px;
display: flex;
align-items: center;
gap: 8px;
padding: 0 8px;
background: transparent;
color: #4e4e49;
font: inherit;
font-size: 13px;
text-align: left;
cursor: pointer;
}
.historyItem:hover {
background: #f4f4f1;
color: #d66c47;
}
.historyIcon {
width: 16px;
display: inline-flex;
align-items: center;
justify-content: center;
}