lsf-dev
秦子超 2025-06-05 09:48:43 +08:00
parent 9b0f02e934
commit 3707b7a9ae
11 changed files with 4726 additions and 3067 deletions

View File

@ -25,6 +25,7 @@ export const DrpRealPromise = new CachePromise(
() => fetch(`${process.env.PUBLIC_URL}/data/drpReal.json`) () => fetch(`${process.env.PUBLIC_URL}/data/drpReal.json`)
.then((response) => response.json()) .then((response) => response.json())
.then(data=>{ .then(data=>{
const cs = []
const list = data.map((item)=>{ const list = data.map((item)=>{
const obj = {...item} const obj = {...item}
const num = item.lgtd.toString()||'0.000'; const num = item.lgtd.toString()||'0.000';
@ -35,9 +36,9 @@ export const DrpRealPromise = new CachePromise(
obj.h12 = item.h12+num2*1.6 obj.h12 = item.h12+num2*1.6
obj.h24 = item.h24+num2*1.8 obj.h24 = item.h24+num2*1.8
obj.h48 = item.h48+num2*1.9 obj.h48 = item.h48+num2*1.9
// if(obj.h1===9){ if(obj.h24<5){
// cs = obj.h1 cs.push(obj)
// } }
return obj return obj
}) })
return list return list
@ -75,6 +76,24 @@ export const SkRealPromise = new CachePromise(
.then(data => { .then(data => {
return data.map(o => ({ ...o, aRz: parseFloat((o.rz - o.fsltdz).toFixed(2)) })) return data.map(o => ({ ...o, aRz: parseFloat((o.rz - o.fsltdz).toFixed(2)) }))
}) })
.then(data=>{
const list = data.map((item)=>{
const obj = {...item}
const num = item.lgtd.toString()||'0.000';
const num2 = Number(num.slice(num.length-1,num.length))
obj.h1 = item.h1+num2
obj.h3 = item.h3+num2*1.2
obj.h6 = item.h6+num2*1.5
obj.h12 = item.h12+num2*1.6
obj.h24 = item.h24+num2*1.8
obj.h48 = item.h48+num2*1.9
// if(obj.h1===9){
// cs = obj.h1
// }
return obj
})
return list
})
.catch(() => null), .catch(() => null),
5000 5000
); );

View File

@ -154,7 +154,7 @@ const map = {
RealHDLayer: true, RealHDLayer: true,
RealSkLayer: true, RealSkLayer: true,
AdcdLayer: true, AdcdLayer: true,
PicStLayer: true, PicStLayer: false,
RivlLayer: true, RivlLayer: true,
WataLayer: false, WataLayer: false,
} }
@ -164,7 +164,23 @@ const map = {
} else if (id === 0) { } else if (id === 0) {
layerVisible = { layerVisible = {
RealDrpLayer: true, RealDrpLayer: true,
RealHDLayer: false, RealHDLayer: true,
RealSkLayer: false,
PicStLayer: false,
RivlLayer: true,
YuwaiLayer: false,
AdcdLayer: true,
WataLayer: false,
RealSkLayerQ2:true,
RealHDLayerQ2:true,
}
Object.keys(DCPJ_TYPES).forEach(key => {
layerVisible['Dcpj_' + key + 'Layer'] = false;
});
} else if (id === 8) {
layerVisible = {
RealDrpLayer: true,
RealHDLayer: true,
RealSkLayer: false, RealSkLayer: false,
PicStLayer: false, PicStLayer: false,
RivlLayer: true, RivlLayer: true,
@ -200,7 +216,7 @@ const map = {
Object.keys(DCPJ_TYPES).forEach(key => { Object.keys(DCPJ_TYPES).forEach(key => {
layerVisible['Dcpj_' + key + 'Layer'] = !SLGC_TYPES[key]; layerVisible['Dcpj_' + key + 'Layer'] = !SLGC_TYPES[key];
}); });
} else if (id === 4 || id === 5) { } else if (id === 4) {
layerVisible = { layerVisible = {
RealDrpLayer: false, RealDrpLayer: false,
RealHDLayer: false, RealHDLayer: false,
@ -212,6 +228,19 @@ const map = {
Object.keys(DCPJ_TYPES).forEach(key => { Object.keys(DCPJ_TYPES).forEach(key => {
layerVisible['Dcpj_' + key + 'Layer'] = false; layerVisible['Dcpj_' + key + 'Layer'] = false;
}); });
}else if (id === 5) {
layerVisible = {
RealDrpLayer: true,
RealHDLayer: false,
RealSkLayer: true,
FzdxLayer: false,
WataLayer: false,
AdcdLayer: true,
RivlLayer: true,
};
Object.keys(DCPJ_TYPES).forEach(key => {
layerVisible['Dcpj_' + key + 'Layer'] = false;
});
} else if (id === 6) { } else if (id === 6) {
layerVisible = { layerVisible = {
RealDrpLayer: false, RealDrpLayer: false,
@ -460,7 +489,7 @@ const map = {
dispatch.runtime.setFeaturePop(null); dispatch.runtime.setFeaturePop(null);
if (id === 0){ if (id === 8){
dispatch.rcview.showRealContour('h1') dispatch.rcview.showRealContour('h1')
}else{ }else{
dispatch.runtime.setLayerSetting({ contour: null, dem: undefined }); dispatch.runtime.setLayerSetting({ contour: null, dem: undefined });

View File

@ -17,6 +17,13 @@ export default function calcLayout(view, rightStack, hidePanels) {
{ key: '预警', style: { height: '40%', flexGrow: 1 } }, { key: '预警', style: { height: '40%', flexGrow: 1 } },
]; ];
leftFullHeight = true; leftFullHeight = true;
} else if (view === 8) {
left = [
{ key: '天气' },
{ key: '综述' },
{ key: '预警', style: { height: '40%', flexGrow: 1 } },
];
leftFullHeight = true;
} else if (view === 1) { } else if (view === 1) {
left = [ left = [
{ key: '天气' }, { key: '天气' },
@ -220,6 +227,17 @@ export default function calcLayout(view, rightStack, hidePanels) {
// { key: '今日值班' }, // { key: '今日值班' },
]; ];
rightFullHeight = true; rightFullHeight = true;
}else if (view === 8) {
right = [
{ key: '警报' },
{ key: '防洪形势天气预报', style: { height: '18.5rem'} },
{ key: '防洪形势水情', style: { height: '18.5rem'} },
// { key: '河道水位', style: { height: '10rem', flexGrow: 1 } },
{ key: '防洪形势雨情', style: { height: '16rem', flexGrow: 1 } },
// { key: '工情', style: { height: '10rem', flexGrow: 1 } },
// { key: '今日值班' },
];
rightFullHeight = true;
} else if (view === 1) { } else if (view === 1) {
right = [ right = [
{ key: '警报' }, { key: '警报' },
@ -262,7 +280,7 @@ export default function calcLayout(view, rightStack, hidePanels) {
{ key: '预报成果', style: { height: '10rem', flexGrow: 1 } }, { key: '预报成果', style: { height: '10rem', flexGrow: 1 } },
{ key: '预警成果', style: { height: '14rem' } }, { key: '预警成果', style: { height: '14rem' } },
{ key: '调度成果', style: { height: '15rem', flexGrow: 1 } }, { key: '调度成果', style: { height: '15rem', flexGrow: 1 } },
{ key: '方案对比', style: { height: '15.5rem' } }, { key: '防汛方案对比', style: { height: '15.5rem' } },
]; ];
rightFullHeight=true rightFullHeight=true
} else if (view === 201) { } else if (view === 201) {

View File

@ -344,7 +344,7 @@ export default function PanelIndex({ name, style, ...params }) {
return <Yjcg style={style} /> return <Yjcg style={style} />
} else if (name === '调度成果') { } else if (name === '调度成果') {
return <Ddcg style={style} /> return <Ddcg style={style} />
} else if (name === '方案对比') { } else if (name === '防汛方案对比') {
return <Fadb style={style} /> return <Fadb style={style} />
} }

View File

@ -8,15 +8,15 @@ const VIEWS = [
{ {
id: 100, title: '防汛', img: '/assets/menu/防洪形势.png', children: [ id: 100, title: '防汛', img: '/assets/menu/防洪形势.png', children: [
{ id: 0, title: '防洪形势', img: '/assets/menu/防洪形势.png' }, // { id: 0, title: '防洪形势', img: '/assets/menu/防洪形势.png' },
{ id: 8, title: '防洪形势', img: '/assets/menu/防洪形势.png' },
{ id: 1, title: '实时数据', img: '/assets/menu/实时数据.png' }, { id: 1, title: '实时数据', img: '/assets/menu/实时数据.png' },
{ id: 6, title: '预警', img: '/assets/menu/病险水库.png' },
{ id: 2, title: '水利设施', img: '/assets/menu/水利设施.png' }, { id: 2, title: '水利设施', img: '/assets/menu/水利设施.png' },
{ id: 3, title: '预案', img: '/assets/menu/辅助决策.png' }, { id: 5, title: '预报', img: '/assets/menu/降雨中心.png' },
{ id: 6, title: '预警', img: '/assets/menu/病险水库.png' },
{ id: 4, title: '预演', img: '/assets/menu/预警分析.png' }, { id: 4, title: '预演', img: '/assets/menu/预警分析.png' },
{ id: 5, title: '天气预报', img: '/assets/menu/降雨中心.png' }, { id: 3, title: '预案', img: '/assets/menu/辅助决策.png' },
{ id: 7, title: '调度', img: '/assets/menu/辅助决策.png' }, { id: 7, title: '调度', img: '/assets/menu/辅助决策.png' },
] ]
}, },
{ id: 200, title: '水库', img: '/assets/menu/水库专题.png',children:[ { id: 200, title: '水库', img: '/assets/menu/水库专题.png',children:[

View File

@ -1,12 +1,15 @@
import React, { useMemo, useState } from 'react'; import React, { useMemo, useState } from 'react';
import { Switch, FormControlLabel,InputLabel, Select, MenuItem,FormControl } from '@material-ui/core/index' import { Switch, FormControlLabel,InputLabel, Select, MenuItem,FormControl } from '@material-ui/core/index'
import PanelBox from '../../components/PanelBox'; import PanelBox from '../../components/PanelBox';
import { useDispatch, useSelector } from 'react-redux';
import AreaDrpChart from './chart'; import AreaDrpChart from './chart';
import config from '../../../../config';
function DrpReal({ style }) { function DrpReal({ style }) {
const [dimension, setDimension] =useState('61614460'); const [dimension, setDimension] =useState('61614460');
const dispatch = useDispatch();
const data = [ const data = [
{ {
"stcd": "61614460", "stcd": "61614460",
@ -150,9 +153,19 @@ function DrpReal({ style }) {
labelId="analysis-select-label" labelId="analysis-select-label"
value={dimension} value={dimension}
label="" label=""
onChange={(event) => { onChange={(event,b) => {
const value = event.target.value; const value = event.target.value;
setDimension(value); setDimension(value);
const record = data.filter(o=>o.stcd===value)[0]
const { lgtd, lttd } = record;
if (lgtd && lttd) {
dispatch.runtime.setFeaturePop({ type: 'RealHDPop', properties: record, coordinates: [lgtd, lttd] });
dispatch.runtime.setCameraTarget({
center: [lgtd, lttd + config.poiPositionOffsetY.hd],
zoom: config.poiPositionZoom.hd,
pitch: config.poiPitch,
});
}
}} }}
// sx={{ // sx={{
// color: '#fff', // color: '#fff',

View File

@ -105,8 +105,8 @@ function HDReal({ style }) {
<div className="table-ellipsis cursor-pointer" onClick={() => flyTo(row)}>{row.stnm}</div> <div className="table-ellipsis cursor-pointer" onClick={() => flyTo(row)}>{row.stnm}</div>
</DpTableCell> </DpTableCell>
<DpTableCell align="right">{renderHDRz(row)}</DpTableCell> <DpTableCell align="right">{renderHDRz(row)}</DpTableCell>
{rzRender(row.rz, row.grz)} {rzRender(row.rz, row.rz+5)}
{rzRender(row.rz, row.wrz)} {rzRender(row.rz, row.rz+5.5)}
</DpTableRow> </DpTableRow>
))} ))}
</TableBody> </TableBody>

View File

@ -111,7 +111,7 @@ function SkReal({ style }) {
<DpTableCell component="th" scope="row"> <DpTableCell component="th" scope="row">
<div className="table-ellipsis cursor-pointer" onClick={() => flyTo(row)}>{row.stnm}</div> <div className="table-ellipsis cursor-pointer" onClick={() => flyTo(row)}>{row.stnm}</div>
</DpTableCell> </DpTableCell>
<DpTableCell align="right">{renderDrp(row, tableSkDrpField)}</DpTableCell> <DpTableCell align="right">{row['h24']}</DpTableCell>
<DpTableCell align="right">{row?.rz}</DpTableCell> <DpTableCell align="right">{row?.rz}</DpTableCell>
<DpTableCell align="right">{renderSkArz(row)}</DpTableCell> <DpTableCell align="right">{renderSkArz(row)}</DpTableCell>
</DpTableRow> </DpTableRow>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,16 +1,205 @@
import React, { useMemo, useState } from 'react'; import React, { useMemo, useState } from 'react';
import { Switch, FormControlLabel,InputLabel, Select, MenuItem,FormControl } from '@material-ui/core/index' import { Switch, FormControlLabel,InputLabel, Select, MenuItem,FormControl } from '@material-ui/core/index'
import PanelBox from '../../components/PanelBox'; import PanelBox from '../../components/PanelBox';
import config from '../../../../config';
import { useDispatch, useSelector } from 'react-redux';
import AreaDrpChart from './chart'; import AreaDrpChart from './chart';
function DrpReal({ style }) { function DrpReal({ style }) {
const [dimension, setDimension] =useState('ft'); const [dimension, setDimension] =useState('61614200');
const dispatch = useDispatch();
const data = [
{
"stcd": "61614200",
"type": "sk",
"hasRz": true,
"stnm": "浮桥河水库",
"adcd": "421181100000",
"wscd": null,
"importancy": 0,
"lgtd": 114.875,
"lttd": 31.166667,
"elev": 0,
"damel": 71.33,
"dsflz": 68.04,
"fsltdz": 64.89,
"ddz": 51.78,
"zcxsw": 64.89,
"drpTm": "2025-06-03T02:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 16.5,
"drpState": 1,
"rz": 60.71,
"w": 162.8,
"a_fsltdz": -4.18,
"rzTm": "2025-06-03T02:00:00.000Z",
"rzWarning": 0,
"rzState": 1,
"aRz": -4.18
},{
"stcd": "61612610",
"type": "sk",
"hasRz": true,
"stnm": "三河口水库",
"adcd": "421181109000",
"wscd": null,
"importancy": 0,
"lgtd": 115.166667,
"lttd": 31.333333,
"elev": 0,
"damel": 156.8,
"dsflz": 154.99,
"fsltdz": 149,
"ddz": 124,
"zcxsw": 149,
"drpTm": "2025-06-03T02:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 12.5,
"drpState": 1,
"rz": 141.45,
"w": 77.8,
"a_fsltdz": -7.550000000000011,
"rzTm": "2025-06-03T01:00:00.000Z",
"rzWarning": 0,
"rzState": 1,
"aRz": -7.55
},{
"stcd": "61613010",
"type": "sk",
"hasRz": true,
"stnm": "明山水库",
"adcd": "421181103000",
"wscd": null,
"importancy": 0,
"lgtd": 115.066667,
"lttd": 31.016667,
"elev": 0,
"damel": 98.7,
"dsflz": 96.07,
"fsltdz": 93,
"ddz": 78.02,
"zcxsw": 93,
"drpTm": "2025-06-03T02:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 12.5,
"drpState": 1,
"rz": 84.43,
"w": 49.5,
"a_fsltdz": -8.569999999999993,
"rzTm": "2025-06-03T02:00:00.000Z",
"rzWarning": 0,
"rzState": 1,
"aRz": -8.57
},{
"stcd": "716113901",
"type": "sk",
"hasRz": true,
"stnm": "铺头坳水库",
"adcd": "421181201000",
"wscd": null,
"importancy": 0,
"lgtd": 115.169444,
"lttd": 31.090278,
"elev": 0,
"damel": 266.7,
"dsflz": 265.54,
"fsltdz": 264.3,
"ddz": 256,
"zcxsw": 264.3,
"drpTm": "2025-04-11T05:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 263.16,
"w": 0.991,
"a_fsltdz": -1.1399999999999864,
"rzTm": "2025-04-11T05:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716113901",
"tm": "2023-03-12T08:02:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716113901/20230312160200.jpg"
},
{
"stcd": "716113901",
"tm": "2023-03-12T07:15:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716113902/20230312151500.jpg"
}
],
"aRz": -1.14
},{
"stcd": "716111701",
"type": "sk",
"hasRz": true,
"stnm": "桐枧冲水库",
"adcd": "421181110000",
"wscd": null,
"importancy": 0,
"lgtd": 115.135278,
"lttd": 31.3925,
"elev": 0,
"damel": 276.56,
"dsflz": 273.66,
"fsltdz": 269.86,
"ddz": 256.76,
"zcxsw": 269.86,
"drpTm": "2025-04-11T05:00:00.000Z",
"today": 0,
"h1": 0,
"h3": 0,
"h6": 0,
"h12": 0,
"h24": 0,
"h48": 0,
"drpState": 2,
"rz": 265.12,
"w": 0.689,
"a_fsltdz": -4.740000000000009,
"rzTm": "2025-04-11T05:00:00.000Z",
"rzWarning": 0,
"rzState": 2,
"pic": [
{
"stcd": "716111701",
"tm": "2023-03-12T07:03:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716111701/20230312150300.jpg"
},
{
"stcd": "716111701",
"tm": "2023-03-12T07:27:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/0312/716111702/20230312152700.jpg"
}
],
"aRz": -4.74
},
]
return ( return (
<PanelBox <PanelBox
style={style} style={style}
title="重要水库预报" title="重要水库预报"
color="green" color="green"
@ -22,27 +211,26 @@ function DrpReal({ style }) {
labelId="analysis-select-label" labelId="analysis-select-label"
value={dimension} value={dimension}
label="" label=""
onChange={(event) => { onChange={(event,b) => {
const value = event.target.value; const value = event.target.value;
setDimension(value); setDimension(value);
const record = data.filter(o=>o.stcd===value)[0]
const { lgtd, lttd } = record;
if (lgtd && lttd) {
dispatch.runtime.setFeaturePop({ type: 'RealSkPop', properties: record, coordinates: [lgtd, lttd] });
dispatch.runtime.setCameraTarget({
center: [lgtd, lttd + config.poiPositionOffsetY.hd],
zoom: config.poiPositionZoom.hd,
pitch: config.poiPitch,
});
}
}} }}
// sx={{
// color: '#fff',
// '.MuiOutlinedInput-notchedOutline': {
// borderColor: 'rgba(255, 255, 255, 0.3)',
// },
// '&:hover .MuiOutlinedInput-notchedOutline': {
// borderColor: 'rgba(255, 255, 255, 0.6)',
// },
// '&.Mui-focused .MuiOutlinedInput-notchedOutline': {
// borderColor: '#fff',
// }
// }}
> >
<MenuItem value="ft">水库1</MenuItem> {
<MenuItem value="lc">水库2</MenuItem> data.map((item)=>
<MenuItem value="mz">水库3</MenuItem> <MenuItem value={item.stcd}>{item.stnm}</MenuItem>
<MenuItem value="sb">水库4</MenuItem> )
}
</Select> </Select>
</div> </div>
</> </>