From e4767754d5a35c2153c7e68e06920f8e6ed54787 Mon Sep 17 00:00:00 2001 From: maojiacai Date: Mon, 8 Sep 2025 19:33:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E5=BF=85=E5=88=B0=E7=82=B9?= =?UTF-8?q?=E9=87=87=E9=9B=86=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=20?= =?UTF-8?q?=E5=A4=84=E7=90=86=E6=89=93=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/patrolList.js | 10 + src/components/GdMap/index.vue | 7 + src/components/GdMap/mapUtil.js | 65 +++ src/pages/clockInPage/components/Timeline.vue | 39 +- src/pages/clockInPage/index.vue | 408 +++++++++++++++--- src/pages/collectPage/collectAndAdd.vue | 74 ++-- .../collectPage/copmonents/customPopup.vue | 1 + .../copmonents/listItemWrapper.vue | 9 +- .../patrolList/copmonents/patrolWrapper.vue | 4 +- src/pages/patrolList/index.vue | 13 +- src/utils/tools.js | 54 ++- 11 files changed, 563 insertions(+), 121 deletions(-) diff --git a/src/api/patrolList.js b/src/api/patrolList.js index 9ffdeb8..9328cc4 100644 --- a/src/api/patrolList.js +++ b/src/api/patrolList.js @@ -16,3 +16,13 @@ export function fetchSelectListByBddxlrwId(params) { params }) } + + +// 打卡 +export function fetchTbZdxlFgdwBddxlrwJlClockIn(data) { + return service({ + url: `${api}/tbZdxlFgdwBddxlrwJl/clockIn`, + method: 'POST', + data + }) +} diff --git a/src/components/GdMap/index.vue b/src/components/GdMap/index.vue index 567a8da..e5b9342 100644 --- a/src/components/GdMap/index.vue +++ b/src/components/GdMap/index.vue @@ -205,6 +205,12 @@ onMounted(() => { mapUtil.value.enableClickEvents() console.log(res) }) + + // 禁用地图 + emitter.on("setMapInteractions", (res) => { + console.log(res) + mapUtil.value.setMapInteractions(res); + }) }); //切换地图底图 const onMapImageChange = (val) => { @@ -286,6 +292,7 @@ onUnmounted(() => { emitter.off("SsCircle"); emitter.off("ClearssCircle"); emitter.off("getMapClickCoordinates"); + emitter.off("setMapInteractions"); }); diff --git a/src/components/GdMap/mapUtil.js b/src/components/GdMap/mapUtil.js index dd04182..e47a5b6 100644 --- a/src/components/GdMap/mapUtil.js +++ b/src/components/GdMap/mapUtil.js @@ -724,6 +724,71 @@ export function MapUtil(map) { _that.mMap.mapboxGLMap.on('click', _that.clickEventHandler); }; + + + // 在 MapUtil.js 中添加以下方法 + MapUtil.prototype.disableMapInteractions = function() { + const _that = this; + + if (!_that.mMap || !_that.mMap.mapboxGLMap) return; + + const map = _that.mMap.mapboxGLMap; + + // 禁用所有交互 + map.boxZoom.disable(); + map.doubleClickZoom.disable(); + map.dragPan.disable(); + map.dragRotate.disable(); + map.keyboard.disable(); + map.scrollZoom.disable(); + map.touchZoomRotate.disable(); + + // 禁用拖拽 + map.dragPan.disable(); + + // 禁用缩放 + map.scrollZoom.disable(); + map.doubleClickZoom.disable(); + map.touchZoomRotate.disable(); + + // 禁用旋转 + map.dragRotate.disable(); + map.touchZoomRotate.disable(); + + // 禁用键盘操作 + map.keyboard.disable(); + + console.log('地图交互已禁用'); + }; + + MapUtil.prototype.enableMapInteractions = function() { + const _that = this; + + if (!_that.mMap || !_that.mMap.mapboxGLMap) return; + + const map = _that.mMap.mapboxGLMap; + + // 启用所有交互 + map.boxZoom.enable(); + map.doubleClickZoom.enable(); + map.dragPan.enable(); + map.dragRotate.enable(); + map.keyboard.enable(); + map.scrollZoom.enable(); + map.touchZoomRotate.enable(); + + console.log('地图交互已启用'); + }; + + MapUtil.prototype.setMapInteractions = function(enabled) { + const _that = this; + + if (enabled) { + _that.enableMapInteractions(); + } else { + _that.disableMapInteractions(); + } + }; } // 获取uuid 作为边界图层ID function getUUid() { diff --git a/src/pages/clockInPage/components/Timeline.vue b/src/pages/clockInPage/components/Timeline.vue index 9b4b8e6..e5c4e73 100644 --- a/src/pages/clockInPage/components/Timeline.vue +++ b/src/pages/clockInPage/components/Timeline.vue @@ -1,32 +1,45 @@