import React, { useMemo, useState,useEffect } from 'react'; import useRequest from '../../../../utils/useRequest'; import PanelBox from '../../components/PanelBox'; import Table from '@material-ui/core/Table'; import TableContainer from '@material-ui/core/TableContainer'; import TableBody from '@material-ui/core/TableBody'; import TableHead from '@material-ui/core/TableHead'; import TableRow from '@material-ui/core/TableRow'; import DpTableCell from '../../../../layouts/mui/DpTableCell'; import DpTableRow from '../../../../layouts/mui/DpTableRow'; import { useDispatch, useSelector } from 'react-redux'; import useRefresh from '../../../../utils/useRefresh'; import { HDRealPromise } from '../../../../models/_/real'; import clsx from 'clsx'; import { renderHDRz } from '../../../../utils/renutils'; import Setting from './Setting'; import { InfoPopNames } from '../../InfoPops'; import config from '../../../../config'; import { showData,bzData} from './constatData' import './index.less' function rzRender(rz, base) { return ( = base ? 'red' : '#fff' }}> {typeof base === 'number' ? base.toFixed(2) : ''} ); } function HDReal({ style }) { const dispatch = useDispatch(); const tableRzFilter = useSelector(s => s.realview.tableRzFilter); const hdAutoRefresh = useSelector(s => s.realview.hdAutoRefresh); // const t = useRefresh(hdAutoRefresh ? 60 * 1000 : 0); // let { data } = useRequest(HDRealPromise.get, t); const [setting, showSetting] = useState(false); const flyTo = (record, type) => { toggleStType(type) const { lgtd, lttd } = record; if (lgtd && lttd) { dispatch.runtime.setFeaturePop({ type, properties: record, coordinates: [lgtd, lttd] }); dispatch.runtime.setCameraTarget({ center: [lgtd, lttd + config.poiPositionOffsetY.hd], zoom: config.poiPositionZoom.hd, pitch: config.poiPitch, }); } } const wgData = [ { } ] const [type, setType] = useState('fx') const toggleStType = (type) => { setType(type) } const toggleAutoRefresh = () => { dispatch.realview.setHdAutoRefresh(!hdAutoRefresh); } useEffect(() => { return () => { dispatch.runtime.setShksh(undefined) } }, []) return ( toggleStType('fx')}>风险网格 toggleStType('jg')}>结构化预案 } extra={ <> {/* showSetting(true)}> */} > } > {type == 'fx' ? 山洪灾害防治区及重点防治区内需转移人员基本情况 : null} { type == 'fx' ? <> 户主 家庭人口 宅基高程(m) 房屋面积(m²) {[].map((row) => ( flyTo(row, 'bz')}> {row.pustName} {row.pustType} {row.irrCode_dictText} ))} 风险统计 35 危险区面积 35 危险区户数 35 风险点(个) 15 危险区人口(人) > : 基本情况 威胁对象: 18 威胁人口: 75 安置点: 2组,3组 预警指标 准备转移: 1小时-mm; 3小时-mm; 6小时-mm 立即转移: 1小时-mm; 3小时-mm; 6小时-mm 防汛值班电话 市汛期值班电话: 县汛期值班电话: 0718-3225026 } {/* { setting && showSetting(false)} /> } */} ) } export default HDReal;