2026-04-21 19:50:57 +08:00
|
|
|
import { useStatusStore } from '@/stores/useStatusStore.ts';
|
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 16:40:04 +08:00
|
|
|
/**
|
|
|
|
|
* 点击显示医院
|
|
|
|
|
*/
|
2026-04-18 17:34:46 +08:00
|
|
|
const clickHospital = () => {
|
|
|
|
|
// 加载状态为true
|
|
|
|
|
useStatusStore().poiLayers.showHospital.loading = true;
|
2026-04-18 16:40:04 +08:00
|
|
|
};
|
|
|
|
|
|
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 20:56:25 +08:00
|
|
|
/**
|
|
|
|
|
* 点击显示学校
|
|
|
|
|
*/
|
|
|
|
|
const clickSchool = () => {
|
|
|
|
|
// 加载状态为true
|
|
|
|
|
useStatusStore().poiLayers.showSchool.loading = true;
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-21 15:49:56 +08:00
|
|
|
/**
|
|
|
|
|
* 点击显示人口网格
|
|
|
|
|
*/
|
|
|
|
|
const clickPopulationGrid = () => {
|
|
|
|
|
// 加载状态为true
|
|
|
|
|
useStatusStore().poiLayers.showPopulationGrid.loading = true;
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-21 16:05:26 +08:00
|
|
|
/**
|
|
|
|
|
* 显示管网
|
|
|
|
|
*/
|
|
|
|
|
const clickWaterPipe = () => {
|
|
|
|
|
useStatusStore().infrastructureLayers.showNetworkSystem.loading = true;
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-24 20:41:41 +08:00
|
|
|
/**
|
|
|
|
|
* 显示交通道路
|
|
|
|
|
*/
|
|
|
|
|
const clickTrafficRoad = () => {
|
|
|
|
|
useStatusStore().infrastructureLayers.showTrafficRoad.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 20:56:25 +08:00
|
|
|
clickSchool,
|
2026-04-21 15:49:56 +08:00
|
|
|
clickPopulationGrid,
|
2026-04-21 16:05:26 +08:00
|
|
|
clickWaterPipe,
|
2026-04-24 20:41:41 +08:00
|
|
|
clickTrafficRoad
|
2026-04-18 20:10:54 +08:00
|
|
|
};
|
2026-04-16 09:09:00 +08:00
|
|
|
};
|