2026-04-21 19:50:57 +08:00
|
|
|
import { useStatusStore } from '@/stores/useStatusStore.ts';
|
|
|
|
|
import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils.ts';
|
2026-04-18 17:34:46 +08:00
|
|
|
import config from '@/config/config.json';
|
2026-04-21 19:50:57 +08:00
|
|
|
import { useButtonSelectedIdStore } from '@/stores/useButtonSelectedIdStore';
|
2026-04-18 17:34:46 +08:00
|
|
|
|
|
|
|
|
export const useRightHandle = () => {
|
2026-05-05 17:09:32 +08:00
|
|
|
/**
|
|
|
|
|
* 暴雨模拟
|
|
|
|
|
* @param status - 状态
|
|
|
|
|
*/
|
|
|
|
|
const rainstormSimulation = (status: unknown) => {
|
|
|
|
|
if (status as boolean) {
|
2026-05-05 19:17:58 +08:00
|
|
|
// 开启暴雨模拟:显示降雨栅格图层
|
|
|
|
|
useStatusStore().weatherLayers.showRainfallGrid.loading = true;
|
|
|
|
|
useStatusStore().weatherLayers.showRainfallGrid.show = true;
|
|
|
|
|
} else {
|
|
|
|
|
// 关闭暴雨模拟:隐藏降雨栅格图层
|
|
|
|
|
useStatusStore().weatherLayers.showRainfallGrid.show = false;
|
2026-05-05 17:09:32 +08:00
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-18 17:34:46 +08:00
|
|
|
/**
|
|
|
|
|
* 重置场景
|
|
|
|
|
*/
|
|
|
|
|
const resetScene = () => {
|
|
|
|
|
CesiumUtilsSingleton.clearAllResources('custom');
|
|
|
|
|
useStatusStore().resetScene();
|
2026-04-21 19:50:57 +08:00
|
|
|
useButtonSelectedIdStore().resetId();
|
2026-04-18 17:34:46 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 重置视角
|
|
|
|
|
*/
|
|
|
|
|
const resetView = () => {
|
|
|
|
|
CesiumUtilsSingleton.flyToTarget(
|
|
|
|
|
config.defaultPosition as [number, number, number]
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
2026-05-05 17:09:32 +08:00
|
|
|
return { rainstormSimulation, resetScene, resetView };
|
2026-04-18 17:34:46 +08:00
|
|
|
};
|