|
|
|
@ -29,7 +29,8 @@
|
|
|
|
|
</template>
|
|
|
|
|
<template v-if="column.key === 'accessUrl'">
|
|
|
|
|
<a-image
|
|
|
|
|
:src="getUrl(record.accessUrl, record.layerName)"
|
|
|
|
|
:src="'/geoserver/group/' + record.layerName + '.png'"
|
|
|
|
|
:fallback="getUrl(record.accessUrl, record.layerName)"
|
|
|
|
|
:style="{ marginRight: '10px' }"
|
|
|
|
|
:width="100"
|
|
|
|
|
:height="100"
|
|
|
|
@ -69,6 +70,23 @@
|
|
|
|
|
>
|
|
|
|
|
<FailYingxiang :failYingxiangData="failYingxiangData" />
|
|
|
|
|
</a-modal>
|
|
|
|
|
|
|
|
|
|
<a-modal
|
|
|
|
|
title="选择更新的影像"
|
|
|
|
|
style="top: 50px"
|
|
|
|
|
:open="chooseUpdateOpen"
|
|
|
|
|
:maskClosable="false"
|
|
|
|
|
:width="600"
|
|
|
|
|
:footer="null"
|
|
|
|
|
@cancel="chooseUpdateClose"
|
|
|
|
|
>
|
|
|
|
|
<ChooseUpdate
|
|
|
|
|
ref="chooseUpdateRef"
|
|
|
|
|
:chooseUpdateData_yearweeks="chooseUpdateData_yearweeks"
|
|
|
|
|
:chooseUpdateData_layernames="chooseUpdateData_layernames"
|
|
|
|
|
@generateThumbnail="generateThumbnail"
|
|
|
|
|
/>
|
|
|
|
|
</a-modal>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
@ -82,9 +100,10 @@
|
|
|
|
|
import dayjs from 'dayjs';
|
|
|
|
|
import { getAppEnvConfig } from '@/utils/env';
|
|
|
|
|
import { BasicTable, useTable } from '@/components/Table';
|
|
|
|
|
import { columns, searchFormSchema } from './util';
|
|
|
|
|
import { columns, searchFormSchema, data } from './util';
|
|
|
|
|
import MapComponent from '@/views/demo/system/geoservermanagement/clound/mapComponent.vue';
|
|
|
|
|
import FailYingxiang from './failYingxiang.vue';
|
|
|
|
|
import ChooseUpdate from './chooseUpdate.vue';
|
|
|
|
|
// api
|
|
|
|
|
import {
|
|
|
|
|
GeoTiffManagerUpdateGeoTiff,
|
|
|
|
@ -93,6 +112,7 @@
|
|
|
|
|
GeoTiffManagerDeleteTifStore,
|
|
|
|
|
GeoTiffManagerUpdateLayerGroupThumb,
|
|
|
|
|
} from '@/api/demo/system';
|
|
|
|
|
import { RecordList } from '../../geoservermanagement/page';
|
|
|
|
|
|
|
|
|
|
// 图片路径拼接
|
|
|
|
|
const { VITE_GLOB_API_URL } = getAppEnvConfig();
|
|
|
|
@ -144,7 +164,6 @@
|
|
|
|
|
reload();
|
|
|
|
|
} else {
|
|
|
|
|
failYingxiangData.value = getFailYingxiangData(res);
|
|
|
|
|
// console.log(failYingxiangData.value);
|
|
|
|
|
failOpen.value = true;
|
|
|
|
|
reload();
|
|
|
|
|
}
|
|
|
|
@ -219,46 +238,101 @@
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 在本地路径生成缩略图-------------------------------------------------------------------------------
|
|
|
|
|
// 选择生成缩略图的影像ref、open、数据
|
|
|
|
|
const chooseUpdateRef = ref();
|
|
|
|
|
const chooseUpdateOpen = ref(false);
|
|
|
|
|
const chooseUpdateData_yearweeks: any = ref([]);
|
|
|
|
|
const chooseUpdateData_layernames: any = ref([]);
|
|
|
|
|
// 选择更新的周数影像弹窗关闭
|
|
|
|
|
function chooseUpdateClose() {
|
|
|
|
|
chooseUpdateOpen.value = false;
|
|
|
|
|
chooseUpdateRef.value.clearSelect_layernames();
|
|
|
|
|
chooseUpdateRef.value.clearSelect_yearweeks();
|
|
|
|
|
}
|
|
|
|
|
// 在本地路径生成缩略图
|
|
|
|
|
async function updateYearWeekThumbnail() {
|
|
|
|
|
GeoTiffManagerLoadPage({
|
|
|
|
|
page: 1,
|
|
|
|
|
limit: 1000000,
|
|
|
|
|
}).then((res) => {
|
|
|
|
|
// 按照时间分类
|
|
|
|
|
let uniqueKeysArray = [...new Set(res.items.map((item) => item.dateDir))];
|
|
|
|
|
// 转换时间数组(年份-周数)
|
|
|
|
|
uniqueKeysArray = [...new Set(uniqueKeysArray.map(convertToYearWeek))];
|
|
|
|
|
// 生成对应年份-周数的缩略图
|
|
|
|
|
let layerNames: any = '';
|
|
|
|
|
uniqueKeysArray.forEach((item, index) => {
|
|
|
|
|
if (index == 0) {
|
|
|
|
|
layerNames = item;
|
|
|
|
|
} else {
|
|
|
|
|
layerNames = layerNames.concat(',' + item);
|
|
|
|
|
}
|
|
|
|
|
// allDataForClearMap = data;
|
|
|
|
|
// 按照时间分类
|
|
|
|
|
allDataForClearMap = allDataForClearMap.sort((a, b) => dayjs(b.dateDir) - dayjs(a.dateDir));
|
|
|
|
|
let uniqueKeysArray = [...new Set(allDataForClearMap.map((item) => item.dateDir))];
|
|
|
|
|
// 转换时间数组(年份-周数)
|
|
|
|
|
uniqueKeysArray = [...new Set(uniqueKeysArray.map(convertToYearWeek))];
|
|
|
|
|
// 生成对应年份-周数的缩略图
|
|
|
|
|
chooseUpdateData_yearweeks.value = [];
|
|
|
|
|
uniqueKeysArray.forEach((item, index) => {
|
|
|
|
|
chooseUpdateData_yearweeks.value.push({
|
|
|
|
|
rowname: item,
|
|
|
|
|
});
|
|
|
|
|
// 更换全部缩略图
|
|
|
|
|
// res.items.forEach((item, index) => {
|
|
|
|
|
// if (layerNames === '') {
|
|
|
|
|
// layerNames = item.layerName;
|
|
|
|
|
// } else {
|
|
|
|
|
// layerNames = layerNames.concat(',' + item.layerName);
|
|
|
|
|
// }
|
|
|
|
|
// });
|
|
|
|
|
// 生成缩略图
|
|
|
|
|
generateThumbnail(layerNames);
|
|
|
|
|
});
|
|
|
|
|
// 影像名称更换全部影像的缩略图
|
|
|
|
|
chooseUpdateData_layernames.value = [];
|
|
|
|
|
allDataForClearMap.forEach((item, index) => {
|
|
|
|
|
chooseUpdateData_layernames.value.push({
|
|
|
|
|
rowname: item.layerName,
|
|
|
|
|
bbox: getBboxFromUrl(item.accessUrl),
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
chooseUpdateOpen.value = true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 生成缩略图
|
|
|
|
|
async function generateThumbnail(layerNames) {
|
|
|
|
|
GeoTiffManagerUpdateLayerGroupThumb({ layerGroups: layerNames }).then((res) => {
|
|
|
|
|
if (res) {
|
|
|
|
|
createMessage.success('生成新的缩略图成功!');
|
|
|
|
|
} else {
|
|
|
|
|
createMessage.error('生成新的缩略图失败!');
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
async function generateThumbnail(layerNames, bbox, length, num) {
|
|
|
|
|
if (bbox) {
|
|
|
|
|
GeoTiffManagerUpdateLayerGroupThumb({
|
|
|
|
|
layerGroups: layerNames,
|
|
|
|
|
bbox: bbox,
|
|
|
|
|
num: 1,
|
|
|
|
|
width: 1024,
|
|
|
|
|
height: 1024,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res && length == num) {
|
|
|
|
|
createMessage.success('生成新的缩略图成功!');
|
|
|
|
|
chooseUpdateRef.value.clearSelect_layernames();
|
|
|
|
|
chooseUpdateRef.value.loading_layernames = false;
|
|
|
|
|
} else if (length == num) {
|
|
|
|
|
createMessage.error('生成新的缩略图失败!');
|
|
|
|
|
chooseUpdateRef.value.loading_layernames = false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
if (length == num) {
|
|
|
|
|
createMessage.error('生成新的缩略图失败!');
|
|
|
|
|
chooseUpdateRef.value.loading_layernames = false;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
// 分割的生成缩略图
|
|
|
|
|
GeoTiffManagerUpdateLayerGroupThumb({
|
|
|
|
|
layerGroups: layerNames,
|
|
|
|
|
bbox: null,
|
|
|
|
|
num: 5,
|
|
|
|
|
width: 4096,
|
|
|
|
|
height: 4096,
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
if (res) {
|
|
|
|
|
createMessage.success('生成新的缩略图成功!');
|
|
|
|
|
chooseUpdateRef.value.loading_yearweeks = false;
|
|
|
|
|
chooseUpdateRef.value.clearSelect_yearweeks();
|
|
|
|
|
// 生成总的缩略图
|
|
|
|
|
GeoTiffManagerUpdateLayerGroupThumb({
|
|
|
|
|
layerGroups: layerNames,
|
|
|
|
|
bbox: null,
|
|
|
|
|
num: 1,
|
|
|
|
|
width: 1024,
|
|
|
|
|
height: 1024,
|
|
|
|
|
});
|
|
|
|
|
} else {
|
|
|
|
|
createMessage.error('生成新的缩略图失败!');
|
|
|
|
|
chooseUpdateRef.value.loading_yearweeks = false;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.catch((error) => {
|
|
|
|
|
createMessage.error('生成新的缩略图失败!');
|
|
|
|
|
chooseUpdateRef.value.loading_yearweeks = false;
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取年份-周数
|
|
|
|
@ -286,7 +360,16 @@
|
|
|
|
|
allDataForClearMap.forEach((data) => {
|
|
|
|
|
mapboxComponentRef.value.clearTaskLayer(data.layerName);
|
|
|
|
|
});
|
|
|
|
|
let bbox = getBboxFromUrl(record.accessUrl);
|
|
|
|
|
let lngLat = getlngLatByAccessUrl(record.accessUrl);
|
|
|
|
|
let chooseRows: any = [];
|
|
|
|
|
record.bbox = getBboxFromUrl(record.accessUrl);
|
|
|
|
|
chooseRows.push(record);
|
|
|
|
|
mapboxComponentRef.value.GeoTiffManagerRaster(chooseRows, lngLat, 11, true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 获取中心点的坐标
|
|
|
|
|
function getlngLatByAccessUrl(accessUrl) {
|
|
|
|
|
let bbox = getBboxFromUrl(accessUrl);
|
|
|
|
|
let lngLat = getCenterPoint(bbox);
|
|
|
|
|
// 检测坐标系
|
|
|
|
|
const result = isProjectedCoordinates(parseFloat(lngLat[0]), parseFloat(lngLat[1]));
|
|
|
|
@ -294,9 +377,6 @@
|
|
|
|
|
lngLat[0] = result[0];
|
|
|
|
|
lngLat[1] = result[1];
|
|
|
|
|
}
|
|
|
|
|
let chooseRows: any = [];
|
|
|
|
|
chooseRows.push(record);
|
|
|
|
|
mapboxComponentRef.value.GeoTiffManagerRaster(chooseRows, lngLat, 11, true);
|
|
|
|
|
return lngLat;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|