import React, { useEffect, useState } from 'react' import { useLocation } from 'react-router' import { useDispatch, useSelector } from 'react-redux' import { Drawer } from 'antd' import './index.less' import MapCtrl from './MapCtrl' import HomePanelsLayoutPage from './homePanelsLayoutPage' import LayersPage from '../Home/dlg/LayersDlg' import Shouqi2 from './img/shouqi2.png' import Zhankai2 from './img/zhankai2.png' import DiQiu from './img/DiQiu.png' import ZhongXin from './img/ZhongXin.png' import Ysgzq from '../ysgzq/ssyq' import Sssq from '../ysgzq/sssq' import Yqz from '../fxzb/jczw/yqz/index.js' import Sqz from '../fxzb/jczw/sqz/index.js' import Ddxsfx from '../fxdd/dqxsfx' // import Tqyb from '../fxdd/tqyb' import Fhxs from './fhxs' import Tqyb from './tqyb' import Tuli from './img/tuli.png' import ysgzqTuli from './img/ysgzqTuli.png' const HomePage = () => { const getLayerVisible = (s:any) => s.map.layerVisible; let mapObj = useSelector((s:any) => s.map.map); const layerVisible = useSelector(getLayerVisible); const location = useLocation() const dispatch = useDispatch() const pathname = location.pathname const [showPanels, setShowPanels] = useState(true) const [open, setOpen] = useState(false) //收起\展开 const collapseExpand = () => { setShowPanels(!showPanels) } //还原地图位置 const reduction = () => { dispatch.runtime.setHome() } //图层控制 const showLayers = () => { setOpen(!open) } const onClose = () => { setOpen(false) } useEffect(() => { // if (pathname !== '/mgr/home') { // dispatch.map.setLayerVisible({ ShuiKuLayer: false }) // dispatch.map.setZhongxingSk(true) // } else { // dispatch.map.setLayerVisible({ ShuiKuLayer: true }) // dispatch.map.setZhongxingSk(true) // } }, [pathname]) useEffect(() => { // if (pathname == '/mgr/home' && !showPanels) { // dispatch.map.setZhongxingSk(true) // dispatch.map.setLayerVisible({ AdcdLayer: true }) // dispatch.map.setLayerVisible({ ShuiKuLayer: true }) // } }, [showPanels]) return (
影像图