fix(B05): 임시 배치 재계산이 입력 중인 폼을 덮어쓰던 것
기준 측점을 넣으면 임시 배치 → 세부유역 재계산 → 전역 선택 동기화가 그 관의 폼을 통째로 다시 로드해, 잔여거리를 입력하려는 순간 칸이 비워졌다(2026-08-18 사용자 보고). 임시 배치 중 그 관이 동기화로 되돌아오면 폼은 그대로 두고 설계유량만 갱신한다 (facilityOptions.setDesignFlow 신설 — 필드 값 불변, 월류 높이 재계산만). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -147,6 +147,9 @@ export interface FacilityOptionsForm {
|
||||
) => void;
|
||||
/** 현재 필드 값을 시설 옵션으로 읽는다(빈 값 생략). */
|
||||
readOptions: () => Record<string, string | number>;
|
||||
/** 설계유량만 갱신한다 — 필드 값은 건드리지 않는다. 임시 배치(2026-08-18)의
|
||||
* 유역 재계산 결과를 입력 중인 폼에 살짝 반영하는 용도. */
|
||||
setDesignFlow: (designFlow: number | null) => void;
|
||||
}
|
||||
|
||||
/** 구조물 배치 폼의 옵션 자리에 끼워지는 계곡 통과 시설 부속 옵션 서브폼. */
|
||||
@@ -450,6 +453,10 @@ export function createFacilityOptionsForm(
|
||||
}
|
||||
syncVisibility();
|
||||
},
|
||||
setDesignFlow(designFlow) {
|
||||
designFlowM3s = designFlow ?? null;
|
||||
syncVisibility();
|
||||
},
|
||||
readOptions() {
|
||||
const options: Record<string, string | number> = {};
|
||||
if (current === "pipe") {
|
||||
|
||||
@@ -446,11 +446,20 @@ export function createStructuresSection(callbacks: StructuresCallbacks): Structu
|
||||
/** 계곡 통과 시설을 폼에 올린다 — 일반 구조물과 같은 흐름(종류·측점·옵션·수정).
|
||||
* 정본이 관 지점이라 editingId 대신 선택 누가거리로 추적한다. */
|
||||
function loadPipeForm(pipe: PipeFacilityItem): void {
|
||||
// 임시 배치 중인 그 관이 재계산을 거쳐 되돌아온 경우가 아니면, 다른 항목으로
|
||||
// 넘어가는 것이므로 임시 배치를 취소한다.
|
||||
// 임시 배치 중인 그 관이 재계산을 거쳐 되돌아온 경우 — 사용자가 폼에 입력하는
|
||||
// 중이므로 폼을 다시 그리지 않는다(입력이 지워진다, 2026-08-18 사용자 보고).
|
||||
// 재계산으로 갱신된 설계유량만 살짝 반영하고 선택 표시를 맞춘다.
|
||||
const isTemp = tempPipeChainage !== null && Math.abs(pipe.chainage_m - tempPipeChainage) < 0.05;
|
||||
if (isTemp) tempPipeChainage = pipe.chainage_m;
|
||||
else cancelTempPipe();
|
||||
if (isTemp) {
|
||||
tempPipeChainage = pipe.chainage_m;
|
||||
selectedPipeChainage = pipe.chainage_m;
|
||||
facilityOptions.setDesignFlow(pipe.design_flow_m3s ?? null);
|
||||
syncButtons();
|
||||
renderList();
|
||||
return;
|
||||
}
|
||||
// 다른 항목으로 넘어가는 것이므로 임시 배치를 취소한다.
|
||||
cancelTempPipe();
|
||||
const hadStructure = editingId !== null;
|
||||
editingId = null;
|
||||
selectedPipeChainage = pipe.chainage_m;
|
||||
|
||||
Reference in New Issue
Block a user