import React, { useEffect, useState } from 'react' import { useLocation } from 'react-router' import { useDispatch, useSelector } from 'react-redux' import './index.less' import MapCtrl from './MapCtrl/index' import HomePanelsLayoutPage from './homePanelsLayoutPage' import Ysgzq from '../ysgzq/ssyq' import Sssq from '../ysgzq/sssq' import Ddxsfx from '../fxdd/dqxsfx' // import Tqyb from '../fxdd/tqyb' import Fhxs from './fhxs' import Tqyb from './tqyb' import Hsyy from './hsyy' import Btn from './btn' const HomePage = () => { const getLayerVisible = (s:any) => s.map.layerVisible; const mode = useSelector((s:any) => s.map.mode); const layerVisible = useSelector(getLayerVisible); const [showPanels, setShowPanels] = useState(true) const location = useLocation() const dispatch = useDispatch() const pathname = location.pathname useEffect(() => { // if (pathname !== '/mgr/home') { // dispatch.map.setLayerVisible({ ShuiKuLayer: false }) // dispatch.map.setZhongxingSk(true) // } else { // dispatch.map.setLayerVisible({ ShuiKuLayer: true }) // dispatch.map.setZhongxingSk(true) // } if(pathname === '/mgr/sy/hsyy'){ dispatch.map.setMode('3d'); }else{ dispatch.map.setMode('2d'); } }, [pathname]) useEffect(() => { // if (pathname == '/mgr/home' && !showPanels) { // dispatch.map.setZhongxingSk(true) // dispatch.map.setLayerVisible({ AdcdLayer: true }) // dispatch.map.setLayerVisible({ ShuiKuLayer: true }) // } }, [showPanels]) return (