From b5ea2cc5ff61785d58f2e67310a91e5257be48e0 Mon Sep 17 00:00:00 2001 From: wzy-warehouse <18135009705@163.com> Date: Thu, 7 May 2026 14:03:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=9A=90=E8=97=8F=E6=96=AD?= =?UTF-8?q?=E8=A3=82=E5=B8=A6bug=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/component/earthquake/FaultComponent.vue | 19 ++++++++++++++++++- src/views/home/earthquake/EarthquakeView.vue | 2 +- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/src/component/earthquake/FaultComponent.vue b/src/component/earthquake/FaultComponent.vue index 1cf26be..1ec0c53 100644 --- a/src/component/earthquake/FaultComponent.vue +++ b/src/component/earthquake/FaultComponent.vue @@ -6,7 +6,10 @@ import { xianFaultData } from '@/assets'; import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils'; import { Color } from 'cesium'; - import { onMounted } from 'vue'; + import { onMounted, watch } from 'vue'; + import { useStatusStore } from '@/stores/useStatusStore.ts'; + + const statusStore = useStatusStore(); onMounted(() => { CesiumUtilsSingleton.addGeoJsonLayer( @@ -23,5 +26,19 @@ } ); }); + + // 监听断裂带显示/隐藏状态 + watch( + () => statusStore.mapLayers.faultShow.show, + (newValue: boolean) => { + if (newValue) { + // 显示断裂带 + CesiumUtilsSingleton.showGeoJsonLayer('xian-earthque-fault-data'); + } else { + // 隐藏断裂带 + CesiumUtilsSingleton.hideGeoJsonLayer('xian-earthque-fault-data'); + } + } + ); diff --git a/src/views/home/earthquake/EarthquakeView.vue b/src/views/home/earthquake/EarthquakeView.vue index c3c85ac..fc78ba1 100644 --- a/src/views/home/earthquake/EarthquakeView.vue +++ b/src/views/home/earthquake/EarthquakeView.vue @@ -10,7 +10,7 @@