diff --git a/src/components/olmap/BurstLocation/AnalysisParameters.tsx b/src/components/olmap/BurstLocation/AnalysisParameters.tsx index 7223617..2461912 100644 --- a/src/components/olmap/BurstLocation/AnalysisParameters.tsx +++ b/src/components/olmap/BurstLocation/AnalysisParameters.tsx @@ -239,6 +239,19 @@ const AnalysisParameters: React.FC = ({ onResult }) => { 模拟方案 + + {isSimulationMode + ? "爆管数据读取所选方案模拟结果,正常数据读取实时模拟结果,两者使用同一爆管时间窗。" + : "爆管数据读取所选监测时间窗,正常数据默认读取前一天同一时段的监测数据。"} + {isSimulationMode && ( diff --git a/src/components/olmap/BurstLocation/LocationResults.tsx b/src/components/olmap/BurstLocation/LocationResults.tsx index afef844..c654403 100644 --- a/src/components/olmap/BurstLocation/LocationResults.tsx +++ b/src/components/olmap/BurstLocation/LocationResults.tsx @@ -75,6 +75,33 @@ const toneStyles: Record< const formatDateTime = (value?: string) => value ? dayjs(value).format("MM-DD HH:mm") : "-"; +const formatDateTimeRange = (start?: string, end?: string) => { + if (!start || !end) return "-"; + return `${formatDateTime(start)} 至 ${formatDateTime(end)}`; +}; + +const getDataSourceLabel = (result: BurstLocationResult) => + result.data_source === "simulation" ? "模拟方案" : "监测数据"; + +const getNormalDataDescription = (result: BurstLocationResult) => { + switch (result.observed_source) { + case "simulation_scheme_burst_realtime_normal_timerange": + return "正常数据读取实时模拟结果,与爆管数据使用同一时间窗。"; + case "scada_burst_scada_normal_timerange": + return "正常数据读取监测数据;未单独指定正常时间窗时,默认使用爆管时段前一天同一时段。"; + case "scada_burst_payload_normal_timerange": + return "爆管数据读取监测数据,正常数据来自请求载荷。"; + case "simulation_scheme_timerange": + return "历史方案记录:爆管数据和正常数据均读取方案模拟结果。"; + case "scada_timerange": + return "历史方案记录:爆管数据和正常数据使用同一监测时间窗。"; + case "request_payload": + return "爆管数据和正常数据均来自请求载荷。"; + default: + return "正常数据按后端返回的数据源规则选择。"; + } +}; + const MetricCard = ({ label, value, hint, tone }: MetricCardProps) => { const style = toneStyles[tone]; return ( @@ -214,6 +241,16 @@ const LocationResults: React.FC = ({ result }) => { const burstTime = result.scada_window?.burst_start ? formatDateTime(result.scada_window.burst_start) : "-"; + const burstWindow = formatDateTimeRange( + result.scada_window?.burst_start, + result.scada_window?.burst_end, + ); + const normalWindow = formatDateTimeRange( + result.scada_window?.normal_start, + result.scada_window?.normal_end, + ); + const sourceLabel = getDataSourceLabel(result); + const normalDataDescription = getNormalDataDescription(result); return ( @@ -287,6 +324,31 @@ const LocationResults: React.FC = ({ result }) => { tone="green" /> + + + + + + 正常数据选择说明 + + + + {normalDataDescription} + + + 爆管窗口: {burstWindow};正常窗口: {normalWindow} + + {result.data_source === "simulation" && result.simulation_scheme?.name ? ( + + 爆管方案: {result.simulation_scheme.name} + + ) : null} + {/* Candidate List */} diff --git a/src/components/olmap/BurstLocation/types.ts b/src/components/olmap/BurstLocation/types.ts index 8c2ffae..0500a36 100644 --- a/src/components/olmap/BurstLocation/types.ts +++ b/src/components/olmap/BurstLocation/types.ts @@ -23,6 +23,8 @@ export interface BurstLocationResult { scada_window?: { burst_start?: string; burst_end?: string; + normal_start?: string; + normal_end?: string; }; pressure_samples?: { burst?: number; @@ -51,6 +53,8 @@ export interface BurstLocationSchemeDetail { scada_window?: { burst_start?: string; burst_end?: string; + normal_start?: string; + normal_end?: string; }; result_summary?: { located_pipe?: string;