From 6568dce13a4be2fea987f22ce5a4dac33e2fc8f2 Mon Sep 17 00:00:00 2001 From: helloxujingliang <3225043@qq.com> Date: Thu, 4 Jul 2024 15:53:59 +0800 Subject: [PATCH] merege --- src/api/sys/layerManagement.ts | 22 +++ src/components/MapboxMaps/MapComponent.vue | 38 +++-- src/views/demo/bootstraps/auditinfo/index.vue | 7 +- .../demo/bootstraps/changearea/index.vue | 8 +- .../MapList/ShowInfoModal/index.vue | 137 ++++++++++++++---- .../demo/bootstraps/curbspotcity/index.vue | 7 +- src/views/demo/bootstraps/mapconfig/index.vue | 31 +++- .../demo/onlineform/formModule/FormModal.vue | 2 + .../demo/onlineform/formModule/index.vue | 1 + .../demo/workflow/task/process/audit.vue | 2 + 10 files changed, 210 insertions(+), 45 deletions(-) diff --git a/src/api/sys/layerManagement.ts b/src/api/sys/layerManagement.ts index 44b5b346..488c40a0 100644 --- a/src/api/sys/layerManagement.ts +++ b/src/api/sys/layerManagement.ts @@ -18,6 +18,8 @@ enum Api { TestRetry = '/testRetry', Login = '/api/Check/Login', Logout = '/api/Check/Logout', + GetConfig = "/api/ShpLayerSource/LoadSettingConfig", + UpdateConfig = "/api/ShpLayerSource/UpdateSettingConfig", } /** @@ -105,6 +107,26 @@ export function getGeom(params:GetGeomParams) { } +export function getConfig(params) { + return defHttp.get( + { + url: Api.GetConfig, + params, + } + ) +} + +export function updateConfig(params) { + return defHttp.post( + { + url: Api.UpdateConfig, + params, + } + ); +} + + + export function deleteLayer(params) { return defHttp.delete( { diff --git a/src/components/MapboxMaps/MapComponent.vue b/src/components/MapboxMaps/MapComponent.vue index 88821679..7db470b4 100644 --- a/src/components/MapboxMaps/MapComponent.vue +++ b/src/components/MapboxMaps/MapComponent.vue @@ -29,7 +29,7 @@
-
+
@@ -192,7 +192,7 @@ watch( ()=>props.mapConfig, (newVal,oldVal)=>{ - // handlerLoadMapLayer(); + handlerLoadMapLayer(); } ) @@ -288,17 +288,17 @@ // 地图图层控制 const handlerLoadMapLayer = ()=>{ if(switchLayerControler){ - var allLayers = map.getStyle().layers; - allLayers.forEach(function(layer){ - console.log("layerEEEEEE",layer); - console.log(layer.id); - // map.removeLayer(layer.id); - }); + // var allLayers = map.getStyle().layers; + // allLayers.forEach(function(layer){ + // console.log("layerEEEEEE",layer); + // console.log(layer.id); + // // map.removeLayer(layer.id); + // }); // var allSources = Object.keys(map.style.sourceCaches); // allSources.forEach(function(sourceId){ // map.removeSource(sourceId); // }); - // map.removeControl(switchLayerControler); + map.removeControl(switchLayerControler); } let configlayers = {}; let baseLayers = []; @@ -638,8 +638,10 @@ isOpen.value = e; }; + const currentPosition = ref(null); // 图斑定位 const handlerLocation = (lngLat) => { + currentPosition.value = lngLat map.flyTo({ center: lngLat, zoom: 17, @@ -651,6 +653,21 @@ }, }); }; + // 定位 + const handlerToPosition = ()=>{ + if(currentPosition.value){ + map.flyTo({ + center: currentPosition.value, + zoom: 17, + speed: 10, // 飞行速度 + curve: 1, // 飞行曲线 + easing(t) { + // 飞行动画函数 + return t; + }, + }); + } + } // 编辑图斑 const handlerEdit = (info) => { @@ -1213,7 +1230,7 @@ } .position-by-lnglat{ - width:29px; + width:58px; height:29px; background:#fff; position:absolute; @@ -1221,7 +1238,6 @@ right:131px; border-radius:3px; .to-location{ - display:none; width:29px; height:29px; float:left; diff --git a/src/views/demo/bootstraps/auditinfo/index.vue b/src/views/demo/bootstraps/auditinfo/index.vue index fa8a26e7..bc6e2de1 100644 --- a/src/views/demo/bootstraps/auditinfo/index.vue +++ b/src/views/demo/bootstraps/auditinfo/index.vue @@ -38,7 +38,7 @@ import AuditProgress from './AuditProgress/index.vue'; import MapList from './MapList/index.vue'; import { getLoadTaskCount } from '@/api/bootstraps/index'; - import { getGeom } from '@/api/sys/layerManagement'; + import { getGeom,getConfig } from '@/api/sys/layerManagement'; import { getDetail } from '@/api/sys/WFSchemeInfo'; import { useMessage } from '@/hooks/web/useMessage'; @@ -47,7 +47,10 @@ const MapboxMap = defineAsyncComponent(() => import('@/components/MapboxMaps/MapComponent.vue')); const MapboxComponent = ref(); const mapConfig = ref({ isShowMap: false }); - + getConfig({code:"mapsetting"}).then(res=>{ + mapConfig.value = JSON.parse(res.codeValue) + console.log("resresres",mapConfig.value); + }) const showParent = ref(true); const year = ref(); const batch = ref(''); diff --git a/src/views/demo/bootstraps/changearea/index.vue b/src/views/demo/bootstraps/changearea/index.vue index 8f802889..325e46f8 100644 --- a/src/views/demo/bootstraps/changearea/index.vue +++ b/src/views/demo/bootstraps/changearea/index.vue @@ -50,12 +50,18 @@ import { getLoadDroneCaseInfoCount, getLoadDroneCaseInfoDetail } from '@/api/bootstraps/index.ts'; import { batchOptions, yearOptions } from '@/views/demo/bootstraps/curbspotcity/util.ts'; import { getChildrenTree } from '@/api/demo/system.ts'; - import { getGeom } from '@/api/sys/layerManagement'; + import { getGeom,getConfig } from '@/api/sys/layerManagement'; const MapboxMap = defineAsyncComponent(() => import('@/components/MapboxMaps/MapComponent.vue')); const MapboxComponent = ref(); const mapConfig = ref({ isShowMap: false }); + getConfig({code:"mapsetting"}).then(res=>{ + mapConfig.value = JSON.parse(res.codeValue) + console.log("resresres",mapConfig.value); + }) + + const showInfo = ref(false); const year = ref(); const batch = ref(); diff --git a/src/views/demo/bootstraps/curbspotcity/MapList/ShowInfoModal/index.vue b/src/views/demo/bootstraps/curbspotcity/MapList/ShowInfoModal/index.vue index 2ec5a8ed..6db1c2cf 100644 --- a/src/views/demo/bootstraps/curbspotcity/MapList/ShowInfoModal/index.vue +++ b/src/views/demo/bootstraps/curbspotcity/MapList/ShowInfoModal/index.vue @@ -1,32 +1,58 @@ - + diff --git a/src/views/demo/bootstraps/curbspotcity/index.vue b/src/views/demo/bootstraps/curbspotcity/index.vue index 20673409..a9dba3e9 100644 --- a/src/views/demo/bootstraps/curbspotcity/index.vue +++ b/src/views/demo/bootstraps/curbspotcity/index.vue @@ -52,11 +52,16 @@ import MapList from './MapList/index.vue' import { getLoadDroneCaseInfoCount, getLoadDroneCaseInfoDetail } from '@/api/bootstraps/index.ts' import { batchOptions, yearOptions} from '@/views/demo/bootstraps/curbspotcity/util.ts' import { getChildrenTree } from '@/api/demo/system.ts' -import { getGeom } from '@/api/sys/layerManagement'; +import { getGeom,getConfig } from '@/api/sys/layerManagement'; const MapboxMap = defineAsyncComponent(() => import('@/components/MapboxMaps/MapComponent.vue')); const MapboxComponent = ref(); const mapConfig = ref({ isShowMap: false }); +getConfig({code:"mapsetting"}).then(res=>{ + mapConfig.value = JSON.parse(res.codeValue) +}) + + const showInfo = ref(false) const year = ref() diff --git a/src/views/demo/bootstraps/mapconfig/index.vue b/src/views/demo/bootstraps/mapconfig/index.vue index aa536282..7633fba7 100644 --- a/src/views/demo/bootstraps/mapconfig/index.vue +++ b/src/views/demo/bootstraps/mapconfig/index.vue @@ -8,8 +8,6 @@ size="small" style="padding:0px 15px" > - - @@ -163,6 +161,8 @@ + + 保存
@@ -185,8 +185,20 @@ import { Form, FormItem, message, Switch,TableProps } from 'ant-design-vue'; import { PageWrapper } from '@/components/Page'; import { ShpLayerSourceLoadPage, GetTableAndViewColumnList } from '@/api/demo/formScheme'; + import{fun_GetForm} from '@/api/demo/formModule' + import {updateConfig,getConfig} from '@/api/sys/layerManagement' import { EditOutlined, DeleteOutlined, PercentageOutlined ,PlusOutlined} from '@ant-design/icons-vue'; import SelectLayer from '@/components/MapboxMaps/Modal/ServeResource/index.vue' + import { useMessage } from '@/hooks/web/useMessage'; + const { createMessage } = useMessage(); + const mapConfig = ref({}); + + + getConfig({code:"mapsetting"}).then(res=>{ + mapConfig.value = JSON.parse(res.codeValue) + }) + + // const mapConfig = reactive({ // baseConfig:{ // state:true, @@ -200,7 +212,7 @@ // minZoom:3, // maxZoom:18 // }, - + interface BaseLayerDataType { key: string | number; name: string; @@ -667,9 +679,8 @@ } ] }; - const mapConfig = ref(config.table.maps); + // const mapConfig = ref(config.table.maps); - console.log("mapConfig2",mapConfig.value); watch( () => config.table.maps, @@ -851,6 +862,16 @@ } } + + const saveMapConfig = ()=>{ + let form = { + code:"mapsetting", + codeValue:JSON.stringify(mapConfig.value) + } + updateConfig(form).then(res=>{ + createMessage.success("保存成功!"); + }) + }