重构组件结构,添加周边分析组件结构(但无具体实现)
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
import { useStatusStore } from '@/stores/useStatusStore.ts';
|
||||
|
||||
/**
|
||||
* 控制面板显示隐藏逻辑
|
||||
*/
|
||||
export const useLayerControl = () => {
|
||||
/**
|
||||
* 点击显示隐藏隐患点
|
||||
* @param status - 显示隐藏状态
|
||||
*/
|
||||
const clickHiddenDangerPoint = (status: unknown) => {
|
||||
// 改变风险点显示状态
|
||||
useStatusStore().mapLayers.riskPointShow.show = status as boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* 点击显示医院
|
||||
*/
|
||||
const clickHospital = () => {
|
||||
// 加载状态为true
|
||||
useStatusStore().poiLayers.showHospital.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 点击显示危险源
|
||||
*/
|
||||
const clickDangerousSource = () => {
|
||||
// 加载状态为true
|
||||
useStatusStore().poiLayers.showDangerSource.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 点击显示避难所
|
||||
*/
|
||||
const clickEmergencyShelter = () => {
|
||||
// 加载状态为true
|
||||
useStatusStore().poiLayers.showRefugeeShelter.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 点击显示消防站
|
||||
*/
|
||||
const clickFireStation = () => {
|
||||
// 加载状态为true
|
||||
useStatusStore().poiLayers.showFireStation.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 点击显示物资储备点
|
||||
*/
|
||||
const clickStorePoints = () => {
|
||||
// 加载状态为true
|
||||
useStatusStore().poiLayers.showReservePoint.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 点击显示人口网格
|
||||
*/
|
||||
const clickPopulationGrid = () => {
|
||||
// 加载状态为true
|
||||
useStatusStore().poiLayers.showPopulationGrid.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 显示管网
|
||||
*/
|
||||
const clickWaterPipe = () => {
|
||||
useStatusStore().infrastructureLayers.showNetworkSystem.loading = true;
|
||||
};
|
||||
|
||||
return {
|
||||
clickHiddenDangerPoint,
|
||||
clickHospital,
|
||||
clickDangerousSource,
|
||||
clickEmergencyShelter,
|
||||
clickFireStation,
|
||||
clickStorePoints,
|
||||
clickPopulationGrid,
|
||||
clickWaterPipe,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,25 @@
|
||||
import { useStatusStore } from '@/stores/useStatusStore';
|
||||
|
||||
export const useLeftHandle = () => {
|
||||
/**
|
||||
* 周边分析
|
||||
*/
|
||||
const clickAroundAnalysis = (status: unknown) => {
|
||||
// 如果选中,隐藏右侧按钮,取消选中则显示右侧按钮
|
||||
if (status as boolean) {
|
||||
useStatusStore().uiComponents.rightButton.show = false;
|
||||
|
||||
// 加载周边分析
|
||||
useStatusStore().functionStatus.aroundAnalysis.loading = true;
|
||||
useStatusStore().functionStatus.aroundAnalysis.show = true;
|
||||
} else {
|
||||
useStatusStore().uiComponents.rightButton.show = true;
|
||||
|
||||
// 隐藏周边分析
|
||||
useStatusStore().functionStatus.aroundAnalysis.show = false;
|
||||
}
|
||||
};
|
||||
return {
|
||||
clickAroundAnalysis,
|
||||
};
|
||||
};
|
||||
@@ -0,0 +1,26 @@
|
||||
import { useStatusStore } from '@/stores/useStatusStore.ts';
|
||||
import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils.ts';
|
||||
import config from '@/config/config.json';
|
||||
import { useButtonSelectedIdStore } from '@/stores/useButtonSelectedIdStore';
|
||||
|
||||
export const useRightHandle = () => {
|
||||
/**
|
||||
* 重置场景
|
||||
*/
|
||||
const resetScene = () => {
|
||||
CesiumUtilsSingleton.clearAllResources('custom');
|
||||
useStatusStore().resetScene();
|
||||
useButtonSelectedIdStore().resetId();
|
||||
};
|
||||
|
||||
/**
|
||||
* 重置视角
|
||||
*/
|
||||
const resetView = () => {
|
||||
CesiumUtilsSingleton.flyToTarget(
|
||||
config.defaultPosition as [number, number, number]
|
||||
);
|
||||
};
|
||||
|
||||
return { resetScene, resetView };
|
||||
};
|
||||
Reference in New Issue
Block a user