feat(): 修改防汛数据

lsf-dev
李神峰 2025-06-13 14:22:18 +08:00
parent 258560d5b4
commit 13868ee323
13 changed files with 256 additions and 33 deletions

Binary file not shown.

View File

@ -272,6 +272,7 @@ export default function calcLayout(view, rightStack, hidePanels) {
} else if (view === 3) {
right = [
{ key: '网格', style: { height: '40rem' } },
{ key: '单个预案', style: { height: '10rem',flexGrow: 1 } },
]
//rightFullHeight = true;
} else if (view === 4) {

View File

@ -14,6 +14,7 @@ function initState() {
layerSetting: {
},
yyObj: {},
yuananType:'sh',
duibifxNum:[],
shkshObj:undefined,
gwobj: undefined,
@ -67,6 +68,9 @@ const runtime = {
setInfoDlg(state, props) {
return { ...state, infoDlg: props }
},
setYuananType(state, props) {
return { ...state, yuananType: props }
},
setYyfa(state, props) {
return { ...state, yyObj: props }
},

View File

@ -143,7 +143,7 @@ import Gsfhqx from './panels/Gsfhqx'
import JbqkRight from './panels/JbqkRight'
import RainSta from './panels/RainSta'
import DrpSta from './panels/DrpSta'
import Yuanan from './panels/SigelYuanan'
export default function PanelIndex({ name, style, ...params }) {
if (name === '天气') {
return (
@ -426,7 +426,9 @@ export default function PanelIndex({ name, style, ...params }) {
return <Zdgzsq style={style} />
} else if (name === '测站到报率') {
return <Czdbl style={style} />
}
} else if (name === '单个预案') {
return <Yuanan style={style} />
}
return (
<PanelBox style={style} title={name} color="red">
<p>not impl</p>

View File

@ -23,6 +23,7 @@ export default function Demo1() {
const isSc = useSelector(s => s.runtime.scya);
const wg = useSelector(s => s.runtime.shkshObj)
const showGw = useSelector(s => s.runtime.showGw)
const yuananType = useSelector(s => s.runtime.yuananType);
console.log('wg', wg);
@ -64,11 +65,22 @@ export default function Demo1() {
!hp && (
<TransitionGroup className={clsx('left', 'dp-panel-container', layout.leftFullHeight && 'fullheight')}>
{
layout.left.map(({ key, ...params }) => (
layout.left.map(({ key, ...params }) => {
if (key != '辅助决策列表') {
return (
<CSSTransition key={key} unmountOnExit exit={false} timeout={500} classNames="dp-panelgroup">
<PanelIndex name={key} {...params} />
</CSSTransition>
))
)
} else if (yuananType == 'sh') {
return (
<CSSTransition key={key} unmountOnExit exit={false} timeout={500} classNames="dp-panelgroup">
<PanelIndex name={key} {...params} />
</CSSTransition>
)
}
}
)
}
</TransitionGroup>
@ -82,7 +94,7 @@ export default function Demo1() {
<TransitionGroup className={clsx('right', 'dp-panel-container', layout.rightFullHeight && 'fullheight')}>
{
layout.right.map(({ key, ...params }) => {
if (key != '网格') {
if (key != '网格' && key != '单个预案') {
return (
<CSSTransition key={key} unmountOnExit exit={false} timeout={500} classNames="dp-panelgroup">
<PanelIndex name={key} {...params} />

View File

@ -447,6 +447,29 @@ export default function Overall({ style }) {
10, 10,
14, 16,
],
'text-max-width': 30,
'text-font': ['Roboto Black'],
'text-field': [
'step',
['zoom'],
[
'case',
['!=', ['get', 'state'], 1], '',
['concat', ['get', 'rz'], 'm']
],
12, [
'case',
['!=', ['get', 'state'], 1], ['get', 'stnm'],
[
'format',
['get', 'stnm'], { 'font-scale': 0.8, 'text-color': '#fff' },
'\n', {},
['concat', ['get', 'rz'], 'm'], {}
]
],
],
'text-anchor': 'top',
'text-offset': [0, 1],
},
'paint': {
'text-color': [

View File

@ -262,8 +262,8 @@ export default function Overall({ style }) {
<TableRow onClick={() =>flyTo(item)}>
<DpTableCell style={{ width: '53%' }}>{item.stnm}</DpTableCell>
<DpTableCell style={{ width: '10%' }}>{item.today}</DpTableCell>
<DpTableCell style={{ width: '20%' }}>阎家河镇</DpTableCell>
<DpTableCell style={{ width: '27%' }}>桃林河</DpTableCell>
<DpTableCell style={{ width: '20%' }}>福田河镇</DpTableCell>
<DpTableCell style={{ width: '27%' }}>长江流域</DpTableCell>
</TableRow>
))
}

View File

@ -169,13 +169,7 @@ function FzjcLayers({ style }) {
}
const [type, setType] = useState('sh')
const toggleStType = (type) => {
// if (type == 'sz') {
// dispatch.map.setLayerVisible({'ShuiZhaLayer':true})
// dispatch.map.setLayerVisible({'BzLayer':false})
// } else {
// dispatch.map.setLayerVisible({'ShuiZhaLayer':false})
// dispatch.map.setLayerVisible({'BzLayer':true})
// }
dispatch.runtime.setYuananType(type)
setType(type)
}

View File

@ -992,6 +992,7 @@ function DrpReal({ style }) {
'features': [],
},
},
'paint': {
'circle-color': [
'case',
@ -1065,6 +1066,29 @@ function DrpReal({ style }) {
10, 10,
14, 16,
],
'text-max-width': 30,
'text-font': ['Roboto Black'],
'text-field': [
'step',
['zoom'],
[
'case',
['!=', ['get', 'state'], 1], '',
['concat', ['get', 'rz'], 'm']
],
12, [
'case',
['!=', ['get', 'state'], 1], ['get', 'stnm'],
[
'format',
['get', 'stnm'], { 'font-scale': 0.8, 'text-color': '#fff' },
'\n', {},
['concat', ['get', 'rz'], 'm'], {}
]
],
],
'text-anchor': 'top',
'text-offset': [0, 1],
},
'paint': {
'text-color': [
@ -1080,6 +1104,7 @@ function DrpReal({ style }) {
},
'visibility': 'visible',
});
}
if (type === 'll') {
map.addLayer({

View File

@ -70,16 +70,16 @@ function HDReal({ style }) {
const toggleAutoRefresh = () => {
dispatch.realview.setHdAutoRefresh(!hdAutoRefresh);
}
const setLayer = (data = [], type) => {
const map = window.__mapref;
const layer = map.getLayer('关联站点')
if (layer) {
map.removeLayer('关联站点');
map.removeSource('关联站点');
}
if (data.length === 0) { return }
if (type === 'hd') {
map.addLayer({
const setLayer = (data = [], type) => {
const map = window.__mapref;
const layer = map.getLayer('关联站点')
if (layer) {
map.removeLayer('关联站点');
map.removeSource('关联站点');
}
if (data.length === 0) { return }
if (type === 'hd') {
map.addLayer({
'id': '关联站点',//+new Date().getTime(),
'type': 'symbol',
'source': {
@ -103,6 +103,29 @@ function HDReal({ style }) {
10, 10,
14, 16,
],
'text-max-width': 30,
'text-font': ['Roboto Black'],
'text-field': [
'step',
['zoom'],
[
'case',
['!=', ['get', 'state'], 1], '',
['concat', ['get', 'rz'], 'm']
],
12, [
'case',
['!=', ['get', 'state'], 1], ['get', 'stnm'],
[
'format',
['get', 'stnm'], { 'font-scale': 0.8, 'text-color': '#fff' },
'\n', {},
['concat', ['get', 'rz'], 'm'], {}
]
],
],
'text-anchor': 'top',
'text-offset': [0, 1],
},
'paint': {
'text-color': [
@ -118,11 +141,11 @@ function HDReal({ style }) {
},
'visibility': 'visible',
});
}
map.getSource('关联站点').setData(parseGeoJSON(data))
}
map.getSource('关联站点').setData(parseGeoJSON(data))
}
return (
<PanelBox
style={style}
@ -153,13 +176,13 @@ function HDReal({ style }) {
</TableHead>
<TableBody>
{showData.map((row) => (
<DpTableRow key={row.stcd} onClick={() => { flyTo(row); setLayer([row],'hd')}}>
<DpTableRow key={row.stcd} onClick={() => { flyTo(row); setLayer([row], 'hd') }}>
<DpTableCell component="th" scope="row">
<div className="table-ellipsis cursor-pointer">{row.stnm}</div>
</DpTableCell>
<DpTableCell align="right">{renderHDRz(row)}{row.stnm == '浮桥河'? '↑':""}</DpTableCell>
{rzRender(row.rz, row.rz+5.5)}
{rzRender(row.rz, row.rz+4)}
<DpTableCell align="right">{renderHDRz(row)}{row.stnm == '浮桥河' ? '↑' : ""}</DpTableCell>
{rzRender(row.rz, row.rz + 5.5)}
{rzRender(row.rz, row.rz + 4)}
</DpTableRow>
))}
</TableBody>

View File

@ -248,8 +248,8 @@ export default function Overall({ style }) {
station.id == 'storm' && drpData.map(item => (
<TableRow onClick={() =>flyTo(item)}>
<DpTableCell style={{ width: '53%' }}>{item.stnm}</DpTableCell>
<DpTableCell style={{ width: timeRange == '1h' ?'27%':"30%" }}>{item.today}</DpTableCell>
<DpTableCell style={{ width: timeRange == '1h' ?'20%':'17%' }}>{timeRange == '1h' ? '福田河镇':'福田河'}</DpTableCell>
<DpTableCell style={{ width: timeRange == '1h' ?'27%':"28%" }}>{item.today}</DpTableCell>
<DpTableCell style={{ width: timeRange == '1h' ?'20%':'19%' }}>{timeRange == '1h' ? '福田河镇':'长江流域'}</DpTableCell>
</TableRow>
))
}

View File

@ -0,0 +1,48 @@
import React, { useMemo, useState } 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 { DrpRealPromise } from '../../../../models/_/real';
import useRefresh from '../../../../utils/useRefresh';
import clsx from 'clsx';
import { renderDrp } from '../../../../utils/renutils';
import { TableSortLabel } from '@material-ui/core';
import { InfoPopNames } from '../../InfoPops';
// import AreaDrpChart from './chart';
import config from '../../../../config';
import TablePage from './table.js'
function DrpReal({ style }) {
const dispatch = useDispatch();
const [ tab, setTab ] = useState('1')
const [ tab2, setTab2 ] = useState('1')
const flyTo = (row) => {
dispatch?.runtime.setInfoDlg({ layerId: 'PdfLayer', properties: row })
}
return (
<PanelBox
style={style}
title="预案"
color="green"
>
<div style={{ color: "#fff",display:'flex',padding:'10px',cursor:'pointer' }} onClick={() => flyTo({planName:'潭家河村山洪灾害防御预案'})}>
<span>潭家河村山洪灾害防御预案</span>
</div>
</PanelBox>
)
}
export default DrpReal;

View File

@ -0,0 +1,91 @@
import React, { useMemo, useState } 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 appconsts from '../../../../models/appconsts';
import { renderDrp, renderSkArz, renderSkRz } from '../../../../utils/renutils';
const data = [
{ name:'雨量站', name2:'10', name3:'8', name4:'2', name5:'80' },
{ name:'水位站', name2:'15', name3:'15', name4:'0', name5:'100' },
{ name:'图像站', name2:'10', name3:'10', name4:'0', name5:'100' },
{ name:'合计', name2:'35', name3:'33', name4:'2', name5:'94.29' },
]
const data2 = [
{ name:'合计', name2:'64', name3:'64', name4:'0', name5:'100' },
]
const data3 = [
{ name:'合计', name2:'12', name3:'12', name4:'0', name5:'100' },
]
function Page({ tab }) {
return (
<TableContainer style={{ height: '12rem' }}>
<Table size="small" stickyHeader>
<TableHead>
<TableRow>
<DpTableCell style={{ minWidth: '2rem' }} align="left"></DpTableCell>
<DpTableCell style={{ minWidth: '3rem' }} align="center">总数</DpTableCell>
<DpTableCell style={{ minWidth: '5rem' }} align="center">在线数量</DpTableCell>
<DpTableCell style={{ minWidth: '5rem' }} align="center">离线数量</DpTableCell>
<DpTableCell style={{ minWidth: '5rem' }} align="center">到报率%</DpTableCell>
</TableRow>
</TableHead>
<TableBody>
{
tab==='1'?data.map((row) => (
<DpTableRow key={row.name}>
<DpTableCell component="th" scope="row">
<div className="table-ellipsis cursor-pointer" onClick={() => {}}>{row.name}</div>
</DpTableCell>
<DpTableCell align="center">{row.name2}</DpTableCell>
<DpTableCell align="center">{row.name3}</DpTableCell>
<DpTableCell align="center">{row.name4}</DpTableCell>
<DpTableCell align="center">{row.name5}</DpTableCell>
</DpTableRow>
)):null
}
{
tab==='2'?data2.map((row) => (
<DpTableRow key={row.name}>
<DpTableCell component="th" scope="row">
<div className="table-ellipsis cursor-pointer" onClick={() => {}}>{row.name}</div>
</DpTableCell>
<DpTableCell align="center">{row.name2}</DpTableCell>
<DpTableCell align="center">{row.name3}</DpTableCell>
<DpTableCell align="center">{row.name4}</DpTableCell>
<DpTableCell align="center">{row.name5}</DpTableCell>
</DpTableRow>
)):null
}
{
tab==='3'?data3.map((row) => (
<DpTableRow key={row.name}>
<DpTableCell component="th" scope="row">
<div className="table-ellipsis cursor-pointer" onClick={() => {}}>{row.name}</div>
</DpTableCell>
<DpTableCell align="center">{row.name2}</DpTableCell>
<DpTableCell align="center">{row.name3}</DpTableCell>
<DpTableCell align="center">{row.name4}</DpTableCell>
<DpTableCell align="center">{row.name5}</DpTableCell>
</DpTableRow>
)):null
}
</TableBody>
</Table>
</TableContainer>
)
}
export default React.memo(Page);