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 = () => {
|
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-25 21:05:59 +08:00
|
|
|
/**
|
|
|
|
|
* 显示高速
|
|
|
|
|
*/
|
|
|
|
|
const clickHighway = () => {
|
|
|
|
|
useStatusStore().infrastructureLayers.showHighway.loading = true;
|
|
|
|
|
};
|
|
|
|
|
/**
|
|
|
|
|
* 显示国道
|
|
|
|
|
*/
|
|
|
|
|
const clickNationRoad = () => {
|
|
|
|
|
useStatusStore().infrastructureLayers.showMainRoad.loading = true;
|
|
|
|
|
};
|
2026-04-27 14:14:39 +08:00
|
|
|
/**
|
|
|
|
|
* 显示桥梁
|
|
|
|
|
*/
|
|
|
|
|
const clickBridge = () => {
|
|
|
|
|
useStatusStore().infrastructureLayers.showBridge.loading = true;
|
|
|
|
|
};
|
2026-04-25 21:05:59 +08:00
|
|
|
|
2026-04-27 14:51:50 +08:00
|
|
|
/**
|
|
|
|
|
* 显示水库
|
|
|
|
|
*/
|
|
|
|
|
const clickReservoir = () => {
|
|
|
|
|
useStatusStore().infrastructureLayers.showReservoir.loading = true;
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-27 15:04:59 +08:00
|
|
|
/**
|
|
|
|
|
* 显示地铁站点
|
|
|
|
|
*/
|
|
|
|
|
const clickSubwayStation = () => {
|
|
|
|
|
useStatusStore().poiLayers.showSubwayStation.loading = true;
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-28 10:05:49 +08:00
|
|
|
/**
|
|
|
|
|
* 显示滑坡隐患点
|
|
|
|
|
*/
|
|
|
|
|
const clickLandslideHiddenPoint = () => {
|
|
|
|
|
useStatusStore().poiLayers.showLandslideHiddenPoint.loading = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 显示泥石流隐患点
|
|
|
|
|
*/
|
|
|
|
|
const clickDebrisFlowHiddenPoint = () => {
|
|
|
|
|
useStatusStore().poiLayers.showDebrisFlowHiddenPoint.loading = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 显示内涝隐患点
|
|
|
|
|
*/
|
|
|
|
|
const clickWaterLoggingHiddenPoint = () => {
|
|
|
|
|
useStatusStore().poiLayers.showWaterLoggingHiddenPoint.loading = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 显示山洪隐患点
|
|
|
|
|
*/
|
|
|
|
|
const clickFlashFloodHiddenPoint = () => {
|
|
|
|
|
useStatusStore().poiLayers.showFlashFloodHiddenPoint.loading = true;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 显示风险点
|
|
|
|
|
*/
|
|
|
|
|
const clickRiskPoint = () => {
|
|
|
|
|
useStatusStore().mapLayers.riskPointShow.loading = true;
|
|
|
|
|
};
|
|
|
|
|
|
2026-04-18 20:10:54 +08:00
|
|
|
return {
|
2026-04-28 10:05:49 +08:00
|
|
|
clickRiskPoint,
|
2026-04-18 20:10:54 +08:00
|
|
|
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-25 21:05:59 +08:00
|
|
|
clickTrafficRoad,
|
|
|
|
|
clickHighway,
|
2026-04-27 14:14:39 +08:00
|
|
|
clickNationRoad,
|
|
|
|
|
clickBridge,
|
2026-04-27 14:51:50 +08:00
|
|
|
clickReservoir,
|
2026-04-27 15:04:59 +08:00
|
|
|
clickSubwayStation,
|
2026-04-28 10:05:49 +08:00
|
|
|
clickLandslideHiddenPoint,
|
|
|
|
|
clickDebrisFlowHiddenPoint,
|
|
|
|
|
clickWaterLoggingHiddenPoint,
|
|
|
|
|
clickFlashFloodHiddenPoint,
|
2026-04-18 20:10:54 +08:00
|
|
|
};
|
2026-04-16 09:09:00 +08:00
|
|
|
};
|