From f91c262ed123b5582369f716ecd541de998541fb Mon Sep 17 00:00:00 2001 From: ZvonimirSun Date: Fri, 15 Mar 2024 18:26:31 +0800 Subject: [PATCH] =?UTF-8?q?feat(gis):=20=E6=8A=BD=E5=8F=96=E6=95=B4?= =?UTF-8?q?=E7=90=86=E9=80=9A=E7=94=A8Gis=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/VanillaJsonEditor.vue | 2 +- src/main.ts | 5 - src/tools/3dView/3dView.vue | 1 + .../child/{addService.vue => AddService.vue} | 56 +-- .../child/{geoJsonEditor.vue => Editor.vue} | 2 +- .../child/{leafletMap.vue => MainMap.vue} | 97 ++--- .../{propertyTable.vue => PropertyTable.vue} | 0 src/tools/geoJson/geoJson.vue | 10 +- src/tools/imageBase64.vue | 3 +- src/tools/latLng.vue | 25 +- src/tools/viewSourceCode.vue | 3 +- src/utils/gisUtils/common.ts | 10 + .../core}/leaflet.ChineseLayer.js | 0 src/utils/gisUtils/index.ts | 2 + src/utils/gisUtils/type.d.ts | 38 ++ src/utils/gisUtils/utils/addressUtils.ts | 45 +++ src/utils/gisUtils/utils/drawUtils.ts | 78 +++++ src/utils/gisUtils/utils/geojsonUtils.ts | 17 + src/utils/gisUtils/utils/index.ts | 6 + src/utils/gisUtils/utils/layerUtils/index.ts | 1 + .../gisUtils/utils/layerUtils/layerUtils.ts | 246 +++++++++++++ src/utils/gisUtils/utils/mapUtils.ts | 53 +++ src/utils/gisUtils/utils/persistMap.ts | 35 ++ src/utils/gisUtils/utils/viewUtils.ts | 7 + src/utils/mapUtils.ts | 330 ------------------ 25 files changed, 609 insertions(+), 463 deletions(-) rename src/tools/geoJson/child/{addService.vue => AddService.vue} (74%) rename src/tools/geoJson/child/{geoJsonEditor.vue => Editor.vue} (96%) rename src/tools/geoJson/child/{leafletMap.vue => MainMap.vue} (72%) rename src/tools/geoJson/child/{propertyTable.vue => PropertyTable.vue} (100%) create mode 100644 src/utils/gisUtils/common.ts rename src/utils/{ => gisUtils/core}/leaflet.ChineseLayer.js (100%) create mode 100644 src/utils/gisUtils/index.ts create mode 100644 src/utils/gisUtils/type.d.ts create mode 100644 src/utils/gisUtils/utils/addressUtils.ts create mode 100644 src/utils/gisUtils/utils/drawUtils.ts create mode 100644 src/utils/gisUtils/utils/geojsonUtils.ts create mode 100644 src/utils/gisUtils/utils/index.ts create mode 100644 src/utils/gisUtils/utils/layerUtils/index.ts create mode 100644 src/utils/gisUtils/utils/layerUtils/layerUtils.ts create mode 100644 src/utils/gisUtils/utils/mapUtils.ts create mode 100644 src/utils/gisUtils/utils/persistMap.ts create mode 100644 src/utils/gisUtils/utils/viewUtils.ts delete mode 100644 src/utils/mapUtils.ts diff --git a/src/components/VanillaJsonEditor.vue b/src/components/VanillaJsonEditor.vue index d79cc59a7..293adef61 100644 --- a/src/components/VanillaJsonEditor.vue +++ b/src/components/VanillaJsonEditor.vue @@ -77,7 +77,7 @@ const documentProperties = computed<{ content?: string size?: string }>(() => { - if (showDocumentProperties) { + if (showDocumentProperties.value) { const data = jsonEditor.get() let content let code diff --git a/src/main.ts b/src/main.ts index 2815f7d2f..cfe898816 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,5 +1,4 @@ import config from './config' -import EventBus from '@/plugins/EventBus.js' import App from '@/App.vue' import axios from '@/plugins/Axios' import { createPiniaPersist } from '@/plugins/PiniaPersist' @@ -13,10 +12,6 @@ const $apiBase = import.meta.env.PROD ? config.apiOrigin : (import.meta.env.VITE const pinia = createPinia() const app = createApp(App) - app.config.globalProperties.$axios = axios - app.config.globalProperties.$eventBus = EventBus - app.provide('$axios', axios) - app.provide('$eventBus', EventBus) axios.$apiBase = $apiBase const piniaPersistPlugin = await createPiniaPersist({ diff --git a/src/tools/3dView/3dView.vue b/src/tools/3dView/3dView.vue index e12357766..dfdd2d5e8 100644 --- a/src/tools/3dView/3dView.vue +++ b/src/tools/3dView/3dView.vue @@ -86,6 +86,7 @@ const rootPath = computed(() => { const path = rootFile.value.webkitRelativePath || rootFile.value.name return path.replace(fileName.value || '', '') } + return '' }) function initScene() { diff --git a/src/tools/geoJson/child/addService.vue b/src/tools/geoJson/child/AddService.vue similarity index 74% rename from src/tools/geoJson/child/addService.vue rename to src/tools/geoJson/child/AddService.vue index 9e458752b..01d26cdc4 100644 --- a/src/tools/geoJson/child/addService.vue +++ b/src/tools/geoJson/child/AddService.vue @@ -1,11 +1,10 @@