diff --git a/src/api/remoteSensingSourceData/remoteSensingSourceData.js b/src/api/remoteSensingSourceData/remoteSensingSourceData.js index 8ca21bc..fee2a17 100644 --- a/src/api/remoteSensingSourceData/remoteSensingSourceData.js +++ b/src/api/remoteSensingSourceData/remoteSensingSourceData.js @@ -41,7 +41,7 @@ export const approval = (data) => { export const importTemplate = (data) => { return request({ url: '/api/' + moduleName + '/ui/remoteSensing/importTemplate', - headers:{'Content-Type': 'multipart/form-data'}, + headers: { 'Content-Type': 'multipart/form-data' }, method: 'post', data: data }); @@ -49,15 +49,17 @@ export const importTemplate = (data) => { export const removeList = (ids) => { return request({ url: '/api/' + moduleName + '/ui/remoteSensing/remove', - method: 'delte', - data: ids, + method: 'get', + params:{ + ids + } }); } export const importTemplateImgList = (data) => { return request({ url: '/api/' + moduleName + '/ui/remoteSensing/importTemplateImgList', - headers:{'Content-Type': 'multipart/form-data'}, + headers: { 'Content-Type': 'multipart/form-data' }, method: 'post', data: data }); 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/remoteSensingData/components/retrievalCondition.vue b/src/views/dataService/remoteSensingData/components/retrievalCondition.vue index e88f27e..ecb0628 100644 --- a/src/views/dataService/remoteSensingData/components/retrievalCondition.vue +++ b/src/views/dataService/remoteSensingData/components/retrievalCondition.vue @@ -151,7 +151,7 @@ const removeThis = ()=>{ type: 'warning', }).then(() => { //删除数据 - removeList(ids,(state.searchName=='1'?"News":null)).then((res) => { + removeList(ids.join(','),(state.searchName=='1'?"News":null)).then((res) => { ElMessage.success("Delete successfully"); getTableData(); }); @@ -397,6 +397,7 @@ const searchRemoteSensingSourceData = () => { // 根据检索条件检索遥感元数据 const getDataByCondition = (current, size, dataNew) => { + dataNew.beforeOrAfter = 3; getRemoteSensingSourceDataByCondition(current, size, JSON.stringify(dataNew)).then( (res) => { state.requestData = res.records; @@ -496,8 +497,8 @@ const onHandleDisasterCurrentChange = (val) => { // 遥感元数据表size改变 const onHandleSizeChange = (val) => { - state.tableData.param.pageSize = val; - state.tableData.param.pageNum = state.tableData.param.pageNum; + state.tableData.param.pageNum = val; + state.tableData.param.pageSize = state.tableData.param.pageSize; let dataNew = {}; if (state.satelliteCodeList.length != 0) { dataNew = { @@ -527,7 +528,6 @@ const onHandleSizeChange = (val) => { // 遥感元数据表current改变 const onHandleCurrentChange = (val) => { - state.tableData.param.pageSize = state.tableData.param.pageSize; state.tableData.param.pageNum = val; let dataNew = {}; if (state.satelliteCodeList.length != 0) { diff --git a/src/views/dataService/remoteSensingData/components/searchCondition.vue b/src/views/dataService/remoteSensingData/components/searchCondition.vue index 8d5438d..b78ddf6 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) + } } @@ -298,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) @@ -308,7 +323,6 @@ const clearCoordinate = () => { // 编辑坐标点 const editCoordinate = () => { } - // 开始爬虫 const startCrawl = () => { if (!state.startTime) { @@ -371,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') + }); + }) }) } @@ -400,10 +420,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 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 @@