From 923d4ea2abbb349d0a127e4a8b31c2d79f3e25c1 Mon Sep 17 00:00:00 2001 From: yyhouc <792163605@qq.com> Date: Fri, 9 Jun 2023 17:04:40 +0800 Subject: [PATCH] =?UTF-8?q?1.area=20=E9=80=89=E6=8B=A9=E7=9A=84=E6=97=B6?= =?UTF-8?q?=E5=80=99=E5=8F=AA=E6=9C=89sentinel=E4=B8=8Elandsat=20=E5=90=A6?= =?UTF-8?q?=E5=88=99=E9=80=89=E6=8B=A9=E5=85=B6=E4=BD=99=E7=9A=84=EF=BC=8C?= =?UTF-8?q?2=E5=9C=A8=E5=88=87=E6=8D=A2=E6=88=90=E5=A4=9A=E8=BE=B9?= =?UTF-8?q?=E7=82=B9=E4=BD=8D=E7=9A=84=E6=97=B6=E5=80=99=E4=BE=9D=E7=84=B6?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=9D=90=E6=A0=87=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/searchCondition.vue | 38 +++++++++++++++++-- 1 file changed, 35 insertions(+), 3 deletions(-) diff --git a/src/views/dataService/remoteSensingData/components/searchCondition.vue b/src/views/dataService/remoteSensingData/components/searchCondition.vue index 8d5438d..72e0634 100644 --- a/src/views/dataService/remoteSensingData/components/searchCondition.vue +++ b/src/views/dataService/remoteSensingData/components/searchCondition.vue @@ -201,7 +201,9 @@ const state = reactive({ lon: '', disLat: '', disLon: '', - data: {} + data: {}, + data2:[], + geometry: null, }) //获取所有卫星类型 onMounted(() => { @@ -209,7 +211,17 @@ onMounted(() => { let data = res.map(item=>{ return {value:item.dictValue,label:item.dictValue} }) - state.sensor = data; + state.data2=data; + //初始化加载根据state.switch判断,当时true的时候加载 landsat、Sentinel。否者加载出这两个以外所有内容 + if(state.switch){ + state.sensor=state.data2.filter(item=>{ + return item.value=='landsat'||item.value=='sentinel' + }) + }else{ + state.sensor=state.data2.filter(item=>{ + return item.value!='landsat'&&item.value!='sentinel' + }) + } state.dictData = res; }) }) @@ -282,9 +294,12 @@ const addCoordinate = () => { document.getElementsByClassName('coordinateBtn')[0].innerText = 'Add coordinates'; } }else{ + map.value.mapOperations.drawCreated() + map.value.mapOperations.off("click", onMapClick) map.value.mapOperations.drawPolygon() - map.value.mapOperations.drawCreated() + map.value.mapOperations.wktParseToMap(state.geometry) + } } @@ -400,10 +415,27 @@ watch( }, { immediate: true } ) +//监听state.switch +watch( + () => state.switch, + (newValue, oldValue) => { + if(newValue){ + state.sensor=state.data2.filter(item=>{ + return item.value=='landsat'||item.value=='sentinel' + }) + }else{ + state.sensor=state.data2.filter(item=>{ + return item.value!='landsat'&&item.value!='sentinel' + }) + } + }, + { immediate: true } +) const setData = (row) => { state.data = row; state.selectID = row.disasterId map.value.mapOperations.wktParseToMap(row.geometry) + state.geometry = row.geometry; } defineExpose({ setData