添加水库

This commit is contained in:
zhuangzhuang2000
2026-04-27 14:51:50 +08:00
parent 76c9a765fc
commit a9f622f211
16 changed files with 243 additions and 7 deletions
@@ -259,9 +259,7 @@ export const useEarthquakeDisasterChain = () => {
name: '显示水库',
statusStore: statusStore.infrastructureLayers,
statusKey: 'showReservoir' as const,
callback: (status: unknown) => {
console.log('显示水库', status);
},
callback: layerControl.clickReservoir,
},
{
name: '显示地铁站',
+5
View File
@@ -84,6 +84,11 @@ export const useMap = () => {
useLoadingInformationStore().bridge.id = id;
}
// 水库
else if (pickedObject.id.startsWith(config.prefix.reservoirPointId)) {
useLoadingInformationStore().reservoir.id = id;
}
// 其他
else {
// 重置状态
@@ -102,6 +102,13 @@ export const useLayerControl = () => {
useStatusStore().infrastructureLayers.showBridge.loading = true;
};
/**
* 显示水库
*/
const clickReservoir = () => {
useStatusStore().infrastructureLayers.showReservoir.loading = true;
};
return {
clickHiddenDangerPoint,
clickHospital,
@@ -116,5 +123,6 @@ export const useLayerControl = () => {
clickHighway,
clickNationRoad,
clickBridge,
clickReservoir,
};
};
@@ -0,0 +1,28 @@
import { reservoirIcon } from '@/assets';
/**
* 水库相关钩子函数
* @returns 字段映射和获取图标方法
*/
export const useReservoirPoint = () => {
/**
* 字段映射配置
*/
const field = {
reservoirName: '水库名称',
location: '地理位置',
safetyAssessResult: '安全等级',
lon: '经度',
lat: '纬度',
};
/**
* 获取水库图标
* @returns 图标路径
*/
function getDisasterIcon(): string {
return reservoirIcon;
}
return { field, getDisasterIcon };
};
+1 -3
View File
@@ -282,9 +282,7 @@ export const useRainDisasterChain = () => {
name: '显示水库',
statusStore: statusStore.infrastructureLayers,
statusKey: 'showReservoir' as const,
callback: (status: unknown) => {
console.log('显示水库', status);
},
callback: layerControl.clickReservoir,
},
{
name: '显示地铁站',