添加降雨服务器配置
This commit is contained in:
@@ -2,8 +2,27 @@ import { useStatusStore } from '@/stores/useStatusStore.ts';
|
||||
import { CesiumUtilsSingleton } from '@/utils/cesium/CesiumUtils.ts';
|
||||
import config from '@/config/config.json';
|
||||
import { useButtonSelectedIdStore } from '@/stores/useButtonSelectedIdStore';
|
||||
import { $api } from '@/api/api';
|
||||
|
||||
export const useRightHandle = () => {
|
||||
/**
|
||||
* 暴雨模拟
|
||||
* @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);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* 重置场景
|
||||
*/
|
||||
@@ -22,5 +41,5 @@ export const useRightHandle = () => {
|
||||
);
|
||||
};
|
||||
|
||||
return { resetScene, resetView };
|
||||
return { rainstormSimulation, resetScene, resetView };
|
||||
};
|
||||
|
||||
@@ -166,9 +166,8 @@ export const useRainDisasterChain = () => {
|
||||
const rightButtonInfo = [
|
||||
{
|
||||
name: '暴雨模拟',
|
||||
callback: () => {
|
||||
console.log('暴雨模拟');
|
||||
},
|
||||
callback: (status: unknown) =>
|
||||
useRightHandle().rainstormSimulation(status),
|
||||
selected: true,
|
||||
},
|
||||
{
|
||||
@@ -222,7 +221,10 @@ export const useRainDisasterChain = () => {
|
||||
callback: layerControl.clickLandslideHiddenPoint,
|
||||
link: landslideIcon,
|
||||
category: ControlPanelCategory.DISASTER_HAZARD,
|
||||
count: () => resourceStore.getResourceCount(LoadingResource.LANDSLIDE_HIDDEN_POINT),
|
||||
count: () =>
|
||||
resourceStore.getResourceCount(
|
||||
LoadingResource.LANDSLIDE_HIDDEN_POINT
|
||||
),
|
||||
},
|
||||
{
|
||||
name: '泥石流隐患点',
|
||||
@@ -231,7 +233,10 @@ export const useRainDisasterChain = () => {
|
||||
callback: layerControl.clickDebrisFlowHiddenPoint,
|
||||
link: debrisFlowIcon,
|
||||
category: ControlPanelCategory.DISASTER_HAZARD,
|
||||
count: () => resourceStore.getResourceCount(LoadingResource.DEBRIS_FLOW_HIDDEN_POINT),
|
||||
count: () =>
|
||||
resourceStore.getResourceCount(
|
||||
LoadingResource.DEBRIS_FLOW_HIDDEN_POINT
|
||||
),
|
||||
},
|
||||
{
|
||||
name: '内涝隐患点',
|
||||
@@ -240,7 +245,10 @@ export const useRainDisasterChain = () => {
|
||||
callback: layerControl.clickWaterLoggingHiddenPoint,
|
||||
link: waterLoggingIcon,
|
||||
category: ControlPanelCategory.DISASTER_HAZARD,
|
||||
count: () => resourceStore.getResourceCount(LoadingResource.WATER_LOGGING_HIDDEN_POINT),
|
||||
count: () =>
|
||||
resourceStore.getResourceCount(
|
||||
LoadingResource.WATER_LOGGING_HIDDEN_POINT
|
||||
),
|
||||
},
|
||||
{
|
||||
name: '山洪隐患点',
|
||||
@@ -249,7 +257,10 @@ export const useRainDisasterChain = () => {
|
||||
callback: layerControl.clickFlashFloodHiddenPoint,
|
||||
link: flashFloodIcon,
|
||||
category: ControlPanelCategory.DISASTER_HAZARD,
|
||||
count: () => resourceStore.getResourceCount(LoadingResource.FLASH_FLOOD_HIDDEN_POINT),
|
||||
count: () =>
|
||||
resourceStore.getResourceCount(
|
||||
LoadingResource.FLASH_FLOOD_HIDDEN_POINT
|
||||
),
|
||||
},
|
||||
{
|
||||
name: '风险点',
|
||||
@@ -277,7 +288,8 @@ export const useRainDisasterChain = () => {
|
||||
callback: layerControl.clickDangerousSource,
|
||||
link: dangerousSourceIcon,
|
||||
category: ControlPanelCategory.INFRASTRUCTURE,
|
||||
count: () => resourceStore.getResourceCount(LoadingResource.DANGEROUS_SOURCE),
|
||||
count: () =>
|
||||
resourceStore.getResourceCount(LoadingResource.DANGEROUS_SOURCE),
|
||||
},
|
||||
{
|
||||
name: '避难所',
|
||||
@@ -286,7 +298,8 @@ export const useRainDisasterChain = () => {
|
||||
callback: layerControl.clickEmergencyShelter,
|
||||
link: emergencyShelterIcon,
|
||||
category: ControlPanelCategory.INFRASTRUCTURE,
|
||||
count: () => resourceStore.getResourceCount(LoadingResource.EMERGENCY_SHELTER),
|
||||
count: () =>
|
||||
resourceStore.getResourceCount(LoadingResource.EMERGENCY_SHELTER),
|
||||
},
|
||||
{
|
||||
name: '消防站',
|
||||
@@ -295,7 +308,8 @@ export const useRainDisasterChain = () => {
|
||||
callback: layerControl.clickFireStation,
|
||||
link: firefighterIcon,
|
||||
category: ControlPanelCategory.INFRASTRUCTURE,
|
||||
count: () => resourceStore.getResourceCount(LoadingResource.FIRE_STATION),
|
||||
count: () =>
|
||||
resourceStore.getResourceCount(LoadingResource.FIRE_STATION),
|
||||
},
|
||||
{
|
||||
name: '储备点',
|
||||
@@ -304,7 +318,8 @@ export const useRainDisasterChain = () => {
|
||||
callback: layerControl.clickStorePoints,
|
||||
link: storePointsIcon,
|
||||
category: ControlPanelCategory.INFRASTRUCTURE,
|
||||
count: () => resourceStore.getResourceCount(LoadingResource.STORE_POINTS),
|
||||
count: () =>
|
||||
resourceStore.getResourceCount(LoadingResource.STORE_POINTS),
|
||||
},
|
||||
{
|
||||
name: '学校',
|
||||
@@ -340,7 +355,8 @@ export const useRainDisasterChain = () => {
|
||||
callback: layerControl.clickSubwayStation,
|
||||
link: subwayIcon,
|
||||
category: ControlPanelCategory.INFRASTRUCTURE,
|
||||
count: () => resourceStore.getResourceCount(LoadingResource.SUBWAY_STATION),
|
||||
count: () =>
|
||||
resourceStore.getResourceCount(LoadingResource.SUBWAY_STATION),
|
||||
},
|
||||
{
|
||||
name: '人口网格',
|
||||
|
||||
Reference in New Issue
Block a user