From 8f9f1bbdfd2750e21d88683b6342ef841307d94d Mon Sep 17 00:00:00 2001 From: lishenfeng Date: Fri, 20 Jun 2025 17:00:34 +0800 Subject: [PATCH] =?UTF-8?q?fix():=20=E4=BF=AE=E6=94=B9=E6=B0=B4=E5=BA=93?= =?UTF-8?q?=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/models/_/base.js | 6 +- .../Home/InfoDlg/EditFaDlg/ScheduleCharts.js | 135 ++++++++++++------ src/views/Home/InfoDlg/WyWarnDlg/index.js | 3 +- src/views/Home/components/ActionDock/index.js | 4 +- src/views/Home/panels/Diaodujg/index.js | 56 +------- src/views/Home/panels/Duibifx/index.js | 55 +------ src/views/Home/panels/WeatherForcast/WF.js | 6 +- src/views/Home/panels/Yuanyfa/ddfa.js | 14 +- src/views/Home/panels/Yuanyfa/index.js | 10 +- 9 files changed, 125 insertions(+), 164 deletions(-) diff --git a/src/models/_/base.js b/src/models/_/base.js index c3c044b..3a8c716 100644 --- a/src/models/_/base.js +++ b/src/models/_/base.js @@ -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( diff --git a/src/views/Home/InfoDlg/EditFaDlg/ScheduleCharts.js b/src/views/Home/InfoDlg/EditFaDlg/ScheduleCharts.js index 377a344..9bde37e 100644 --- a/src/views/Home/InfoDlg/EditFaDlg/ScheduleCharts.js +++ b/src/views/Home/InfoDlg/EditFaDlg/ScheduleCharts.js @@ -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 (
- - - + + + 1
浮桥河水库 - 2025-5-20 10:00:00 + {moment().subtract(2,'day').format('YYYY-MM-DD 10:00:00')} GN1 红色 -120mm diff --git a/src/views/Home/components/ActionDock/index.js b/src/views/Home/components/ActionDock/index.js index 5961fe3..93494a8 100644 --- a/src/views/Home/components/ActionDock/index.js +++ b/src/views/Home/components/ActionDock/index.js @@ -155,8 +155,8 @@ export default function ActionDock({ }) { )) }
- @湖北纬皓端成科技有限公司 - 联系电话: 15697168180 + @湖北鲧石物联科技有限公司 + 联系电话: 18672386868
) diff --git a/src/views/Home/panels/Diaodujg/index.js b/src/views/Home/panels/Diaodujg/index.js index cbd08fe..cb3e57a 100644 --- a/src/views/Home/panels/Diaodujg/index.js +++ b/src/views/Home/panels/Diaodujg/index.js @@ -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) ? <>
水库洪水演进
diff --git a/src/views/Home/panels/Duibifx/index.js b/src/views/Home/panels/Duibifx/index.js index 65d405d..55377b2 100644 --- a/src/views/Home/panels/Duibifx/index.js +++ b/src/views/Home/panels/Duibifx/index.js @@ -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 ( diff --git a/src/views/Home/panels/WeatherForcast/WF.js b/src/views/Home/panels/WeatherForcast/WF.js index 5004df2..3f45b66 100644 --- a/src/views/Home/panels/WeatherForcast/WF.js +++ b/src/views/Home/panels/WeatherForcast/WF.js @@ -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'); diff --git a/src/views/Home/panels/Yuanyfa/ddfa.js b/src/views/Home/panels/Yuanyfa/ddfa.js index 7eab408..7b8f260 100644 --- a/src/views/Home/panels/Yuanyfa/ddfa.js +++ b/src/views/Home/panels/Yuanyfa/ddfa.js @@ -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 }) => { > - 调度方案-{data.date} + 调度方案-{data.date} {/* */}
- + 初始水位为{data.initialLevel}m,通过开启工作闸门进行提前泄洪,开度最大为 {data.maxOpening}m,最大下泄流量为{data.maxFlow}m³/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 (
{schedules.map((schedule) => ( diff --git a/src/views/Home/panels/Yuanyfa/index.js b/src/views/Home/panels/Yuanyfa/index.js index 422ecb2..ccc8629 100644 --- a/src/views/Home/panels/Yuanyfa/index.js +++ b/src/views/Home/panels/Yuanyfa/index.js @@ -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)