2026-04-13 10:30:03 +08:00
|
|
|
|
<template>
|
|
|
|
|
|
<div>
|
2026-04-14 16:00:39 +08:00
|
|
|
|
<!-- 基础组件 -->
|
2026-04-13 10:30:03 +08:00
|
|
|
|
<BasicComponent
|
|
|
|
|
|
:disaster-type="DisasterType.RAINSTORM"
|
|
|
|
|
|
:key="route.fullPath"
|
|
|
|
|
|
/>
|
2026-04-13 19:27:32 +08:00
|
|
|
|
|
2026-04-14 16:00:39 +08:00
|
|
|
|
<!-- 灾害链影响列表组件 -->
|
2026-04-13 19:27:32 +08:00
|
|
|
|
<DisasterChainPointComponent
|
2026-06-26 10:08:34 +08:00
|
|
|
|
v-if="
|
2026-05-07 13:11:15 +08:00
|
|
|
|
statusStore.appLoadingCompleted &&
|
|
|
|
|
|
statusStore.uiComponents.disasterChainPointShow.loading
|
2026-04-18 16:40:04 +08:00
|
|
|
|
"
|
2026-06-26 10:08:34 +08:00
|
|
|
|
:select-options="selectOptions"
|
|
|
|
|
|
:table-data-list="tableDatas"
|
|
|
|
|
|
:table-columns="tableColumns"
|
|
|
|
|
|
:page-option="paginationConfig"
|
|
|
|
|
|
:total-data-count="allDataCount"
|
|
|
|
|
|
@change-conditions="changeConditions"
|
|
|
|
|
|
@change-current-page="changeCurrentPage"
|
2026-04-13 19:27:32 +08:00
|
|
|
|
/>
|
2026-04-13 20:55:32 +08:00
|
|
|
|
|
2026-04-14 16:00:39 +08:00
|
|
|
|
<!-- 左侧按钮组件 -->
|
2026-04-18 16:40:04 +08:00
|
|
|
|
<LeftButtonComponent
|
|
|
|
|
|
v-if="
|
2026-05-07 13:11:15 +08:00
|
|
|
|
statusStore.appLoadingCompleted &&
|
|
|
|
|
|
statusStore.uiComponents.leftButton.loading
|
2026-04-18 16:40:04 +08:00
|
|
|
|
"
|
|
|
|
|
|
:button-list="leftButtonInfo"
|
|
|
|
|
|
/>
|
2026-04-14 16:33:23 +08:00
|
|
|
|
|
2026-05-06 17:44:30 +08:00
|
|
|
|
<!-- 左侧图例组件 -->
|
|
|
|
|
|
<LeftLegendComponent
|
|
|
|
|
|
v-if="
|
2026-05-07 13:11:15 +08:00
|
|
|
|
statusStore.appLoadingCompleted &&
|
|
|
|
|
|
statusStore.uiComponents.leftLegend.loading
|
2026-05-06 17:44:30 +08:00
|
|
|
|
"
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
2026-04-14 16:33:23 +08:00
|
|
|
|
<!-- 右侧按钮组件 -->
|
2026-04-18 16:40:04 +08:00
|
|
|
|
<RightButtonComponent
|
|
|
|
|
|
v-if="
|
2026-05-07 13:11:15 +08:00
|
|
|
|
statusStore.appLoadingCompleted &&
|
|
|
|
|
|
statusStore.uiComponents.rightButton.loading
|
2026-04-18 16:40:04 +08:00
|
|
|
|
"
|
|
|
|
|
|
:button-list="rightButtonInfo"
|
|
|
|
|
|
/>
|
2026-04-15 22:41:06 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 控制显示组件 -->
|
|
|
|
|
|
<ControlShowComponent :constrol-show-list="controlPanel" />
|
2026-04-18 16:40:04 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 控制显示详情组件 -->
|
|
|
|
|
|
<ControlShowDetailComponent />
|
2026-04-21 19:50:57 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 功能组件 -->
|
|
|
|
|
|
<FunctionComponent />
|
2026-05-06 19:22:10 +08:00
|
|
|
|
|
|
|
|
|
|
<!-- 步骤组件 -->
|
|
|
|
|
|
<StepComponent />
|
2026-04-13 10:30:03 +08:00
|
|
|
|
</div>
|
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
|
|
import BasicComponent from '@/component/rain-earthquake/BasicComponent.vue';
|
2026-04-15 22:41:06 +08:00
|
|
|
|
import ControlShowComponent from '@/component/rain-earthquake/ControlShowComponent.vue';
|
2026-04-18 16:40:04 +08:00
|
|
|
|
import ControlShowDetailComponent from '@/component/rain-earthquake/ControlShowDetailComponent.vue';
|
2026-04-13 19:27:32 +08:00
|
|
|
|
import DisasterChainPointComponent from '@/component/rain-earthquake/DisasterChainPointComponent.vue';
|
2026-04-21 19:50:57 +08:00
|
|
|
|
import FunctionComponent from '@/component/rain-earthquake/FunctionComponent.vue';
|
2026-04-14 16:00:39 +08:00
|
|
|
|
import LeftButtonComponent from '@/component/rain-earthquake/LeftButtonComponent.vue';
|
2026-05-06 17:44:30 +08:00
|
|
|
|
import LeftLegendComponent from '@/component/rain-earthquake/LeftLegendComponent.vue';
|
2026-04-14 16:33:23 +08:00
|
|
|
|
import RightButtonComponent from '@/component/rain-earthquake/RightButtonComponent.vue';
|
2026-05-06 19:22:10 +08:00
|
|
|
|
import StepComponent from '@/component/rain-earthquake/StepComponent.vue';
|
2026-04-13 20:55:32 +08:00
|
|
|
|
import { useRainDisasterChain } from '@/hooks/rainstorm/useRainDisasterChain';
|
2026-06-25 22:07:39 +08:00
|
|
|
|
import { useAroundAnalysis } from '@/hooks/rain-earthquake/useAroundAnalysis';
|
2026-06-26 13:54:57 +08:00
|
|
|
|
import { InfrastructurePointType } from '@/types/common/InfrastructurePointType';
|
2026-06-25 22:07:39 +08:00
|
|
|
|
import type { AroundAnalysisState } from '@/types/common/useAroundAnalysisType';
|
|
|
|
|
|
import type { PointResource } from '@/types/common/useAroundAnalysisType';
|
|
|
|
|
|
import type { XianHiddenDangerSpots } from '@/types/base/XianHiddenDangerSpots';
|
2026-06-26 11:16:12 +08:00
|
|
|
|
import type { XianRiskSpots } from '@/types/base/XianRiskSpots';
|
2026-06-26 13:54:57 +08:00
|
|
|
|
import type { XianHospitals } from '@/types/base/XianHospitals';
|
2026-06-12 11:20:57 +08:00
|
|
|
|
import {
|
|
|
|
|
|
useDisasterChainTable,
|
|
|
|
|
|
type SearchConditions,
|
|
|
|
|
|
} from '@/hooks/useDisasterChainTable';
|
2026-04-18 16:40:04 +08:00
|
|
|
|
import { useStatusStore } from '@/stores/useStatusStore';
|
2026-06-26 09:39:23 +08:00
|
|
|
|
import {
|
|
|
|
|
|
DisasterType,
|
|
|
|
|
|
PointType,
|
|
|
|
|
|
HiddenDangerPointTypeMap,
|
|
|
|
|
|
} from '@/types/common/DisasterType.ts';
|
2026-06-26 10:08:34 +08:00
|
|
|
|
import {onBeforeMount, watch, provide, computed} from 'vue';
|
2026-04-13 10:30:03 +08:00
|
|
|
|
import { useRoute } from 'vue-router';
|
|
|
|
|
|
|
|
|
|
|
|
const route = useRoute();
|
2026-04-13 19:27:32 +08:00
|
|
|
|
|
2026-06-12 10:39:27 +08:00
|
|
|
|
const { leftButtonInfo, rightButtonInfo, controlPanel } =
|
|
|
|
|
|
useRainDisasterChain();
|
2026-05-07 13:11:15 +08:00
|
|
|
|
|
|
|
|
|
|
const statusStore = useStatusStore();
|
2026-06-12 10:39:27 +08:00
|
|
|
|
|
2026-06-25 22:07:39 +08:00
|
|
|
|
// 在父组件中创建 useAroundAnalysis 实例,并通过 provide 提供给子组件
|
|
|
|
|
|
const aroundAnalysisState = useAroundAnalysis();
|
|
|
|
|
|
provide<AroundAnalysisState>('aroundAnalysisState', aroundAnalysisState);
|
|
|
|
|
|
|
2026-06-12 11:20:57 +08:00
|
|
|
|
const {
|
|
|
|
|
|
selectOptions,
|
|
|
|
|
|
tableColumns,
|
|
|
|
|
|
tableDatas,
|
|
|
|
|
|
paginationConfig,
|
2026-06-26 09:39:23 +08:00
|
|
|
|
conditions,
|
2026-06-12 11:20:57 +08:00
|
|
|
|
changeConditions,
|
|
|
|
|
|
setConditions,
|
|
|
|
|
|
changeCurrentPage,
|
|
|
|
|
|
setSelectOptions,
|
|
|
|
|
|
setTableColumns,
|
2026-06-25 22:07:39 +08:00
|
|
|
|
setTableDatas,
|
2026-06-12 11:20:57 +08:00
|
|
|
|
} = useDisasterChainTable();
|
2026-06-12 10:39:27 +08:00
|
|
|
|
|
2026-06-26 10:08:34 +08:00
|
|
|
|
// 所有数据的总数(所有类型的脉冲点总和)
|
|
|
|
|
|
const allDataCount = computed(() => {
|
|
|
|
|
|
return aroundAnalysisState.pulsePoints.value?.length || 0;
|
|
|
|
|
|
});
|
|
|
|
|
|
|
2026-06-12 10:39:27 +08:00
|
|
|
|
onBeforeMount(() => {
|
2026-06-12 11:20:57 +08:00
|
|
|
|
// 设置下拉选项
|
|
|
|
|
|
setSelectOptions([
|
2026-06-26 13:54:57 +08:00
|
|
|
|
{value: PointType.LANDSLIDE, label: '滑坡'},
|
|
|
|
|
|
{value: PointType.DEBRIS_FLOW, label: '泥石流'},
|
|
|
|
|
|
{value: PointType.WATER_LOGGING, label: '内涝'},
|
|
|
|
|
|
{value: PointType.FLASH_FLOOD, label: '山洪'},
|
|
|
|
|
|
{value: PointType.COLLAPSE, label: '崩塌'},
|
|
|
|
|
|
{value: PointType.RISK_AREA, label: '风险区'},
|
|
|
|
|
|
{value: InfrastructurePointType.HOSPITAL, label: '医院'},
|
2026-06-12 11:20:57 +08:00
|
|
|
|
]);
|
2026-06-12 10:39:27 +08:00
|
|
|
|
|
2026-06-26 11:16:12 +08:00
|
|
|
|
// 设置表格列配置(默认显示隐患点的列)
|
2026-06-12 11:20:57 +08:00
|
|
|
|
setTableColumns([
|
2026-06-26 13:54:57 +08:00
|
|
|
|
{title: '名称', key: 'disasterName'},
|
|
|
|
|
|
{title: '位置', key: 'position'},
|
|
|
|
|
|
{title: '规模等级', key: 'scaleGrade'},
|
|
|
|
|
|
{title: '险情等级', key: 'riskGrade'},
|
2026-06-12 11:20:57 +08:00
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
* 条件改变执行
|
|
|
|
|
|
* @param value
|
|
|
|
|
|
*/
|
|
|
|
|
|
changeConditions.value = (value: SearchConditions) => {
|
|
|
|
|
|
setConditions(value);
|
2026-06-26 11:16:12 +08:00
|
|
|
|
|
|
|
|
|
|
// 根据选择的类型动态改变表格列
|
|
|
|
|
|
if (value.hiddenPoint === PointType.RISK_AREA) {
|
|
|
|
|
|
// 风险区:只显示风险区等级
|
|
|
|
|
|
setTableColumns([
|
2026-06-26 13:54:57 +08:00
|
|
|
|
{title: '名称', key: 'disasterName'},
|
|
|
|
|
|
{title: '位置', key: 'position'},
|
|
|
|
|
|
{title: '风险区等级', key: 'riskLevel'},
|
|
|
|
|
|
]);
|
|
|
|
|
|
} else if (value.hiddenPoint === InfrastructurePointType.HOSPITAL) {
|
|
|
|
|
|
// 医院:只显示医院等级
|
|
|
|
|
|
setTableColumns([
|
|
|
|
|
|
{title: '名称', key: 'disasterName'},
|
|
|
|
|
|
{title: '位置', key: 'position'},
|
|
|
|
|
|
{title: '医院等级', key: 'level'},
|
2026-06-26 11:16:12 +08:00
|
|
|
|
]);
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// 隐患点:显示规模等级和险情等级
|
|
|
|
|
|
setTableColumns([
|
2026-06-26 13:54:57 +08:00
|
|
|
|
{title: '名称', key: 'disasterName'},
|
|
|
|
|
|
{title: '位置', key: 'position'},
|
|
|
|
|
|
{title: '规模等级', key: 'scaleGrade'},
|
|
|
|
|
|
{title: '险情等级', key: 'riskGrade'},
|
2026-06-26 11:16:12 +08:00
|
|
|
|
]);
|
|
|
|
|
|
}
|
2026-06-12 11:20:57 +08:00
|
|
|
|
};
|
2026-06-25 22:07:39 +08:00
|
|
|
|
|
2026-06-26 09:39:23 +08:00
|
|
|
|
// 监听脉冲点变化和下拉选项变化,过滤并更新表格数据
|
2026-06-26 13:54:57 +08:00
|
|
|
|
watch(
|
|
|
|
|
|
[
|
|
|
|
|
|
() => aroundAnalysisState.pulsePoints.value,
|
|
|
|
|
|
() => conditions.value.hiddenPoint,
|
|
|
|
|
|
],
|
|
|
|
|
|
([newPulsePoints, hiddenPointType]: [PointResource[], PointType | InfrastructurePointType]) => {
|
|
|
|
|
|
console.log('=== 脉冲点变化 ===');
|
|
|
|
|
|
console.log('newPulsePoints:', newPulsePoints);
|
|
|
|
|
|
console.log('newPulsePoints.length:', newPulsePoints?.length);
|
|
|
|
|
|
console.log('hiddenPointType:', hiddenPointType);
|
|
|
|
|
|
|
|
|
|
|
|
if (newPulsePoints && newPulsePoints.length > 0) {
|
|
|
|
|
|
// 根据选中的类型过滤
|
|
|
|
|
|
const filteredPoints = newPulsePoints.filter(point => {
|
|
|
|
|
|
// 隐患点过滤
|
|
|
|
|
|
if (point.category === 'hidden-danger') {
|
|
|
|
|
|
const englishType = HiddenDangerPointTypeMap[hiddenPointType as PointType];
|
|
|
|
|
|
return englishType ? point.originalType === englishType : false;
|
|
|
|
|
|
}
|
|
|
|
|
|
// 风险点过滤
|
|
|
|
|
|
if (
|
|
|
|
|
|
hiddenPointType === PointType.RISK_AREA &&
|
|
|
|
|
|
point.category === 'risk-point'
|
|
|
|
|
|
) {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
// 医院过滤
|
|
|
|
|
|
if (
|
|
|
|
|
|
hiddenPointType === InfrastructurePointType.HOSPITAL &&
|
|
|
|
|
|
point.category === 'hospital'
|
|
|
|
|
|
) {
|
|
|
|
|
|
return true;
|
|
|
|
|
|
}
|
|
|
|
|
|
return false;
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
// 根据类型转换数据
|
|
|
|
|
|
const convertedData = filteredPoints.map(point => {
|
|
|
|
|
|
if (point.category === 'risk-point') {
|
|
|
|
|
|
// 风险点数据
|
|
|
|
|
|
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)}`
|
|
|
|
|
|
: '未知位置',
|
|
|
|
|
|
riskLevel: String(point.risk_level || '一般'),
|
|
|
|
|
|
lon: point.lon,
|
|
|
|
|
|
lat: point.lat,
|
|
|
|
|
|
} as XianRiskSpots;
|
|
|
|
|
|
} else if (point.category === 'hospital') {
|
|
|
|
|
|
// 医院数据
|
|
|
|
|
|
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 || '未知'),
|
|
|
|
|
|
lon: point.lon,
|
|
|
|
|
|
lat: point.lat,
|
|
|
|
|
|
} as XianHospitals;
|
|
|
|
|
|
} else {
|
|
|
|
|
|
// 隐患点数据
|
|
|
|
|
|
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)}`
|
|
|
|
|
|
: '未知位置',
|
|
|
|
|
|
scaleGrade: String(point.scale_grade || '未知'),
|
|
|
|
|
|
riskGrade: String(point.risk_grade || '一般'),
|
|
|
|
|
|
lon: point.lon,
|
|
|
|
|
|
lat: point.lat,
|
|
|
|
|
|
fieldCode: String(point.id),
|
|
|
|
|
|
province: '陕西省',
|
|
|
|
|
|
city: '西安市',
|
|
|
|
|
|
county: '',
|
|
|
|
|
|
village: '',
|
|
|
|
|
|
isDelete: 0,
|
|
|
|
|
|
} as XianHiddenDangerSpots;
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
console.log('convertedData:', convertedData);
|
|
|
|
|
|
setTableDatas(convertedData);
|
2026-06-26 11:16:12 +08:00
|
|
|
|
} else {
|
2026-06-26 13:54:57 +08:00
|
|
|
|
// 如果没有脉冲点,则清空表格数据
|
|
|
|
|
|
console.log('清空表格数据');
|
|
|
|
|
|
setTableDatas([]);
|
2026-06-26 11:16:12 +08:00
|
|
|
|
}
|
2026-06-26 13:54:57 +08:00
|
|
|
|
},
|
|
|
|
|
|
{ immediate: true, deep: true }
|
|
|
|
|
|
);
|
|
|
|
|
|
});
|
2026-04-13 19:27:32 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
2026-06-25 22:07:39 +08:00
|
|
|
|
<style scoped></style>
|