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 {Typography,makeStyles} from '@material-ui/core'; import './index.less' const useStyles = makeStyles((theme) => ({ root: { width: '100%', backgroundColor: 'transparent', color: '#fff' }, tabs: { borderBottom: '1px solid rgba(255, 255, 255, 0.12)', '& .MuiTab-root': { color: '#fff', '&.Mui-selected': { color: '#2196f3' } }, '& .MuiTabs-indicator': { backgroundColor: '#2196f3' } }, table: { backgroundColor: 'transparent', '& .MuiTableCell-root': { color: '#fff', borderColor: 'rgba(255, 255, 255, 0.12)' } }, statsContainer: { marginTop: theme.spacing(2), backgroundColor: 'rgba(0, 0, 0, 0.2)', borderRadius: theme.shape.borderRadius, padding: theme.spacing(2) }, statsRow: { display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: theme.spacing(1) }, warningCell: { backgroundColor: 'rgba(156, 39, 176, 0.3)' }, yearLabel: { backgroundColor: '#1976d2', padding: '2px 2px', borderRadius: 12, fontSize: '0.75rem' }, title: { color: '#1976d2', marginBottom: theme.spacing(2), marginTop: 10, marginLeft:20, display: 'flex', alignItems: 'center', '&::before': { content: '""', width: 4, height: 16, backgroundColor: '#1976d2', marginRight: theme.spacing(1), }, }, })); 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 classes = useStyles(); const [type, setType] = useState('fx') const toggleStType = (type) => { setType(type) } const householdData = [ { owner: '张时', population: 4, elevation: 125.6, area: 86.5 }, { owner: '李自才', population: 3, elevation: 126.2, area: 92.3 }, { owner: '王德军', population: 5, elevation: 124.8, area: 110.5 }, { owner: '赵小明', population: 2, elevation: 125.9, area: 75.8 }, { owner: '陈龙', population: 6, elevation: 126.5, area: 135.2 }, { owner: '刘包', population: 4, elevation: 125.3, area: 95.6 }, { owner: '孙有才', population: 3, elevation: 124.5, area: 82.4 }, { owner: '周德佩', population: 5, elevation: 126.8, area: 115.7 } ]; 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²) {householdData.map((row) => ( flyTo(row, 'bz')}> {row.owner} {row.population} {row.elevation} {row.area} ))}
风险统计
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;