Merge remote-tracking branch 'origin/sub_laptop_4' into main_laptop_1
This commit is contained in:
@@ -129,3 +129,17 @@ export function followMovedPipe(projectId: string | null, fromM: number, toM: nu
|
||||
{ partKey: picked.partKey },
|
||||
);
|
||||
}
|
||||
|
||||
/** 종단 측점 하나를 지움(513-3 · 우클릭 「배관 · 구조물 삭제」 종단 · 평면 공용) — 측점 id = 주인 · `주인:역할`
|
||||
* (`plannedIrregular`) · 관 기준 측점 = 그 자리 · 관 구간 끝 = 관 자리 · 그 밖 = 구조물 id(좌측 칸 [삭제]와 같은 길). */
|
||||
export function removeStationOwner(
|
||||
station: { id: string; chainage_m: number },
|
||||
pipe: boolean,
|
||||
remove: { pipe: (chainageM: number) => void; structure: (structureId: string) => void },
|
||||
): void {
|
||||
if (pipe) return remove.pipe(station.chainage_m);
|
||||
const owner = station.id.replace(/:(start|end)$/, "");
|
||||
const at = pipeChainageOf(owner);
|
||||
if (at !== null) remove.pipe(at);
|
||||
else remove.structure(owner);
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ import "../../B05_Profile/B05_Profile_UI_Style.css";
|
||||
import "../../B05_Profile/B05_Profile_UI_Style_Table.css";
|
||||
import "../../B05_Profile/B05_Profile_UI_Style_Drainage.css";
|
||||
import "../../B05_Profile/B05_Profile_UI_Style_Structures.css";
|
||||
import { pipeIdAt } from "./design_pipe_ids";
|
||||
import { pipeIdAt, removeStationOwner } from "./design_pipe_ids";
|
||||
import { useDesignStore } from "./design_store";
|
||||
import { pageSettingsPanelValues } from "../../B05_Profile/B05_Profile_UI_Page_Latest";
|
||||
import { setPlusStations } from "../../common_util/common_util_structure_station";
|
||||
@@ -194,9 +194,12 @@ export async function mountProfileView(
|
||||
onStructureMove: (from, to, station) => {
|
||||
if (isPipeStation(station)) profilePanel.drainage.movePipe(from, to);
|
||||
},
|
||||
onStructureRemove: (station) => {
|
||||
if (isPipeStation(station)) profilePanel.drainage.removePipe(station.chainage_m);
|
||||
},
|
||||
// 우클릭 삭제 — 관 = 관 지점 정본 · 그 밖 = 좌측 칸 [삭제]와 같은 길(513-3)
|
||||
onStructureRemove: (station) =>
|
||||
removeStationOwner(station, isPipeStation(station), {
|
||||
pipe: (chainage) => profilePanel.drainage.removePipe(chainage),
|
||||
structure: (structureId) => panel.structures.removeById(structureId),
|
||||
}),
|
||||
// 우클릭 [배관 추가] — 사이드 폼에 종류·측점을 실어 주고 [추가]로 확정(2026-08-18).
|
||||
onPipeAdd: (chainage) => panel.structures.addAt(chainage, "pipe"),
|
||||
onStructureAdd: (chainage, type) =>
|
||||
|
||||
Reference in New Issue
Block a user