From 2fe535e553cdedea069e362050bb788773dd5037 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Tue, 23 Dec 2025 14:50:41 +0800 Subject: [PATCH] =?UTF-8?q?style(layout):=20=E5=AE=8C=E5=96=84=20Z-INDEX?= =?UTF-8?q?=20=E5=B1=82=E7=BA=A7=E7=AE=A1=E7=90=86=EF=BC=8C=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E5=85=A8=E5=B1=80=E4=BE=A7=E8=BE=B9=E6=A0=8F=E6=A0=B7?= =?UTF-8?q?=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit layoutConfig.js: - 重构 Z_INDEX 常量,分层管理(页面内部 → 系统级) - 添加详细注释说明各层级用途 - 新增 SIDEBAR、DROPDOWN、POPOVER 等层级定义 GlobalSidebar: - 使用统一的 Z_INDEX.SIDEBAR 常量 - 优化背景色和边框样式 - 添加 h="100%" 确保高度填满 MainLayout: - 简化注释 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/components/GlobalSidebar/index.js | 12 ++++-- src/layouts/MainLayout.js | 16 ++++---- src/layouts/config/layoutConfig.js | 59 ++++++++++++++++++++++++--- 3 files changed, 71 insertions(+), 16 deletions(-) diff --git a/src/components/GlobalSidebar/index.js b/src/components/GlobalSidebar/index.js index f0d09610..9cc53229 100644 --- a/src/components/GlobalSidebar/index.js +++ b/src/components/GlobalSidebar/index.js @@ -29,6 +29,7 @@ import { useNavigate } from 'react-router-dom'; import { useGlobalSidebar } from '@/contexts/GlobalSidebarContext'; import { useAuth } from '@/contexts/AuthContext'; import { getEventDetailUrl } from '@/utils/idEncoder'; +import { Z_INDEX } from '@/layouts/config/layoutConfig'; import WatchSidebar from '@views/Profile/components/WatchSidebar'; import { WatchlistPanel, FollowingEventsPanel } from '@views/Profile/components/WatchSidebar/components'; import HotSectorsRanking from '@views/Profile/components/MarketDashboard/components/atoms/HotSectorsRanking'; @@ -267,12 +268,14 @@ const GlobalSidebar = () => { return ( {/* 加载状态 */} {loading && ( @@ -287,8 +290,9 @@ const GlobalSidebar = () => { {/* 标题栏 - 收起按钮 + 标题 */} - {/* 主体区域 - 左侧页面内容 + 右侧全局侧边栏 */} - - {/* 页面内容区域 - flex: 1 占据剩余空间,包含错误边界、懒加载 */} - + {/* 主体区域 - 页面内容 + 右侧全局侧边栏(绝对定位覆盖) */} + + {/* 页面内容区域 - 全宽度,与导航栏对齐 */} + }> @@ -51,9 +51,11 @@ export default function MainLayout() { - {/* 全局右侧工具栏 - 可收起/展开 */} - - + {/* 全局右侧工具栏 - 绝对定位覆盖在内容上方 */} + + + + {/* 返回顶部按钮 - 滚动超过阈值时显示 */} {/*