第四步:基础设施点数据分类显示

This commit is contained in:
2026-06-26 15:48:43 +08:00
parent b913bea524
commit 629c780e45
7 changed files with 320 additions and 11 deletions
+238 -5
View File
@@ -79,6 +79,14 @@
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';
import type { XianStorePoints } from '@/types/base/XianStorePoints';
import type { XianSchool } from '@/types/base/XianSchool';
import type { XianBridge } from '@/types/base/XianBridge';
import type { XianReservoirList } from '@/types/base/XianReservoirList';
import type { XianSubwayStations } from '@/types/base/XianSubwayStations';
import {
useDisasterChainTable,
type SearchConditions,
@@ -132,6 +140,14 @@
{value: PointType.COLLAPSE, label: '崩塌'},
{value: PointType.RISK_AREA, label: '风险区'},
{value: InfrastructurePointType.HOSPITAL, label: '医院'},
{value: InfrastructurePointType.DANGEROUS_SOURCE, label: '危险源'},
{value: InfrastructurePointType.REFUGEE_SHELTER, label: '避难所'},
{value: InfrastructurePointType.FIRE_STATION, label: '消防站'},
{value: InfrastructurePointType.STORE_POINTS, label: '储备点'},
{value: InfrastructurePointType.SCHOOL, label: '学校'},
{value: InfrastructurePointType.BRIDGE, label: '桥梁'},
{value: InfrastructurePointType.RESERVOIR, label: '水库'},
{value: InfrastructurePointType.SUBWAY, label: '地铁站'},
]);
// 设置表格列配置(默认显示隐患点的列)
@@ -164,6 +180,70 @@
{title: '位置', key: 'position'},
{title: '医院等级', key: 'level'},
]);
} else if (value.hiddenPoint === InfrastructurePointType.DANGEROUS_SOURCE) {
// 危险源:显示危险源等级和安全生产标准化等级
setTableColumns([
{title: '名称', key: 'disasterName'},
{title: '位置', key: 'position'},
{title: '危险源等级', key: 'level'},
{title: '安全生产标准化等级', key: 'safeProductLevel'},
]);
} else if (value.hiddenPoint === InfrastructurePointType.REFUGEE_SHELTER) {
// 避难所:显示避难所类型和避难所性质
setTableColumns([
{title: '名称', key: 'disasterName'},
{title: '位置', key: 'position'},
{title: '避难所类型', key: 'type'},
{title: '避难所性质', key: 'constructionCategory'},
]);
} else if (value.hiddenPoint === InfrastructurePointType.FIRE_STATION) {
// 消防站:显示队伍类型和消防站类型
setTableColumns([
{title: '名称', key: 'disasterName'},
{title: '位置', key: 'position'},
{title: '队伍类型', key: 'teamType'},
{title: '消防站类型', key: 'fireType'},
]);
} else if (value.hiddenPoint === InfrastructurePointType.STORE_POINTS) {
// 储备点:显示分级和所属部门
setTableColumns([
{title: '名称', key: 'disasterName'},
{title: '位置', key: 'position'},
{title: '分级', key: 'level'},
{title: '所属部门', key: 'department'},
]);
} else if (value.hiddenPoint === InfrastructurePointType.SCHOOL) {
// 学校:显示学校类型和所属部门
setTableColumns([
{title: '名称', key: 'disasterName'},
{title: '位置', key: 'position'},
{title: '学校类型', key: 'schoolType'},
{title: '所属部门', key: 'schoolCreater'},
]);
} else if (value.hiddenPoint === InfrastructurePointType.BRIDGE) {
// 桥梁:显示类型和建成时间
setTableColumns([
{title: '名称', key: 'disasterName'},
{title: '位置', key: 'position'},
{title: '类型', key: 'bridgeType'},
{title: '建成时间', key: 'buildTime'},
]);
} else if (value.hiddenPoint === InfrastructurePointType.RESERVOIR) {
// 水库:显示安全状态和净防洪库容
setTableColumns([
{title: '名称', key: 'disasterName'},
{title: '位置', key: 'position'},
{title: '安全状态', key: 'safetyStatus'},
{title: '净防洪库容(万m³)', key: 'netFloodCapacity'},
]);
} else if (value.hiddenPoint === InfrastructurePointType.SUBWAY) {
// 地铁站:显示地铁线路和积水深度
setTableColumns([
{title: '名称', key: 'disasterName'},
{title: '位置', key: 'position'},
{title: '地铁线路', key: 'line'},
{title: '积水深度', key: 'depthOfAccumulatedWater'},
]);
} else {
// 隐患点:显示规模等级和险情等级
setTableColumns([
@@ -202,11 +282,20 @@
) {
return true;
}
// 医院过滤
if (
hiddenPointType === InfrastructurePointType.HOSPITAL &&
point.category === 'hospital'
) {
// 基础设施点过滤
const infrastructureMap: Record<string, string> = {
[InfrastructurePointType.HOSPITAL]: 'hospital',
[InfrastructurePointType.DANGEROUS_SOURCE]: 'danger',
[InfrastructurePointType.REFUGEE_SHELTER]: 'shelter',
[InfrastructurePointType.FIRE_STATION]: 'fire',
[InfrastructurePointType.STORE_POINTS]: 'store',
[InfrastructurePointType.SCHOOL]: 'school',
[InfrastructurePointType.BRIDGE]: 'bridge',
[InfrastructurePointType.RESERVOIR]: 'reservoir',
[InfrastructurePointType.SUBWAY]: 'subway',
};
const infraCategory = infrastructureMap[hiddenPointType as InfrastructurePointType];
if (infraCategory && point.category === infraCategory) {
return true;
}
return false;
@@ -248,6 +337,150 @@
lon: point.lon,
lat: point.lat,
} as XianHospitals;
} else if (point.category === 'danger') {
// 危险源数据
return {
id:
typeof point.id === 'number'
? point.id
: parseInt(String(point.id), 10),
name: point.value,
disasterName: point.value,
position:
point.lon !== undefined && point.lat !== undefined
? `${point.lon.toFixed(4)}, ${point.lat.toFixed(4)}`
: '未知位置',
level: String(point.level || '未知'),
safeProductLevel: String(point.safe_product_level || '未知'),
lon: point.lon,
lat: point.lat,
} as XianDangerousSource;
} else if (point.category === 'shelter') {
// 避难所数据
return {
id:
typeof point.id === 'number'
? point.id
: parseInt(String(point.id), 10),
name: point.value,
disasterName: point.value,
position:
point.lon !== undefined && point.lat !== undefined
? `${point.lon.toFixed(4)}, ${point.lat.toFixed(4)}`
: '未知位置',
type: String(point.type || '未知'),
constructionCategory: String(point.construction_category || '未知'),
lon: point.lon,
lat: point.lat,
} as XianEmergencyShelter;
} else if (point.category === 'fire') {
// 消防站数据
return {
id:
typeof point.id === 'number'
? point.id
: parseInt(String(point.id), 10),
name: point.value,
disasterName: point.value,
position:
point.lon !== undefined && point.lat !== undefined
? `${point.lon.toFixed(4)}, ${point.lat.toFixed(4)}`
: '未知位置',
teamType: String(point.team_type || '未知'),
fireType: String(point.fire_type || '未知'),
lon: point.lon,
lat: point.lat,
} as XianFirefighter;
} else if (point.category === 'store') {
// 储备点数据
return {
id:
typeof point.id === 'number'
? point.id
: parseInt(String(point.id), 10),
name: point.value,
disasterName: point.value,
position:
point.lon !== undefined && point.lat !== undefined
? `${point.lon.toFixed(4)}, ${point.lat.toFixed(4)}`
: '未知位置',
level: String(point.level || '未知'),
department: String(point.department || '未知'),
lon: point.lon,
lat: point.lat,
} as XianStorePoints;
} else if (point.category === 'school') {
// 学校数据
return {
id:
typeof point.id === 'number'
? point.id
: parseInt(String(point.id), 10),
name: point.value,
disasterName: point.value,
position:
point.lon !== undefined && point.lat !== undefined
? `${point.lon.toFixed(4)}, ${point.lat.toFixed(4)}`
: '未知位置',
schoolType: String(point.school_type || '未知'),
schoolCreater: String(point.school_creater || '未知'),
lon: point.lon,
lat: point.lat,
} as XianSchool;
} else if (point.category === 'bridge') {
// 桥梁数据
return {
id:
typeof point.id === 'number'
? point.id
: parseInt(String(point.id), 10),
name: point.value,
disasterName: point.value,
position:
point.lon !== undefined && point.lat !== undefined
? `${point.lon.toFixed(4)}, ${point.lat.toFixed(4)}`
: '未知位置',
bridgeType: String(point.bridge_type || '未知'),
buildTime: String(point.build_time || '未知'),
lon: point.lon,
lat: point.lat,
} as XianBridge;
} else if (point.category === 'reservoir') {
// 水库数据
return {
id:
typeof point.id === 'number'
? point.id
: parseInt(String(point.id), 10),
name: point.value,
disasterName: point.value,
position:
point.lon !== undefined && point.lat !== undefined
? `${point.lon.toFixed(4)}, ${point.lat.toFixed(4)}`
: '未知位置',
safetyStatus: String(point.safety_status || '未知'),
netFloodCapacity: String(point.net_flood_capacity || '未知'),
lon: point.lon,
lat: point.lat,
} as XianReservoirList;
} else if (point.category === 'subway') {
// 地铁站数据
return {
id:
typeof point.id === 'number'
? point.id
: parseInt(String(point.id), 10),
name: point.value,
disasterName: point.value,
position:
point.lon !== undefined && point.lat !== undefined
? `${point.lon.toFixed(4)}, ${point.lat.toFixed(4)}`
: '未知位置',
line: String(point.line || '未知'),
depthOfAccumulatedWater: String(point.depth_of_accumulated_water || '未知'),
lon: point.lon,
lat: point.lat,
} as XianSubwayStations;
} else {
// 隐患点数据
return {