From c5b0f43a0dfbdbc1b1f0ad94851a3ae0b6a04ac5 Mon Sep 17 00:00:00 2001 From: Huarch Date: Thu, 30 Apr 2026 13:47:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=BA=E5=88=B6=E8=A6=81=E6=B1=82=20onClose?= =?UTF-8?q?=20=E5=B1=9E=E6=80=A7=EF=BC=8C=E7=AE=80=E5=8C=96=E9=9D=A2?= =?UTF-8?q?=E6=9D=BF=E5=85=B3=E9=97=AD=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/olmap/core/Controls/HistoryDataPanel.tsx | 5 ++--- src/components/olmap/core/Controls/PropertyPanel.tsx | 5 ++--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/olmap/core/Controls/HistoryDataPanel.tsx b/src/components/olmap/core/Controls/HistoryDataPanel.tsx index bec278a..4455589 100644 --- a/src/components/olmap/core/Controls/HistoryDataPanel.tsx +++ b/src/components/olmap/core/Controls/HistoryDataPanel.tsx @@ -65,7 +65,7 @@ export interface SCADADataPanelProps { /** 外部传入结束时间(ISO8601 字符串),用于初始化并触发查询 */ end_time?: string; /** 关闭面板 */ - onClose?: () => void; + onClose: () => void; } type PanelTab = "chart" | "table"; @@ -432,7 +432,6 @@ const SCADADataPanel: React.FC = ({ end_time, onClose, }) => { - const handleClose = onClose ?? (() => {}); // 从 featureInfos 中提取设备 ID 列表 const deviceIds = useMemo( () => featureInfos.map(([id]) => id), @@ -936,7 +935,7 @@ const SCADADataPanel: React.FC = ({ diff --git a/src/components/olmap/core/Controls/PropertyPanel.tsx b/src/components/olmap/core/Controls/PropertyPanel.tsx index 67cff8e..ea49f1b 100644 --- a/src/components/olmap/core/Controls/PropertyPanel.tsx +++ b/src/components/olmap/core/Controls/PropertyPanel.tsx @@ -26,7 +26,7 @@ interface PropertyPanelProps { id?: string; type?: string; properties?: PropertyItem[]; - onClose?: () => void; + onClose: () => void; } const PropertyPanel: React.FC = ({ @@ -36,7 +36,6 @@ const PropertyPanel: React.FC = ({ onClose, }) => { const draggableRef = useRef(null); - const handleClose = onClose ?? (() => {}); const headerActionSx = { color: "common.white", backgroundColor: "rgba(255,255,255,0.08)", @@ -98,7 +97,7 @@ const PropertyPanel: React.FC = ({