diff --git a/frontend/src/layouts/AdminLayout.vue b/frontend/src/layouts/AdminLayout.vue index fc39460..6b2c284 100644 --- a/frontend/src/layouts/AdminLayout.vue +++ b/frontend/src/layouts/AdminLayout.vue @@ -217,6 +217,11 @@ const defaultOpeneds = computed(() => { }) const adminName = computed(() => adminSession.nickname || adminSession.username || '管理员') +const adminRoleText = computed(() => { + if (adminSession.isSuperAdmin) return '超级管理员' + const names = adminSession.roles.map(role => role.name).filter(Boolean) + return names.join(' / ') || '管理员' +}) const supportStatus = computed(() => adminSession.supportStatus || 'offline') const hasChatPermission = computed(() => adminSession.hasPermission('chat:view')) @@ -330,62 +335,58 @@ async function handleForcedPasswordChange() { + +
-
-
- - 首页 - {{ route.meta.title }} - -
-
- - - - {{ statusLabels[supportStatus] }} - - - - - - - -
-
@@ -523,6 +524,89 @@ async function handleForcedPasswordChange() { overflow-x: hidden; } +.admin-sidebar-footer { + display: grid; + flex: none; + gap: 10px; + padding: 12px; + border-top: 1px solid #3d4e5f; + background: rgba(16, 24, 39, 0.18); +} + +.admin-shell--collapsed .admin-sidebar-footer { + padding: 10px 8px; +} + +.sidebar-status { + display: flex; + align-items: center; + justify-content: center; + gap: 7px; + width: 100%; + min-height: 30px; + padding: 0 10px; + border: 1px solid; + border-radius: 8px; + color: #d7dfec; + cursor: pointer; + transition: + background-color 0.2s, + border-color 0.2s; +} + +.sidebar-status:hover { + background-color: rgba(255, 255, 255, 0.08); +} + +.admin-shell--collapsed .sidebar-status { + padding: 0; +} + +.sidebar-user { + display: flex; + align-items: center; + gap: 10px; + min-width: 0; + width: 100%; + padding: 8px; + border-radius: 10px; + cursor: pointer; + transition: background-color 0.2s; +} + +.sidebar-user:hover { + background-color: rgba(255, 255, 255, 0.08); +} + +.admin-shell--collapsed .sidebar-user { + justify-content: center; + padding: 8px 0; +} + +.sidebar-user-text { + display: grid; + min-width: 0; + gap: 2px; +} + +.sidebar-user-text strong { + overflow: hidden; + color: #fff; + font-size: 13px; + line-height: 18px; + text-overflow: ellipsis; + white-space: nowrap; +} + +.sidebar-user-text small { + overflow: hidden; + color: #8fa0ba; + font-size: 12px; + line-height: 16px; + text-overflow: ellipsis; + white-space: nowrap; +} + .admin-menu:not(.el-menu--collapse) { width: 100%; } @@ -603,43 +687,6 @@ async function handleForcedPasswordChange() { overflow: hidden; } -.admin-topbar { - height: 56px; - flex: none; - display: flex; - align-items: center; - justify-content: space-between; - padding: 0 24px; - background-color: #fff; - box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08); -} - -.topbar-left { - display: flex; - align-items: center; -} - -.topbar-right { - display: flex; - align-items: center; - gap: 16px; -} - -.status-badge { - display: flex; - align-items: center; - gap: 6px; - padding: 6px 12px; - border: 1px solid; - border-radius: 16px; - cursor: pointer; - transition: all 0.2s; -} - -.status-badge:hover { - background-color: #f5f7fa; -} - .status-dot { width: 8px; height: 8px; @@ -649,7 +696,7 @@ async function handleForcedPasswordChange() { .status-text { font-size: 13px; - color: #606266; + color: inherit; font-weight: 500; } @@ -657,22 +704,10 @@ async function handleForcedPasswordChange() { margin-right: 8px; } -.user-info { - display: flex; - align-items: center; - gap: 8px; - cursor: pointer; - color: #606266; -} - -.username { - font-size: 14px; -} - .admin-main { flex: 1; min-height: 0; - padding: 24px; + padding: 18px 24px 24px; overflow-y: auto; }