diff --git a/src/components/olmap/core/Controls/HistoryDataPanel.tsx b/src/components/olmap/core/Controls/HistoryDataPanel.tsx index 04deb10..bec278a 100644 --- a/src/components/olmap/core/Controls/HistoryDataPanel.tsx +++ b/src/components/olmap/core/Controls/HistoryDataPanel.tsx @@ -432,6 +432,7 @@ const SCADADataPanel: React.FC = ({ end_time, onClose, }) => { + const handleClose = onClose ?? (() => {}); // 从 featureInfos 中提取设备 ID 列表 const deviceIds = useMemo( () => featureInfos.map(([id]) => id), @@ -931,19 +932,17 @@ const SCADADataPanel: React.FC = ({ }} /> - {onClose && ( - - - - - - )} + + + + + diff --git a/src/components/olmap/core/Controls/PropertyPanel.tsx b/src/components/olmap/core/Controls/PropertyPanel.tsx index 2f6343f..67cff8e 100644 --- a/src/components/olmap/core/Controls/PropertyPanel.tsx +++ b/src/components/olmap/core/Controls/PropertyPanel.tsx @@ -36,6 +36,7 @@ const PropertyPanel: React.FC = ({ onClose, }) => { const draggableRef = useRef(null); + const handleClose = onClose ?? (() => {}); const headerActionSx = { color: "common.white", backgroundColor: "rgba(255,255,255,0.08)", @@ -93,19 +94,17 @@ const PropertyPanel: React.FC = ({

属性面板

- {onClose && ( - - - - - - )} + + + + + {/* 内容区域 */}