feat(): 水库总览修改

lsf-dev
李神峰 2025-06-12 11:45:21 +08:00
parent d4a3f222a2
commit 455f63f122
11 changed files with 198 additions and 125 deletions

View File

@ -44,6 +44,52 @@
],
"layer": "RealSkLayer",
"layerPop": "RealSkPop"
},
{
"stcd": "716115401",
"type": "sk",
"hasRz": true,
"stnm": "小玉潭水库",
"adcd": "421181110000",
"wscd": null,
"importancy": 0,
"lgtd": 114.96946270525194,
"lttd": 31.469026638957608,
"elev": 0,
"damel": 21.6,
"dsflz": 20.15,
"fsltdz": 130.8,
"ddz": 0,
"zcxsw": 130.8,
"drpTm": "2024-05-17T08:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 126.41,
"w": 4.971,
"a_fsltdz": -4.390000000000015,
"rzTm": "2024-05-17T06:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716115401",
"tm": "2024-05-17T08:05:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2024/0517/716115401/20240517160500.jpg"
},
{
"stcd": "716115401",
"tm": "2024-05-17T08:20:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2024/0517/716115402/20240517162000.jpg"
}
],
"layer": "RealSkLayer",
"layerPop": "RealSkPop"
},
{
"stcd": "716115301",
@ -669,6 +715,7 @@
"h48": 15,
"drpState": 1,
"rz": 84.67,
"xs":10432,
"w": 16900,
"a_fsltdz": -8.329999999999998,
"rzTm": "2025-06-06T22:00:00.000Z",
@ -704,6 +751,7 @@
"drpState": 2,
"rz": 83,
"w": 1026,
"xs":375,
"a_fsltdz": -15.299999999999997,
"rzTm": "2025-06-06T00:00:00.000Z",
"rzWarning": 0,
@ -737,6 +785,7 @@
"h48": 0,
"drpState": 2,
"rz": 203.4,
"xs":1164,
"w": 2797,
"a_fsltdz": -5.079999999999984,
"rzTm": "2025-06-06T00:00:00.000Z",
@ -1876,6 +1925,7 @@
"drpState": 1,
"rz": 60.7,
"w": 45490,
"xs":32133,
"a_fsltdz": -4.189999999999998,
"rzTm": "2025-06-06T22:00:00.000Z",
"rzWarning": 0,
@ -5451,6 +5501,7 @@
"h48": 43.5,
"drpState": 1,
"rz": 141.56,
"xs":12744,
"w": 16926,
"a_fsltdz": -7.439999999999998,
"rzTm": "2025-06-06T22:00:00.000Z",
@ -5486,6 +5537,7 @@
"drpState": 1,
"rz": 120,
"w": 6015,
"xs":1676,
"a_fsltdz": -17,
"rzTm": "2025-06-06T00:00:00.000Z",
"rzWarning": 0,
@ -5888,6 +5940,7 @@
"drpState": 2,
"rz": 224.31,
"w": 1415,
"xs":750,
"a_fsltdz": -6.689999999999998,
"rzTm": "2025-04-11T05:00:00.000Z",
"rzWarning": 0,
@ -7486,6 +7539,7 @@
"drpState": 2,
"rz": 156.8,
"w": 1834,
"xs":448,
"a_fsltdz": -10.599999999999994,
"rzTm": "2025-06-06T00:00:00.000Z",
"rzWarning": 0,
@ -8256,6 +8310,7 @@
"drpState": 1,
"rz": 117.78,
"w": 1577,
"xs":628,
"a_fsltdz": -4.659999999999997,
"rzTm": "2025-06-06T22:00:00.000Z",
"rzWarning": 0,
@ -9072,6 +9127,7 @@
"drpState": 1,
"rz": 144.5,
"w": 1574,
"xs":"--",
"a_fsltdz": -14.5,
"rzTm": "2025-06-06T00:00:00.000Z",
"rzWarning": 0,

BIN
src/assets/yybg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 MiB

View File

@ -136,8 +136,8 @@ const enterpriseData = [
const statistics = {
floodArea: 3.57,
affectedVillages: 2,
affectedHouseholds: 310,
affectedPopulation: 940,
affectedHouseholds: 75,
affectedPopulation: 224,
};
const FloodImpactMonitor = () => {
@ -162,8 +162,8 @@ const FloodImpactMonitor = () => {
<Typography variant="h6" className={classes.title}>
城镇集镇村庄
</Typography>
<Paper>
<Table className={classes.table}>
<Paper style={{background:"transparent"}}>
<Table className={classes.table} >
<thead>
<tr>
<th>名称</th>
@ -196,7 +196,7 @@ const FloodImpactMonitor = () => {
<Typography variant="h6" className={classes.title}>
企事业单位影响情况
</Typography>
<Paper>
<Paper style={{background:"transparent"}}>
<Table className={classes.table}>
<thead>
<tr>

View File

@ -40,7 +40,7 @@ function HDStDlg({ record, onClose }) {
</DpTabs>
<DpCloseButton onClick={onClose} />
</DpAppBar>
<div style={{ display: 'flex' }}>
<div className='yy-contents'>
<div className='yy-left'>
<WarningCard
key={warnObj.id}
@ -53,10 +53,10 @@ function HDStDlg({ record, onClose }) {
/>
</div>
<div className='yy-middle'>
<VideoPlayer
{/* <VideoPlayer
videoUrl={`${process.env.PUBLIC_URL}/assets/yyVideo.mp4`}
date=""
/>
/> */}
{/* <video src={`${process.env.PUBLIC_URL}/assets/yyVideo.mp4`} style={{width:'100%',height:'100%'}}></video> */}
</div>
<div className='yy-right'>

View File

@ -1,6 +1,12 @@
.yy-left,.yy-right{
width:450px
width:450px;
background: rgba(6, 34, 56, .8);
}
.yy-middle{
width: 1000px;
}
.yy-contents{
display: flex;
background:url(../../../../assets/yybg.png) no-repeat;
background-size: 100% 100%;
}

View File

@ -153,7 +153,7 @@ const RainfallMonitor = () => {
<Tab label="降雨情景" />
<Tab label="风险评估" />
</Tabs>
{
tabValue == 0 ? <>
<TableContainer component={Paper} className={classes.table}>
@ -213,10 +213,6 @@ const RainfallMonitor = () => {
</Box>
</> : <Fxyb />
}
</Box>
);
};

View File

@ -24,7 +24,7 @@ function SkSmtp({ record, onClose }) {
<div className="boxhead"></div>
<DialogContent style={{ padding: 0, width: '30rem', overflowX: 'hidden' }}>
<DpAppBar position="sticky">
<Typography variant="h6" style={{ alignSelf: 'center', marginLeft: '0.5rem', flexGrow: 1 }}>{record.stnm}</Typography>
<Typography variant="h6" style={{ alignSelf: 'center', marginLeft: '0.5rem', flexGrow: 1,color:"#fff" }}>{record.stnm}</Typography>
<DpCloseButton onClick={onClose} />
</DpAppBar>
<SkSmtpPanel personels={record.personels || []} txt={record.txt} />

View File

@ -50,7 +50,7 @@ function HDReal({ style }) {
return (
<PanelBox
style={style}
title="监测2告警"
title="监测告警"
color="green"
extra={
<div>

View File

@ -12,17 +12,17 @@ function Page({ style }) {
<div style={{width:'24%',display:'flex',flexDirection:'column',alignItems:'center',border:'1px solid rgba(36, 136, 223, 0.4)',paddingTop:'0.2rem',background:'#132a4b'}}>
<img src={`${process.env.PUBLIC_URL}/assets/icon/大型水库.svg`} width={20} alt=""/>
<div style={{color:'#ffffff',fontSize:'0.8rem',marginTop:'0.1rem'}}>中型水库</div>
<div style={{color:'#ffffff',fontSize:'0.8rem',lineHeight:'1rem'}}><span style={{color:'#7dd188',fontSize:'1.2rem'}}>3</span> </div>
<div style={{color:'#ffffff',fontSize:'0.8rem',lineHeight:'1rem'}}><span style={{color:'#7dd188',fontSize:'1.2rem'}}>7</span> </div>
</div>
<div style={{width:'24%',display:'flex',flexDirection:'column',alignItems:'center',border:'1px solid rgba(36, 136, 223, 0.4)',paddingTop:'0.2rem',background:'#132a4b'}}>
<img src={`${process.env.PUBLIC_URL}/assets/icon/大型水库.svg`} width={20} alt=""/>
<div style={{color:'#ffffff',fontSize:'0.8rem',marginTop:'0.1rem'}}>(1)型水库</div>
<div style={{color:'#ffffff',fontSize:'0.8rem',lineHeight:'1rem'}}><span style={{color:'#7dd188',fontSize:'1.2rem'}}>3</span> </div>
<div style={{color:'#ffffff',fontSize:'0.8rem',lineHeight:'1rem'}}><span style={{color:'#7dd188',fontSize:'1.2rem'}}>44</span> </div>
</div>
<div style={{width:'24%',display:'flex',flexDirection:'column',alignItems:'center',border:'1px solid rgba(36, 136, 223, 0.4)',paddingTop:'0.2rem',background:'#132a4b'}}>
<img src={`${process.env.PUBLIC_URL}/assets/icon/大型水库.svg`} width={20} alt=""/>
<div style={{color:'#ffffff',fontSize:'0.8rem',marginTop:'0.1rem'}}>(2)型水库</div>
<div style={{color:'#ffffff',fontSize:'0.8rem',lineHeight:'1rem'}}><span style={{color:'#7dd188',fontSize:'1.2rem'}}>3</span> </div>
<div style={{color:'#ffffff',fontSize:'0.8rem',lineHeight:'1rem'}}><span style={{color:'#7dd188',fontSize:'1.2rem'}}>207</span> </div>
</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
import React, { useEffect, useMemo, useState } from 'react';
import { Switch, Collapse,Table, TableContainer, TableBody,TableHead, TableRow, TableSortLabel } from '@material-ui/core/index'
import { Switch, Collapse, Table, TableContainer, TableBody, TableHead, TableRow, TableSortLabel } from '@material-ui/core/index'
import DpTableCell from '../../../../layouts/mui/DpTableCell';
import DpTableRow from '../../../../layouts/mui/DpTableRow';
import PanelBox from '../../components/PanelBox';
@ -12,35 +12,40 @@ import CollapsePage from './collapsePage'
function DrpReal({ style }) {
const [dimension, setDimension] =useState('ft');
const [skData,setSkData] = useState([])
const [skType,setSkType] = useState('')
const [sort,setSort] = useState(true)
const [dimension, setDimension] = useState('ft');
const [skData, setSkData] = useState([])
const [skType, setSkType] = useState('')
const [sort, setSort] = useState(true)
const [sort1, setSort1] = useState(true)
const dispatch = useDispatch();
const tableData = useMemo(()=>{
if(skType==='1'){
return (skData.filter(o=>o.w>10000)||[]).sort((a,b)=>sort?(b.w-a.w):(a.w-b.w))
const tableData = useMemo(() => {
if (skType === '1') {
return (skData.filter(o => o.w > 10000) || []).sort((a, b) => sort ? (b.w - a.w) : (a.w - b.w))
}
if(skType==='2'){
return (skData.filter(o=>o.w>100 && o.w<=10000)||[]).sort((a,b)=>sort?(b.w-a.w):(a.w-b.w))
if (skType === '2') {
return (skData.filter(o => o.w > 100 && o.w <= 10000) || []).sort((a, b) => sort ? (b.w - a.w) : (a.w - b.w))
}
if(skType==='3'){
return (skData.filter(o=>o.w>0.375 && o.w<=100)||[]).sort((a,b)=>sort?(b.w-a.w):(a.w-b.w))
if (skType === '3') {
const filterSkData = skData.filter(o => o.w > 0.375 && o.w <= 100) || [];
const newFilterData = filterSkData.map(item => ({ ...item, xs: (item.w * 0.6).toFixed(2) }))
return newFilterData.sort((a, b) => sort ? (b.w - a.w) : (a.w - b.w))
}
if(skType==='4'){
return (skData.filter(o=>o.w>=0 && o.w<=0.375)||[]).sort((a,b)=>sort?(b.w-a.w):(a.w-b.w))
if (skType === '4') {
const filterSkData = skData.filter(o => o.w >= 0 && o.w <= 0.375) || [];
const newFilterData = filterSkData.map(item => ({ ...item, xs: (item.w * 0.6).toFixed(2) }))
return newFilterData.sort((a, b) => sort ? (b.w - a.w) : (a.w - b.w))
}
return []
},[skData,skType,sort])
}, [skData, skType, sort, sort1])
const skTypeObj = [
{type:'1',name:'大型水库',num1:3,num2:7.9316},//8.735
{type:'2',name:'中型水库',num1:7,num2:1.627},
{type:'3',name:'小(1)型水库',num1:43,num2:1.627},
{type:'4',name:'小(2)型水库',num1:207,num2:8.735},
{ type: '1', name: '大型水库', num1: 3, num2: 7.9316 },//8.735
{ type: '2', name: '中型水库', num1: 7, num2: 1.627 },
{ type: '3', name: '小(1)型水库', num1: 44, num2: 1.627 },
{ type: '4', name: '小(2)型水库', num1: 207, num2: 8.735 },
]
useEffect(()=>{
useEffect(() => {
getSkData()
// return ()=>{
@ -51,132 +56,142 @@ function DrpReal({ style }) {
// map.removeSource('临时水库tz');
// }
// }
},[])
}, [])
const getSkData = async()=>{
const getSkData = async () => {
const data = await SkRealPromise.get();
setSkData(data)
}
const flyTo = (row)=>{
const flyTo = (row) => {
const { lgtd, lttd } = row;
if (lgtd && lttd) {
// dispatch.runtime.setFeaturePop({ type: 'RealSkPop', properties: row, coordinates: [row.lgtd, row.lttd] });
dispatch.runtime.setCameraTarget({
center: [lgtd, lttd+0.005],
// dispatch.runtime.setFeaturePop({ type: 'RealSkPop', properties: row, coordinates: [row.lgtd, row.lttd] });
dispatch.runtime.setCameraTarget({
center: [lgtd, lttd + 0.005],
zoom: 15,
pitch: 50,
bearing: 0
});
});
}
}
const setSkLayer = (data=[])=>{
const setSkLayer = (data = []) => {
const map = window.__mapref;
const layer = map.getLayer('临时水库tz')
if(layer){
if (layer) {
map.removeLayer('临时水库tz');
map.removeSource('临时水库tz');
}
if(data.length===0){return}
if (data.length === 0) { return }
map.addLayer({
'id': '临时水库tz',//+new Date().getTime(),
'type': 'symbol',
'source': {
'type': 'geojson',
'data': {
'type': 'FeatureCollection',
'features': [],
},
'id': '临时水库tz',//+new Date().getTime(),
'type': 'symbol',
'source': {
'type': 'geojson',
'data': {
'type': 'FeatureCollection',
'features': [],
},
'layout': {
// 'icon-allow-overlap': true,
// 'text-allow-overlap': true,
'icon-image': '水库', // 从properties中动态读取icon字段
'icon-size': [
'interpolate', ['linear'], ['zoom'],
10, 0.8,
14, 0.8,
],
'text-size': [
'interpolate', ['linear'], ['zoom'],
5, 10,
14, 14,
],
'text-font': ['Roboto Black'],
'text-field': [
'step',
['zoom'],
'',
8, ['get', 'stnm']
],
'text-anchor': 'top',
'text-offset': [0, 1],
},
'paint': {
'text-color': '#fff'
},
'visibility': 'visible',
},
'layout': {
// 'icon-allow-overlap': true,
// 'text-allow-overlap': true,
'icon-image': '水库', // 从properties中动态读取icon字段
'icon-size': [
'interpolate', ['linear'], ['zoom'],
10, 0.8,
14, 0.8,
],
'text-size': [
'interpolate', ['linear'], ['zoom'],
5, 10,
14, 14,
],
'text-font': ['Roboto Black'],
'text-field': [
'step',
['zoom'],
'',
8, ['get', 'stnm']
],
'text-anchor': 'top',
'text-offset': [0, 1],
},
'paint': {
'text-color': '#fff'
},
'visibility': 'visible',
});
map.getSource('临时水库tz').setData(parseGeoJSON(data))
}
return (
return (
<PanelBox
style={style}
title="水库总览"
color="green"
>
<CountPage/>
<CountPage />
{
skTypeObj.map((item)=>
(<>
<CollapsePage type={item.type} name={item.name} num1={item.num1} num2={item.num2} skType={skType} setSkType={setSkType}/>
<Collapse in={skType===item.type} timeout="auto" unmountOnExit>
<TableContainer style={{ maxHeight: 'calc( 100vh - 28.2rem )' }}>
<Table size="small" stickyHeader>
<TableHead>
<TableRow>
<DpTableCell style={{ minWidth: '1rem' }} align="left">序号</DpTableCell>
<DpTableCell style={{ minWidth: '5rem' }} align="center">水库名称</DpTableCell>
<DpTableCell style={{ minWidth: '8rem' }} align="center">类型</DpTableCell>
<DpTableCell style={{ minWidth: '8rem' }} align="center">
<TableSortLabel
onClick={() => setSort(!sort)}
skTypeObj.map((item) =>
(<>
<CollapsePage type={item.type} name={item.name} num1={item.num1} num2={item.num2} skType={skType} setSkType={setSkType} />
<Collapse in={skType === item.type} timeout="auto" unmountOnExit>
<TableContainer style={{ maxHeight: 'calc( 100vh - 28.2rem )' }}>
<Table size="small" stickyHeader>
<TableHead>
<TableRow>
<DpTableCell style={{ minWidth: '3rem' }} align="left">序号</DpTableCell>
<DpTableCell style={{ minWidth: '8rem' }} align="center">水库名称</DpTableCell>
<DpTableCell style={{ minWidth: '8rem' }} align="center">类型</DpTableCell>
<DpTableCell style={{ minWidth: '8rem' }} align="center">
{/* <TableSortLabel
onClick={() => setSort1(!sort1)}
active={true}
direction={sort?'desc':'asc'}>
{'库容(万m³)'}
</TableSortLabel>
</DpTableCell>
</TableRow>
</TableHead>
{
tableData.map((tableRow,index)=>
direction={sort1?'desc':'asc'}>
{'蓄水量(万m³)'}
</TableSortLabel> */}
蓄水量(万m³)
</DpTableCell>
<DpTableCell style={{ minWidth: '8rem' }} align="center">
<TableSortLabel
onClick={() => setSort(!sort)}
active={true}
direction={sort ? 'desc' : 'asc'}>
{'库容(万m³)'}
</TableSortLabel>
</DpTableCell>
</TableRow>
</TableHead>
{
tableData.map((tableRow, index) =>
<TableBody>
<DpTableRow key={tableRow.stcd}>
<DpTableCell align="center" >{index+1}</DpTableCell>
<DpTableCell align="center" >{index + 1}</DpTableCell>
<DpTableCell align="center" >
<div className="table-ellipsis cursor-pointer" onClick={()=>{
flyTo(tableRow)
setSkLayer([tableRow])
}}>
{tableRow.stnm}
</div>
<div className="table-ellipsis cursor-pointer" onClick={() => {
flyTo(tableRow)
setSkLayer([tableRow])
}}>
{tableRow.stnm}
</div>
</DpTableCell>
<DpTableCell align="center" >{item.name}</DpTableCell>
<DpTableCell align="center" >{tableRow.xs}</DpTableCell>
<DpTableCell align="center" >{tableRow.w}</DpTableCell>
</DpTableRow>
</TableBody>
)
}
</Table>
</TableContainer>
</Collapse>
</>)
)
}
</Table>
</TableContainer>
</Collapse>
</>)
)
}
</PanelBox>
)
}
}
export default DrpReal;

View File

@ -104,7 +104,7 @@ function DrpReal({ style }) {
},
'paint': {
'line-color': 'red',
'line-width': 10
'line-width': 6
// [
// 'case',
// ['==', ['get', 'LEVEL'], 1], 2.2,