Files
xian_vue_new/src/hooks/useLayerControl.ts
T

74 lines
1.6 KiB
TypeScript
Raw Normal View History

import { useStatusStore } from '@/stores/useStatusStore';
2026-04-16 09:09:00 +08:00
/**
* 控制面板显示隐藏逻辑
*/
export const useLayerControl = () => {
/**
* 点击显示隐藏隐患点
* @param status - 显示隐藏状态
*/
const clickHiddenDangerPoint = (status: unknown) => {
2026-04-18 17:34:46 +08:00
// 改变风险点显示状态
useStatusStore().mapLayers.riskPointShow.show = status as boolean;
2026-04-16 09:09:00 +08:00
};
/**
* 点击显示医院
*/
2026-04-18 17:34:46 +08:00
const clickHospital = () => {
// 加载状态为true
useStatusStore().poiLayers.showHospital.loading = true;
};
2026-04-18 19:03:06 +08:00
/**
* 点击显示危险源
*/
const clickDangerousSource = () => {
// 加载状态为true
useStatusStore().poiLayers.showDangerSource.loading = true;
};
2026-04-18 20:10:54 +08:00
/**
* 点击显示避难所
*/
const clickEmergencyShelter = () => {
// 加载状态为true
useStatusStore().poiLayers.showRefugeeShelter.loading = true;
};
2026-04-18 20:48:01 +08:00
/**
* 点击显示消防站
*/
const clickFireStation = () => {
// 加载状态为true
useStatusStore().poiLayers.showFireStation.loading = true;
};
2026-04-18 22:35:49 +08:00
/**
* 点击显示物资储备点
*/
const clickStorePoints = () => {
// 加载状态为true
useStatusStore().poiLayers.showReservePoint.loading = true;
};
2026-04-21 15:49:56 +08:00
/**
* 点击显示人口网格
*/
const clickPopulationGrid = () => {
// 加载状态为true
useStatusStore().poiLayers.showPopulationGrid.loading = true;
};
2026-04-18 20:10:54 +08:00
return {
clickHiddenDangerPoint,
clickHospital,
clickDangerousSource,
clickEmergencyShelter,
2026-04-18 20:48:01 +08:00
clickFireStation,
2026-04-18 22:35:49 +08:00
clickStorePoints,
2026-04-21 15:49:56 +08:00
clickPopulationGrid,
2026-04-18 20:10:54 +08:00
};
2026-04-16 09:09:00 +08:00
};