合并代码

lsf-dev
秦子超 2025-06-11 11:08:39 +08:00
commit 8fafed3199
15 changed files with 171 additions and 142 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 107 KiB

After

Width:  |  Height:  |  Size: 107 KiB

View File

@ -337,9 +337,9 @@
}, },
"白蚁监测": { "白蚁监测": {
"width": 20, "width": 20,
"height": 32, "height": 30,
"x": 74, "x": 74,
"y": 290, "y": 286,
"pixelRatio": 0.5, "pixelRatio": 0.5,
"visible": true "visible": true
}, },

View File

@ -247,13 +247,15 @@ const map = {
RealHDLayer: false, RealHDLayer: false,
RealSkLayer: false, RealSkLayer: false,
RainDrpLayer:true, RainDrpLayer:true,
ShuikuLayer:true, ShuikuLayer:false,
BxSkLayer: true, BxSkLayer: true,
FzdxLayer: false, FzdxLayer: false,
WataLayer: false, WataLayer: false,
AdcdLayer: true, AdcdLayer: true,
RoadLayer: true, RoadLayer: true,
RivlLayer: true, RivlLayer: true,
RealHDLayerQ2: true,
RealSkLayerQ2:true
}; };
Object.keys(DCPJ_TYPES).forEach(key => { Object.keys(DCPJ_TYPES).forEach(key => {
layerVisible['Dcpj_' + key + 'Layer'] = false; layerVisible['Dcpj_' + key + 'Layer'] = false;

View File

@ -56,7 +56,7 @@ function HDStDlg({ record, onClose }) {
<DpTabs value={value} indicatorColor="primary" onChange={(_, v) => setValue(v)}> <DpTabs value={value} indicatorColor="primary" onChange={(_, v) => setValue(v)}>
<DpTab label={record.res_nm+'-'+record.cd_nm} /> <DpTab label={record.res_nm+'-'+record.cd_nm} />
</DpTabs> </DpTabs>
<button className={classes.addButton} onClick={()=>setVisible(true)}>三维展示</button> {/* <button className={classes.addButton} onClick={()=>setVisible(true)}>三维展示</button> */}
<DpCloseButton onClick={onClose} /> <DpCloseButton onClick={onClose} />
</DpAppBar> </DpAppBar>
<div style={{ padding: '2rem', hminHeight: '50rem',maxHeight: '60rem' }}> <div style={{ padding: '2rem', hminHeight: '50rem',maxHeight: '60rem' }}>

View File

@ -200,19 +200,19 @@ function HDChart({ record }) {
{/* <div className={classes.realdrpgrid}> {/* <div className={classes.realdrpgrid}>
<div className="item"> <div className="item">
<Typography variant="caption">水位</Typography> <Typography variant="caption">水位</Typography>
<Typography variant="h5">{renderHDRz(record)}</Typography> <Typography variant="h5" style={{color:"#fff"}}>{renderHDRz(record)}</Typography>
</div> </div>
<div className="item"> <div className="item" >
<Typography variant="caption">设防水位</Typography> <Typography variant="caption">设防水位</Typography>
<Typography variant="h5">{record.sfz || '--'}</Typography> <Typography variant="h5" style={{color:"#fff"}}>{record.sfz || '--'}</Typography>
</div> </div>
<div className="item"> <div className="item">
<Typography variant="caption">警戒水位</Typography> <Typography variant="caption">警戒水位</Typography>
<Typography variant="h5">{record.wrz || '--'}</Typography> <Typography variant="h5" style={{color:"#fff"}}>{record.wrz || '--'}</Typography>
</div> </div>
<div className="item"> <div className="item">
<Typography variant="caption">保证水位</Typography> <Typography variant="caption">保证水位</Typography>
<Typography variant="h5">{record.grz || '--'}</Typography> <Typography variant="h5" style={{color:"#fff"}}>{record.grz || '--'}</Typography>
</div> </div>
</div> */} </div> */}
</div> </div>

View File

@ -46,8 +46,8 @@ const ShapeStyle = {
const page1 = [ const page1 = [
{ {
"res_cd": "42118140035", "res_cd": "42118140035",
"res_lon": 115.14137, "res_lon": 114.875,
"res_lat": 31.55095, "res_lat": 31.166667,
"cd": "01", "cd": "01",
"cd_nm": "GN1", "cd_nm": "GN1",
"stnm": "GN1", "stnm": "GN1",
@ -65,7 +65,7 @@ const page1 = [
"eng_scal": "小1型", "eng_scal": "小1型",
"danger_stat": "非病险水库", "danger_stat": "非病险水库",
"label": "2023高标准", "label": "2023高标准",
"res_nm": "大堰口水库", "res_nm": "浮桥河水库",
"de_value": -11.5381, "de_value": -11.5381,
"dn_value": -11.2248, "dn_value": -11.2248,
"du_value": 113.8833, "du_value": 113.8833,

View File

@ -9,6 +9,7 @@ import ReactEcharts from 'echarts-for-react';
import moment from 'moment' import moment from 'moment'
import rzOption from './rzOption'; import rzOption from './rzOption';
import DpAlert from '../../../../layouts/mui/DpAlert'; import DpAlert from '../../../../layouts/mui/DpAlert';
import { backgroundColor } from 'echarts/lib/theme/dark';
function RzSearch({ record }) { function RzSearch({ record }) {
console.log('r', record); console.log('r', record);
@ -64,7 +65,7 @@ function RzSearch({ record }) {
<DpAlert style={{ width: '100%' }} severity="error">{searchTm.error}</DpAlert> <DpAlert style={{ width: '100%' }} severity="error">{searchTm.error}</DpAlert>
</DpToolComponent> </DpToolComponent>
) : ( ) : (
<DpResultComponent> <DpResultComponent >
<ReactEcharts <ReactEcharts
option={option} option={option}
style={{ height: '100%' }} style={{ height: '100%' }}

View File

@ -1,5 +1,6 @@
import echarts from 'echarts/lib/echarts'; import echarts from 'echarts/lib/echarts';
import { hdyjColor } from '../../../../utils/renutils'; import { hdyjColor } from '../../../../utils/renutils';
import { backgroundColor } from 'echarts/lib/theme/dark';
export default function rzOption({ data, skinfo }) { export default function rzOption({ data, skinfo }) {
const serialData = data.map(obj => [obj.tm, obj.rz || obj.z || 0]); const serialData = data.map(obj => [obj.tm, obj.rz || obj.z || 0]);
@ -19,14 +20,15 @@ export default function rzOption({ data, skinfo }) {
]; ];
} else if (data[0]) { } else if (data[0]) {
const { sfz, wrz, grz } = data[0]; const { sfz, wrz, grz } = data[0];
const recordWrz = wrz||skinfo.wrz;
markLine.data = []; markLine.data = [];
if (sfz) { if (sfz) {
sorted.push(sfz) sorted.push(sfz)
markLine.data.push({ label: { formatter: '设防水位' }, yAxis: sfz, lineStyle: { color: hdyjColor[1] } }); markLine.data.push({ label: { formatter: '设防水位' }, yAxis: sfz, lineStyle: { color: hdyjColor[1] } });
} }
if (wrz) { if (recordWrz) {
sorted.push(wrz) sorted.push(recordWrz)
markLine.data.push({ label: { formatter: '警戒水位' }, yAxis: wrz, lineStyle: { color: hdyjColor[2] } }); markLine.data.push({ label: { formatter: '警戒水位' + `(${recordWrz})` }, yAxis: recordWrz, lineStyle: { color: hdyjColor[2] } });
} }
if (grz) { if (grz) {
sorted.push(grz) sorted.push(grz)
@ -51,9 +53,9 @@ export default function rzOption({ data, skinfo }) {
} }
}, },
grid: { grid: {
x: 24, x: 25,
y: 24, y: 24,
x2: 38, x2: 100,
y2: 42, y2: 42,
borderWidth: 0 borderWidth: 0
}, },

View File

@ -67,7 +67,7 @@ export default function OverallContent({ data, skAll }) {
24小时中共有<span className={classes.number}>1</span> 24小时中共有<span className={classes.number}>1</span>
个站点雨量为<span className={classes.sttype}>大暴雨</span> 个站点雨量为<span className={classes.sttype}>大暴雨</span>
<span className={classes.number}>261mm</span> <span className={classes.number}>261mm</span>
共产生<span className={classes.number}>3</span>21<span className={classes.number}>1</span> 共产生<span className={classes.number}>3</span>21<span className={classes.number}>1</span><span className={classes.number}>1</span>
</div> </div>
{/* <div> {/* <div>

View File

@ -14,12 +14,13 @@ import clsx from 'clsx';
import { renderDrp } from '../../../../utils/renutils'; import { renderDrp } from '../../../../utils/renutils';
const data1 = [ const data1 = [
{ {
"res_cd": "42118140035", "res_cd": "42118140035",
"res_lon": 115.14137, "res_lon": 114.875,
"res_lat": 31.55095, "res_lat": 31.166667,
"cd": "01", "cd": "01",
"cd_nm": "GN1", "cd_nm": "GN1",
"stnm": "GN1",
"res_reg_cd": "42118140006-A4", "res_reg_cd": "42118140006-A4",
"ch": "0+000", "ch": "0+000",
"province_cd": "420000000000", "province_cd": "420000000000",
@ -34,50 +35,17 @@ const data1 = [
"eng_scal": "小1型", "eng_scal": "小1型",
"danger_stat": "非病险水库", "danger_stat": "非病险水库",
"label": "2023高标准", "label": "2023高标准",
"res_nm": "大堰口水库", "res_nm": "浮桥河水库",
"de_value": -4.2885, "de_value": -11.5381,
"dn_value": -13.5384, "dn_value": -11.2248,
"du_value": 132.4892, "du_value": 113.8833,
"de_trend": null, "de_trend": null,
"dn_trend": null, "dn_trend": null,
"du_trend": null, "du_trend": null,
"max_de": 1.0981, "max_de": 2.9303,
"max_dn": -2.3255, "max_dn": -2.1648,
"max_du": 132.4892, "max_du": 113.8833,
"dt": "2025-05-20", "dt": "2025-05-25",
"is_has_data": "y"
},
{
"res_cd": "42118140035",
"res_lon": 115.14137,
"res_lat": 31.55095,
"cd": "03",
"cd_nm": "GN3",
"res_reg_cd": "42118140006-A4",
"ch": "0+000",
"province_cd": "420000000000",
"province_nm": "湖北省",
"city_cd": "421100000000",
"city_nm": "黄冈市",
"county_cd": "421181000000",
"county_nm": "麻城市",
"town_cd": "421181112000",
"town_nm": "福田河镇",
"bas_guid": "鄂东五河片区",
"eng_scal": "小1型",
"danger_stat": "非病险水库",
"label": "2023高标准",
"res_nm": "大堰口水库",
"de_value": -10.73,
"dn_value": -9.8975,
"du_value": 121.3495,
"de_trend": null,
"dn_trend": null,
"du_trend": null,
"max_de": 1.0981,
"max_dn": -2.3255,
"max_du": 132.4892,
"dt": "2025-05-20",
"is_has_data": "y" "is_has_data": "y"
}, },
{ {
@ -640,14 +608,16 @@ function DrpReal({ style }) {
<DpTableRow key={row.stcd}> <DpTableRow key={row.stcd}>
<DpTableCell component="th" scope="row"> <DpTableCell component="th" scope="row">
<div className="table-ellipsis cursor-pointer" onClick={() => { <div className="table-ellipsis cursor-pointer" onClick={() => {
const { res_lon:lgtd, res_lat:lttd } = row; const { res_lon: lgtd, res_lat: lttd,res_nm:stnm } = row;
if (lgtd && lttd) { if (stnm == '浮桥河水库') {
dispatch.runtime.setCameraTarget({ if (lgtd && lttd) {
center: [lgtd, lttd], dispatch.runtime.setCameraTarget({
zoom: 15, center: [lgtd, lttd],
pitch: 60, zoom: 15,
bearing: 0 pitch: 60,
}); bearing: 0
});
}
} }
}}>{row.res_nm}</div> }}>{row.res_nm}</div>
</DpTableCell> </DpTableCell>

View File

@ -204,7 +204,11 @@ export default function Overall({ style }) {
<Button <Button
key={item.value} key={item.value}
className={classes.timeButton} className={classes.timeButton}
onClick={() => setTimeRange(item.value)} onClick={() => {
if (item.value == '1h' || item.value == '3h') {
setTimeRange(item.value)
}
}}
variant={timeRange === item.value ? 'contained' : 'outlined'} variant={timeRange === item.value ? 'contained' : 'outlined'}
style={{ padding: '5px 10px' }} style={{ padding: '5px 10px' }}
> >
@ -255,10 +259,10 @@ export default function Overall({ style }) {
{/* 展开的详细内容可以在这里添加 */}{ {/* 展开的详细内容可以在这里添加 */}{
station.id == 'heavy' && drpData.map(item => ( station.id == 'heavy' && drpData.map(item => (
<TableRow onClick={() =>flyTo(item)}> <TableRow onClick={() =>flyTo(item)}>
<DpTableCell style={{ width: '25%' }}>{item.stnm}</DpTableCell> <DpTableCell style={{ width: '53%' }}>{item.stnm}</DpTableCell>
<DpTableCell style={{ width: '20%' }}>{item.today}</DpTableCell> <DpTableCell style={{ width: '10%' }}>{item.today}</DpTableCell>
<DpTableCell style={{ width: '25%' }}>阎家河镇</DpTableCell> <DpTableCell style={{ width: '20%' }}>阎家河镇</DpTableCell>
<DpTableCell style={{ width: '30%' }}>桃林河</DpTableCell> <DpTableCell style={{ width: '27%' }}>桃林河</DpTableCell>
</TableRow> </TableRow>
)) ))
} }

View File

@ -1,5 +1,6 @@
import React, { useState } from 'react'; import React, { useState,useCallback} from 'react';
import { OverallPromise } from '../../../../models/_/real'; import { OverallPromise } from '../../../../models/_/real';
import { useDispatch, useSelector } from 'react-redux';
import useRequest from '../../../../utils/useRequest'; import useRequest from '../../../../utils/useRequest';
import PanelBox from '../../components/PanelBox'; import PanelBox from '../../components/PanelBox';
import OverallContent from './OverallContent'; import OverallContent from './OverallContent';
@ -22,7 +23,13 @@ import {
import AddIcon from '@material-ui/icons/Add'; import AddIcon from '@material-ui/icons/Add';
import RemoveIcon from '@material-ui/icons/Remove'; import RemoveIcon from '@material-ui/icons/Remove';
import DpTableCell from '../../../../layouts/mui/DpTableCell'; import DpTableCell from '../../../../layouts/mui/DpTableCell';
import useRefresh from '../../../../utils/useRefresh';
import { hdyjUnclose } from '../../../../models/_/hdyj';
import moment from 'moment';
import { HDRealPromise } from '../../../../models/_/real';
import { InfoPopNames } from '../../InfoPops';
import { hdyjLatestClosed } from '../../../../models/_/hdyj';
import config from '../../../../config';
const useStyles = makeStyles((theme) => ({ const useStyles = makeStyles((theme) => ({
root: { root: {
color: '#fff', color: '#fff',
@ -90,7 +97,24 @@ const useStyles = makeStyles((theme) => ({
} }
})); }));
export default function Overall({ style }) { export default function Overall({ style }) {
const dispatch = useDispatch();
const t = useRefresh(60 * 1000);
const hdyj =[{
"stcd": "61612900",
"stnm": "阎家河",
"adcd": null,
"wscd": null,
"importancy": 0,
"lgtd": 115.128722,
"lttd": 31.207,
"elev": null,
"hasRz": true,
"type": "sw",
"tm": "2025-06-03T02:00:00.000Z",
"rz": 61.75,
"state": 1,
wrz:61.6
}]
const classes = useStyles(); const classes = useStyles();
const [types, setTypes] = useState({ const [types, setTypes] = useState({
mountain: true, mountain: true,
@ -109,8 +133,8 @@ export default function Overall({ style }) {
}; };
const stations = [ const stations = [
{ id: 'history', name: '超危险水位', count: 0, type: 'pink' }, { id: 'history', name: '超危险水位', count: 0, type: 'pink',types:'wx' },
{ id: '100year', name: '超警戒水位', count: 0, type: 'purple' }, { id: '100year', name: '超警戒水位', count: 1, type: 'purple',types:'jj' },
]; ];
const toggleExpand = (id) => { const toggleExpand = (id) => {
@ -119,6 +143,19 @@ export default function Overall({ style }) {
[id]: !prev[id] [id]: !prev[id]
})); }));
}; };
const flyTo = useCallback(async ({ stcd, source }) => {
const list = await HDRealPromise.get() || [];
const record = list.find(o => o.stcd === stcd) || {};
const { lgtd, lttd } = record;
if (lgtd && lttd) {
dispatch.runtime.setFeaturePop({ type: InfoPopNames.RealHDPop, properties: {...record,wrz:61.6}, coordinates: [lgtd, lttd] });
dispatch.runtime.setCameraTarget({
center: [lgtd, lttd],
zoom: 15,
pitch: config.poiPitch,
});
}
}, [dispatch]);
return ( return (
<PanelBox <PanelBox
@ -175,13 +212,25 @@ export default function Overall({ style }) {
<DpTableCell colSpan={4} style={{ padding: 0 }}> <DpTableCell colSpan={4} style={{ padding: 0 }}>
<Collapse in={expanded[station.id]} timeout="auto" unmountOnExit> <Collapse in={expanded[station.id]} timeout="auto" unmountOnExit>
<Box className={`${classes.expandedRow} ${station.color}`}> <Box className={`${classes.expandedRow} ${station.color}`}>
{/* 展开的详细内容可以在这里添加 */} {
{/* <TableRow> station.types == 'jj' ? hdyj.map(item => (
<DpTableCell style={{ width: '25%' }}>站名</DpTableCell> <TableRow onClick={() => flyTo(item)}>
<DpTableCell style={{ width: '20%' }}>水位(m)</DpTableCell> <DpTableCell style={{ width: '40%' }}><div
<DpTableCell style={{ width: '25%' }}>所属政区</DpTableCell> className="table-ellipsis cursor-pointer"
<DpTableCell style={{ width: '30%' }}>所属流域</DpTableCell> >{item.stnm}</div></DpTableCell>
</TableRow> */} <DpTableCell style={{ width: '20%' }}><div
className="table-ellipsis cursor-pointer"
>{item.rz}</div></DpTableCell>
<DpTableCell style={{ width: '24%' }}><div
className="table-ellipsis cursor-pointer"
>{item.stnm}</div></DpTableCell>
<DpTableCell style={{ width: '20%' }}>{item.stnm}</DpTableCell>
</TableRow>
))
:
<Typography>暂无详细信息</Typography>
}
</Box> </Box>
</Collapse> </Collapse>
</DpTableCell> </DpTableCell>

View File

@ -105,13 +105,13 @@ export default function Overall({ style }) {
{ {
type: 'immediate', type: 'immediate',
label: '立即转移', label: '立即转移',
count: 3, count: 0,
details: [] // 这里可以添加详细信息的数组 details: [] // 这里可以添加详细信息的数组
}, },
{ {
type: 'prepare', type: 'prepare',
label: '准备转移', label: '准备转移',
count: 0, count: 3,
details: [] // 这里可以添加详细信息的数组 details: [] // 这里可以添加详细信息的数组
} }
]; ];
@ -278,10 +278,8 @@ export default function Overall({ style }) {
<DpTableCell colSpan={3} style={{ padding: 0 }}> <DpTableCell colSpan={3} style={{ padding: 0 }}>
<Collapse in={expanded[row.type]} timeout="auto" unmountOnExit> <Collapse in={expanded[row.type]} timeout="auto" unmountOnExit>
<Box className={classes.expandedContent}> <Box className={classes.expandedContent}>
{/* 这里可以添加展开后显示的详细内容 */}
{/* <Typography>暂无详细信息</Typography> */}
{ {
row.type == 'immediate' ? zyData.map(item => ( row.type == 'prepare' ? zyData.map(item => (
<TableRow onClick={() => flyTo(item)}> <TableRow onClick={() => flyTo(item)}>
<DpTableCell style={{ width: '30%' }}><div <DpTableCell style={{ width: '30%' }}><div
className="table-ellipsis cursor-pointer" className="table-ellipsis cursor-pointer"

View File

@ -130,50 +130,52 @@ export default function Overall({ style }) {
})); }));
}; };
const skData = [{ const skData =[{
"stcd": "716113701", "stcd": "716129061",
"type": "sk", "type": "sk",
"hasRz": true, "hasRz": true,
"stnm": "永红水库", "stnm": "仰天窝水库",
"adcd": "421181105000", "adcd": "421181201000",
"wscd": null, "wscd": null,
"importancy": 0, "importancy": 0,
"lgtd": 115.120278, "lgtd": 115.106667,
"lttd": 31.183611, "lttd": 31.126389,
"elev": 0, "elev": 0,
"damel": 131.99, "damel": 325.08,
"dsflz": 130.56, "dsflz": 324.18,
"fsltdz": 129.9, "fsltdz": 323.5,
"ddz": 113.5, "ddz": 319.5,
"zcxsw": 129.9, "zcxsw": 323.5,
"drpTm": "2025-04-11T06:00:00.000Z", "drpTm": "2025-04-11T05:00:00.000Z",
"today": 0, "today": 0,
"h1": 0, "h1": 0,
"h3": 0, "h3": 0,
"h6": 0, "h6": 0,
"h12": 0, "h12": 0,
"h24": 0, "h24": 0,
"h48": 0, "h48": 0,
"drpState": 2, "drpState": 2,
"rz": 130.15, "rz": 325.16,
"w": 0.444, "w": 0.132,
"a_fsltdz": -10.75, "a_fsltdz": 4.660000000000025,
"rzTm": "2025-04-11T06:00:00.000Z", "rzTm": "2025-04-11T05:00:00.000Z",
"rzWarning": 0, "rzWarning": 1,
"rzState": 2, "rzState": 2,
"pic": [ "pic": [
{ {
"stcd": "716113701", "stcd": "716129061",
"tm": "2023-11-16T11:19:00.000Z", "tm": "2023-03-12T06:05:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/1116/716113701/20231116191900.jpg" "url": "http://223.75.53.106:8891/skjgimages/2023/0312/716129061/20230312140500.jpg"
}, },
{ {
"stcd": "716113701", "stcd": "716129061",
"tm": "2023-11-16T09:05:00.000Z", "tm": "2023-03-12T07:25:00.000Z",
"url": "http://223.75.53.106:8891/skjgimages/2023/1116/716113702/20231116170500.jpg" "url": "http://223.75.53.106:8891/skjgimages/2023/0312/716129062/20230312152500.jpg"
} }
] ],
},] "aRz": 4.66,
"strarz": "4.66"
}];
const flyTo = () => { const flyTo = () => {
const { lgtd, lttd } = skData[0]; const { lgtd, lttd } = skData[0];
if (lgtd && lttd) { if (lgtd && lttd) {
@ -247,11 +249,11 @@ export default function Overall({ style }) {
station.id == "cxx" && <TableRow onClick={() => flyTo()}> station.id == "cxx" && <TableRow onClick={() => flyTo()}>
<DpTableCell style={{ width: '20%' }}><div <DpTableCell style={{ width: '20%' }}><div
className="table-ellipsis cursor-pointer" className="table-ellipsis cursor-pointer"
>永红水库</div></DpTableCell> >仰天窝水库</div></DpTableCell>
<DpTableCell style={{ width: '20%' }}>130.15(0.25)</DpTableCell> <DpTableCell style={{ width: '20%' }}>325.16(1.66)</DpTableCell>
<DpTableCell style={{ width: '20%' }}><div <DpTableCell style={{ width: '20%' }}><div
className="table-ellipsis cursor-pointer" className="table-ellipsis cursor-pointer"
>阎家河</div></DpTableCell> >龟山</div></DpTableCell>
<DpTableCell style={{ width: '20%' }}>阎家河</DpTableCell> <DpTableCell style={{ width: '20%' }}>阎家河</DpTableCell>
<DpTableCell style={{ width: '20%' }}><a <DpTableCell style={{ width: '20%' }}><a
className="table-ellipsis cursor-pointer" className="table-ellipsis cursor-pointer"

View File

@ -88,6 +88,7 @@ function Hdyj({ data }) {
}, [dispatch]); }, [dispatch]);
const showdata = hisdata?.length > 0 ? hisdata : (data || []); const showdata = hisdata?.length > 0 ? hisdata : (data || []);
console.log("showdata",showdata);
return ( return (
<div className="dppanel-shyj"> <div className="dppanel-shyj">