规范化操作
This commit is contained in:
@@ -37,6 +37,7 @@
|
||||
import { useHiddenPoint } from '@/hooks/rain-earthquake/useHiddenPoint';
|
||||
import { useStatusStore } from '@/stores/useStatusStore';
|
||||
import { LoadingResource } from '@/types/common/LoadingResourceType';
|
||||
import { useLoadingResourceStore } from '@/stores/useLoadingResourceStore';
|
||||
|
||||
// 接收父组件传递的参数
|
||||
const props = defineProps<{
|
||||
@@ -97,5 +98,27 @@
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatusStore().mapLayers.hiddenDangerPointShow.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
// 显示隐患点
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResourceStore().getLoadingResource(
|
||||
LoadingResource.HIDDEN_DANGER_POINT
|
||||
)
|
||||
);
|
||||
} else {
|
||||
// 隐藏隐患点
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResourceStore().getLoadingResource(
|
||||
LoadingResource.HIDDEN_DANGER_POINT
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
<style scoped></style>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
:base-points="hospitalPoints"
|
||||
:get-disaster-icon="getDisasterIcon"
|
||||
:prefix="config.prefix.hospitalPointId"
|
||||
:is-default="true"
|
||||
:is-default="false"
|
||||
:loading-resource-field="LoadingResource.HOSPITAL"
|
||||
/>
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils';
|
||||
import { LoadingResource } from '@/types/common/LoadingResourceType';
|
||||
import { useHospitalPoint } from '@/hooks/rain-earthquake/useHospitalPoint';
|
||||
import { useLoadingResourceStore } from '@/stores/useLoadingResourceStore';
|
||||
|
||||
const hospitalPoints = ref<Point[]>([]);
|
||||
|
||||
@@ -90,6 +91,24 @@
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatusStore().poiLayers.showHospital.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
// 显示医院
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResourceStore().getLoadingResource(LoadingResource.HOSPITAL)
|
||||
);
|
||||
} else {
|
||||
// 隐藏医院
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResourceStore().getLoadingResource(LoadingResource.HOSPITAL)
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils';
|
||||
import { useRiskPoint } from '@/hooks/rain-earthquake/useRiskPoint';
|
||||
import { LoadingResource } from '@/types/common/LoadingResourceType';
|
||||
import { useLoadingResourceStore } from '@/stores/useLoadingResourceStore';
|
||||
|
||||
const riskPoints = ref<Point[]>([]);
|
||||
|
||||
@@ -88,6 +89,26 @@
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
// 监听显示隐藏风险点
|
||||
watch(
|
||||
() => useStatusStore().mapLayers.riskPointShow.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResourceStore().getLoadingResource(
|
||||
LoadingResource.RISK_POINT
|
||||
)
|
||||
);
|
||||
} else {
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResourceStore().getLoadingResource(
|
||||
LoadingResource.RISK_POINT
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<style scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user