Zhufu 2024-08-27 17:32:13 +08:00
commit f128873f57
2 changed files with 27 additions and 3 deletions

View File

@ -90,6 +90,9 @@
tableSpan.value = 0;
mapSpan.value = 24;
searchFormSchema.value = searchFormSchema_map;
setTimeout(() => {
mapboxComponentRef.value.resize();
}, 200);
}
//
function exitScreen() {
@ -97,6 +100,9 @@
tableSpan.value = 12;
mapSpan.value = 12;
searchFormSchema.value = searchFormSchema_table;
setTimeout(() => {
mapboxComponentRef.value.resize();
}, 200);
}
// ------------------------------------------------------------
@ -282,8 +288,8 @@
type: 'FeatureCollection',
features: [],
};
let lngList: any = [];
let latList: any = [];
// let lngList: any = [];
// let latList: any = [];
tasklist?.forEach((item, index) => {
// lngList.push(parseFloat(item.gemo.x));
// latList.push(parseFloat(item.gemo.y));
@ -364,7 +370,12 @@
const handleOpen = (path) => {
modalOpen.value = true;
modalTitle.value = '';
modalImage.value = VITE_GLOB_API_URL_VAR.value + path;
//
if (isValidUrl(path)) {
modalImage.value = path;
} else {
modalImage.value = VITE_GLOB_API_URL_VAR.value + path;
}
};
//
const handleCancel = () => {
@ -372,6 +383,12 @@
modalTitle.value = '';
modalImage.value = '';
};
//
function isValidUrl(url: string): boolean {
const regex =
/^(?:http|ftp)s?:\/\/(?:(?:[A-Z0-9](?:[A-Z0-9-]{0,61}[A-Z0-9])?\.)+(?:[A-Z]{2,6}\.?|[A-Z0-9-]{2,}\.?)|localhost|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|\[?[A-F0-9]*:[A-F0-9:]+\]?)(?::\d+)?(?:\/?|[\/?]\S+)$/i;
return regex.test(url);
}
onMounted(() => {
handleReset();

View File

@ -231,6 +231,7 @@
// -
function AchievementManageRaster(taskLayerGeoJson, lngLat, zoom) {
// resize();
//
clearTaskLayer('AchievementManageRaster');
//
@ -297,6 +298,11 @@
}
}
//
function resize() {
map.resize();
}
onMounted(() => {
mapboxgl.accessToken = MAPBOX_TOKEN;
map = initMap();
@ -313,6 +319,7 @@
GeoserverManagementRaster,
GeoTiffManagerRaster,
AchievementManageRaster,
resize,
});
</script>
<style type="less" scoped>