diff --git a/src/views/sponeScreen/projectHM/ProjectEvaluation.vue b/src/views/sponeScreen/projectHM/ProjectEvaluation.vue index 6018b65..663ca11 100644 --- a/src/views/sponeScreen/projectHM/ProjectEvaluation.vue +++ b/src/views/sponeScreen/projectHM/ProjectEvaluation.vue @@ -248,25 +248,28 @@ function historyDataWarn() { rtuWarnConfigList({ startTime: dateRain.value, endTime: dateRain.value }).then(res => { console.log('历史告警数据---', res); + bus.emit('removeMapDatas', ['warning_monitor']); 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.size = 500; 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' }); + bus.emit('setLayerVisible', { layername: 'warning_monitor', isCheck: true }); }, }); + } else { + bus.emit('setLayerVisible', { layername: 'warning_monitor', isCheck: false }); } }); } diff --git a/src/views/sponeScreen/projectHM/ProjectEvaluation.vue b/src/views/sponeScreen/projectHM/ProjectEvaluation.vue index 6018b65..663ca11 100644 --- a/src/views/sponeScreen/projectHM/ProjectEvaluation.vue +++ b/src/views/sponeScreen/projectHM/ProjectEvaluation.vue @@ -248,25 +248,28 @@ function historyDataWarn() { rtuWarnConfigList({ startTime: dateRain.value, endTime: dateRain.value }).then(res => { console.log('历史告警数据---', res); + bus.emit('removeMapDatas', ['warning_monitor']); 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.size = 500; 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' }); + bus.emit('setLayerVisible', { layername: 'warning_monitor', isCheck: true }); }, }); + } else { + 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 54cc55b..d1d45bf 100644 --- a/src/views/sponeScreen/waterFlood/index.vue +++ b/src/views/sponeScreen/waterFlood/index.vue @@ -98,7 +98,7 @@ let warningFeatures = []; datas.forEach(element => { let warningFeature = turf.point(element.lonLat.split(',').map(Number), element); - warningFeature.properties.size = 1000; + warningFeature.properties.size = 500; warningFeature.properties.stName = ''; warningFeatures.push(warningFeature); }); @@ -112,6 +112,8 @@ bus.emit('setLayerVisible', { layername: key, isCheck: true }); }, }); + } else { + bus.emit('setLayerVisible', { layername: key, isCheck: false }); } }); }