diff --git a/src/views/sponeScreen/gisMF/legendKF.vue b/src/views/sponeScreen/gisMF/legendKF.vue index 1bdb850..2ce595e 100644 --- a/src/views/sponeScreen/gisMF/legendKF.vue +++ b/src/views/sponeScreen/gisMF/legendKF.vue @@ -241,6 +241,7 @@ timeType: 'month', }); let datas = res.data || []; + console.log('datas---', datas); datas.forEach(item => { item.name = item.stCode + '/' + item.rainCumulative + 'mm'; }); diff --git a/src/views/sponeScreen/gisMF/legendKF.vue b/src/views/sponeScreen/gisMF/legendKF.vue index 1bdb850..2ce595e 100644 --- a/src/views/sponeScreen/gisMF/legendKF.vue +++ b/src/views/sponeScreen/gisMF/legendKF.vue @@ -241,6 +241,7 @@ timeType: 'month', }); let datas = res.data || []; + console.log('datas---', datas); datas.forEach(item => { item.name = item.stCode + '/' + item.rainCumulative + 'mm'; }); diff --git a/src/views/sponeScreen/projectHM/ProjectEvaluation.vue b/src/views/sponeScreen/projectHM/ProjectEvaluation.vue index a93bd74..fd805fc 100644 --- a/src/views/sponeScreen/projectHM/ProjectEvaluation.vue +++ b/src/views/sponeScreen/projectHM/ProjectEvaluation.vue @@ -92,7 +92,7 @@ import WaterAnalysis_icon from '@/assets/newImgs/HMScreen/WaterAnalysis_icon.png'; import { graphicReport } from '@/api/dataAnalysis/syntherticData'; import { listrtuSiteInfo } from '@/api/dataAnalysis/rtuSiteInfo'; - +import { rtuWarnConfigList } from '@/api/dataAnalysis/historyGj.js'; const areaList = ref([ { name: '古城片区', value: '0', lonlat: [114.35, 34.802] }, { name: '城东南片区', value: '1', lonlat: [114.37, 34.792] }, @@ -239,6 +239,7 @@ // 典型项目点击 function changeProject(val) { bus.emit('checkProjectFX', { project: XmList.value[val] }); + bus.emit('setLayerVisible', { layername: 'warning_monitor', isCheck: true }); // 渲染点位上图 bus.emit('setIniteLayer', [ { @@ -266,12 +267,38 @@ pitch: 30, }); } - +// 历史某一天报警 +function historyDataWarn() { + rtuWarnConfigList({ startTime: dateRain.value, endTime: dateRain.value }).then(res => { + console.log('历史告警数据---', res); + let datas = res.data || []; + if (datas.length > 0) { + // 渲染报警图层 + let warningFeatures = []; + datas.forEach(element => { + let warningFeature = turf.point(element.lonLat.split(',').map(Number), element); + warningFeature.properties.size = 1000; + warningFeature.properties.stName = ''; + warningFeatures.push(warningFeature); + }); + let warningGeojson = turf.featureCollection(warningFeatures); + bus.emit('removeMapDatas', ['warning_monitor']); + let key = 'warning_monitor'; + bus.emit('getGeojsonByType', { + type: key, + callback: geojson => { + if (!!!geojson.features.length) bus.emit('setGeoJSON', { json: warningGeojson, key: 'warning_monitor' }); + }, + }); + } + }); +} onMounted(() => { hmssVal.value = hmssList.value[0].value; //默认第一个监测点 getJSDList(); //获取积水点数据 bus.on('changeRainDate', val => { dateRain.value = val; + historyDataWarn(); changeHmss(); //海绵设施数据加载 changeJSD(); //积水点数据加载 }); diff --git a/src/views/sponeScreen/gisMF/legendKF.vue b/src/views/sponeScreen/gisMF/legendKF.vue index 1bdb850..2ce595e 100644 --- a/src/views/sponeScreen/gisMF/legendKF.vue +++ b/src/views/sponeScreen/gisMF/legendKF.vue @@ -241,6 +241,7 @@ timeType: 'month', }); let datas = res.data || []; + console.log('datas---', datas); datas.forEach(item => { item.name = item.stCode + '/' + item.rainCumulative + 'mm'; }); diff --git a/src/views/sponeScreen/projectHM/ProjectEvaluation.vue b/src/views/sponeScreen/projectHM/ProjectEvaluation.vue index a93bd74..fd805fc 100644 --- a/src/views/sponeScreen/projectHM/ProjectEvaluation.vue +++ b/src/views/sponeScreen/projectHM/ProjectEvaluation.vue @@ -92,7 +92,7 @@ import WaterAnalysis_icon from '@/assets/newImgs/HMScreen/WaterAnalysis_icon.png'; import { graphicReport } from '@/api/dataAnalysis/syntherticData'; import { listrtuSiteInfo } from '@/api/dataAnalysis/rtuSiteInfo'; - +import { rtuWarnConfigList } from '@/api/dataAnalysis/historyGj.js'; const areaList = ref([ { name: '古城片区', value: '0', lonlat: [114.35, 34.802] }, { name: '城东南片区', value: '1', lonlat: [114.37, 34.792] }, @@ -239,6 +239,7 @@ // 典型项目点击 function changeProject(val) { bus.emit('checkProjectFX', { project: XmList.value[val] }); + bus.emit('setLayerVisible', { layername: 'warning_monitor', isCheck: true }); // 渲染点位上图 bus.emit('setIniteLayer', [ { @@ -266,12 +267,38 @@ pitch: 30, }); } - +// 历史某一天报警 +function historyDataWarn() { + rtuWarnConfigList({ startTime: dateRain.value, endTime: dateRain.value }).then(res => { + console.log('历史告警数据---', res); + let datas = res.data || []; + if (datas.length > 0) { + // 渲染报警图层 + let warningFeatures = []; + datas.forEach(element => { + let warningFeature = turf.point(element.lonLat.split(',').map(Number), element); + warningFeature.properties.size = 1000; + warningFeature.properties.stName = ''; + warningFeatures.push(warningFeature); + }); + let warningGeojson = turf.featureCollection(warningFeatures); + bus.emit('removeMapDatas', ['warning_monitor']); + let key = 'warning_monitor'; + bus.emit('getGeojsonByType', { + type: key, + callback: geojson => { + if (!!!geojson.features.length) bus.emit('setGeoJSON', { json: warningGeojson, key: 'warning_monitor' }); + }, + }); + } + }); +} onMounted(() => { hmssVal.value = hmssList.value[0].value; //默认第一个监测点 getJSDList(); //获取积水点数据 bus.on('changeRainDate', val => { dateRain.value = val; + historyDataWarn(); changeHmss(); //海绵设施数据加载 changeJSD(); //积水点数据加载 }); diff --git a/src/views/sponeScreen/projectHM/index.vue b/src/views/sponeScreen/projectHM/index.vue index 188095e..9adb1fe 100644 --- a/src/views/sponeScreen/projectHM/index.vue +++ b/src/views/sponeScreen/projectHM/index.vue @@ -32,7 +32,7 @@ import qipao from '@/views/sponeScreen/projectHM/gongchenkanbani_comp/qipao.vue'; import bus from '@/bus/index'; import PipeDetail from '@/views/sponeScreen/waterFlood/pipeDetail.vue'; //管网监测点详情 -import { rtuWarnConfigList } from '@/api/dataAnalysis/historyGj.js'; + const { proxy } = getCurrentInstance(); const showPanel = ref(true); //面板展开收起 @@ -72,48 +72,17 @@ }); } -// 历史某一天报警 -function historyDataWarn() { - rtuWarnConfigList({ startTime: localStorage.getItem('setRainDateKF'), endTime: localStorage.getItem('setRainDateKF') }).then(res => { - console.log('历史告警数据---', res); - let datas = res.data || []; - if (datas.length > 0) { - // 渲染报警图层 - console.log('datas---', datas); - let warningFeatures = []; - datas.forEach(element => { - let warningFeature = turf.point(element.lonLat.split(',').map(Number), element); - warningFeature.properties.size = 1000; - warningFeature.properties.stName = ''; - warningFeatures.push(warningFeature); - }); - let warningGeojson = turf.featureCollection(warningFeatures); - let key = 'warning_monitor'; - bus.emit('getGeojsonByType', { - type: key, - callback: geojson => { - if (!!!geojson.features.length) bus.emit('setGeoJSON', { json: warningGeojson, key: 'warning_monitor' }); - bus.emit('setLayerVisible', { layername: key, isCheck: true }); - }, - }); - } - }); -} - onMounted(() => { // 管网监测点 bus.on('pipeMonitorBus', params => { pipeParams.value = params; showPipe.value = true; }); - - // 实时报警 - nextTick(() => { - historyDataWarn(); - }); }); onBeforeUnmount(() => { bus.off('pipeMonitorBus'); + bus.emit('removeMapDatas', ['warning_monitor']); + bus.emit('setLayerVisible', { layername: 'warning_monitor', isCheck: false }); }); diff --git a/src/views/sponeScreen/gisMF/legendKF.vue b/src/views/sponeScreen/gisMF/legendKF.vue index 1bdb850..2ce595e 100644 --- a/src/views/sponeScreen/gisMF/legendKF.vue +++ b/src/views/sponeScreen/gisMF/legendKF.vue @@ -241,6 +241,7 @@ timeType: 'month', }); let datas = res.data || []; + console.log('datas---', datas); datas.forEach(item => { item.name = item.stCode + '/' + item.rainCumulative + 'mm'; }); diff --git a/src/views/sponeScreen/projectHM/ProjectEvaluation.vue b/src/views/sponeScreen/projectHM/ProjectEvaluation.vue index a93bd74..fd805fc 100644 --- a/src/views/sponeScreen/projectHM/ProjectEvaluation.vue +++ b/src/views/sponeScreen/projectHM/ProjectEvaluation.vue @@ -92,7 +92,7 @@ import WaterAnalysis_icon from '@/assets/newImgs/HMScreen/WaterAnalysis_icon.png'; import { graphicReport } from '@/api/dataAnalysis/syntherticData'; import { listrtuSiteInfo } from '@/api/dataAnalysis/rtuSiteInfo'; - +import { rtuWarnConfigList } from '@/api/dataAnalysis/historyGj.js'; const areaList = ref([ { name: '古城片区', value: '0', lonlat: [114.35, 34.802] }, { name: '城东南片区', value: '1', lonlat: [114.37, 34.792] }, @@ -239,6 +239,7 @@ // 典型项目点击 function changeProject(val) { bus.emit('checkProjectFX', { project: XmList.value[val] }); + bus.emit('setLayerVisible', { layername: 'warning_monitor', isCheck: true }); // 渲染点位上图 bus.emit('setIniteLayer', [ { @@ -266,12 +267,38 @@ pitch: 30, }); } - +// 历史某一天报警 +function historyDataWarn() { + rtuWarnConfigList({ startTime: dateRain.value, endTime: dateRain.value }).then(res => { + console.log('历史告警数据---', res); + let datas = res.data || []; + if (datas.length > 0) { + // 渲染报警图层 + let warningFeatures = []; + datas.forEach(element => { + let warningFeature = turf.point(element.lonLat.split(',').map(Number), element); + warningFeature.properties.size = 1000; + warningFeature.properties.stName = ''; + warningFeatures.push(warningFeature); + }); + let warningGeojson = turf.featureCollection(warningFeatures); + bus.emit('removeMapDatas', ['warning_monitor']); + let key = 'warning_monitor'; + bus.emit('getGeojsonByType', { + type: key, + callback: geojson => { + if (!!!geojson.features.length) bus.emit('setGeoJSON', { json: warningGeojson, key: 'warning_monitor' }); + }, + }); + } + }); +} onMounted(() => { hmssVal.value = hmssList.value[0].value; //默认第一个监测点 getJSDList(); //获取积水点数据 bus.on('changeRainDate', val => { dateRain.value = val; + historyDataWarn(); changeHmss(); //海绵设施数据加载 changeJSD(); //积水点数据加载 }); diff --git a/src/views/sponeScreen/projectHM/index.vue b/src/views/sponeScreen/projectHM/index.vue index 188095e..9adb1fe 100644 --- a/src/views/sponeScreen/projectHM/index.vue +++ b/src/views/sponeScreen/projectHM/index.vue @@ -32,7 +32,7 @@ import qipao from '@/views/sponeScreen/projectHM/gongchenkanbani_comp/qipao.vue'; import bus from '@/bus/index'; import PipeDetail from '@/views/sponeScreen/waterFlood/pipeDetail.vue'; //管网监测点详情 -import { rtuWarnConfigList } from '@/api/dataAnalysis/historyGj.js'; + const { proxy } = getCurrentInstance(); const showPanel = ref(true); //面板展开收起 @@ -72,48 +72,17 @@ }); } -// 历史某一天报警 -function historyDataWarn() { - rtuWarnConfigList({ startTime: localStorage.getItem('setRainDateKF'), endTime: localStorage.getItem('setRainDateKF') }).then(res => { - console.log('历史告警数据---', res); - let datas = res.data || []; - if (datas.length > 0) { - // 渲染报警图层 - console.log('datas---', datas); - let warningFeatures = []; - datas.forEach(element => { - let warningFeature = turf.point(element.lonLat.split(',').map(Number), element); - warningFeature.properties.size = 1000; - warningFeature.properties.stName = ''; - warningFeatures.push(warningFeature); - }); - let warningGeojson = turf.featureCollection(warningFeatures); - let key = 'warning_monitor'; - bus.emit('getGeojsonByType', { - type: key, - callback: geojson => { - if (!!!geojson.features.length) bus.emit('setGeoJSON', { json: warningGeojson, key: 'warning_monitor' }); - bus.emit('setLayerVisible', { layername: key, isCheck: true }); - }, - }); - } - }); -} - onMounted(() => { // 管网监测点 bus.on('pipeMonitorBus', params => { pipeParams.value = params; showPipe.value = true; }); - - // 实时报警 - nextTick(() => { - historyDataWarn(); - }); }); onBeforeUnmount(() => { bus.off('pipeMonitorBus'); + bus.emit('removeMapDatas', ['warning_monitor']); + bus.emit('setLayerVisible', { layername: 'warning_monitor', isCheck: false }); }); diff --git a/src/views/sponeScreen/waterFlood/index.vue b/src/views/sponeScreen/waterFlood/index.vue index 0016a84..98f6ce4 100644 --- a/src/views/sponeScreen/waterFlood/index.vue +++ b/src/views/sponeScreen/waterFlood/index.vue @@ -73,7 +73,7 @@ const wscObj = ref({}); const wscTitle = ref('污水处理厂'); const pipeParams = ref({}); - +const warnTimer = ref(null); // 面板内容展开收起控制 const props = defineProps({ showPanel: { @@ -95,7 +95,6 @@ let datas = res.data || []; if (datas.length > 0) { // 渲染报警图层 - console.log('datas-----', datas); let warningFeatures = []; datas.forEach(element => { let warningFeature = turf.point(element.lonLat.split(',').map(Number), element); @@ -104,6 +103,7 @@ warningFeatures.push(warningFeature); }); let warningGeojson = turf.featureCollection(warningFeatures); + bus.emit('removeMapDatas', ['warning_monitor']); let key = 'warning_monitor'; bus.emit('getGeojsonByType', { type: key, @@ -211,11 +211,17 @@ }, 1200); // 实时报警 realDataWarn(); + warnTimer.value = setInterval(() => { + realDataWarn(); + }, 300000); }); onBeforeUnmount(() => { bus.off('checkBZGYT'); bus.off('checkWSCGYT'); bus.off('pipeMonitorBus'); + clearInterval(warnTimer.value); + bus.emit('setLayerVisible', { layername: 'warning_monitor', isCheck: false }); + bus.emit('removeMapDatas', ['warning_monitor']); if (!newfiberMapbox) return; newfiberMapbox.removeLayer(newfiberMapbox.getLayerByName('waterFlow')); if (newfiberMapbox.map.hasImage('materialFeatures')) {