From 0690b0b8040ca6d08ea96d13428824a29e7d45ee Mon Sep 17 00:00:00 2001 From: JIANG Date: Tue, 3 Feb 2026 11:11:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=A0=87=E7=AD=BE=E7=B4=A2?= =?UTF-8?q?=E5=BC=95=E6=8A=A5=E9=94=99=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BurstPipeAnalysis/BurstPipeAnalysisPanel.tsx | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/components/olmap/BurstPipeAnalysis/BurstPipeAnalysisPanel.tsx b/src/components/olmap/BurstPipeAnalysis/BurstPipeAnalysisPanel.tsx index 4288cb3..929fa3d 100644 --- a/src/components/olmap/BurstPipeAnalysis/BurstPipeAnalysisPanel.tsx +++ b/src/components/olmap/BurstPipeAnalysis/BurstPipeAnalysisPanel.tsx @@ -99,6 +99,16 @@ const BurstPipeAnalysisPanel: React.FC = ({ setCurrentTab(newValue); }; + const handleModeChange = (_event: React.SyntheticEvent, newMode: PanelMode) => { + setPanelMode(newMode); + // 切换模式时,如果当前标签索引超出新模式的标签数量,重置为第一个标签 + // 爆管分析有4个标签(0-3),水质模拟有3个标签(0-2) + const maxTabIndex = newMode === "burst" ? 3 : 2; + if (currentTab > maxTabIndex) { + setCurrentTab(0); + } + }; + const handleLocateScheme = async (scheme: SchemeRecord) => { try { const response = await axios.get( @@ -204,7 +214,7 @@ const BurstPipeAnalysisPanel: React.FC = ({ setPanelMode(value)} + onChange={handleModeChange} variant="fullWidth" sx={{ minHeight: 46,