fix(): 修改水库模块

lsf-dev
李神峰 2025-06-20 17:00:34 +08:00
parent c77f0e4773
commit 8f9f1bbdfd
9 changed files with 125 additions and 164 deletions

View File

@ -5,10 +5,12 @@ import apiurl from '../apiurl';
export const BouaPromise = new CachePromise(
() => fetch('./data/boua.geojson').then(res => res.json()).catch(() => null), 0);
// () => fetch('./data/boua.geojson').then(res => res.json()).catch(() => null), 0);
() => fetch(`${process.env.PUBLIC_URL}/data/boua.geojson`).then(res => res.json()).catch(() => null), 0);
export const WataPromise = new CachePromise(
() => fetch('./data/wata.geojson').then(res => res.json()).catch(() => null), 0);
// () => fetch('./data/wata.geojson').then(res => res.json()).catch(() => null), 0);
() => fetch(`${process.env.PUBLIC_URL}/data/wata.geojson`).then(res => res.json()).catch(() => null), 0);
function _watau(level) {
return new CachePromise(

View File

@ -52,24 +52,66 @@ const ScheduleCharts = () => {
// 生成测试数据
useEffect(() => {
const generateData = () => {
const timePoints = [];
const openingData = [];
const inflowData = [];
const outflowData = [];
const levelData = [];
// const timePoints = [];
// const openingData = [];
// const inflowData = [];
// const outflowData = [];
// const levelData = [];
for (let i = 0; i < 96; i++) { // 24小时每15分钟一个点
const time = new Date('2025-05-18');
time.setMinutes(time.getMinutes() + i * 15);
const timeStr = time.toLocaleTimeString('zh-CN', { hour12: false });
timePoints.push(timeStr);
// 模拟数据
openingData.push(i < 32 ? 1.5 : i < 80 ? 2 : 1.2);
inflowData.push(Math.sin(i / 10) * 300 + 400);
outflowData.push(Math.max(0, Math.sin((i - 10) / 10) * 100 + 150));
levelData.push(Math.min(68.04, 40 + Math.sin(i / 30) * 10 + 20));
}
const timePoints = [
"05-28 07:00", "05-28 10:00", "05-28 13:00", "05-28 16:00", "05-28 19:00", "05-28 22:00",
"05-29 01:00", "05-29 04:00", "05-29 07:00", "05-29 10:00", "05-29 13:00", "05-29 16:00", "05-29 19:00", "05-29 22:00",
"05-30 01:00", "05-30 04:00", "05-30 07:00", "05-30 10:00", "05-30 13:00", "05-30 16:00", "05-30 19:00", "05-30 22:00",
"05-31 01:00", "05-31 04:00", "05-31 07:00", "05-31 10:00", "05-31 13:00", "05-31 16:00", "05-31 19:00", "05-31 22:00",
"06-01 01:00", "06-01 04:00", "06-01 07:00", "06-01 10:00", "06-01 13:00", "06-01 16:00", "06-01 19:00", "06-01 22:00",
"06-02 01:00", "06-02 04:00", "06-02 06:00"
];
const openingData = [
0.5, 0.5, 0.5, 0.5, 1.0, 1.0, // 05-28
2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, // 05-29
2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0, // 05-30
2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 1.8, 1.8, // 05-31
1.8, 1.8, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5, // 06-01
1.5, 1.5, 1.5 // 06-02
];
const inflowData = [
100, 150, 200, 250, 350, 450, // 05-28
650, 750, 700, 600, 500, 400, 300, 250, // 05-29
200, 180, 170, 160, 150, 140, 130, 120, // 05-30
110, 100, 100, 100, 100, 100, 100, 100, // 05-31
100, 100, 100, 100, 100, 100, 100, 100, // 06-01
100, 100, 100 // 06-02
];
const outflowData = [
50, 80, 100, 120, 140, 160, // 05-28
180, 190, 200, 200, 200, 190, 180, 170, // 05-29
160, 150, 140, 130, 120, 110, 100, 100, // 05-30
100, 100, 100, 100, 100, 100, 100, 100, // 05-31
100, 100, 100, 100, 100, 100, 100, 100, // 06-01
100, 100, 100 // 06-02
];
const levelData = [
30, 30, 32, 35, 40, 45, // 05-28
50, 55, 60, 65, 68, 68, 68, 68, // 05-29
67, 66, 65, 64, 63, 62, 60, 58, // 05-30
56, 54, 52, 50, 48, 46, 44, 42, // 05-31
40, 38, 36, 35, 34, 33, 32, 32, // 06-01
32, 32, 32 // 06-02
];
// for (let i = 0; i < 96; i++) { // 24小时每15分钟一个点
// const time = new Date('2025-05-18');
// time.setMinutes(time.getMinutes() + i * 15);
// const timeStr = time.toLocaleTimeString('zh-CN', { hour12: false });
// timePoints.push(timeStr);
// // 模拟数据
// openingData.push(i < 32 ? 1.5 : i < 80 ? 2 : 1.2);
// inflowData.push(Math.sin(i / 10) * 300 + 400);
// outflowData.push(Math.max(0, Math.sin((i - 10) / 10) * 100 + 150));
// levelData.push(Math.min(68.04, 40 + Math.sin(i / 30) * 10 + 20));
// }
return { timePoints, openingData, inflowData, outflowData, levelData };
};
@ -89,24 +131,24 @@ const ScheduleCharts = () => {
const handleChartEvents = {
click: (params) => {
if (params.componentType === 'markPoint') {
if (params.seriesIndex === 1) {
setFlowDialogOpen(true);
} else{
setLevelDialogOpen(true);
if (params.componentType === 'markPoint') {
if (params.seriesIndex === 1) {
setFlowDialogOpen(true);
} else {
setLevelDialogOpen(true);
}
}
}
}
};
};
const getOpeningOption = () => ({
grid: { top: 30, right: 20, bottom: 30, left: 50 },
tooltip: { trigger: 'axis' },
legend: {
data: ['开度'],
textStyle: { color: '#fff' },
top: 0
},
legend: {
data: ['开度'],
textStyle: { color: '#fff' },
top: 0
},
xAxis: {
type: 'category',
data: chartData?.timePoints,
@ -126,7 +168,7 @@ const ScheduleCharts = () => {
data: chartData?.openingData?.map(item => item.toFixed(2)),
type: 'line',
smooth: true,
symbol:'none',
symbol: 'none',
lineStyle: { color: '#4a90e2' },
areaStyle: { color: '#4a90e2', opacity: 0.1 },
itemStyle: { color: '#4a90e2' },
@ -136,11 +178,11 @@ const ScheduleCharts = () => {
const getFlowOption = () => ({
grid: { top: 30, right: 20, bottom: 30, left: 50 },
tooltip: { trigger: 'axis' },
legend: {
data: ['入库流量', '出库流量'],
textStyle: { color: '#fff' },
top: 0
},
legend: {
data: ['入库流量', '出库流量'],
textStyle: { color: '#fff' },
top: 0
},
xAxis: {
type: 'category',
data: chartData?.timePoints,
@ -160,7 +202,7 @@ const ScheduleCharts = () => {
name: '入库流量',
data: chartData?.inflowData?.map(item => item.toFixed(2)),
type: 'line',
symbol:'none',
symbol: 'none',
smooth: true,
lineStyle: { color: '#ffd700' },
areaStyle: { color: '#ffd700', opacity: 0.1 },
@ -170,7 +212,7 @@ const ScheduleCharts = () => {
name: '出库流量',
data: chartData?.outflowData?.map(item => item.toFixed(2)),
type: 'line',
symbol:'none',
symbol: 'none',
smooth: true,
lineStyle: { color: '#4a90e2' },
areaStyle: { color: '#4a90e2', opacity: 0.1 },
@ -180,7 +222,8 @@ const ScheduleCharts = () => {
itemStyle: { color: '#4a90e2' },
label: { color: '#fff' },
symbolSize: 40,
onClick: () => { setFlowDialogOpen(true); console.log(1111111111111);
onClick: () => {
setFlowDialogOpen(true); console.log(1111111111111);
},
},
},
@ -191,10 +234,10 @@ const ScheduleCharts = () => {
grid: { top: 30, right: 20, bottom: 30, left: 50 },
tooltip: { trigger: 'axis' },
legend: {
data: ['水位', '校核洪水位'],
textStyle: { color: '#fff' },
top: 0
},
data: ['水位', '校核洪水位'],
textStyle: { color: '#fff' },
top: 0
},
xAxis: {
type: 'category',
data: chartData?.timePoints,
@ -210,10 +253,10 @@ const ScheduleCharts = () => {
splitLine: { lineStyle: { color: '#2a2b2f' } },
},
series: [{
name: '水位',
name: '水位',
data: chartData?.levelData?.map(item => item.toFixed(2)),
type: 'line',
symbol:'none',
symbol: 'none',
smooth: true,
lineStyle: { color: '#4a90e2' },
areaStyle: { color: '#4a90e2', opacity: 0.1 },
@ -238,9 +281,9 @@ const ScheduleCharts = () => {
return (
<div className={classes.root}>
<ReactECharts option={getOpeningOption()} className={classes.chart} style={{height:230}} />
<ReactECharts option={getFlowOption()} className={classes.chart} style={{height:230}} onEvents={handleChartEvents}/>
<ReactECharts option={getLevelOption()} className={classes.chart} style={{height:230}} onEvents={handleChartEvents}/>
<ReactECharts option={getOpeningOption()} className={classes.chart} style={{ height: 230 }} />
<ReactECharts option={getFlowOption()} className={classes.chart} style={{ height: 230 }} onEvents={handleChartEvents} />
<ReactECharts option={getLevelOption()} className={classes.chart} style={{ height: 230 }} onEvents={handleChartEvents} />
<Dialog
open={flowDialogOpen}

View File

@ -14,6 +14,7 @@ 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 moment from 'moment';
function HDStDlg({ record, onClose }) {
const [value, setValue] = React.useState(0);
@ -55,7 +56,7 @@ function HDStDlg({ record, onClose }) {
<div className="table-ellipsis cursor-pointer" >1</div>
</DpTableCell>
<DpTableCell align="center">浮桥河水库</DpTableCell>
<DpTableCell align="center">2025-5-20 10:00:00</DpTableCell>
<DpTableCell align="center">{moment().subtract(2,'day').format('YYYY-MM-DD 10:00:00')}</DpTableCell>
<DpTableCell align="center">GN1</DpTableCell>
<DpTableCell align="center">红色</DpTableCell>
<DpTableCell align="center">-120mm</DpTableCell>

View File

@ -155,8 +155,8 @@ export default function ActionDock({ }) {
))
}
<div className="logo">
<a href="http://www.hbwhdc.cn" target="blank" style={{ color: '#fff', cursor: 'pointer' }}>@湖北纬皓端成科技有限公司</a>
<span style={{ marginRight: '1rem' }}></span>: 15697168180
<a href="http://www.hbwhdc.cn" target="blank" style={{ color: '#fff', cursor: 'pointer' }}>@湖北鲧石物联科技有限公司</a>
<span style={{ marginRight: '1rem' }}></span>: 18672386868
</div>
</div>
)

View File

@ -34,62 +34,12 @@ function HDReal({ style }) {
const tableRzFilter = useSelector(s => s.realview.tableRzFilter);
const hdAutoRefresh = useSelector(s => s.realview.hdAutoRefresh);
const yyRes = useSelector(s => s.runtime.yyObj);
const xiayouxh = useSelector(s => s.runtime.xiayouxh);
const t = useRefresh(hdAutoRefresh ? 60 * 1000 : 0);
// let { data } = useRequest(HDRealPromise.get, t);
const [setting, showSetting] = useState(false);
// const showData = useMemo(() => {
// if (!data) {
// return [];
// }
// let ret = [];
// data.forEach(o => {
// if (!tableRzFilter[o.type]) {
// return;
// }
// o.status = Math.floor(Math.random() * (4 - 0 + 1)) + 0
// o.kd = (Math.random() * 100).toFixed(2);
// o.ll = (Math.random() * 100).toFixed(1);
// ret.push(o);
// });
// return ret;
// }, [data, tableRzFilter]);
const randomMinutes = Math.floor(Math.random() * 60) + 1;
const format = 'YYYY-MM-DD HH:mm';
const showData = [
{
stnm: '尼尔基坝上',
rz: '215.74',
maxF: '7170',
cxTime: '08-17 08时',
ffTime:'08-23 20时'
},
{
stnm: '同盟',
rz: '170.30',
maxF: '10300',
cxTime: '08-20 20时',
ffTime:'08-20 20时'
}
]
const resData = [
{
stnm: '福田河镇',
area:"200",
rz: '215.74',
maxF: '7170',
cxTime: '08-17 08时',
ffTime:'08-23 20时'
},
{
stnm: '顺河镇',
area: '300',
maxF: '10300',
cxTime: '08-20 20时',
ffTime:'08-20 20时'
}
]
const flyTo = (record) => {
const { lgtd, lttd } = record;
if (lgtd && lttd) {
@ -132,7 +82,7 @@ function HDReal({ style }) {
}
>
{
yyRes.yy ? <>
(yyRes.yy || xiayouxh) ? <>
<div className='skyb-box' >
<div className='rain-yb'>
<div className='title-yb'>水库洪水演进</div>

View File

@ -40,58 +40,7 @@ function HDReal({ style }) {
// let { data } = useRequest(HDRealPromise.get, t);
const [setting, showSetting] = useState(false);
// const showData = useMemo(() => {
// if (!data) {
// return [];
// }
// let ret = [];
// data.forEach(o => {
// if (!tableRzFilter[o.type]) {
// return;
// }
// o.status = Math.floor(Math.random() * (4 - 0 + 1)) + 0
// o.kd = (Math.random() * 100).toFixed(2);
// o.ll = (Math.random() * 100).toFixed(1);
// ret.push(o);
// });
// return ret;
// }, [data, tableRzFilter]);
const randomMinutes = Math.floor(Math.random() * 60) + 1;
const format = 'YYYY-MM-DD HH:mm';
const showData = [
{
stnm: '尼尔基坝上',
rz: '215.74',
maxF: '7170',
cxTime: '08-17 08时',
ffTime: '08-23 20时'
},
{
stnm: '同盟',
rz: '170.30',
maxF: '10300',
cxTime: '08-20 20时',
ffTime: '08-20 20时'
}
]
const resData = [
{
stnm: '福田河镇',
area: "200",
rz: '215.74',
maxF: '7170',
cxTime: '08-17 08时',
ffTime: '08-23 20时'
},
{
stnm: '顺河镇',
area: '300',
maxF: '10300',
cxTime: '08-20 20时',
ffTime: '08-20 20时'
}
]
const flyTo = (record) => {
const { lgtd, lttd } = record;
if (lgtd && lttd) {
@ -118,7 +67,7 @@ function HDReal({ style }) {
return (
<PanelBox
style={style}
title="对比分析"
title="方案对比"
color="green"
// tabs={
// <span className="button-group">

View File

@ -50,7 +50,8 @@ function WF() {
const genWeatherContour24H = () => {
dispatch.runtime.setYyfa({ yy: '' })
dispatch.runtime.setXiayouxh(false)
dispatch.runtime.setXiayouxh(false)
dispatch.runtime.setDuibifx([])
dispatch.shyjview.showWeather24h();
const map = window.__mapref
if (map) {
@ -60,7 +61,8 @@ function WF() {
const genWeatherContourRadar = () => {
dispatch.runtime.setYyfa({ yy: '' })
dispatch.runtime.setXiayouxh(false)
dispatch.runtime.setXiayouxh(false)
dispatch.runtime.setDuibifx([])
dispatch.shyjview.showWeatherRadar();
const map = window.__mapref
map.setLayoutProperty('热力图', 'visibility', 'none');

View File

@ -11,7 +11,7 @@ const useStyles = makeStyles({
backgroundColor: 'transparent',
color: '#fff',
borderRadius: 8,
border: '1px solid #2a2b2f',
border: '2px solid #d7d7d7',
cursor: 'pointer',
transition: 'all 0.3s ease',
'&:hover': {
@ -55,13 +55,13 @@ const ScheduleCard = ({ data, selected, onClick }) => {
>
<CardContent style={{padding:"0 10px"}}>
<Typography variant="h8" className={classes.title}>
<span style={{color:"#fff"}}>调度方案-{data.date}</span>
<span style={{color:"#fff",fontSize:18}}>调度方案-{data.date}</span>
{/* <Box component="span" className={classes.editIcon}>
</Box> */}
</Typography>
<div className={classes.content}>
<Typography component="p" style={{fontSize:14}}>
<Typography component="p" style={{fontSize:16}}>
初始水位为{data.initialLevel}m通过开启工作闸门进行提前泄洪开度最大为
{data.maxOpening}m最大下泄流量为{data.maxFlow}/s共持续调控
{data.duration}小时期间最高水位为{data.maxLevel}m未超过校核洪水位
@ -108,12 +108,18 @@ const [compareList, setCompareList] = useState([])
setCompareList([...compareList,findItem])
}
const dispatch = useDispatch();
const num = useSelector(s => s.runtime.duibifxNum)
useEffect(() => {
const redList = Array.from(new Set(compareList.map(item => item.id)))
dispatch.runtime.setDuibifx(redList)
}, [compareList])
useEffect(() => {
if (!num.length) {
setSelectedCard(undefined)
}
}, [num])
return (
<div style={{height:'10rem',overflow:'auto'}}>
{schedules.map((schedule) => (

View File

@ -112,7 +112,7 @@ export default function Warn({ style }) {
setYyValue(true)
dispatch.runtime.setYyfa({ yy: true })
dispatch.runtime.setXiayouxh(true)
closeLayer()
// if (value) {
// }
}
@ -154,10 +154,18 @@ export default function Warn({ style }) {
dispatch.runtime.setDuibifx(selectedSchemes)
}, [selectedSchemes])
const closeLayer = () => {
dispatch.runtime.setLayerSetting({ contour: null, dem: undefined });
dispatch.map.setLayerVisible({ ContourLayer: false });
const map = window.__mapref
map.setLayoutProperty('热力图', 'visibility', 'none');
}
const productFa = () => {
dispatch?.runtime.setInfoDlg({ layerId: 'YuananLayer', properties: {} })
dispatch.runtime.setYyfa({})
dispatch.runtime.setXiayouxh(false)
closeLayer()
}
const changeYY = (e) => {
setValue(e.target.value)