import React from 'react'; import { Box, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Paper, Tabs, Tab, Typography, makeStyles } from '@material-ui/core'; import Fxyb from './fxyb'; 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: 'transparent', 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), }, }, })); const RainfallMonitor = () => { const rainfallList = [ { time: '2024-12-10 10:00:00', rainfall: 1.5, magnified: 3, simulated: 4.5 }, { time: '2024-12-10 11:00:00', rainfall: 1.5, magnified: 3, simulated: 4.5 }, { time: '2024-12-10 12:00:00', rainfall: 4.5, magnified: 9, simulated: 13.5 }, { time: '2024-12-10 13:00:00', rainfall: 1.5, magnified: 3, simulated: 4.5 }, { time: '2024-12-10 14:00:00', rainfall: 1.5, magnified: 3, simulated: 4.5 }, { time: '2024-12-10 15:00:00', rainfall: 0, magnified: 0, simulated: 0 }, { time: '2024-12-10 16:00:00', rainfall: 1.5, magnified: 3, simulated: 4.5 }, { time: '2024-12-10 17:00:00', rainfall: 1.5, magnified: 3, simulated: 4.5 }, { time: '2024-12-10 18:00:00', rainfall: 3, magnified: 6, simulated: 9 }, ]; const classes = useStyles(); const [tabValue, setTabValue] = React.useState(0); const handleTabChange = (event, newValue) => { setTabValue(newValue); }; return ( { tabValue == 0 ? <> 降雨预测 时间 面雨量(mm) 放大量(mm) 预演面雨量(mm) {/* 这里添加实际的降雨数据行 */} {rainfallList.map((row) => (
{row.time}
{row.rainfall} {row.magnified} {row.simulated}
))}
{['1小时', '3小时', '6小时', '12小时', '24小时'].map((period) => ( {period} ))}
最大雨量重现期统计
{[265.5, 591, 943.5, 1311.6, 1451.7].map((value, index) => ( {value} ))}
{['>102.0', '>125.0', '>141.0', '>163.0', '>188.0'].map((threshold, index) => ( {threshold} 100年一遇 ))}
: }
); }; export default RainfallMonitor;