Files
xian_vue_new/src/component/rain-earthquake/detail-panels/WaterPipeComponent.vue
T

41 lines
931 B
Vue
Raw Normal View History

2026-04-21 16:05:26 +08:00
<!-- 供水管网 -->
<template>
<LoadingGeoserverLayer
:id="`waterPipe`"
:layers="`xian:xian_water_pipe`"
@provide-layers="provideLayers"
/>
</template>
<script lang="ts" setup>
import { useStatusStore } from '@/stores/useStatusStore.ts';
2026-04-21 16:05:26 +08:00
import type { ImageryLayer } from 'cesium';
import { onMounted, watch } from 'vue';
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
2026-04-21 16:05:26 +08:00
2026-05-07 13:59:14 +08:00
const statusStore = useStatusStore();
2026-05-07 12:53:25 +08:00
2026-04-21 16:05:26 +08:00
// 保存图层引用
let waterPipeLayer: ImageryLayer | null = null;
onMounted(() => {
// 监听显示隐藏
watch(
2026-05-07 13:59:14 +08:00
() => statusStore.infrastructureLayers.showNetworkSystem.show,
2026-04-21 16:05:26 +08:00
(newValue: boolean) => {
waterPipeLayer!.show = newValue;
}
);
});
/**
* 提供图层
* @param layer 图层
*/
function provideLayers(layer: ImageryLayer) {
waterPipeLayer = layer;
}
</script>
<style scoped></style>