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-05-05 17:09:32 +08:00
|
|
|
import { $api } from '@/api/api';
|
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) {
|
|
|
|
|
// 获取降雨栅格
|
|
|
|
|
$api.meteorology
|
|
|
|
|
.getRainfallGrid({
|
|
|
|
|
startTime: '2025-08-20T00:00:00',
|
|
|
|
|
endTime: '2025-08-20T00:00:00',
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log(res);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
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
|
|
|
};
|