From b7c0ce70686edfdb14f5688adb62058067b8b813 Mon Sep 17 00:00:00 2001 From: wzy-warehouse <18135009705@163.com> Date: Sat, 18 Apr 2026 20:48:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B6=88=E9=98=B2=E7=AB=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/api.ts | 18 +++ src/api/firefighter.ts | 20 +++ src/assets/images/icon/firefighter.png | Bin 0 -> 3125 bytes src/assets/index.ts | 1 + .../ControlShowDetailComponent.vue | 9 ++ .../rain-earthquake/FireStationComponent.vue | 120 ++++++++++++++++++ src/config/config.json | 3 +- .../earthquake/useEarthquakeDisasterChain.ts | 4 +- src/hooks/map/useMap.ts | 5 + .../rain-earthquake/useFireStationPoint.ts | 33 +++++ src/hooks/rainstorm/useRainDisasterChain.ts | 4 +- src/hooks/useLayerControl.ts | 9 ++ src/stores/useLoadingInformation.ts | 13 ++ src/types/base/XianFirefighter.ts | 115 +++++++++++++++++ src/types/common/LoadingResourceType.ts | 3 + 15 files changed, 350 insertions(+), 7 deletions(-) create mode 100644 src/api/firefighter.ts create mode 100644 src/assets/images/icon/firefighter.png create mode 100644 src/component/rain-earthquake/FireStationComponent.vue create mode 100644 src/hooks/rain-earthquake/useFireStationPoint.ts create mode 100644 src/types/base/XianFirefighter.ts diff --git a/src/api/api.ts b/src/api/api.ts index 911d39a..99f802d 100644 --- a/src/api/api.ts +++ b/src/api/api.ts @@ -5,12 +5,14 @@ import { getBasePoins as getRiskBasePoints, getPointDetailById as getRiskPointDe import { getBasePoins as getHospitalsBasePoints, getPointDetailById as getHospitalsPointDetailById} from './hospitals' import { getBasePoints as getDangerousSourceBasePoints, getPointDetailById as getDangerousSourcePointDetailById} from './dangerous-source' import { getBasePoints as getEmergencyShelterBasePoints, getPointDetailById as getEmergencyShelterPointDetailById} from './emergency-shelter' +import { getBasePoints as getFirefighterBasePoints, getPointDetailById as getFirefighterPointDetailById} from './firefighter' import type { ApiResponse } from '@/types/ApiResponse' import type { XianHiddenDangerSpots } from '@/types/base/XianHiddenDangerSpots' import type { XianRiskSpots } from '@/types/base/XianRiskSpots' import type { XianHospitals } from '@/types/base/XianHospitals' import type { XianDangerousSource } from '@/types/base/XianDangerousSource' import type { XianEmergencyShelter } from '@/types/base/XianEmergencyShelter' +import type { XianFirefighter } from '@/types/base/XianFirefighter' /** * API接口统一导出对象 @@ -106,4 +108,20 @@ export const $api = { */ getPointDetailById: (id: number): Promise> => getEmergencyShelterPointDetailById(id), }, + + // 消防站信息 + firefighter: { + /** + * 获取所有基础消防站 + * @returns 消防站数据数组 + */ + getBasePoints: (): Promise> => getFirefighterBasePoints(), + + /** + * 根据id获取消防站详情 + * @param id - 消防站id + * @returns 消防站详情 + */ + getPointDetailById: (id: number): Promise> => getFirefighterPointDetailById(id), + }, } diff --git a/src/api/firefighter.ts b/src/api/firefighter.ts new file mode 100644 index 0000000..25d642c --- /dev/null +++ b/src/api/firefighter.ts @@ -0,0 +1,20 @@ +import type { ApiResponse } from "@/types/ApiResponse" +import type { XianFirefighter } from "@/types/base/XianFirefighter" +import httpInstance from "@/utils/request/http" + +/** + * 获取消防站基础数据 + * @returns 消防站数据数组 + */ +export const getBasePoints = (): Promise> => { + return httpInstance.get('/firefighter/base-points') +} + +/** + * 根据id获取消防站详情 + * @param id - 消防站id + * @returns 消防站详情 + */ +export const getPointDetailById = (id: number): Promise> => { + return httpInstance.get(`/firefighter/point-detail/${id}`) +} diff --git a/src/assets/images/icon/firefighter.png b/src/assets/images/icon/firefighter.png new file mode 100644 index 0000000000000000000000000000000000000000..e20440ad15ad994e7a406d9b88b099b566a69f01 GIT binary patch literal 3125 zcmY*bc|6oz+y60^$u`y^#n?(QGZ?Zoc1@$~hU^Sun=!T-dzkE7jZmq33Y8_@?x>Jx zkg^+*wRA_89*r$ov%TYa@6YqT&mY&h*7Lot^ZlI9=bTI%tBZns$N2yN5H!b_*|D|q zp@4bVYtH^F5?gVQ?Jk-Ce=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B@~c>nM@MWv_sa9_ zE}YA{uVYmvqaerip1>$8yQR{3POuy$B68t|tlT}VHO;Z)^tau;JpC5wf4**& zyo}ZKu=e(htZ?-^5$&sB!c*IU&WU+DK%boWHn`1x8Io9|>lHy$*_1829Kig|qZawb@5up}&8izcdYA$GTzm>%Y$9 zRvXz@y*WtQc0jYTNIUV-M{CFf`ES?q&PNUAJQ1JRABiH^3ENICf6mM*vmwv_N$bvt zy{gIjS@R>X{oU=%Y=15+seJhh3CwtTv`mDYw)fR347A7^m0J%9De3#;wMy(x#QPUg ztdKK|URC)gzWYtry?lX2b!qlyXBDIQ%%E-N&bjv?H$nBA( zp2>hs1HobG!yLbL_qB~wh9d1D?Ih$^8K?57H8tBCPUqBzeqZCZ+5*MG`T2}fr$O^l zxlJ-u^|1jpCs*Ks7x+>O1Sxt!V4>+2ea)k-ILC6EHChx(@XUOwG1m3w8CJPjfAtgB z6*V0Z{6Qh{L7@0*obVA46db}=h=AqTP|6o0mZ!UtH?H(~L{SD6BO`99P!BkMpE2w- UoxIs{_;)wIU}g4~iC5D90LBuJ6951J literal 0 HcmV?d00001 diff --git a/src/assets/index.ts b/src/assets/index.ts index aca4399..117fdd3 100644 --- a/src/assets/index.ts +++ b/src/assets/index.ts @@ -9,6 +9,7 @@ export { default as riskAreaIcon } from '@/assets/images/icon/risk-area.png'; export { default as hospitalIcon } from '@/assets/images/icon/hospital.png'; export { default as dangerousSourceIcon } from '@/assets/images/icon/dangerous-source.png'; export { default as emergencyShelterIcon } from '@/assets/images/icon/emergency-shelter.png'; +export { default as firefighterIcon } from '@/assets/images/icon/firefighter.png'; // 图片 export { default as backgroundImage } from '@/assets/images/background-image.png'; diff --git a/src/component/rain-earthquake/ControlShowDetailComponent.vue b/src/component/rain-earthquake/ControlShowDetailComponent.vue index 53425ad..2510bf3 100644 --- a/src/component/rain-earthquake/ControlShowDetailComponent.vue +++ b/src/component/rain-earthquake/ControlShowDetailComponent.vue @@ -22,6 +22,14 @@ useStatusStore().poiLayers.showRefugeeShelter.loading " /> + + + diff --git a/src/component/rain-earthquake/FireStationComponent.vue b/src/component/rain-earthquake/FireStationComponent.vue new file mode 100644 index 0000000..4430a4d --- /dev/null +++ b/src/component/rain-earthquake/FireStationComponent.vue @@ -0,0 +1,120 @@ + + + + + + diff --git a/src/config/config.json b/src/config/config.json index 8c0e550..b29be8c 100644 --- a/src/config/config.json +++ b/src/config/config.json @@ -38,6 +38,7 @@ "riskPointId": "risk-point-", "hospitalPointId": "hospital-point-", "dangerousSourcePointId": "dangerous-source-point-", - "emergencyShelterPointId": "emergency-shelter-point-" + "emergencyShelterPointId": "emergency-shelter-point-", + "fireStationPointId": "fire-station-point-" } } \ No newline at end of file diff --git a/src/hooks/earthquake/useEarthquakeDisasterChain.ts b/src/hooks/earthquake/useEarthquakeDisasterChain.ts index 722be62..3d4178e 100644 --- a/src/hooks/earthquake/useEarthquakeDisasterChain.ts +++ b/src/hooks/earthquake/useEarthquakeDisasterChain.ts @@ -205,9 +205,7 @@ export const useEarthquakeDisasterChain = () => { name: '显示消防站', statusStore: statusStore.poiLayers, statusKey: 'showFireStation' as const, - callback: (status: unknown) => { - console.log('显示消防站', status); - }, + callback: layerControl.clickFireStation, }, { name: '显示储备点', diff --git a/src/hooks/map/useMap.ts b/src/hooks/map/useMap.ts index 0f57250..bd1a030 100644 --- a/src/hooks/map/useMap.ts +++ b/src/hooks/map/useMap.ts @@ -64,6 +64,11 @@ export const useMap = () => { useLoadingInformationStore().emergencyShelter.id = id; } + // 消防站 + else if (pickedObject.id.startsWith(config.prefix.fireStationPointId)) { + useLoadingInformationStore().fireStation.id = id; + } + // 其他 else { // 重置状态 diff --git a/src/hooks/rain-earthquake/useFireStationPoint.ts b/src/hooks/rain-earthquake/useFireStationPoint.ts new file mode 100644 index 0000000..0c69d0e --- /dev/null +++ b/src/hooks/rain-earthquake/useFireStationPoint.ts @@ -0,0 +1,33 @@ +import { firefighterIcon } from '@/assets'; + +/** + * 消防站相关钩子函数 + * @returns + */ +export const useFireStationPoint = () => { + /** + * 字段映射配置 + */ + const field = { + teamName: '消防站/队名称', + teamType: '消防站类型', + address: '地理位置', + lon: '经度', + lat: '纬度', + teamNum: '消防队人数', + cars: '消防车数量', + devices: '消防器材数量', + unitHead: '负责人', + telephone: '手机号', + }; + + /** + * 获取消防站图标 + * @returns 图标路径 + */ + function getDisasterIcon(): string { + return firefighterIcon; + } + + return { field, getDisasterIcon }; +}; diff --git a/src/hooks/rainstorm/useRainDisasterChain.ts b/src/hooks/rainstorm/useRainDisasterChain.ts index fbdcccc..9cb5018 100644 --- a/src/hooks/rainstorm/useRainDisasterChain.ts +++ b/src/hooks/rainstorm/useRainDisasterChain.ts @@ -235,9 +235,7 @@ export const useRainDisasterChain = () => { name: '显示消防站', statusStore: statusStore.poiLayers, statusKey: 'showFireStation' as const, - callback: (status: unknown) => { - console.log('显示消防站', status); - }, + callback: layerControl.clickFireStation, }, { name: '显示储备点', diff --git a/src/hooks/useLayerControl.ts b/src/hooks/useLayerControl.ts index 6b9787f..fe04749 100644 --- a/src/hooks/useLayerControl.ts +++ b/src/hooks/useLayerControl.ts @@ -37,10 +37,19 @@ export const useLayerControl = () => { useStatusStore().poiLayers.showRefugeeShelter.loading = true; }; + /** + * 点击显示消防站 + */ + const clickFireStation = () => { + // 加载状态为true + useStatusStore().poiLayers.showFireStation.loading = true; + }; + return { clickHiddenDangerPoint, clickHospital, clickDangerousSource, clickEmergencyShelter, + clickFireStation, }; }; diff --git a/src/stores/useLoadingInformation.ts b/src/stores/useLoadingInformation.ts index 2981022..6a3f320 100644 --- a/src/stores/useLoadingInformation.ts +++ b/src/stores/useLoadingInformation.ts @@ -68,6 +68,14 @@ export const useLoadingInformationStore = defineStore( id: -1, }); + // ============================== 消防站状态 ================================ + const fireStation = reactive({ + /** 加载状态 */ + loading: false, + /** 消防站ID */ + id: -1, + }); + /** * 重置所有状态 */ @@ -95,6 +103,10 @@ export const useLoadingInformationStore = defineStore( // 避难所状态重置 emergencyShelter.loading = false; emergencyShelter.id = -1; + + // 消防站状态重置 + fireStation.loading = false; + fireStation.id = -1; }; return { @@ -104,6 +116,7 @@ export const useLoadingInformationStore = defineStore( hospital, dangerousSource, emergencyShelter, + fireStation, resetStatue, }; } diff --git a/src/types/base/XianFirefighter.ts b/src/types/base/XianFirefighter.ts new file mode 100644 index 0000000..72e1567 --- /dev/null +++ b/src/types/base/XianFirefighter.ts @@ -0,0 +1,115 @@ +import type { Point } from './Point'; + +/** + * 西安市政府消防队伍数据接口 + */ +export interface XianFirefighter extends Point { + /** 队伍名称 */ + teamName?: string; + /** 队伍编号 */ + teamId?: string; + /** 队伍类型 */ + teamType?: string; + /** 消防站类型 */ + fireType?: string; + /** 详细地址 */ + address?: string; + /** 建立时间 */ + standTime?: string; + /** 总面积 */ + area?: number; + /** 建筑面积 */ + structionArea?: number; + /** 总人数 */ + teamNum?: number; + /** 指挥人数 */ + leaderNum?: number; + /** 技术人数 */ + techNum?: number; + /** 消防员人数 */ + firerNum?: number; + /** 消防员平均年龄 */ + averageAge?: number; + /** 消防车总数 */ + cars?: number; + /** 水罐消防车数 */ + waterCars?: number; + /** 泡沫消防车数 */ + foamCars?: number; + /** 举高消防车数 */ + highCars?: number; + /** 专勤消防车数 */ + dedicateCars?: number; + /** 器材总数 */ + devices?: number; + /** 侦检器材数 */ + detectionDevice?: number; + /** 救援器材数 */ + saveDevice?: number; + /** 破拆器材数 */ + destructionDevice?: number; + /** 堵漏器材数 */ + fillDevice?: number; + /** 转移器材数 */ + transferDevice?: number; + /** 洗消器材数 */ + washDevice?: number; + /** 照明器材数 */ + lightDevice?: number; + /** 灭火器材数 */ + fireDevice?: number; + /** 上一年出警次数 */ + goOut?: number; + /** 上一年出警人次 */ + outPeople?: number; + /** 上一年出警车次 */ + outCar?: number; + /** 上报时间 */ + reportTime?: string; + /** 单位负责人 */ + unitHead?: string; + /** 行政区划代码 */ + governmentCode?: string; + /** 创建时间 */ + createTime?: string; + /** 县 */ + county?: string; + /** 乡 */ + country?: string; + /** 村 */ + village?: string; + /** 空间点坐标 */ + position?: string; + /** 联系电话 */ + telephone?: string; + /** 创建人名称 */ + createName?: string; + /** 市 */ + city?: string; + /** 统计负责人 */ + statisticHead?: string; + /** 街道 */ + street?: string; + /** 填表人 */ + fillName?: string; + /** 省 */ + province?: string; + /** 物理主键 */ + fxpcDataidSjgl?: string; + /** 省编码 */ + provinceCode?: number; + /** 市编码 */ + cityCode?: number; + /** 县编码 */ + countyCode?: number; + /** 更新时间 */ + updateTime?: string; + /** 写入时间 */ + writeTime?: string; + /** 经度 */ + lon?: number; + /** 纬度 */ + lat?: number; + /** 逻辑删除标识,0未删除,1已删除 */ + isDelete?: number; +} diff --git a/src/types/common/LoadingResourceType.ts b/src/types/common/LoadingResourceType.ts index 2ebf3b3..b5a2461 100644 --- a/src/types/common/LoadingResourceType.ts +++ b/src/types/common/LoadingResourceType.ts @@ -22,4 +22,7 @@ export enum LoadingResource { /** 避难所 */ EMERGENCY_SHELTER = 'EMERGENCY_SHELTER', + + /** 消防站 */ + FIRE_STATION = 'FIRE_STATION', }