点击暴雨模拟按钮时候显示降雨图层
This commit is contained in:
@@ -149,6 +149,13 @@ export const useLayerControl = () => {
|
||||
useStatusStore().mapLayers.faultShow.loading = true;
|
||||
};
|
||||
|
||||
/**
|
||||
* 显示降雨栅格
|
||||
*/
|
||||
const clickRainfallGrid = () => {
|
||||
useStatusStore().weatherLayers.showRainfallGrid.loading = true;
|
||||
};
|
||||
|
||||
return {
|
||||
clickRiskPoint,
|
||||
clickFault,
|
||||
@@ -170,5 +177,6 @@ export const useLayerControl = () => {
|
||||
clickDebrisFlowHiddenPoint,
|
||||
clickWaterLoggingHiddenPoint,
|
||||
clickFlashFloodHiddenPoint,
|
||||
clickRainfallGrid,
|
||||
};
|
||||
};
|
||||
|
||||
@@ -2,7 +2,6 @@ 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 = () => {
|
||||
/**
|
||||
@@ -11,15 +10,12 @@ export const useRightHandle = () => {
|
||||
*/
|
||||
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);
|
||||
});
|
||||
// 开启暴雨模拟:显示降雨栅格图层
|
||||
useStatusStore().weatherLayers.showRainfallGrid.loading = true;
|
||||
useStatusStore().weatherLayers.showRainfallGrid.show = true;
|
||||
} else {
|
||||
// 关闭暴雨模拟:隐藏降雨栅格图层
|
||||
useStatusStore().weatherLayers.showRainfallGrid.show = false;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -31,6 +31,11 @@ import { LoadingResource } from '@/types/common/LoadingResourceType.ts';
|
||||
* @returns
|
||||
*/
|
||||
export const useRainDisasterChain = () => {
|
||||
// 初始化暴雨模拟状态(因为右侧按钮默认选中)
|
||||
const statusStore = useStatusStore();
|
||||
statusStore.weatherLayers.showRainfallGrid.loading = true;
|
||||
statusStore.weatherLayers.showRainfallGrid.show = true;
|
||||
|
||||
// ================灾害链影响点列表================================
|
||||
/**
|
||||
* 搜索条件
|
||||
@@ -168,7 +173,6 @@ export const useRainDisasterChain = () => {
|
||||
name: '暴雨模拟',
|
||||
callback: (status: unknown) =>
|
||||
useRightHandle().rainstormSimulation(status),
|
||||
selected: true,
|
||||
},
|
||||
{
|
||||
name: '暴雨触发',
|
||||
|
||||
Reference in New Issue
Block a user