diff --git a/src/components/StockChart/KLineChartModal.tsx b/src/components/StockChart/KLineChartModal.tsx index dd684f72..e1c90b57 100644 --- a/src/components/StockChart/KLineChartModal.tsx +++ b/src/components/StockChart/KLineChartModal.tsx @@ -42,8 +42,6 @@ export interface KLineChartModalProps { eventTime?: string | null; /** 模态框大小 */ size?: string; - /** z-index 层级(用于嵌套 Modal 场景) */ - zIndex?: number; } /** @@ -64,7 +62,6 @@ const KLineChartModal: React.FC = ({ stock, eventTime, size = '5xl', - zIndex, }) => { const chartRef = useRef(null); const chartInstance = useRef(null); @@ -459,15 +456,7 @@ const KLineChartModal: React.FC = ({ if (!stock) return null; - // 计算实际使用的 z-index(使用超高值确保在最上层) - const overlayZIndex = zIndex || 9998; - const contentZIndex = zIndex ? zIndex + 1 : 9999; - - console.log('[KLineChartModal] z-index 设置:', { - overlayZIndex, - contentZIndex, - isOpen, - }); + console.log('[KLineChartModal] 渲染 Modal, isOpen:', isOpen); return ( = ({ blockScrollOnMount={false} isCentered > - + diff --git a/src/views/Community/components/InvestmentCalendar.js b/src/views/Community/components/InvestmentCalendar.js index d71ade3f..39672f65 100644 --- a/src/views/Community/components/InvestmentCalendar.js +++ b/src/views/Community/components/InvestmentCalendar.js @@ -296,6 +296,9 @@ const InvestmentCalendar = () => { formattedEventTime: formattedEventTime }); + // 先关闭相关股票模态框,避免 z-index 冲突 + setStockModalVisible(false); + setSelectedStock({ stock_code: stockCode, // 添加交易所后缀 stock_name: stock[1] @@ -840,7 +843,7 @@ const InvestmentCalendar = () => { )} - {/* K线图弹窗 - 使用超高 z-index 确保显示在最上层 */} + {/* K线图弹窗 */} {selectedStock && ( { stock={selectedStock} eventTime={selectedEventTime} size="5xl" - zIndex={9998} /> )}