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 = ({