修改组件中store的调用方式
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div>
|
||||
<!-- 加载桥梁点 -->
|
||||
<LoadingPoints
|
||||
v-if="useStatus.appLoadingCompleted && bridgeList.length > 0"
|
||||
v-if="statusStore.appLoadingCompleted && bridgeList.length > 0"
|
||||
:base-points="bridgeList"
|
||||
:get-disaster-icon="getDisasterIcon"
|
||||
:prefix="config.prefix.bridgePointId"
|
||||
@@ -15,11 +15,11 @@
|
||||
<InformationBox
|
||||
:data="storePointDetail as Record<string, any>"
|
||||
:field="field"
|
||||
v-if="useLoadingInformation.bridge.loading"
|
||||
v-if="loadingInformationStore.bridge.loading"
|
||||
:title="informationBoxTitle"
|
||||
:offset-x="offsetX"
|
||||
:offset-y="offsetY"
|
||||
:key="useLoadingInformation.bridge.id"
|
||||
:key="loadingInformationStore.bridge.id"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -40,9 +40,9 @@
|
||||
|
||||
const bridgeList = ref<Point[]>([]);
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const useLoadingInformation = useLoadingInformationStore();
|
||||
const useLoadingResource = useLoadingResourceStore();
|
||||
const statusStore = useStatusStore();
|
||||
const loadingInformationStore = useLoadingInformationStore();
|
||||
const loadingResourceStore = useLoadingResourceStore();
|
||||
|
||||
// 信息框相关配置
|
||||
const offsetX = ref(0);
|
||||
@@ -59,13 +59,13 @@
|
||||
|
||||
// 监听id变化
|
||||
watch(
|
||||
() => useLoadingInformation.bridge.id,
|
||||
() => loadingInformationStore.bridge.id,
|
||||
async (newId: number) => {
|
||||
if (newId === -1) {
|
||||
return;
|
||||
}
|
||||
// 获取桥梁点数据
|
||||
const clickObject = useLoadingInformation.clickObject;
|
||||
const clickObject = loadingInformationStore.clickObject;
|
||||
|
||||
if (!clickObject || !clickObject.primitive) {
|
||||
console.warn('点击对象或图元不存在');
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
const res = await $api.bridges.getPointDetailById(
|
||||
useLoadingInformation.bridge.id
|
||||
loadingInformationStore.bridge.id
|
||||
);
|
||||
|
||||
// 更新数据
|
||||
@@ -89,7 +89,7 @@
|
||||
offsetY.value = screenPos.y;
|
||||
|
||||
// 显示新的信息框
|
||||
useLoadingInformation.bridge.loading = true;
|
||||
loadingInformationStore.bridge.loading = true;
|
||||
} catch (error) {
|
||||
throw new Error(`坐标转换失败:${error}`);
|
||||
}
|
||||
@@ -98,18 +98,18 @@
|
||||
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.infrastructureLayers.showBridge.show,
|
||||
() => statusStore.infrastructureLayers.showBridge.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
// 显示桥梁点
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResource.getLoadingResource(LoadingResource.BRIDGE)
|
||||
loadingResourceStore.getLoadingResource(LoadingResource.BRIDGE)
|
||||
.ids
|
||||
);
|
||||
} else {
|
||||
// 隐藏桥梁点
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResource.getLoadingResource(LoadingResource.BRIDGE)
|
||||
loadingResourceStore.getLoadingResource(LoadingResource.BRIDGE)
|
||||
.ids
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div>
|
||||
<!-- 加载危险源 -->
|
||||
<LoadingPoints
|
||||
v-if="useStatus.appLoadingCompleted && dangerousSourcePoints.length > 0"
|
||||
v-if="statusStore.appLoadingCompleted && dangerousSourcePoints.length > 0"
|
||||
:base-points="dangerousSourcePoints"
|
||||
:get-disaster-icon="getDisasterIcon"
|
||||
:prefix="config.prefix.dangerousSourcePointId"
|
||||
@@ -15,11 +15,11 @@
|
||||
<InformationBox
|
||||
:data="dangerousSourcePointDetail as Record<string, any>"
|
||||
:field="field"
|
||||
v-if="useLoadingInformation.dangerousSource.loading"
|
||||
v-if="loadingInformationStore.dangerousSource.loading"
|
||||
:title="informationBoxTitle"
|
||||
:offset-x="offsetX"
|
||||
:offset-y="offsetY"
|
||||
:key="useLoadingInformation.dangerousSource.id"
|
||||
:key="loadingInformationStore.dangerousSource.id"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -40,9 +40,9 @@
|
||||
|
||||
const dangerousSourcePoints = ref<Point[]>([]);
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const useLoadingInformation = useLoadingInformationStore();
|
||||
const useLoadingResource = useLoadingResourceStore();
|
||||
const statusStore = useStatusStore();
|
||||
const loadingInformationStore = useLoadingInformationStore();
|
||||
const loadingResourceStore = useLoadingResourceStore();
|
||||
|
||||
// 信息框相关配置
|
||||
const offsetX = ref(0);
|
||||
@@ -59,13 +59,13 @@
|
||||
|
||||
// 监听id变化
|
||||
watch(
|
||||
() => useLoadingInformation.dangerousSource.id,
|
||||
() => loadingInformationStore.dangerousSource.id,
|
||||
async (newId: number) => {
|
||||
if (newId === -1) {
|
||||
return;
|
||||
}
|
||||
// 获取危险源数据
|
||||
const clickObject = useLoadingInformation.clickObject;
|
||||
const clickObject = loadingInformationStore.clickObject;
|
||||
|
||||
if (!clickObject || !clickObject.primitive) {
|
||||
console.warn('点击对象或图元不存在');
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
const res = await $api.dangerousSource.getPointDetailById(
|
||||
useLoadingInformation.dangerousSource.id
|
||||
loadingInformationStore.dangerousSource.id
|
||||
);
|
||||
|
||||
// 更新数据
|
||||
@@ -89,7 +89,7 @@
|
||||
offsetY.value = screenPos.y;
|
||||
|
||||
// 显示新的信息框
|
||||
useLoadingInformation.dangerousSource.loading = true;
|
||||
loadingInformationStore.dangerousSource.loading = true;
|
||||
} catch (error) {
|
||||
throw new Error(`坐标转换失败:${error}`);
|
||||
}
|
||||
@@ -98,19 +98,19 @@
|
||||
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.poiLayers.showDangerSource.show,
|
||||
() => statusStore.poiLayers.showDangerSource.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
// 显示危险源
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResource.getLoadingResource(
|
||||
loadingResourceStore.getLoadingResource(
|
||||
LoadingResource.DANGEROUS_SOURCE
|
||||
).ids
|
||||
);
|
||||
} else {
|
||||
// 隐藏危险源
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResource.getLoadingResource(
|
||||
loadingResourceStore.getLoadingResource(
|
||||
LoadingResource.DANGEROUS_SOURCE
|
||||
).ids
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div>
|
||||
<!-- 加载避难所 -->
|
||||
<LoadingPoints
|
||||
v-if="useStatus.appLoadingCompleted && emergencyShelterPoints.length > 0"
|
||||
v-if="statusStore.appLoadingCompleted && emergencyShelterPoints.length > 0"
|
||||
:base-points="emergencyShelterPoints"
|
||||
:get-disaster-icon="getDisasterIcon"
|
||||
:prefix="config.prefix.emergencyShelterPointId"
|
||||
@@ -15,11 +15,11 @@
|
||||
<InformationBox
|
||||
:data="emergencyShelterPointDetail as Record<string, any>"
|
||||
:field="field"
|
||||
v-if="useLoadingInformation.emergencyShelter.loading"
|
||||
v-if="loadingInformationStore.emergencyShelter.loading"
|
||||
:title="informationBoxTitle"
|
||||
:offset-x="offsetX"
|
||||
:offset-y="offsetY"
|
||||
:key="useLoadingInformation.emergencyShelter.id"
|
||||
:key="loadingInformationStore.emergencyShelter.id"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -40,9 +40,9 @@
|
||||
|
||||
const emergencyShelterPoints = ref<Point[]>([]);
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const useLoadingInformation = useLoadingInformationStore();
|
||||
const useLoadingResource = useLoadingResourceStore();
|
||||
const statusStore = useStatusStore();
|
||||
const loadingInformationStore = useLoadingInformationStore();
|
||||
const loadingResourceStore = useLoadingResourceStore();
|
||||
|
||||
// 信息框相关配置
|
||||
const offsetX = ref(0);
|
||||
@@ -59,13 +59,13 @@
|
||||
|
||||
// 监听id变化
|
||||
watch(
|
||||
() => useLoadingInformation.emergencyShelter.id,
|
||||
() => loadingInformationStore.emergencyShelter.id,
|
||||
async (newId: number) => {
|
||||
if (newId === -1) {
|
||||
return;
|
||||
}
|
||||
// 获取避难所数据
|
||||
const clickObject = useLoadingInformation.clickObject;
|
||||
const clickObject = loadingInformationStore.clickObject;
|
||||
|
||||
if (!clickObject || !clickObject.primitive) {
|
||||
console.warn('点击对象或图元不存在');
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
const res = await $api.emergencyShelter.getPointDetailById(
|
||||
useLoadingInformation.emergencyShelter.id
|
||||
loadingInformationStore.emergencyShelter.id
|
||||
);
|
||||
|
||||
// 更新数据
|
||||
@@ -89,7 +89,7 @@
|
||||
offsetY.value = screenPos.y;
|
||||
|
||||
// 显示新的信息框
|
||||
useLoadingInformation.emergencyShelter.loading = true;
|
||||
loadingInformationStore.emergencyShelter.loading = true;
|
||||
} catch (error) {
|
||||
throw new Error(`坐标转换失败:${error}`);
|
||||
}
|
||||
@@ -98,19 +98,19 @@
|
||||
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.poiLayers.showRefugeeShelter.show,
|
||||
() => statusStore.poiLayers.showRefugeeShelter.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
// 显示避难所
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResource.getLoadingResource(
|
||||
loadingResourceStore.getLoadingResource(
|
||||
LoadingResource.EMERGENCY_SHELTER
|
||||
).ids
|
||||
);
|
||||
} else {
|
||||
// 隐藏避难所
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResource.getLoadingResource(
|
||||
loadingResourceStore.getLoadingResource(
|
||||
LoadingResource.EMERGENCY_SHELTER
|
||||
).ids
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div>
|
||||
<!-- 加载消防站 -->
|
||||
<LoadingPoints
|
||||
v-if="useStatus.appLoadingCompleted && fireStationPoints.length > 0"
|
||||
v-if="statusStore.appLoadingCompleted && fireStationPoints.length > 0"
|
||||
:base-points="fireStationPoints"
|
||||
:get-disaster-icon="getDisasterIcon"
|
||||
:prefix="config.prefix.fireStationPointId"
|
||||
@@ -15,11 +15,11 @@
|
||||
<InformationBox
|
||||
:data="fireStationPointDetail as Record<string, any>"
|
||||
:field="field"
|
||||
v-if="useLoadingInformation.fireStation.loading"
|
||||
v-if="loadingInformationStore.fireStation.loading"
|
||||
:title="informationBoxTitle"
|
||||
:offset-x="offsetX"
|
||||
:offset-y="offsetY"
|
||||
:key="useLoadingInformation.fireStation.id"
|
||||
:key="loadingInformationStore.fireStation.id"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -40,9 +40,9 @@
|
||||
|
||||
const fireStationPoints = ref<Point[]>([]);
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const useLoadingInformation = useLoadingInformationStore();
|
||||
const useLoadingResource = useLoadingResourceStore();
|
||||
const statusStore = useStatusStore();
|
||||
const loadingInformationStore = useLoadingInformationStore();
|
||||
const loadingResourceStore = useLoadingResourceStore();
|
||||
|
||||
// 信息框相关配置
|
||||
const offsetX = ref(0);
|
||||
@@ -59,13 +59,13 @@
|
||||
|
||||
// 监听id变化
|
||||
watch(
|
||||
() => useLoadingInformation.fireStation.id,
|
||||
() => loadingInformationStore.fireStation.id,
|
||||
async (newId: number) => {
|
||||
if (newId === -1) {
|
||||
return;
|
||||
}
|
||||
// 获取消防站数据
|
||||
const clickObject = useLoadingInformation.clickObject;
|
||||
const clickObject = loadingInformationStore.clickObject;
|
||||
|
||||
if (!clickObject || !clickObject.primitive) {
|
||||
console.warn('点击对象或图元不存在');
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
const res = await $api.firefighter.getPointDetailById(
|
||||
useLoadingInformation.fireStation.id
|
||||
loadingInformationStore.fireStation.id
|
||||
);
|
||||
|
||||
// 更新数据
|
||||
@@ -89,7 +89,7 @@
|
||||
offsetY.value = screenPos.y;
|
||||
|
||||
// 显示新的信息框
|
||||
useLoadingInformation.fireStation.loading = true;
|
||||
loadingInformationStore.fireStation.loading = true;
|
||||
} catch (error) {
|
||||
throw new Error(`坐标转换失败:${error}`);
|
||||
}
|
||||
@@ -98,19 +98,19 @@
|
||||
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.poiLayers.showFireStation.show,
|
||||
() => statusStore.poiLayers.showFireStation.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
// 显示消防站
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResource.getLoadingResource(
|
||||
loadingResourceStore.getLoadingResource(
|
||||
LoadingResource.FIRE_STATION
|
||||
).ids
|
||||
);
|
||||
} else {
|
||||
// 隐藏消防站
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResource.getLoadingResource(
|
||||
loadingResourceStore.getLoadingResource(
|
||||
LoadingResource.FIRE_STATION
|
||||
).ids
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import { onMounted, watch } from 'vue';
|
||||
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const statusStore = useStatusStore();
|
||||
|
||||
// 保存图层引用
|
||||
let highwayLayer: ImageryLayer | null = null;
|
||||
@@ -21,7 +21,7 @@
|
||||
onMounted(() => {
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.infrastructureLayers.showHighway.show,
|
||||
() => statusStore.infrastructureLayers.showHighway.show,
|
||||
(newValue: boolean) => {
|
||||
highwayLayer!.show = newValue;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div>
|
||||
<!-- 加载医院 -->
|
||||
<LoadingPoints
|
||||
v-if="useStatus.appLoadingCompleted && hospitalPoints.length > 0"
|
||||
v-if="statusStore.appLoadingCompleted && hospitalPoints.length > 0"
|
||||
:base-points="hospitalPoints"
|
||||
:get-disaster-icon="getDisasterIcon"
|
||||
:prefix="config.prefix.hospitalPointId"
|
||||
@@ -15,11 +15,11 @@
|
||||
<InformationBox
|
||||
:data="hospitalPointDetail as Record<string, any>"
|
||||
:field="field"
|
||||
v-if="useLoadingInformation.hospital.loading"
|
||||
v-if="loadingInformationStore.hospital.loading"
|
||||
:title="informationBoxTitle"
|
||||
:offset-x="offsetX"
|
||||
:offset-y="offsetY"
|
||||
:key="useLoadingInformation.hospital.id"
|
||||
:key="loadingInformationStore.hospital.id"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -40,9 +40,9 @@
|
||||
|
||||
const hospitalPoints = ref<Point[]>([]);
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const useLoadingInformation = useLoadingInformationStore();
|
||||
const useLoadingResource = useLoadingResourceStore();
|
||||
const statusStore = useStatusStore();
|
||||
const loadingInformationStore = useLoadingInformationStore();
|
||||
const loadingResourceStore = useLoadingResourceStore();
|
||||
|
||||
// 信息框相关配置
|
||||
const offsetX = ref(0);
|
||||
@@ -59,13 +59,13 @@
|
||||
|
||||
// 监听id变化
|
||||
watch(
|
||||
() => useLoadingInformation.hospital.id,
|
||||
() => loadingInformationStore.hospital.id,
|
||||
async (newId: number) => {
|
||||
if (newId === -1) {
|
||||
return;
|
||||
}
|
||||
// 获取医院数据
|
||||
const clickObject = useLoadingInformation.clickObject;
|
||||
const clickObject = loadingInformationStore.clickObject;
|
||||
|
||||
if (!clickObject || !clickObject.primitive) {
|
||||
console.warn('点击对象或图元不存在');
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
const res = await $api.hospitals.getPointDetailById(
|
||||
useLoadingInformation.hospital.id
|
||||
loadingInformationStore.hospital.id
|
||||
);
|
||||
|
||||
// 更新数据
|
||||
@@ -89,7 +89,7 @@
|
||||
offsetY.value = screenPos.y;
|
||||
|
||||
// 显示新的信息框
|
||||
useLoadingInformation.hospital.loading = true;
|
||||
loadingInformationStore.hospital.loading = true;
|
||||
} catch (error) {
|
||||
throw new Error(`坐标转换失败:${error}`);
|
||||
}
|
||||
@@ -98,18 +98,18 @@
|
||||
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.poiLayers.showHospital.show,
|
||||
() => statusStore.poiLayers.showHospital.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
// 显示医院
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResource.getLoadingResource(LoadingResource.HOSPITAL)
|
||||
loadingResourceStore.getLoadingResource(LoadingResource.HOSPITAL)
|
||||
.ids
|
||||
);
|
||||
} else {
|
||||
// 隐藏医院
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResource.getLoadingResource(LoadingResource.HOSPITAL)
|
||||
loadingResourceStore.getLoadingResource(LoadingResource.HOSPITAL)
|
||||
.ids
|
||||
);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import { onMounted, watch } from 'vue';
|
||||
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const statusStore = useStatusStore();
|
||||
|
||||
// 保存图层引用
|
||||
let mainRoadLayer: ImageryLayer | null = null;
|
||||
@@ -21,7 +21,7 @@
|
||||
onMounted(() => {
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.infrastructureLayers.showMainRoad.show,
|
||||
() => statusStore.infrastructureLayers.showMainRoad.show,
|
||||
(newValue: boolean) => {
|
||||
mainRoadLayer!.show = newValue;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import { onMounted, watch } from 'vue';
|
||||
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const statusStore = useStatusStore();
|
||||
|
||||
// 保存图层引用
|
||||
let populationLayer: ImageryLayer | null = null;
|
||||
@@ -21,7 +21,7 @@
|
||||
onMounted(() => {
|
||||
// 监听显示
|
||||
watch(
|
||||
() => useStatus.poiLayers.showPopulationGrid.show,
|
||||
() => statusStore.poiLayers.showPopulationGrid.show,
|
||||
(newValue: boolean) => {
|
||||
populationLayer!.show = newValue;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div>
|
||||
<!-- 加载水库点位 -->
|
||||
<LoadingPoints
|
||||
v-if="useStatus.appLoadingCompleted && reservoirList.length > 0"
|
||||
v-if="statusStore.appLoadingCompleted && reservoirList.length > 0"
|
||||
:base-points="reservoirList"
|
||||
:get-disaster-icon="getDisasterIcon"
|
||||
:prefix="config.prefix.reservoirPointId"
|
||||
@@ -15,11 +15,11 @@
|
||||
<InformationBox
|
||||
:data="reservoirDetail as Record<string, any>"
|
||||
:field="field"
|
||||
v-if="useLoadingInformation.reservoir.loading"
|
||||
v-if="loadingInformationStore.reservoir.loading"
|
||||
:title="informationBoxTitle"
|
||||
:offset-x="offsetX"
|
||||
:offset-y="offsetY"
|
||||
:key="useLoadingInformation.reservoir.id"
|
||||
:key="loadingInformationStore.reservoir.id"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -32,7 +32,7 @@
|
||||
import config from '@/config/config.json';
|
||||
import InformationBox from '@/component/common/InformationBox.vue';
|
||||
import { useStatusStore } from '@/stores/useStatusStore.ts';
|
||||
import { useLoadingInformationStore } from '@/stores/useLoadingInformation.ts';
|
||||
import { useLoadingInformationStore } from '@/stores/useLoadingInformation';
|
||||
import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils.ts';
|
||||
import { LoadingResource } from '@/types/common/LoadingResourceType.ts';
|
||||
import { useReservoirPoint } from '@/hooks/rain-earthquake/useReservoirPoint.ts';
|
||||
@@ -40,9 +40,9 @@
|
||||
|
||||
const reservoirList = ref<Point[]>([]);
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const useLoadingInformation = useLoadingInformationStore();
|
||||
const useLoadingResource = useLoadingResourceStore();
|
||||
const statusStore = useStatusStore();
|
||||
const loadingInformationStore = useLoadingInformationStore();
|
||||
const loadingResourceStore = useLoadingResourceStore();
|
||||
|
||||
// 信息框相关配置
|
||||
const offsetX = ref(0);
|
||||
@@ -59,13 +59,13 @@
|
||||
|
||||
// 监听id变化
|
||||
watch(
|
||||
() => useLoadingInformation.reservoir.id,
|
||||
() => loadingInformationStore.reservoir.id,
|
||||
async (newId: number) => {
|
||||
if (newId === -1) {
|
||||
return;
|
||||
}
|
||||
// 获取水库数据
|
||||
const clickObject = useLoadingInformation.clickObject;
|
||||
const clickObject = loadingInformationStore.clickObject;
|
||||
|
||||
if (!clickObject || !clickObject.primitive) {
|
||||
console.warn('点击对象或图元不存在');
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
const res = await $api.reservoirs.getPointDetailById(
|
||||
useLoadingInformation.reservoir.id
|
||||
loadingInformationStore.reservoir.id
|
||||
);
|
||||
|
||||
// 更新数据
|
||||
@@ -89,7 +89,7 @@
|
||||
offsetY.value = screenPos.y;
|
||||
|
||||
// 显示新的信息框
|
||||
useLoadingInformation.reservoir.loading = true;
|
||||
loadingInformationStore.reservoir.loading = true;
|
||||
} catch (error) {
|
||||
throw new Error(`坐标转换失败:${error}`);
|
||||
}
|
||||
@@ -98,21 +98,17 @@
|
||||
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.infrastructureLayers.showReservoir?.show,
|
||||
() => statusStore.infrastructureLayers.showReservoir?.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
// 显示水库
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResource.getLoadingResource(
|
||||
LoadingResource.RESERVOIR
|
||||
).ids
|
||||
loadingResourceStore.getLoadingResource(LoadingResource.RESERVOIR).ids
|
||||
);
|
||||
} else {
|
||||
// 隐藏水库
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResource.getLoadingResource(
|
||||
LoadingResource.RESERVOIR
|
||||
).ids
|
||||
loadingResourceStore.getLoadingResource(LoadingResource.RESERVOIR).ids
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div>
|
||||
<!-- 加载学校点位 -->
|
||||
<LoadingPoints
|
||||
v-if="useStatus.appLoadingCompleted && schoolList.length > 0"
|
||||
v-if="statusStore.appLoadingCompleted && schoolList.length > 0"
|
||||
:base-points="schoolList"
|
||||
:get-disaster-icon="getDisasterIcon"
|
||||
:prefix="config.prefix.schoolPointId"
|
||||
@@ -15,11 +15,11 @@
|
||||
<InformationBox
|
||||
:data="schoolDetail as Record<string, any>"
|
||||
:field="field"
|
||||
v-if="useLoadingInformation.school.loading"
|
||||
v-if="loadingInformationStore.school.loading"
|
||||
:title="informationBoxTitle"
|
||||
:offset-x="offsetX"
|
||||
:offset-y="offsetY"
|
||||
:key="useLoadingInformation.school.id"
|
||||
:key="loadingInformationStore.school.id"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -40,9 +40,9 @@
|
||||
|
||||
const schoolList = ref<Point[]>([]);
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const useLoadingInformation = useLoadingInformationStore();
|
||||
const useLoadingResource = useLoadingResourceStore();
|
||||
const statusStore = useStatusStore();
|
||||
const loadingInformationStore = useLoadingInformationStore();
|
||||
const loadingResourceStore = useLoadingResourceStore();
|
||||
|
||||
// 信息框相关配置
|
||||
const offsetX = ref(0);
|
||||
@@ -59,13 +59,13 @@
|
||||
|
||||
// 监听id变化
|
||||
watch(
|
||||
() => useLoadingInformation.school.id,
|
||||
() => loadingInformationStore.school.id,
|
||||
async (newId: number) => {
|
||||
if (newId === -1) {
|
||||
return;
|
||||
}
|
||||
// 获取学校数据
|
||||
const clickObject = useLoadingInformation.clickObject;
|
||||
const clickObject = loadingInformationStore.clickObject;
|
||||
|
||||
if (!clickObject || !clickObject.primitive) {
|
||||
console.warn('点击对象或图元不存在');
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
const res = await $api.schools.getPointDetailById(
|
||||
useLoadingInformation.school.id
|
||||
loadingInformationStore.school.id
|
||||
);
|
||||
|
||||
// 更新数据
|
||||
@@ -89,7 +89,7 @@
|
||||
offsetY.value = screenPos.y;
|
||||
|
||||
// 显示新的信息框
|
||||
useLoadingInformation.school.loading = true;
|
||||
loadingInformationStore.school.loading = true;
|
||||
} catch (error) {
|
||||
throw new Error(`坐标转换失败:${error}`);
|
||||
}
|
||||
@@ -98,18 +98,18 @@
|
||||
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.poiLayers.showSchool?.show,
|
||||
() => statusStore.poiLayers.showSchool?.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
// 显示学校
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResource.getLoadingResource(LoadingResource.SCHOOL)
|
||||
loadingResourceStore.getLoadingResource(LoadingResource.SCHOOL)
|
||||
.ids
|
||||
);
|
||||
} else {
|
||||
// 隐藏学校
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResource.getLoadingResource(LoadingResource.SCHOOL)
|
||||
loadingResourceStore.getLoadingResource(LoadingResource.SCHOOL)
|
||||
.ids
|
||||
);
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div>
|
||||
<!-- 加载物资储备点 -->
|
||||
<LoadingPoints
|
||||
v-if="useStatus.appLoadingCompleted && storePointsList.length > 0"
|
||||
v-if="statusStore.appLoadingCompleted && storePointsList.length > 0"
|
||||
:base-points="storePointsList"
|
||||
:get-disaster-icon="getDisasterIcon"
|
||||
:prefix="config.prefix.storePointsPointId"
|
||||
@@ -15,11 +15,11 @@
|
||||
<InformationBox
|
||||
:data="storePointDetail as Record<string, any>"
|
||||
:field="field"
|
||||
v-if="useLoadingInformation.storePoints.loading"
|
||||
v-if="loadingInformationStore.storePoints.loading"
|
||||
:title="informationBoxTitle"
|
||||
:offset-x="offsetX"
|
||||
:offset-y="offsetY"
|
||||
:key="useLoadingInformation.storePoints.id"
|
||||
:key="loadingInformationStore.storePoints.id"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -40,9 +40,9 @@
|
||||
|
||||
const storePointsList = ref<Point[]>([]);
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const useLoadingInformation = useLoadingInformationStore();
|
||||
const useLoadingResource = useLoadingResourceStore();
|
||||
const statusStore = useStatusStore();
|
||||
const loadingInformationStore = useLoadingInformationStore();
|
||||
const loadingResourceStore = useLoadingResourceStore();
|
||||
|
||||
// 信息框相关配置
|
||||
const offsetX = ref(0);
|
||||
@@ -59,13 +59,13 @@
|
||||
|
||||
// 监听id变化
|
||||
watch(
|
||||
() => useLoadingInformation.storePoints.id,
|
||||
() => loadingInformationStore.storePoints.id,
|
||||
async (newId: number) => {
|
||||
if (newId === -1) {
|
||||
return;
|
||||
}
|
||||
// 获取物资储备点数据
|
||||
const clickObject = useLoadingInformation.clickObject;
|
||||
const clickObject = loadingInformationStore.clickObject;
|
||||
|
||||
if (!clickObject || !clickObject.primitive) {
|
||||
console.warn('点击对象或图元不存在');
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
const res = await $api.storePoints.getPointDetailById(
|
||||
useLoadingInformation.storePoints.id
|
||||
loadingInformationStore.storePoints.id
|
||||
);
|
||||
|
||||
// 更新数据
|
||||
@@ -89,7 +89,7 @@
|
||||
offsetY.value = screenPos.y;
|
||||
|
||||
// 显示新的信息框
|
||||
useLoadingInformation.storePoints.loading = true;
|
||||
loadingInformationStore.storePoints.loading = true;
|
||||
} catch (error) {
|
||||
throw new Error(`坐标转换失败:${error}`);
|
||||
}
|
||||
@@ -98,19 +98,19 @@
|
||||
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.poiLayers.showReservePoint.show,
|
||||
() => statusStore.poiLayers.showReservePoint.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
// 显示物资储备点
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResource.getLoadingResource(
|
||||
loadingResourceStore.getLoadingResource(
|
||||
LoadingResource.STORE_POINTS
|
||||
).ids
|
||||
);
|
||||
} else {
|
||||
// 隐藏物资储备点
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResource.getLoadingResource(
|
||||
loadingResourceStore.getLoadingResource(
|
||||
LoadingResource.STORE_POINTS
|
||||
).ids
|
||||
);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div>
|
||||
<!-- 加载地铁站点点位 -->
|
||||
<LoadingPoints
|
||||
v-if="useStatus.appLoadingCompleted && subwayStationList.length > 0"
|
||||
v-if="statusStore.appLoadingCompleted && subwayStationList.length > 0"
|
||||
:base-points="subwayStationList"
|
||||
:get-disaster-icon="getDisasterIcon"
|
||||
:prefix="config.prefix.subwayStationPointId"
|
||||
@@ -15,11 +15,11 @@
|
||||
<InformationBox
|
||||
:data="subwayStationDetail as Record<string, any>"
|
||||
:field="field"
|
||||
v-if="useLoadingInformation.subwayStation.loading"
|
||||
v-if="loadingInformationStore.subwayStation.loading"
|
||||
:title="informationBoxTitle"
|
||||
:offset-x="offsetX"
|
||||
:offset-y="offsetY"
|
||||
:key="useLoadingInformation.subwayStation.id"
|
||||
:key="loadingInformationStore.subwayStation.id"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
@@ -40,9 +40,9 @@
|
||||
|
||||
const subwayStationList = ref<Point[]>([]);
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const useLoadingInformation = useLoadingInformationStore();
|
||||
const useLoadingResource = useLoadingResourceStore();
|
||||
const statusStore = useStatusStore();
|
||||
const loadingInformationStore = useLoadingInformationStore();
|
||||
const loadingResourceStore = useLoadingResourceStore();
|
||||
|
||||
// 信息框相关配置
|
||||
const offsetX = ref(0);
|
||||
@@ -59,13 +59,13 @@
|
||||
|
||||
// 监听id变化
|
||||
watch(
|
||||
() => useLoadingInformation.subwayStation.id,
|
||||
() => loadingInformationStore.subwayStation.id,
|
||||
async (newId: number) => {
|
||||
if (newId === -1) {
|
||||
return;
|
||||
}
|
||||
// 获取地铁站点数据
|
||||
const clickObject = useLoadingInformation.clickObject;
|
||||
const clickObject = loadingInformationStore.clickObject;
|
||||
|
||||
if (!clickObject || !clickObject.primitive) {
|
||||
console.warn('点击对象或图元不存在');
|
||||
@@ -73,7 +73,7 @@
|
||||
}
|
||||
|
||||
const res = await $api.subwayStations.getPointDetailById(
|
||||
useLoadingInformation.subwayStation.id
|
||||
loadingInformationStore.subwayStation.id
|
||||
);
|
||||
|
||||
// 更新数据
|
||||
@@ -89,7 +89,7 @@
|
||||
offsetY.value = screenPos.y;
|
||||
|
||||
// 显示新的信息框
|
||||
useLoadingInformation.subwayStation.loading = true;
|
||||
loadingInformationStore.subwayStation.loading = true;
|
||||
} catch (error) {
|
||||
throw new Error(`坐标转换失败:${error}`);
|
||||
}
|
||||
@@ -98,19 +98,19 @@
|
||||
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.poiLayers.showSubwayStation?.show,
|
||||
() => statusStore.poiLayers.showSubwayStation?.show,
|
||||
(newValue: boolean) => {
|
||||
if (newValue) {
|
||||
// 显示地铁站点
|
||||
CesiumUtilsSingleton.batchShowPrimitives(
|
||||
useLoadingResource.getLoadingResource(
|
||||
loadingResourceStore.getLoadingResource(
|
||||
LoadingResource.SUBWAY_STATION
|
||||
).ids
|
||||
);
|
||||
} else {
|
||||
// 隐藏地铁站点
|
||||
CesiumUtilsSingleton.batchHidePrimitives(
|
||||
useLoadingResource.getLoadingResource(
|
||||
loadingResourceStore.getLoadingResource(
|
||||
LoadingResource.SUBWAY_STATION
|
||||
).ids
|
||||
);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import { onMounted, watch } from 'vue';
|
||||
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const statusStore = useStatusStore();
|
||||
|
||||
// 保存图层引用
|
||||
let trafficRoadLayer: ImageryLayer | null = null;
|
||||
@@ -21,7 +21,7 @@
|
||||
onMounted(() => {
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.infrastructureLayers.showTrafficRoad.show,
|
||||
() => statusStore.infrastructureLayers.showTrafficRoad.show,
|
||||
(newValue: boolean) => {
|
||||
trafficRoadLayer!.show = newValue;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
import { onMounted, watch } from 'vue';
|
||||
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
|
||||
|
||||
const useStatus = useStatusStore();
|
||||
const statusStore = useStatusStore();
|
||||
|
||||
// 保存图层引用
|
||||
let waterPipeLayer: ImageryLayer | null = null;
|
||||
@@ -21,7 +21,7 @@
|
||||
onMounted(() => {
|
||||
// 监听显示隐藏
|
||||
watch(
|
||||
() => useStatus.infrastructureLayers.showNetworkSystem.show,
|
||||
() => statusStore.infrastructureLayers.showNetworkSystem.show,
|
||||
(newValue: boolean) => {
|
||||
waterPipeLayer!.show = newValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user