import React from 'react';
import {
Table,
Typography,
Box,
Paper,
Grid,
makeStyles
} from '@material-ui/core';
const useStyles = makeStyles((theme) => ({
root: {
padding: theme.spacing(2),
},
section: {
marginBottom: theme.spacing(3),
},
title: {
color: '#1976d2',
marginBottom: theme.spacing(2),
display: 'flex',
alignItems: 'center',
'&::before': {
content: '""',
width: 4,
height: 16,
backgroundColor: '#1976d2',
marginRight: theme.spacing(1),
},
},
table: {
minWidth: 400,
'& th': {
// backgroundColor: '#f5f5f5',
fontWeight: 'bold',
textAlign: 'left',
},
},
statusChip: {
padding: '2px 8px',
borderRadius: 4,
display: 'inline-block',
textAlign: 'center',
width: 50,
},
danger: {
backgroundColor: '#ffebee',
color: '#d32f2f',
},
warning: {
backgroundColor: '#fff3e0',
color: '#ef6c00',
},
info: {
backgroundColor: '#e3f2fd',
color: '#1976d2',
},
statItem: {
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
flexDirection: 'column',
padding: theme.spacing(2),
'& .icon': {
fontSize: 40,
color: '#1976d2',
marginBottom: theme.spacing(1),
},
'& .value': {
fontSize: 24,
color: '#1976d2',
fontWeight: 'bold',
},
'& .label': {
color: '#fff',
width: 130,
marginLeft:30
},
},
}));
// 测试数据
const townData = [
{
name: '七里坪社区',
district: '七里坪社区',
manager: '谢磊',
population: 35,
riskLevel: '危险',
},
{
name: '七里坪社区',
district: '七里坪社区',
manager: '刘家军',
population: 24,
riskLevel: '警戒',
},
{
name: '七里坪社区',
district: '七里坪社区',
manager: '刘家军',
population: 49,
riskLevel: '关注',
},
];
const enterpriseData = [
{
name: '国电广润',
department: '',
manager: '谢磊',
affectedPopulation: 44,
riskLevel: '危险',
},
{
name: '建始七里',
department: '',
manager: '刘家军',
affectedPopulation: 22,
riskLevel: '警戒',
},
{
name: '建始县业',
department: '',
manager: '刘家军',
affectedPopulation: 50,
riskLevel: '关注',
},
];
const statistics = {
floodArea: 3.57,
affectedVillages: 2,
affectedHouseholds: 310,
affectedPopulation: 940,
};
const FloodImpactMonitor = () => {
const classes = useStyles();
const getRiskLevelStyle = (level) => {
switch (level) {
case '危险':
return classes.danger;
case '警戒':
return classes.warning;
case '关注':
return classes.info;
default:
return '';
}
};
return (
城镇、集镇、村庄
| 名称 |
所属乡镇 |
负责人 |
人口数 |
风险等级 |
{townData.map((item, index) => (
| {item.name} |
{item.district} |
{item.manager} |
{item.population} |
{item.riskLevel}
|
))}
企事业单位影响情况
| 基础设施名称 |
所属行政单元 |
负责人 |
影响人数 |
风险等级 |
{enterpriseData.map((item, index) => (
| {item.name} |
{item.department} |
{item.manager} |
{item.affectedPopulation} |
{item.riskLevel}
|
))}
汛情统计
🌊
{statistics.floodArea}
淹没面积(km²)
🏘️
{statistics.affectedVillages}
影响村庄(个)
🏠
{statistics.affectedHouseholds}
影响户数(户)
👥
{statistics.affectedPopulation}
影响人口(人)
);
};
export default FloodImpactMonitor;