From 4fe94592e672fb9ff3993021e8cf531a8c449940 Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 30 Mar 2026 16:30:51 +0800 Subject: [PATCH] fix: adjust z-index and height to prevent overlap, reduce tabs size --- src/global.less | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/src/global.less b/src/global.less index c7fc7f0..d80accf 100644 --- a/src/global.less +++ b/src/global.less @@ -57,7 +57,7 @@ body { top: 0 !important; right: 0 !important; left: 220px !important; /* 侧边栏宽度 */ - z-index: 1000 !important; + z-index: 1001 !important; /* 提高z-index确保在最上层 */ display: flex !important; justify-content: space-between; align-items: center; @@ -76,19 +76,21 @@ body { } // Tabs Header样式 - 固定在CustomHeader下方 +.ant-pro-page-container > .ant-pro-page-container-header, .ant-pro-page-container-header { position: fixed !important; - top: 64px !important; /* CustomHeader的高度 */ + top: 64px !important; /* CustomHeader的高度,确保在其下方 */ right: 0 !important; left: 220px !important; /* 侧边栏宽度 */ - z-index: 999 !important; /* 低于CustomHeader */ + z-index: 1000 !important; /* 低于CustomHeader但高于内容 */ margin: 0 !important; padding: 8px 24px !important; background: #ffffff !important; border-bottom: 1px solid #f0f0f0 !important; box-shadow: 0 1px 4px rgba(0,0,0,0.05) !important; height: auto !important; - min-height: 48px !important; + min-height: 40px !important; /* 减小最小高度 */ + max-height: 60px !important; /* 添加最大高度限制 */ } // 当侧边栏折叠时,调整tabs header的left值 @@ -102,37 +104,44 @@ body { top: 64px !important; right: 0 !important; left: 220px !important; - z-index: 999 !important; + z-index: 1000 !important; margin: 0 !important; padding: 8px 24px !important; + min-height: 40px !important; + max-height: 60px !important; } -// Tabs样式优化 +// Tabs样式优化 - 让内容自动撑开 .ant-pro-page-container-header .tabs-header-only { margin: 0 !important; line-height: 1 !important; + height: auto !important; } .ant-pro-page-container-header .ant-tabs { margin: 0 !important; + height: auto !important; } .ant-pro-page-container-header .ant-tabs-nav { margin-bottom: 0 !important; + height: auto !important; } .ant-pro-page-container-header .ant-tabs-nav-list { margin-bottom: 0 !important; + height: auto !important; } .ant-pro-page-container-header .ant-tabs-tab { - padding: 6px 12px !important; + padding: 5px 12px !important; /* 减小padding */ background: #f5f5f5; border-radius: 4px 4px 0 0; margin-right: 4px; transition: all 0.2s; - height: 32px !important; - line-height: 32px !important; + height: 30px !important; /* 减小标签高度 */ + line-height: 30px !important; + font-size: 13px; /* 稍微减小字体 */ } .ant-pro-page-container-header .ant-tabs-tab-active {