import React, { useEffect, useState } from 'react'; import { Modal, Button, message } from 'antd'; import FullScreenPage from '../layout/FullScreenInter'; const PopupWindow = () => { const [visible, setVisible] = useState(false); const [params, setParams] = useState({}); useEffect(() => { // 尝试从 URL 查询参数获取 const searchParams = new URLSearchParams(window.location.search); const timeRange = searchParams.get('timeRange') || ''; const filterType = searchParams.get('filterType') || ''; if (timeRange || filterType) { setParams({ timeRange, filterType }); setVisible(true); } else { // 从 localStorage 获取 const storedParams = localStorage.getItem('popupParams'); if (storedParams) { try { const parsedParams = JSON.parse(storedParams); setParams(parsedParams); setVisible(true); localStorage.removeItem('popupParams'); } catch (error) { message.error('参数解析错误'); } } } }, []); return (