From c60aa7bca6b2b3d6df8affacb5d76815621c43d8 Mon Sep 17 00:00:00 2001 From: xh <11675084@qq.com> Date: Fri, 23 Jan 2026 15:54:56 +0800 Subject: [PATCH] =?UTF-8?q?=E6=89=8B=E6=8C=81=E8=A1=A8=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E9=83=A8=E9=97=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Home/components/services/animation.service.ts | 9 ++-- .../Home/components/services/marker.service.ts | 10 ++-- .../views/gas/handdetector/HandDetectorForm.vue | 53 ++++++++++++++++++---- 3 files changed, 54 insertions(+), 18 deletions(-) diff --git a/web/src/views/HandDevice/Home/components/services/animation.service.ts b/web/src/views/HandDevice/Home/components/services/animation.service.ts index 64de4bb..dba284c 100644 --- a/web/src/views/HandDevice/Home/components/services/animation.service.ts +++ b/web/src/views/HandDevice/Home/components/services/animation.service.ts @@ -138,7 +138,7 @@ export class AnimationService { } addAll(markers: MarkerData[]) { - console.time('animationService addAll') + // console.time('animationService addAll') this.statusColor.clear() this.statusColorStyleMap.clear() // this.clear() @@ -151,12 +151,13 @@ export class AnimationService { markers.forEach((marker) => { const feature = new Feature({ geometry: new Point(fromLonLat(marker.coordinates)), - markerData: marker + markerData: marker, + rippleColor: marker.statusColor }) // 设置动画开始时间 // feature.set('animationStart', Date.now()) - feature.set('rippleColor', marker.statusColor) + // feature.set('rippleColor', marker.statusColor) features.push(feature) if (marker.statusColor) { this.statusColor.add(marker.statusColor) @@ -164,7 +165,7 @@ export class AnimationService { }) source?.addFeatures(features) this.rippleLayer?.setSource(source) - console.timeEnd('animationService addAll') + // console.timeEnd('animationService addAll') } show() { diff --git a/web/src/views/HandDevice/Home/components/services/marker.service.ts b/web/src/views/HandDevice/Home/components/services/marker.service.ts index 1904710..61d3605 100644 --- a/web/src/views/HandDevice/Home/components/services/marker.service.ts +++ b/web/src/views/HandDevice/Home/components/services/marker.service.ts @@ -42,7 +42,7 @@ export class MarkerService { * 更新标记数据 */ async updateData(markers: MarkerData[]) { - console.time('create features') + // console.time('create features') const features: Feature[] = [] markers.forEach((marker) => { const feature = new Feature({ @@ -54,16 +54,16 @@ export class MarkerService { feature.setStyle(createMarkerStyle(statusColor)) features.push(feature) }) - console.timeEnd('create features') + // console.timeEnd('create features') await nextTick() - console.time('add features') + // console.time('add features') const vectorSource = new VectorSource() vectorSource.addFeatures(features) this.markerLayer?.getSource()?.setSource(vectorSource) - console.timeEnd('add features') + // console.timeEnd('add features') this.getSinglePointsInView() } setClusterDistance = debounce(() => { @@ -79,6 +79,8 @@ export class MarkerService { distance = 80 } else if (zoom <= 10) { distance = 50 + } else if (zoom <= 14) { + distance = 40 } else if (zoom <= 16) { distance = 20 } else if (zoom <= 17) { diff --git a/web/src/views/gas/handdetector/HandDetectorForm.vue b/web/src/views/gas/handdetector/HandDetectorForm.vue index 645b1ad..b9ed089 100644 --- a/web/src/views/gas/handdetector/HandDetectorForm.vue +++ b/web/src/views/gas/handdetector/HandDetectorForm.vue @@ -1,5 +1,5 @@