修改组件中store的调用方式

This commit is contained in:
wzy-warehouse
2026-05-07 13:59:14 +08:00
parent ce6200389c
commit 4b55283ff6
32 changed files with 299 additions and 303 deletions
+2 -2
View File
@@ -22,7 +22,7 @@
// 点处理钩子 // 点处理钩子
const pointsHandle = usePointsHandle(); const pointsHandle = usePointsHandle();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
onMounted(() => { onMounted(() => {
// 加载点 // 加载点
@@ -35,7 +35,7 @@
); );
// 记录id // 记录id
useLoadingResource.addLoadingResource(props.loadingResourceField!, result); loadingResourceStore.addLoadingResource(props.loadingResourceField!, result);
}); });
</script> </script>
+4 -4
View File
@@ -16,8 +16,8 @@
const { areas, areasId, areasColor, areaTransparency, labelTransparency } = const { areas, areasId, areasColor, areaTransparency, labelTransparency } =
useAdministrativeDivision(); useAdministrativeDivision();
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
onMounted(async () => { onMounted(async () => {
// 构建批量添加配置数组 // 构建批量添加配置数组
@@ -48,7 +48,7 @@
await CesiumUtilsSingleton.batchAddGeoJsonLayers(layerConfigs); await CesiumUtilsSingleton.batchAddGeoJsonLayers(layerConfigs);
// 记录行政区划id // 记录行政区划id
useLoadingResource.addLoadingResource( loadingResourceStore.addLoadingResource(
LoadingResource.ADMINISTRATIVE_DIVISION, LoadingResource.ADMINISTRATIVE_DIVISION,
{ ids: areasId, info: [] } // 此处info不进行记录 { ids: areasId, info: [] } // 此处info不进行记录
); );
@@ -56,7 +56,7 @@
// 监听显示状态改变 // 监听显示状态改变
watch( watch(
() => useStatus.mapLayers.showAdministrativeDivision.show, () => statusStore.mapLayers.showAdministrativeDivision.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
CesiumUtilsSingleton.batchShowGeoJsonLayers(areasId); CesiumUtilsSingleton.batchShowGeoJsonLayers(areasId);
+4 -4
View File
@@ -4,8 +4,8 @@
<!-- 行政区划 --> <!-- 行政区划 -->
<AdministrativeDivision <AdministrativeDivision
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.mapLayers.showAdministrativeDivision.loading statusStore.mapLayers.showAdministrativeDivision.loading
" "
/> />
</template> </template>
@@ -31,7 +31,7 @@
automaticallyAdjustThePerspective, automaticallyAdjustThePerspective,
prohibitedEvents, prohibitedEvents,
} = useMap(); } = useMap();
const useStatus = useStatusStore(); const statusStore = useStatusStore();
onBeforeMount(() => { onBeforeMount(() => {
resetScene(); resetScene();
@@ -52,7 +52,7 @@
}); });
// 设置状态 // 设置状态
useStatus.appLoadingCompleted = true; statusStore.appLoadingCompleted = true;
// 注册全局点击监听器 // 注册全局点击监听器
registerAndClickOnTheListener(); registerAndClickOnTheListener();
@@ -9,40 +9,40 @@
<!-- 滑坡隐患点 --> <!-- 滑坡隐患点 -->
<LandslideComponent <LandslideComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showLandslideHiddenPoint.loading statusStore.poiLayers.showLandslideHiddenPoint.loading
" "
/> />
<!-- 泥石流隐患点 --> <!-- 泥石流隐患点 -->
<DebrisFlowComponent <DebrisFlowComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showDebrisFlowHiddenPoint.loading statusStore.poiLayers.showDebrisFlowHiddenPoint.loading
" "
/> />
<!-- 内涝隐患点 --> <!-- 内涝隐患点 -->
<WaterLoggingComponent <WaterLoggingComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showWaterLoggingHiddenPoint.loading statusStore.poiLayers.showWaterLoggingHiddenPoint.loading
" "
/> />
<!-- 山洪隐患点 --> <!-- 山洪隐患点 -->
<FlashFloodComponent <FlashFloodComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showFlashFloodHiddenPoint.loading statusStore.poiLayers.showFlashFloodHiddenPoint.loading
" "
/> />
<!-- 降雨栅格图层组件 --> <!-- 降雨栅格图层组件 -->
<RainfallGridComponent <RainfallGridComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.weatherLayers.showRainfallGrid.loading statusStore.weatherLayers.showRainfallGrid.loading
" "
/> />
</template> </template>
@@ -52,16 +52,16 @@
<!-- 滑坡隐患点 --> <!-- 滑坡隐患点 -->
<LandslideComponent <LandslideComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showLandslideHiddenPoint.loading statusStore.poiLayers.showLandslideHiddenPoint.loading
" "
/> />
<!-- 泥石流隐患点 --> <!-- 泥石流隐患点 -->
<DebrisFlowComponent <DebrisFlowComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showDebrisFlowHiddenPoint.loading statusStore.poiLayers.showDebrisFlowHiddenPoint.loading
" "
/> />
</template> </template>
@@ -69,8 +69,8 @@
<!-- 风险点组件 --> <!-- 风险点组件 -->
<RiskPointComponent <RiskPointComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.mapLayers.riskPointShow.loading statusStore.mapLayers.riskPointShow.loading
" "
/> />
</div> </div>
@@ -87,7 +87,7 @@
import RainfallGridComponent from '@/component/rain-earthquake/detail-panels/RainfallGridComponent.vue'; import RainfallGridComponent from '@/component/rain-earthquake/detail-panels/RainfallGridComponent.vue';
import { useStatusStore } from '@/stores/useStatusStore'; import { useStatusStore } from '@/stores/useStatusStore';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
// 获取父组件传递德数据 // 获取父组件传递德数据
const props = defineProps<{ const props = defineProps<{
@@ -1,7 +1,7 @@
<template> <template>
<div <div
class="control-show-panel-box" class="control-show-panel-box"
v-show="useStatus.uiComponents.controlPanel.show" v-show="statusStore.uiComponents.controlPanel.show"
> >
<div class="title-box"> <div class="title-box">
<header>图例与控制</header> <header>图例与控制</header>
@@ -65,8 +65,8 @@
import { useStatusStore } from '@/stores/useStatusStore'; import { useStatusStore } from '@/stores/useStatusStore';
import { computed } from 'vue'; import { computed } from 'vue';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const props = defineProps<{ const props = defineProps<{
constrolShowList: { constrolShowList: {
@@ -108,7 +108,7 @@
callback: (...args: unknown[]) => unknown callback: (...args: unknown[]) => unknown
) => { ) => {
// 重置信息框状态,隐藏显示 // 重置信息框状态,隐藏显示
useLoadingInformation.resetStatue(); loadingInformationStore.resetStatue();
// 调用回调函数 // 调用回调函数
callback(status); callback(status);
@@ -2,109 +2,109 @@
<!-- 医院 --> <!-- 医院 -->
<HospitalComponent <HospitalComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showHospital.loading statusStore.poiLayers.showHospital.loading
" "
/> />
<!-- 危险源 --> <!-- 危险源 -->
<DangerousSourceComponent <DangerousSourceComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showDangerSource.loading statusStore.poiLayers.showDangerSource.loading
" "
/> />
<!-- 避难所 --> <!-- 避难所 -->
<EmergencyShelterComponent <EmergencyShelterComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showRefugeeShelter.loading statusStore.poiLayers.showRefugeeShelter.loading
" "
/> />
<!-- 消防站 --> <!-- 消防站 -->
<FireStationComponent <FireStationComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showFireStation.loading statusStore.poiLayers.showFireStation.loading
" "
/> />
<!-- 物资储备点 --> <!-- 物资储备点 -->
<StorePointsComponent <StorePointsComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showReservePoint.loading statusStore.poiLayers.showReservePoint.loading
" "
/> />
<!-- 学校 --> <!-- 学校 -->
<SchoolComponent <SchoolComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showSchool.loading statusStore.poiLayers.showSchool.loading
" "
/> />
<!-- 人口网格 --> <!-- 人口网格 -->
<PopulationGridComponent <PopulationGridComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showPopulationGrid.loading statusStore.poiLayers.showPopulationGrid.loading
" "
/> />
<!-- 管网系统 --> <!-- 管网系统 -->
<WaterPipeComponent <WaterPipeComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.infrastructureLayers.showNetworkSystem.loading statusStore.infrastructureLayers.showNetworkSystem.loading
" "
/> />
<!-- 交通道路 --> <!-- 交通道路 -->
<TrafficRoadComponent <TrafficRoadComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.infrastructureLayers.showTrafficRoad.loading statusStore.infrastructureLayers.showTrafficRoad.loading
" "
/> />
<!-- 高速 --> <!-- 高速 -->
<HighwayComponent <HighwayComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.infrastructureLayers.showHighway.loading statusStore.infrastructureLayers.showHighway.loading
" "
/> />
<!-- 国道 --> <!-- 国道 -->
<NationRoadComponent <NationRoadComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.infrastructureLayers.showMainRoad.loading statusStore.infrastructureLayers.showMainRoad.loading
" "
/> />
<!-- 桥梁 --> <!-- 桥梁 -->
<BridgeComponent <BridgeComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.infrastructureLayers.showBridge.loading statusStore.infrastructureLayers.showBridge.loading
" "
/> />
<!-- 水库 --> <!-- 水库 -->
<ReservoirComponent <ReservoirComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.infrastructureLayers.showReservoir.loading statusStore.infrastructureLayers.showReservoir.loading
" "
/> />
<!-- 地铁站点 --> <!-- 地铁站点 -->
<SubwayStationComponent <SubwayStationComponent
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.poiLayers.showSubwayStation.loading statusStore.poiLayers.showSubwayStation.loading
" "
/> />
</template> </template>
@@ -126,7 +126,7 @@
import ReservoirComponent from '@/component/rain-earthquake/detail-panels/ReservoirComponent.vue'; import ReservoirComponent from '@/component/rain-earthquake/detail-panels/ReservoirComponent.vue';
import SubwayStationComponent from '@/component/rain-earthquake/detail-panels/SubwayStationComponent.vue'; import SubwayStationComponent from '@/component/rain-earthquake/detail-panels/SubwayStationComponent.vue';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
</script> </script>
<style scoped lang="less"></style> <style scoped lang="less"></style>
@@ -6,15 +6,15 @@
type="primary" type="primary"
@click="changeStatus" @click="changeStatus"
circle circle
:title="`${useStatus.uiComponents.disasterChainPointShow.show ? '关闭' : '打开'}灾害链影响点列表`" :title="`${statusStore.uiComponents.disasterChainPointShow.show ? '关闭' : '打开'}灾害链影响点列表`"
>{{ >{{
useStatus.uiComponents.disasterChainPointShow.show ? '-' : '+' statusStore.uiComponents.disasterChainPointShow.show ? '-' : '+'
}}</el-button }}</el-button
> >
</div> </div>
<div <div
class="disaster-list-box" class="disaster-list-box"
v-show="useStatus.uiComponents.disasterChainPointShow.show" v-show="statusStore.uiComponents.disasterChainPointShow.show"
> >
<header class="table-title"> <header class="table-title">
<span>灾害链影响点列表</span> <span>灾害链影响点列表</span>
@@ -84,7 +84,7 @@
import type { PaginationType } from '@/types/common/PaginationType'; import type { PaginationType } from '@/types/common/PaginationType';
import { ref, watch, computed, type Ref } from 'vue'; import { ref, watch, computed, type Ref } from 'vue';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
// 接收父组件的参数 // 接收父组件的参数
const props = defineProps<{ const props = defineProps<{
@@ -126,8 +126,8 @@
// 切换面板显示状态 // 切换面板显示状态
const changeStatus = () => { const changeStatus = () => {
useStatus.uiComponents.disasterChainPointShow.show = statusStore.uiComponents.disasterChainPointShow.show =
!useStatus.uiComponents.disasterChainPointShow.show; !statusStore.uiComponents.disasterChainPointShow.show;
}; };
// 上一页 // 上一页
@@ -2,8 +2,8 @@
<!-- 周边分析组件 --> <!-- 周边分析组件 -->
<AroundAnalysis <AroundAnalysis
v-if=" v-if="
useStatus.appLoadingCompleted && statusStore.appLoadingCompleted &&
useStatus.functionStatus.aroundAnalysis.loading statusStore.functionStatus.aroundAnalysis.loading
" "
/> />
</template> </template>
@@ -12,7 +12,7 @@
import { useStatusStore } from '@/stores/useStatusStore'; import { useStatusStore } from '@/stores/useStatusStore';
import AroundAnalysis from './function-child/AroundAnalysis.vue'; import AroundAnalysis from './function-child/AroundAnalysis.vue';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
</script> </script>
<style scoped></style> <style scoped></style>
@@ -1,9 +1,9 @@
<template> <template>
<div <div
v-show="useStatus.uiComponents.leftButton.show" v-show="statusStore.uiComponents.leftButton.show"
class="left-button-box" class="left-button-box"
:style="{ :style="{
left: `${useStatus.uiComponents.disasterChainPointShow.show ? 575 : 100}px`, left: `${statusStore.uiComponents.disasterChainPointShow.show ? 575 : 100}px`,
}" }"
> >
<ul class="left-button-ul"> <ul class="left-button-ul">
@@ -11,7 +11,7 @@
<button <button
@click="handelButton(index, buttonItem.callback)" @click="handelButton(index, buttonItem.callback)"
:style="{ :style="{
'background-image': `url(${useButtonSelectedId.leftButtonSelectedId == index ? leftOrangeButton : leftBlueButton})`, 'background-image': `url(${buttonSelectedIdStore.leftButtonSelectedId == index ? leftOrangeButton : leftBlueButton})`,
}" }"
> >
{{ buttonItem.name }} {{ buttonItem.name }}
@@ -27,8 +27,8 @@
import { useStatusStore } from '@/stores/useStatusStore.ts'; import { useStatusStore } from '@/stores/useStatusStore.ts';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useButtonSelectedId = useButtonSelectedIdStore(); const buttonSelectedIdStore = useButtonSelectedIdStore();
// 接收父组件传递的参数 // 接收父组件传递的参数
const props = defineProps<{ const props = defineProps<{
@@ -52,7 +52,7 @@
// 如果找到了选中的按钮,设置选中状态,同时执行回调函数 // 如果找到了选中的按钮,设置选中状态,同时执行回调函数
if (lastSelectedIndex !== -1) { if (lastSelectedIndex !== -1) {
useButtonSelectedId.leftButtonSelectedId = lastSelectedIndex; buttonSelectedIdStore.leftButtonSelectedId = lastSelectedIndex;
props.buttonList[lastSelectedIndex].callback(); props.buttonList[lastSelectedIndex].callback();
} }
}); });
@@ -63,23 +63,23 @@
callback: (...args: unknown[]) => unknown callback: (...args: unknown[]) => unknown
) => { ) => {
// 取消选中 // 取消选中
if (index == useButtonSelectedId.leftButtonSelectedId) { if (index == buttonSelectedIdStore.leftButtonSelectedId) {
callback(false); callback(false);
useButtonSelectedId.leftButtonSelectedId = -1; buttonSelectedIdStore.leftButtonSelectedId = -1;
return; return;
} else if ( } else if (
useButtonSelectedId.leftButtonSelectedId != -1 && buttonSelectedIdStore.leftButtonSelectedId != -1 &&
useButtonSelectedId.leftButtonSelectedId != index buttonSelectedIdStore.leftButtonSelectedId != index
) { ) {
console.error('当前按钮选中有误,请选择正确的按钮。'); console.error('当前按钮选中有误,请选择正确的按钮。');
return; return;
} }
useButtonSelectedId.leftButtonSelectedId = index; buttonSelectedIdStore.leftButtonSelectedId = index;
callback(true); callback(true);
// 如果该按钮只执行一次,则取消选中 // 如果该按钮只执行一次,则取消选中
if (props.buttonList[index].executeOnce) { if (props.buttonList[index].executeOnce) {
useButtonSelectedId.leftButtonSelectedId = -1; buttonSelectedIdStore.leftButtonSelectedId = -1;
} }
}; };
</script> </script>
@@ -3,21 +3,21 @@
<div <div
class="legend-container" class="legend-container"
v-show=" v-show="
useStatus.uiComponents.leftLegend.show && statusStore.uiComponents.leftLegend.show &&
Object.keys(useLeftLegend.legendListInfo).length > 0 Object.keys(leftLegendStore.legendListInfo).length > 0
" "
> >
<div <div
class="legend-box" class="legend-box"
v-for="key in Object.keys(useLeftLegend.legendListInfo)" v-for="key in Object.keys(leftLegendStore.legendListInfo)"
:key="key" :key="key"
> >
<div class="legend-title"> <div class="legend-title">
{{ useLeftLegend.legendListInfo[key].title }} {{ leftLegendStore.legendListInfo[key].title }}
</div> </div>
<div <div
class="legend-item" class="legend-item"
v-for="(item, index) in useLeftLegend.legendListInfo[key].list" v-for="(item, index) in leftLegendStore.legendListInfo[key].list"
:key="index" :key="index"
> >
<div <div
@@ -36,8 +36,8 @@
import { useLeftLegendStore } from '@/stores/useLeftLegendStore'; import { useLeftLegendStore } from '@/stores/useLeftLegendStore';
import { useStatusStore } from '@/stores/useStatusStore'; import { useStatusStore } from '@/stores/useStatusStore';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLeftLegend = useLeftLegendStore(); const leftLegendStore = useLeftLegendStore();
</script> </script>
<style scoped> <style scoped>
@@ -1,14 +1,14 @@
<template> <template>
<div <div
class="right-button-box" class="right-button-box"
v-show="useStatus.uiComponents.rightButton.show" v-show="statusStore.uiComponents.rightButton.show"
> >
<ul class="right-button-ul"> <ul class="right-button-ul">
<li v-for="(buttonItem, index) in buttonList" :key="index"> <li v-for="(buttonItem, index) in buttonList" :key="index">
<button <button
@click="handelButton(index, buttonItem.callback)" @click="handelButton(index, buttonItem.callback)"
:style="{ :style="{
'background-image': `url(${useButtonSelectedId.rightButtonSelectedId == index ? rightOrangeButton : rightBlueButton})`, 'background-image': `url(${buttonSelectedIdStore.rightButtonSelectedId == index ? rightOrangeButton : rightBlueButton})`,
}" }"
> >
{{ buttonItem.name }} {{ buttonItem.name }}
@@ -24,8 +24,8 @@
import { useStatusStore } from '@/stores/useStatusStore.ts'; import { useStatusStore } from '@/stores/useStatusStore.ts';
import { onMounted } from 'vue'; import { onMounted } from 'vue';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useButtonSelectedId = useButtonSelectedIdStore(); const buttonSelectedIdStore = useButtonSelectedIdStore();
// 接收父组件传递的参数 // 接收父组件传递的参数
const props = defineProps<{ const props = defineProps<{
@@ -49,7 +49,7 @@
// 如果找到了选中的按钮,设置选中状态,同时执行回调函数 // 如果找到了选中的按钮,设置选中状态,同时执行回调函数
if (lastSelectedIndex !== -1) { if (lastSelectedIndex !== -1) {
useButtonSelectedId.rightButtonSelectedId = lastSelectedIndex; buttonSelectedIdStore.rightButtonSelectedId = lastSelectedIndex;
props.buttonList[lastSelectedIndex].callback(true); props.buttonList[lastSelectedIndex].callback(true);
} }
}); });
@@ -59,20 +59,20 @@
index: number, index: number,
callback: (...args: unknown[]) => unknown callback: (...args: unknown[]) => unknown
) => { ) => {
if (index == useButtonSelectedId.rightButtonSelectedId) { if (index == buttonSelectedIdStore.rightButtonSelectedId) {
useButtonSelectedId.rightButtonSelectedId = -1; buttonSelectedIdStore.rightButtonSelectedId = -1;
callback(false); callback(false);
return; return;
} else if ( } else if (
useButtonSelectedId.rightButtonSelectedId != -1 && buttonSelectedIdStore.rightButtonSelectedId != -1 &&
useButtonSelectedId.rightButtonSelectedId != index buttonSelectedIdStore.rightButtonSelectedId != index
) { ) {
return; return;
} }
useButtonSelectedId.rightButtonSelectedId = index; buttonSelectedIdStore.rightButtonSelectedId = index;
callback(true); callback(true);
if (props.buttonList[index].executeOnce) { if (props.buttonList[index].executeOnce) {
useButtonSelectedId.rightButtonSelectedId = -1; buttonSelectedIdStore.rightButtonSelectedId = -1;
} }
}; };
</script> </script>
@@ -1,13 +1,13 @@
<template> <template>
<div class="step-box" v-show="useStatus.uiComponents.stepBar.show"> <div class="step-box" v-show="statusStore.uiComponents.stepBar.show">
<el-steps <el-steps
style="width: 100%; background-color: #ffffff00" style="width: 100%; background-color: #ffffff00"
:active="useStep.currentStep" :active="stepStore.currentStep"
finish-status="success" finish-status="success"
simple simple
> >
<el-step <el-step
v-for="(item, index) in useStep.stepList" v-for="(item, index) in stepStore.stepList"
:key="index" :key="index"
:title="item" :title="item"
/> />
@@ -19,8 +19,8 @@
import { useStatusStore } from '@/stores/useStatusStore'; import { useStatusStore } from '@/stores/useStatusStore';
import { useStepStore } from '@/stores/useStepStore'; import { useStepStore } from '@/stores/useStepStore';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useStep = useStepStore(); const stepStore = useStepStore();
</script> </script>
<style scoped> <style scoped>
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载泥石流隐患点 --> <!-- 加载泥石流隐患点 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && debrisFlowPoints.length > 0" v-if="statusStore.appLoadingCompleted && debrisFlowPoints.length > 0"
:base-points="debrisFlowPoints" :base-points="debrisFlowPoints"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.debrisFlowHiddenPointId" :prefix="config.prefix.debrisFlowHiddenPointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="debrisFlowPointDetail as Record<string, any>" :data="debrisFlowPointDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.debrisFlowHiddenPoint.loading" v-if="loadingInformationStore.debrisFlowHiddenPoint.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.debrisFlowHiddenPoint.id" :key="loadingInformationStore.debrisFlowHiddenPoint.id"
/> />
</div> </div>
</template> </template>
@@ -44,9 +44,9 @@
const debrisFlowPoints = ref<Point[]>([]); const debrisFlowPoints = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
const { field, getDisasterIcon } = useHiddenPoint(); const { field, getDisasterIcon } = useHiddenPoint();
@@ -65,13 +65,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.debrisFlowHiddenPoint.id, () => loadingInformationStore.debrisFlowHiddenPoint.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取泥石流隐患点数据 // 获取泥石流隐患点数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -79,7 +79,7 @@
} }
const res = await $api.hiddenDangerSpots.getPointDetailById( const res = await $api.hiddenDangerSpots.getPointDetailById(
useLoadingInformation.debrisFlowHiddenPoint.id loadingInformationStore.debrisFlowHiddenPoint.id
); );
// 更新数据 // 更新数据
@@ -95,7 +95,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.debrisFlowHiddenPoint.loading = true; loadingInformationStore.debrisFlowHiddenPoint.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -104,19 +104,19 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.poiLayers.showDebrisFlowHiddenPoint.show, () => statusStore.poiLayers.showDebrisFlowHiddenPoint.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示泥石流隐患点 // 显示泥石流隐患点
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.DEBRIS_FLOW_HIDDEN_POINT LoadingResource.DEBRIS_FLOW_HIDDEN_POINT
).ids ).ids
); );
} else { } else {
// 隐藏泥石流隐患点 // 隐藏泥石流隐患点
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.DEBRIS_FLOW_HIDDEN_POINT LoadingResource.DEBRIS_FLOW_HIDDEN_POINT
).ids ).ids
); );
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载山洪隐患点 --> <!-- 加载山洪隐患点 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && flashFloodPoints.length > 0" v-if="statusStore.appLoadingCompleted && flashFloodPoints.length > 0"
:base-points="flashFloodPoints" :base-points="flashFloodPoints"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.flashFloodHiddenPointId" :prefix="config.prefix.flashFloodHiddenPointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="flashFloodPointDetail as Record<string, any>" :data="flashFloodPointDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.flashFloodHiddenPoint.loading" v-if="loadingInformationStore.flashFloodHiddenPoint.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.flashFloodHiddenPoint.id" :key="loadingInformationStore.flashFloodHiddenPoint.id"
/> />
</div> </div>
</template> </template>
@@ -44,9 +44,9 @@
const flashFloodPoints = ref<Point[]>([]); const flashFloodPoints = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
const { field, getDisasterIcon } = useHiddenPoint(); const { field, getDisasterIcon } = useHiddenPoint();
@@ -65,13 +65,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.flashFloodHiddenPoint.id, () => loadingInformationStore.flashFloodHiddenPoint.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取山洪隐患点数据 // 获取山洪隐患点数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -79,7 +79,7 @@
} }
const res = await $api.hiddenDangerSpots.getPointDetailById( const res = await $api.hiddenDangerSpots.getPointDetailById(
useLoadingInformation.flashFloodHiddenPoint.id loadingInformationStore.flashFloodHiddenPoint.id
); );
// 更新数据 // 更新数据
@@ -95,7 +95,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.flashFloodHiddenPoint.loading = true; loadingInformationStore.flashFloodHiddenPoint.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -104,19 +104,19 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.poiLayers.showFlashFloodHiddenPoint.show, () => statusStore.poiLayers.showFlashFloodHiddenPoint.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示山洪隐患点 // 显示山洪隐患点
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.FLASH_FLOOD_HIDDEN_POINT LoadingResource.FLASH_FLOOD_HIDDEN_POINT
).ids ).ids
); );
} else { } else {
// 隐藏山洪隐患点 // 隐藏山洪隐患点
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.FLASH_FLOOD_HIDDEN_POINT LoadingResource.FLASH_FLOOD_HIDDEN_POINT
).ids ).ids
); );
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载滑坡隐患点 --> <!-- 加载滑坡隐患点 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && landslidePoints.length > 0" v-if="statusStore.appLoadingCompleted && landslidePoints.length > 0"
:base-points="landslidePoints" :base-points="landslidePoints"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.landslideHiddenPointId" :prefix="config.prefix.landslideHiddenPointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="landslidePointDetail as Record<string, any>" :data="landslidePointDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.landslideHiddenPoint.loading" v-if="loadingInformationStore.landslideHiddenPoint.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.landslideHiddenPoint.id" :key="loadingInformationStore.landslideHiddenPoint.id"
/> />
</div> </div>
</template> </template>
@@ -44,9 +44,9 @@
const landslidePoints = ref<Point[]>([]); const landslidePoints = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
const { field, getDisasterIcon } = useHiddenPoint(); const { field, getDisasterIcon } = useHiddenPoint();
@@ -65,13 +65,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.landslideHiddenPoint.id, () => loadingInformationStore.landslideHiddenPoint.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取滑坡隐患点数据 // 获取滑坡隐患点数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -79,7 +79,7 @@
} }
const res = await $api.hiddenDangerSpots.getPointDetailById( const res = await $api.hiddenDangerSpots.getPointDetailById(
useLoadingInformation.landslideHiddenPoint.id loadingInformationStore.landslideHiddenPoint.id
); );
// 更新数据 // 更新数据
@@ -95,7 +95,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.landslideHiddenPoint.loading = true; loadingInformationStore.landslideHiddenPoint.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -104,19 +104,19 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.poiLayers.showLandslideHiddenPoint.show, () => statusStore.poiLayers.showLandslideHiddenPoint.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示滑坡隐患点 // 显示滑坡隐患点
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.LANDSLIDE_HIDDEN_POINT LoadingResource.LANDSLIDE_HIDDEN_POINT
).ids ).ids
); );
} else { } else {
// 隐藏滑坡隐患点 // 隐藏滑坡隐患点
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.LANDSLIDE_HIDDEN_POINT LoadingResource.LANDSLIDE_HIDDEN_POINT
).ids ).ids
); );
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载风险点 --> <!-- 加载风险点 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && riskPoints.length > 0" v-if="statusStore.appLoadingCompleted && riskPoints.length > 0"
:base-points="riskPoints" :base-points="riskPoints"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.riskPointId" :prefix="config.prefix.riskPointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="riskPointDetail as Record<string, any>" :data="riskPointDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.riskPoint.loading" v-if="loadingInformationStore.riskPoint.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.riskPoint.id" :key="loadingInformationStore.riskPoint.id"
/> />
</div> </div>
</template> </template>
@@ -40,9 +40,9 @@
const riskPoints = ref<Point[]>([]); const riskPoints = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
// 信息框相关配置 // 信息框相关配置
const offsetX = ref(0); const offsetX = ref(0);
@@ -58,13 +58,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.riskPoint.id, () => loadingInformationStore.riskPoint.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取风险点数据 // 获取风险点数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -72,7 +72,7 @@
} }
const res = await $api.riskSpots.getPointDetailById( const res = await $api.riskSpots.getPointDetailById(
useLoadingInformation.riskPoint.id loadingInformationStore.riskPoint.id
); );
// 更新数据 // 更新数据
@@ -87,7 +87,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.riskPoint.loading = true; loadingInformationStore.riskPoint.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -96,17 +96,17 @@
// 监听显示隐藏风险点 // 监听显示隐藏风险点
watch( watch(
() => useStatus.mapLayers.riskPointShow.show, () => statusStore.mapLayers.riskPointShow.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.RISK_POINT LoadingResource.RISK_POINT
).ids ).ids
); );
} else { } else {
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.RISK_POINT LoadingResource.RISK_POINT
).ids ).ids
); );
@@ -4,7 +4,7 @@
<!-- 加载内涝隐患点 --> <!-- 加载内涝隐患点 -->
<LoadingPoints <LoadingPoints
v-if=" v-if="
useStatus.appLoadingCompleted && waterLoggingPoints.length > 0 statusStore.appLoadingCompleted && waterLoggingPoints.length > 0
" "
:base-points="waterLoggingPoints" :base-points="waterLoggingPoints"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
@@ -17,11 +17,11 @@
<InformationBox <InformationBox
:data="waterLoggingPointDetail as Record<string, any>" :data="waterLoggingPointDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.waterLoggingHiddenPoint.loading" v-if="loadingInformationStore.waterLoggingHiddenPoint.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.waterLoggingHiddenPoint.id" :key="loadingInformationStore.waterLoggingHiddenPoint.id"
/> />
</div> </div>
</template> </template>
@@ -46,9 +46,9 @@
const waterLoggingPoints = ref<Point[]>([]); const waterLoggingPoints = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
const { field, getDisasterIcon } = useHiddenPoint(); const { field, getDisasterIcon } = useHiddenPoint();
@@ -67,13 +67,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.waterLoggingHiddenPoint.id, () => loadingInformationStore.waterLoggingHiddenPoint.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取内涝隐患点数据 // 获取内涝隐患点数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -81,7 +81,7 @@
} }
const res = await $api.hiddenDangerSpots.getPointDetailById( const res = await $api.hiddenDangerSpots.getPointDetailById(
useLoadingInformation.waterLoggingHiddenPoint.id loadingInformationStore.waterLoggingHiddenPoint.id
); );
// 更新数据 // 更新数据
@@ -97,7 +97,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.waterLoggingHiddenPoint.loading = true; loadingInformationStore.waterLoggingHiddenPoint.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -106,19 +106,19 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.poiLayers.showWaterLoggingHiddenPoint.show, () => statusStore.poiLayers.showWaterLoggingHiddenPoint.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示内涝隐患点 // 显示内涝隐患点
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.WATER_LOGGING_HIDDEN_POINT LoadingResource.WATER_LOGGING_HIDDEN_POINT
).ids ).ids
); );
} else { } else {
// 隐藏内涝隐患点 // 隐藏内涝隐患点
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.WATER_LOGGING_HIDDEN_POINT LoadingResource.WATER_LOGGING_HIDDEN_POINT
).ids ).ids
); );
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载桥梁点 --> <!-- 加载桥梁点 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && bridgeList.length > 0" v-if="statusStore.appLoadingCompleted && bridgeList.length > 0"
:base-points="bridgeList" :base-points="bridgeList"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.bridgePointId" :prefix="config.prefix.bridgePointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="storePointDetail as Record<string, any>" :data="storePointDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.bridge.loading" v-if="loadingInformationStore.bridge.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.bridge.id" :key="loadingInformationStore.bridge.id"
/> />
</div> </div>
</template> </template>
@@ -40,9 +40,9 @@
const bridgeList = ref<Point[]>([]); const bridgeList = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
// 信息框相关配置 // 信息框相关配置
const offsetX = ref(0); const offsetX = ref(0);
@@ -59,13 +59,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.bridge.id, () => loadingInformationStore.bridge.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取桥梁点数据 // 获取桥梁点数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -73,7 +73,7 @@
} }
const res = await $api.bridges.getPointDetailById( const res = await $api.bridges.getPointDetailById(
useLoadingInformation.bridge.id loadingInformationStore.bridge.id
); );
// 更新数据 // 更新数据
@@ -89,7 +89,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.bridge.loading = true; loadingInformationStore.bridge.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -98,18 +98,18 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.infrastructureLayers.showBridge.show, () => statusStore.infrastructureLayers.showBridge.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示桥梁点 // 显示桥梁点
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource(LoadingResource.BRIDGE) loadingResourceStore.getLoadingResource(LoadingResource.BRIDGE)
.ids .ids
); );
} else { } else {
// 隐藏桥梁点 // 隐藏桥梁点
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource(LoadingResource.BRIDGE) loadingResourceStore.getLoadingResource(LoadingResource.BRIDGE)
.ids .ids
); );
} }
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载危险源 --> <!-- 加载危险源 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && dangerousSourcePoints.length > 0" v-if="statusStore.appLoadingCompleted && dangerousSourcePoints.length > 0"
:base-points="dangerousSourcePoints" :base-points="dangerousSourcePoints"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.dangerousSourcePointId" :prefix="config.prefix.dangerousSourcePointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="dangerousSourcePointDetail as Record<string, any>" :data="dangerousSourcePointDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.dangerousSource.loading" v-if="loadingInformationStore.dangerousSource.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.dangerousSource.id" :key="loadingInformationStore.dangerousSource.id"
/> />
</div> </div>
</template> </template>
@@ -40,9 +40,9 @@
const dangerousSourcePoints = ref<Point[]>([]); const dangerousSourcePoints = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
// 信息框相关配置 // 信息框相关配置
const offsetX = ref(0); const offsetX = ref(0);
@@ -59,13 +59,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.dangerousSource.id, () => loadingInformationStore.dangerousSource.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取危险源数据 // 获取危险源数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -73,7 +73,7 @@
} }
const res = await $api.dangerousSource.getPointDetailById( const res = await $api.dangerousSource.getPointDetailById(
useLoadingInformation.dangerousSource.id loadingInformationStore.dangerousSource.id
); );
// 更新数据 // 更新数据
@@ -89,7 +89,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.dangerousSource.loading = true; loadingInformationStore.dangerousSource.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -98,19 +98,19 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.poiLayers.showDangerSource.show, () => statusStore.poiLayers.showDangerSource.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示危险源 // 显示危险源
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.DANGEROUS_SOURCE LoadingResource.DANGEROUS_SOURCE
).ids ).ids
); );
} else { } else {
// 隐藏危险源 // 隐藏危险源
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.DANGEROUS_SOURCE LoadingResource.DANGEROUS_SOURCE
).ids ).ids
); );
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载避难所 --> <!-- 加载避难所 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && emergencyShelterPoints.length > 0" v-if="statusStore.appLoadingCompleted && emergencyShelterPoints.length > 0"
:base-points="emergencyShelterPoints" :base-points="emergencyShelterPoints"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.emergencyShelterPointId" :prefix="config.prefix.emergencyShelterPointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="emergencyShelterPointDetail as Record<string, any>" :data="emergencyShelterPointDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.emergencyShelter.loading" v-if="loadingInformationStore.emergencyShelter.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.emergencyShelter.id" :key="loadingInformationStore.emergencyShelter.id"
/> />
</div> </div>
</template> </template>
@@ -40,9 +40,9 @@
const emergencyShelterPoints = ref<Point[]>([]); const emergencyShelterPoints = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
// 信息框相关配置 // 信息框相关配置
const offsetX = ref(0); const offsetX = ref(0);
@@ -59,13 +59,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.emergencyShelter.id, () => loadingInformationStore.emergencyShelter.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取避难所数据 // 获取避难所数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -73,7 +73,7 @@
} }
const res = await $api.emergencyShelter.getPointDetailById( const res = await $api.emergencyShelter.getPointDetailById(
useLoadingInformation.emergencyShelter.id loadingInformationStore.emergencyShelter.id
); );
// 更新数据 // 更新数据
@@ -89,7 +89,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.emergencyShelter.loading = true; loadingInformationStore.emergencyShelter.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -98,19 +98,19 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.poiLayers.showRefugeeShelter.show, () => statusStore.poiLayers.showRefugeeShelter.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示避难所 // 显示避难所
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.EMERGENCY_SHELTER LoadingResource.EMERGENCY_SHELTER
).ids ).ids
); );
} else { } else {
// 隐藏避难所 // 隐藏避难所
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.EMERGENCY_SHELTER LoadingResource.EMERGENCY_SHELTER
).ids ).ids
); );
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载消防站 --> <!-- 加载消防站 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && fireStationPoints.length > 0" v-if="statusStore.appLoadingCompleted && fireStationPoints.length > 0"
:base-points="fireStationPoints" :base-points="fireStationPoints"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.fireStationPointId" :prefix="config.prefix.fireStationPointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="fireStationPointDetail as Record<string, any>" :data="fireStationPointDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.fireStation.loading" v-if="loadingInformationStore.fireStation.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.fireStation.id" :key="loadingInformationStore.fireStation.id"
/> />
</div> </div>
</template> </template>
@@ -40,9 +40,9 @@
const fireStationPoints = ref<Point[]>([]); const fireStationPoints = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
// 信息框相关配置 // 信息框相关配置
const offsetX = ref(0); const offsetX = ref(0);
@@ -59,13 +59,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.fireStation.id, () => loadingInformationStore.fireStation.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取消防站数据 // 获取消防站数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -73,7 +73,7 @@
} }
const res = await $api.firefighter.getPointDetailById( const res = await $api.firefighter.getPointDetailById(
useLoadingInformation.fireStation.id loadingInformationStore.fireStation.id
); );
// 更新数据 // 更新数据
@@ -89,7 +89,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.fireStation.loading = true; loadingInformationStore.fireStation.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -98,19 +98,19 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.poiLayers.showFireStation.show, () => statusStore.poiLayers.showFireStation.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示消防站 // 显示消防站
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.FIRE_STATION LoadingResource.FIRE_STATION
).ids ).ids
); );
} else { } else {
// 隐藏消防站 // 隐藏消防站
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.FIRE_STATION LoadingResource.FIRE_STATION
).ids ).ids
); );
@@ -13,7 +13,7 @@
import { onMounted, watch } from 'vue'; import { onMounted, watch } from 'vue';
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue'; import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
// 保存图层引用 // 保存图层引用
let highwayLayer: ImageryLayer | null = null; let highwayLayer: ImageryLayer | null = null;
@@ -21,7 +21,7 @@
onMounted(() => { onMounted(() => {
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.infrastructureLayers.showHighway.show, () => statusStore.infrastructureLayers.showHighway.show,
(newValue: boolean) => { (newValue: boolean) => {
highwayLayer!.show = newValue; highwayLayer!.show = newValue;
} }
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载医院 --> <!-- 加载医院 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && hospitalPoints.length > 0" v-if="statusStore.appLoadingCompleted && hospitalPoints.length > 0"
:base-points="hospitalPoints" :base-points="hospitalPoints"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.hospitalPointId" :prefix="config.prefix.hospitalPointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="hospitalPointDetail as Record<string, any>" :data="hospitalPointDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.hospital.loading" v-if="loadingInformationStore.hospital.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.hospital.id" :key="loadingInformationStore.hospital.id"
/> />
</div> </div>
</template> </template>
@@ -40,9 +40,9 @@
const hospitalPoints = ref<Point[]>([]); const hospitalPoints = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
// 信息框相关配置 // 信息框相关配置
const offsetX = ref(0); const offsetX = ref(0);
@@ -59,13 +59,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.hospital.id, () => loadingInformationStore.hospital.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取医院数据 // 获取医院数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -73,7 +73,7 @@
} }
const res = await $api.hospitals.getPointDetailById( const res = await $api.hospitals.getPointDetailById(
useLoadingInformation.hospital.id loadingInformationStore.hospital.id
); );
// 更新数据 // 更新数据
@@ -89,7 +89,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.hospital.loading = true; loadingInformationStore.hospital.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -98,18 +98,18 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.poiLayers.showHospital.show, () => statusStore.poiLayers.showHospital.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示医院 // 显示医院
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource(LoadingResource.HOSPITAL) loadingResourceStore.getLoadingResource(LoadingResource.HOSPITAL)
.ids .ids
); );
} else { } else {
// 隐藏医院 // 隐藏医院
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource(LoadingResource.HOSPITAL) loadingResourceStore.getLoadingResource(LoadingResource.HOSPITAL)
.ids .ids
); );
} }
@@ -13,7 +13,7 @@
import { onMounted, watch } from 'vue'; import { onMounted, watch } from 'vue';
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue'; import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
// 保存图层引用 // 保存图层引用
let mainRoadLayer: ImageryLayer | null = null; let mainRoadLayer: ImageryLayer | null = null;
@@ -21,7 +21,7 @@
onMounted(() => { onMounted(() => {
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.infrastructureLayers.showMainRoad.show, () => statusStore.infrastructureLayers.showMainRoad.show,
(newValue: boolean) => { (newValue: boolean) => {
mainRoadLayer!.show = newValue; mainRoadLayer!.show = newValue;
} }
@@ -13,7 +13,7 @@
import { onMounted, watch } from 'vue'; import { onMounted, watch } from 'vue';
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue'; import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
// 保存图层引用 // 保存图层引用
let populationLayer: ImageryLayer | null = null; let populationLayer: ImageryLayer | null = null;
@@ -21,7 +21,7 @@
onMounted(() => { onMounted(() => {
// 监听显示 // 监听显示
watch( watch(
() => useStatus.poiLayers.showPopulationGrid.show, () => statusStore.poiLayers.showPopulationGrid.show,
(newValue: boolean) => { (newValue: boolean) => {
populationLayer!.show = newValue; populationLayer!.show = newValue;
} }
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载水库点位 --> <!-- 加载水库点位 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && reservoirList.length > 0" v-if="statusStore.appLoadingCompleted && reservoirList.length > 0"
:base-points="reservoirList" :base-points="reservoirList"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.reservoirPointId" :prefix="config.prefix.reservoirPointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="reservoirDetail as Record<string, any>" :data="reservoirDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.reservoir.loading" v-if="loadingInformationStore.reservoir.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.reservoir.id" :key="loadingInformationStore.reservoir.id"
/> />
</div> </div>
</template> </template>
@@ -32,7 +32,7 @@
import config from '@/config/config.json'; import config from '@/config/config.json';
import InformationBox from '@/component/common/InformationBox.vue'; import InformationBox from '@/component/common/InformationBox.vue';
import { useStatusStore } from '@/stores/useStatusStore.ts'; 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 { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils.ts';
import { LoadingResource } from '@/types/common/LoadingResourceType.ts'; import { LoadingResource } from '@/types/common/LoadingResourceType.ts';
import { useReservoirPoint } from '@/hooks/rain-earthquake/useReservoirPoint.ts'; import { useReservoirPoint } from '@/hooks/rain-earthquake/useReservoirPoint.ts';
@@ -40,9 +40,9 @@
const reservoirList = ref<Point[]>([]); const reservoirList = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
// 信息框相关配置 // 信息框相关配置
const offsetX = ref(0); const offsetX = ref(0);
@@ -59,13 +59,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.reservoir.id, () => loadingInformationStore.reservoir.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取水库数据 // 获取水库数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -73,7 +73,7 @@
} }
const res = await $api.reservoirs.getPointDetailById( const res = await $api.reservoirs.getPointDetailById(
useLoadingInformation.reservoir.id loadingInformationStore.reservoir.id
); );
// 更新数据 // 更新数据
@@ -89,7 +89,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.reservoir.loading = true; loadingInformationStore.reservoir.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -98,21 +98,17 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.infrastructureLayers.showReservoir?.show, () => statusStore.infrastructureLayers.showReservoir?.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示水库 // 显示水库
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(LoadingResource.RESERVOIR).ids
LoadingResource.RESERVOIR
).ids
); );
} else { } else {
// 隐藏水库 // 隐藏水库
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(LoadingResource.RESERVOIR).ids
LoadingResource.RESERVOIR
).ids
); );
} }
} }
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载学校点位 --> <!-- 加载学校点位 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && schoolList.length > 0" v-if="statusStore.appLoadingCompleted && schoolList.length > 0"
:base-points="schoolList" :base-points="schoolList"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.schoolPointId" :prefix="config.prefix.schoolPointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="schoolDetail as Record<string, any>" :data="schoolDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.school.loading" v-if="loadingInformationStore.school.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.school.id" :key="loadingInformationStore.school.id"
/> />
</div> </div>
</template> </template>
@@ -40,9 +40,9 @@
const schoolList = ref<Point[]>([]); const schoolList = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
// 信息框相关配置 // 信息框相关配置
const offsetX = ref(0); const offsetX = ref(0);
@@ -59,13 +59,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.school.id, () => loadingInformationStore.school.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取学校数据 // 获取学校数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -73,7 +73,7 @@
} }
const res = await $api.schools.getPointDetailById( const res = await $api.schools.getPointDetailById(
useLoadingInformation.school.id loadingInformationStore.school.id
); );
// 更新数据 // 更新数据
@@ -89,7 +89,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.school.loading = true; loadingInformationStore.school.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -98,18 +98,18 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.poiLayers.showSchool?.show, () => statusStore.poiLayers.showSchool?.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示学校 // 显示学校
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource(LoadingResource.SCHOOL) loadingResourceStore.getLoadingResource(LoadingResource.SCHOOL)
.ids .ids
); );
} else { } else {
// 隐藏学校 // 隐藏学校
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource(LoadingResource.SCHOOL) loadingResourceStore.getLoadingResource(LoadingResource.SCHOOL)
.ids .ids
); );
} }
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载物资储备点 --> <!-- 加载物资储备点 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && storePointsList.length > 0" v-if="statusStore.appLoadingCompleted && storePointsList.length > 0"
:base-points="storePointsList" :base-points="storePointsList"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.storePointsPointId" :prefix="config.prefix.storePointsPointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="storePointDetail as Record<string, any>" :data="storePointDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.storePoints.loading" v-if="loadingInformationStore.storePoints.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.storePoints.id" :key="loadingInformationStore.storePoints.id"
/> />
</div> </div>
</template> </template>
@@ -40,9 +40,9 @@
const storePointsList = ref<Point[]>([]); const storePointsList = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
// 信息框相关配置 // 信息框相关配置
const offsetX = ref(0); const offsetX = ref(0);
@@ -59,13 +59,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.storePoints.id, () => loadingInformationStore.storePoints.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取物资储备点数据 // 获取物资储备点数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -73,7 +73,7 @@
} }
const res = await $api.storePoints.getPointDetailById( const res = await $api.storePoints.getPointDetailById(
useLoadingInformation.storePoints.id loadingInformationStore.storePoints.id
); );
// 更新数据 // 更新数据
@@ -89,7 +89,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.storePoints.loading = true; loadingInformationStore.storePoints.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -98,19 +98,19 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.poiLayers.showReservePoint.show, () => statusStore.poiLayers.showReservePoint.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示物资储备点 // 显示物资储备点
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.STORE_POINTS LoadingResource.STORE_POINTS
).ids ).ids
); );
} else { } else {
// 隐藏物资储备点 // 隐藏物资储备点
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.STORE_POINTS LoadingResource.STORE_POINTS
).ids ).ids
); );
@@ -3,7 +3,7 @@
<div> <div>
<!-- 加载地铁站点点位 --> <!-- 加载地铁站点点位 -->
<LoadingPoints <LoadingPoints
v-if="useStatus.appLoadingCompleted && subwayStationList.length > 0" v-if="statusStore.appLoadingCompleted && subwayStationList.length > 0"
:base-points="subwayStationList" :base-points="subwayStationList"
:get-disaster-icon="getDisasterIcon" :get-disaster-icon="getDisasterIcon"
:prefix="config.prefix.subwayStationPointId" :prefix="config.prefix.subwayStationPointId"
@@ -15,11 +15,11 @@
<InformationBox <InformationBox
:data="subwayStationDetail as Record<string, any>" :data="subwayStationDetail as Record<string, any>"
:field="field" :field="field"
v-if="useLoadingInformation.subwayStation.loading" v-if="loadingInformationStore.subwayStation.loading"
:title="informationBoxTitle" :title="informationBoxTitle"
:offset-x="offsetX" :offset-x="offsetX"
:offset-y="offsetY" :offset-y="offsetY"
:key="useLoadingInformation.subwayStation.id" :key="loadingInformationStore.subwayStation.id"
/> />
</div> </div>
</template> </template>
@@ -40,9 +40,9 @@
const subwayStationList = ref<Point[]>([]); const subwayStationList = ref<Point[]>([]);
const useStatus = useStatusStore(); const statusStore = useStatusStore();
const useLoadingInformation = useLoadingInformationStore(); const loadingInformationStore = useLoadingInformationStore();
const useLoadingResource = useLoadingResourceStore(); const loadingResourceStore = useLoadingResourceStore();
// 信息框相关配置 // 信息框相关配置
const offsetX = ref(0); const offsetX = ref(0);
@@ -59,13 +59,13 @@
// 监听id变化 // 监听id变化
watch( watch(
() => useLoadingInformation.subwayStation.id, () => loadingInformationStore.subwayStation.id,
async (newId: number) => { async (newId: number) => {
if (newId === -1) { if (newId === -1) {
return; return;
} }
// 获取地铁站点数据 // 获取地铁站点数据
const clickObject = useLoadingInformation.clickObject; const clickObject = loadingInformationStore.clickObject;
if (!clickObject || !clickObject.primitive) { if (!clickObject || !clickObject.primitive) {
console.warn('点击对象或图元不存在'); console.warn('点击对象或图元不存在');
@@ -73,7 +73,7 @@
} }
const res = await $api.subwayStations.getPointDetailById( const res = await $api.subwayStations.getPointDetailById(
useLoadingInformation.subwayStation.id loadingInformationStore.subwayStation.id
); );
// 更新数据 // 更新数据
@@ -89,7 +89,7 @@
offsetY.value = screenPos.y; offsetY.value = screenPos.y;
// 显示新的信息框 // 显示新的信息框
useLoadingInformation.subwayStation.loading = true; loadingInformationStore.subwayStation.loading = true;
} catch (error) { } catch (error) {
throw new Error(`坐标转换失败:${error}`); throw new Error(`坐标转换失败:${error}`);
} }
@@ -98,19 +98,19 @@
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.poiLayers.showSubwayStation?.show, () => statusStore.poiLayers.showSubwayStation?.show,
(newValue: boolean) => { (newValue: boolean) => {
if (newValue) { if (newValue) {
// 显示地铁站点 // 显示地铁站点
CesiumUtilsSingleton.batchShowPrimitives( CesiumUtilsSingleton.batchShowPrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.SUBWAY_STATION LoadingResource.SUBWAY_STATION
).ids ).ids
); );
} else { } else {
// 隐藏地铁站点 // 隐藏地铁站点
CesiumUtilsSingleton.batchHidePrimitives( CesiumUtilsSingleton.batchHidePrimitives(
useLoadingResource.getLoadingResource( loadingResourceStore.getLoadingResource(
LoadingResource.SUBWAY_STATION LoadingResource.SUBWAY_STATION
).ids ).ids
); );
@@ -13,7 +13,7 @@
import { onMounted, watch } from 'vue'; import { onMounted, watch } from 'vue';
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue'; import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
// 保存图层引用 // 保存图层引用
let trafficRoadLayer: ImageryLayer | null = null; let trafficRoadLayer: ImageryLayer | null = null;
@@ -21,7 +21,7 @@
onMounted(() => { onMounted(() => {
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.infrastructureLayers.showTrafficRoad.show, () => statusStore.infrastructureLayers.showTrafficRoad.show,
(newValue: boolean) => { (newValue: boolean) => {
trafficRoadLayer!.show = newValue; trafficRoadLayer!.show = newValue;
} }
@@ -13,7 +13,7 @@
import { onMounted, watch } from 'vue'; import { onMounted, watch } from 'vue';
import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue'; import LoadingGeoserverLayer from '../../common/LoadingGeoserverLayer.vue';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
// 保存图层引用 // 保存图层引用
let waterPipeLayer: ImageryLayer | null = null; let waterPipeLayer: ImageryLayer | null = null;
@@ -21,7 +21,7 @@
onMounted(() => { onMounted(() => {
// 监听显示隐藏 // 监听显示隐藏
watch( watch(
() => useStatus.infrastructureLayers.showNetworkSystem.show, () => statusStore.infrastructureLayers.showNetworkSystem.show,
(newValue: boolean) => { (newValue: boolean) => {
waterPipeLayer!.show = newValue; waterPipeLayer!.show = newValue;
} }
@@ -1,7 +1,7 @@
<template> <template>
<div <div
class="around-analysis-box" class="around-analysis-box"
v-show="useStatus.functionStatus.aroundAnalysis.show" v-show="statusStore.functionStatus.aroundAnalysis.show"
> >
<!-- 搜索组件 --> <!-- 搜索组件 -->
<SearchComponent /> <SearchComponent />
@@ -20,7 +20,7 @@
import ButtonComponent from './around-analysis/ButtonComponent.vue'; import ButtonComponent from './around-analysis/ButtonComponent.vue';
import SearchComponent from './around-analysis/SearchComponent.vue'; import SearchComponent from './around-analysis/SearchComponent.vue';
const useStatus = useStatusStore(); const statusStore = useStatusStore();
</script> </script>
<style scoped></style> <style scoped></style>