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 1/4] =?UTF-8?q?1.area=20=E9=80=89=E6=8B=A9=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=E5=8F=AA=E6=9C=89sentinel=E4=B8=8Elandsat=20?= =?UTF-8?q?=E5=90=A6=E5=88=99=E9=80=89=E6=8B=A9=E5=85=B6=E4=BD=99=E7=9A=84?= =?UTF-8?q?=EF=BC=8C2=E5=9C=A8=E5=88=87=E6=8D=A2=E6=88=90=E5=A4=9A?= =?UTF-8?q?=E8=BE=B9=E7=82=B9=E4=BD=8D=E7=9A=84=E6=97=B6=E5=80=99=E4=BE=9D?= =?UTF-8?q?=E7=84=B6=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 From 50e43936b3ff9a47da151e453fa78fdb840d9856 Mon Sep 17 00:00:00 2001 From: yyhouc <792163605@qq.com> Date: Fri, 9 Jun 2023 17:19:56 +0800 Subject: [PATCH 2/4] =?UTF-8?q?1.=E6=97=B6=E9=97=B4=E4=B8=8D=E4=BC=9A?= =?UTF-8?q?=E8=A2=AB=E6=B8=85=E9=99=A4=202.=E7=8E=B0=E5=9C=A8=E7=88=AC?= =?UTF-8?q?=E8=99=AB=E5=90=AF=E5=8A=A8=E5=AE=8C=E6=88=90=E5=90=8E=E4=BC=9A?= =?UTF-8?q?=E6=8F=90=E7=A4=BA=20xxx=E7=88=AC=E8=99=AB=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=EF=BC=8C=E6=98=AF=E5=90=A6=E8=BF=94=E5=9B=9E=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/searchCondition.vue | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/views/dataService/remoteSensingData/components/searchCondition.vue b/src/views/dataService/remoteSensingData/components/searchCondition.vue index 72e0634..b78ddf6 100644 --- a/src/views/dataService/remoteSensingData/components/searchCondition.vue +++ b/src/views/dataService/remoteSensingData/components/searchCondition.vue @@ -313,8 +313,8 @@ const clearCoordinate = () => { return; } state.coordinateList = []; - state.startTime = ''; - state.endTime = ''; + // state.startTime = ''; + // state.endTime = ''; state.addCoord = false map.value.mapOperations.deleteRectangle() map.value.mapOperations.off("click", onMapClick) @@ -323,7 +323,6 @@ const clearCoordinate = () => { // 编辑坐标点 const editCoordinate = () => { } - // 开始爬虫 const startCrawl = () => { if (!state.startTime) { @@ -386,10 +385,16 @@ const startCrawl = () => { var typeStr=typeArr.join('、') // getData(); - ElMessage({ - message: 'Successfully launched '+typeStr+' crawler', - type: 'success', - }) + //使用英语询问是否停留在当前页,还是返回到列表页 + ElMessageBox.confirm('The '+typeStr+' data has been crawled, do you want to stay on this page?', 'Prompt', { + confirmButtonText: 'Stay', + cancelButtonText: 'Return to the list', + type: 'warning' + }).then(() => { + }).catch(() => { + emit('response') + }); + }) }) } From 3670a2bdcffd0db0eb1bef8363784251a315c423 Mon Sep 17 00:00:00 2001 From: yyhouc <792163605@qq.com> Date: Fri, 9 Jun 2023 17:55:45 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=88=A0=E9=99=A4=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E5=86=85=E9=83=A8=E5=9B=BD=E9=99=85=E5=8C=96=EF=BC=8C=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E8=B6=85=E6=97=B6=E8=AE=BE=E7=BD=AE=E4=B8=BAnull?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/utils/storage.js | 7 +++---- src/views/dataService/visualData/index.vue | 5 ----- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/utils/storage.js b/src/utils/storage.js index a4ac8bb..4c1c7f8 100644 --- a/src/utils/storage.js +++ b/src/utils/storage.js @@ -57,16 +57,15 @@ export const Session = { window.sessionStorage.setItem(Local.setKey(key), JSON.stringify({data:val,time:curTime})); }, //如果缓存过期则返回null - getEx(key,time = 6*60*1000) { + getEx(key,time = false) { let data = window.sessionStorage.getItem(Local.setKey(key)); let dataObj = JSON.parse(data); //如果dataObj为null,表示该数据从未设置过期时间 if (dataObj == null) { return null; } - if (new Date().getTime() - dataObj.time > time) { - window.sessionStorage.removeItem(Local.setKey(key)); - return null; + if (time) { + return dataObj; } else { return dataObj.data; } diff --git a/src/views/dataService/visualData/index.vue b/src/views/dataService/visualData/index.vue index 9c23717..bb3e5fa 100644 --- a/src/views/dataService/visualData/index.vue +++ b/src/views/dataService/visualData/index.vue @@ -1,6 +1,5 @@