diff --git a/src/views/sponeScreen/gisMF/legendKF.vue b/src/views/sponeScreen/gisMF/legendKF.vue index 73dd686..1517821 100644 --- a/src/views/sponeScreen/gisMF/legendKF.vue +++ b/src/views/sponeScreen/gisMF/legendKF.vue @@ -67,17 +67,13 @@ //图例一级标题点击 const changeAllLegend = item => { - // console.log('item---', item); // item.isCheck = !item.isCheck; }; //图例点击 const changeLegend = async item => { item.isCheck = !item.isCheck; - // console.log('item--', item); bus.emit('setLayerVisible', item); - // if (item.layername == 'weather_cloud') { - // return newfiberMap.setLayersVisible([item.layername], item.isCheck); - // } + if (item.layername == 'whiteMap') { legendList.value[0]['children'][0][1].isCheck = false; legendList.value[0]['children'][1][0].isCheck = false; @@ -235,25 +231,10 @@ timeType: 'month', }); let datas = res.data || []; - console.log('datas---', datas); datas.forEach(item => { - item.name = item.stCode + '/' + item.rainCumulative + 'mm'; + item.name = item.stName + '/' + item.rainCumulative + 'mm'; }); - // newfiberMapBoxVectorLayer.addGeojsonSymbol(item.layername, datas, rainStation_icon); - - // res.data.forEach(feature => { - // // 实时降雨量范围不同颜色 小-中-大 - // if (feature.properties.pn05 <= 0.3) { - // feature.properties.fillcolor = 'rgba(41, 184, 219,0.7)'; - // } else if (feature.properties.pn05 > 0.3 && feature.properties.pn05 <= 0.8) { - // feature.properties.fillcolor = 'rgba(255, 237, 82,0.7)'; - // } else if (feature.properties.pn05 > 0.8) { - // feature.properties.fillcolor = 'rgba(255, 69, 69,0.7)'; - // } - // }); - // newfiberMapBoxVectorLayer.addGeojsonPolygon(item.layername + '_area', item.dataArea); - - console.log('雨量站历史数据---', res, localStorage.getItem('setRainDateKF')); + console.log('雨量站历史数据---', datas, localStorage.getItem('setRainDateKF')); } else { // 实时降雨数据 // 渲染文字和降雨量 @@ -300,7 +281,6 @@ }); nextTick(() => { bus.on('setIniteLayer', data => { - // console.log('data---', data); if (!data.length) { let legendList_1 = legendList.value[1]['children'].concat(legendList.value[2]['children']).flat(); legendList_1.forEach(layer => { @@ -308,14 +288,12 @@ changeLegend(layer); }); } else { - //if (legendList.value.length == 0) return; let legendList_1 = legendList.value[0]['children'] .concat(legendList.value[1]['children']) .concat(legendList.value[2]['children']) .flat(); data.forEach(layer => { let selectedLayer = legendList_1.filter(item => item.layername == layer.layername); - // console.log('selectedLayer--', selectedLayer); selectedLayer.forEach(i => { i.isCheck = layer.show; changeLegend(i);