From 13bda6d15bd94d9815e0bb95cdcfac1ee3fdb806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=9D=B4=EB=82=9C=EA=B2=BD?= Date: Fri, 17 Apr 2026 08:14:21 +0900 Subject: [PATCH] =?UTF-8?q?fix(incidents):=20MPA=20=EB=A6=AC=ED=8C=A9?= =?UTF-8?q?=ED=86=A0=EB=A7=81=20=EB=88=84=EB=9D=BD=20imports=20=EC=A0=95?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - IncidentsView: SplitPanelContent 중복 import 제거 (contents/ 스텁 미사용) - predictionApi: fetchOilSpillSummary 이관 (PredictionInterface의 api 미임포트로 사실상 동작불가 함수였음) - AnalysisSelectModal, hnsDispersionLayers: @tabs/→@components/+@interfaces/, @common/components/→@components/common/ --- .../components/AnalysisSelectModal.tsx | 12 +++++----- .../incidents/components/IncidentsView.tsx | 1 - .../incidents/utils/hnsDispersionLayers.ts | 17 ++++---------- .../prediction/services/predictionApi.ts | 12 ++++++++++ .../prediction/PredictionInterface.ts | 23 ------------------- 5 files changed, 23 insertions(+), 42 deletions(-) diff --git a/frontend/src/components/incidents/components/AnalysisSelectModal.tsx b/frontend/src/components/incidents/components/AnalysisSelectModal.tsx index 0463c4e..5657172 100644 --- a/frontend/src/components/incidents/components/AnalysisSelectModal.tsx +++ b/frontend/src/components/incidents/components/AnalysisSelectModal.tsx @@ -1,10 +1,10 @@ import { useState, useEffect, useRef } from 'react'; -import { fetchPredictionAnalyses } from '@tabs/prediction/services/predictionApi'; -import type { PredictionAnalysis } from '@tabs/prediction/services/predictionApi'; -import { fetchHnsAnalyses } from '@tabs/hns/services/hnsApi'; -import type { HnsAnalysisItem } from '@tabs/hns/services/hnsApi'; -import { fetchRescueOps } from '@tabs/rescue/services/rescueApi'; -import type { RescueOpsItem } from '@tabs/rescue/services/rescueApi'; +import { fetchPredictionAnalyses } from '@components/prediction/services/predictionApi'; +import type { PredictionAnalysis } from '@interfaces/prediction/PredictionInterface'; +import { fetchHnsAnalyses } from '@components/hns/services/hnsApi'; +import type { HnsAnalysisItem } from '@interfaces/hns/HnsInterface'; +import { fetchRescueOps } from '@components/rescue/services/rescueApi'; +import type { RescueOpsItem } from '@interfaces/rescue/RescueInterface'; // ── 타입 정의 ────────────────────────────────────────── export type AnalysisModalType = 'oil' | 'hns' | 'rescue'; diff --git a/frontend/src/components/incidents/components/IncidentsView.tsx b/frontend/src/components/incidents/components/IncidentsView.tsx index 46fe44b..54d0b6e 100644 --- a/frontend/src/components/incidents/components/IncidentsView.tsx +++ b/frontend/src/components/incidents/components/IncidentsView.tsx @@ -39,7 +39,6 @@ import { } from '../utils/dischargeZoneData'; import { useMapStore } from '@common/store/mapStore'; import { FlyToController } from './contents/FlyToController'; -import { SplitPanelContent } from './contents/SplitPanelContent'; import { VesselPopupPanel } from './contents/VesselPopupPanel'; import { IncidentPopupContent } from './contents/IncidentPopupContent'; import { VesselDetailModal } from './contents/VesselDetailModal'; diff --git a/frontend/src/components/incidents/utils/hnsDispersionLayers.ts b/frontend/src/components/incidents/utils/hnsDispersionLayers.ts index bb70351..b9ad740 100644 --- a/frontend/src/components/incidents/utils/hnsDispersionLayers.ts +++ b/frontend/src/components/incidents/utils/hnsDispersionLayers.ts @@ -5,18 +5,11 @@ * - MapView와 동일한 BitmapLayer (캔버스 히트맵) + ScatterplotLayer (AEGL 원) 생성 */ import { BitmapLayer, ScatterplotLayer } from '@deck.gl/layers'; -import { computeDispersion } from '@tabs/hns/utils/dispersionEngine'; -import { getSubstanceToxicity } from '@tabs/hns/utils/toxicityData'; -import { hexToRgba } from '@common/components/map/mapUtils'; -import type { HnsAnalysisItem } from '@tabs/hns/services/hnsApi'; -import type { - MeteoParams, - SourceParams, - SimParams, - DispersionModel, - AlgorithmType, - StabilityClass, -} from '@tabs/hns/utils/dispersionTypes'; +import { computeDispersion } from '@components/hns/utils/dispersionEngine'; +import { getSubstanceToxicity } from '@components/hns/utils/toxicityData'; +import { hexToRgba } from '@components/common/map/mapUtils'; +import type { HnsAnalysisItem, MeteoParams, SourceParams, SimParams } from '@interfaces/hns/HnsInterface'; +import type { DispersionModel, AlgorithmType, StabilityClass } from '@types/hns/HnsType'; // MapView와 동일한 색상 정지점 const COLOR_STOPS: [number, number, number, number][] = [ diff --git a/frontend/src/components/prediction/services/predictionApi.ts b/frontend/src/components/prediction/services/predictionApi.ts index 3514c9e..1cf6d2b 100644 --- a/frontend/src/components/prediction/services/predictionApi.ts +++ b/frontend/src/components/prediction/services/predictionApi.ts @@ -4,6 +4,7 @@ import type { PredictionDetail, BacktrackResult, TrajectoryResponse, + OilSpillSummaryResponse, SensitiveResourceCategory, SensitiveResourceFeatureCollection, SpreadParticlesGeojson, @@ -63,6 +64,17 @@ export const fetchAnalysisTrajectory = async ( return response.data; }; +export const fetchOilSpillSummary = async ( + acdntSn: number, + predRunSn?: number, +): Promise => { + const response = await api.get( + `/prediction/analyses/${acdntSn}/oil-summary`, + predRunSn != null ? { params: { predRunSn } } : undefined, + ); + return response.data; +}; + export const fetchSensitiveResources = async ( acdntSn: number, ): Promise => { diff --git a/frontend/src/interfaces/prediction/PredictionInterface.ts b/frontend/src/interfaces/prediction/PredictionInterface.ts index 464da08..e9cc397 100644 --- a/frontend/src/interfaces/prediction/PredictionInterface.ts +++ b/frontend/src/interfaces/prediction/PredictionInterface.ts @@ -216,29 +216,6 @@ export interface OilSpillSummaryResponse { byModel: Record; } -export const fetchAnalysisTrajectory = async ( - acdntSn: number, - predRunSn?: number, -): Promise => { - const response = await api.get( - `/prediction/analyses/${acdntSn}/trajectory`, - predRunSn != null ? { params: { predRunSn } } : undefined, - ); - return response.data; -}; - -export const fetchOilSpillSummary = async ( - acdntSn: number, - predRunSn?: number, -): Promise => { - const response = await api.get( - `/prediction/analyses/${acdntSn}/oil-summary`, - predRunSn != null ? { params: { predRunSn } } : undefined, - ); - return response.data; -}; - - export interface SensitiveResourceCategory { category: string; count: number;