feat(구조물표): 323-6 바꿈 한 길 — 바뀜 신호 하나(구조물 초안도 설계 가게 · watchDrafts) · 종류 바꿈 표 규칙(swapsInPlace · E · F 점형 ↔ 구간형 = 지우고 같은 기준 측점에 새로) · 조용한 되돌림 없앰(알림) · 그리기가 조정값 안 만듦 · replayDraftPipeOptions 걷음
- 구조물 초안 쓰기 = useDesignStore().set("structures")(칸 그대로) → 관 초안과 같은 구독 · 횡단 보기 watchDrafts(구조물 = 늘 · 관 = 자리 · 종류 · 구간 · 잇기가 바뀔 때만 · 옵션만은 폼 길이 그 카드만 · 카드 줌 · 팬 지킴) · 옛 되부름 onStructuresChanged 걷음
- 종류 바꿈 = 표(catalog) swapsInPlace — 정본 다름 · 구조물 자리꼴 다름(E · F) = 지우고 같은 기준 측점에 새로(구간 = 기본 길이) · 같으면 종류 키만 · 막히면 옛 기록 · 옛 종류 폼 + 알림(전엔 [수정] 조기 반환 → 조용히 되돌림 · 드롭다운만 새 종류)
- syncApplied = 사용자가 조작한 세션이 있을 때만 깎음(카드 그리기가 자동 배치를 조정값으로 굳혀 [저장]으로 내보내던 것)
- replayDraftPipeOptions 걷음 — 그림 자료는 형상 얹기(초안 현황) · 다단 조정값은 조정 세션이 정본
- 시험: test_323_6_change(신호 · 거르기 · 표 규칙 · 그리기 · 걷음) · test_319 점형 ↔ 구간형 · 막힘 알림 · 되얹기 시험 = 형상 얹기로 · 옛 기대 글 고침
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Ji4nuyLVHcxrXWHTdb5nRD
This commit is contained in:
@@ -18,7 +18,8 @@ import { asRoad } from "./B05_Profile_UI_Structures_Define";
|
||||
import { readState, writeState } from "../A00_Common/b_page_state";
|
||||
import { NO_SELECTION, PIPE_MATCH_M, selectDesign } from "../A00_Common/design/design_selection";
|
||||
import { readGroupItems, readSummaryItem } from "../common_util/common_util_summary_item";
|
||||
import { showConfirmDialog } from "@ui/ui_template_elements";
|
||||
import { showConfirmDialog, showToast } from "@ui/ui_template_elements";
|
||||
import { swapsInPlace } from "../common_util/common_util_structure_catalog";
|
||||
import { forgetStationAdjusts } from "../B06_Section/B06_Section_Api_Culvert_Options";
|
||||
|
||||
/** 배선에 필요한 패널 내부 값 — 이름은 분리 전 지역변수와 같다. */
|
||||
@@ -89,9 +90,10 @@ export function bindStructuresEvents(ctx: StructuresEventContext): {
|
||||
: ctx.pipeFacilities().find((entry) => Math.abs(entry.chainage_m - pipe) < PIPE_MATCH_M);
|
||||
const prev = ctx.typeMap().get(record ? asRoad(record).type_id : (pipeItem?.facility ?? ""));
|
||||
if (!next || !prev) return startNew(ctx.groupSelect.value, next?.type_id); // 빈칸 = 새로 놓기
|
||||
// 정본이 다른 종류(관 지점 ↔ 구조물 — 맹암거 · 개거 등)로 = 옛 것을 지워 「없음」을 거친 뒤 같은
|
||||
// 측점에 새 종류를 놓고 고름(우클릭 추가 길 · 새 종류 기본값 · 요구 217) · 옛 조정값은 318-4 대로 버림
|
||||
if (!!next.managed_by !== !!prev.managed_by) {
|
||||
// 표 규칙(323-6 · `swapsInPlace`) — 정본이 다르거나(관 지점 ↔ 구조물) 구조물 자리꼴이 다르면(E · F 점형 ↔
|
||||
// 구간형) 옛 것을 지워 「없음」을 거친 뒤 같은 기준 측점에 새 종류를 놓고 고름(우클릭 추가 길 · 새 종류
|
||||
// 기본값 · 구간 = 기본 길이 · 요구 217) · 옛 조정값은 318-4 대로 버림
|
||||
if (!swapsInPlace(prev.type_id, next.type_id)) {
|
||||
const at = record ? structureAnchorM(record) : pipeItem!.chainage_m;
|
||||
if (record) {
|
||||
ctx.structures.splice(index, 1);
|
||||
@@ -135,8 +137,12 @@ export function bindStructuresEvents(ctx: StructuresEventContext): {
|
||||
// 관 지점 종류 바꿈 — 그 측점 옛 조정값(세션)은 버리고 [저장] 때 정본에서도 비움(318-4)
|
||||
if (pipeItem)
|
||||
forgetStationAdjusts(ctx.projectId, pipeItem.chainage_m, prev.type_id, next.type_id);
|
||||
// 반영이 막혀(측점 등) 기록이 그대로면 옛 기록으로 되돌림
|
||||
if (record && draft && ctx.structures[index] === draft) ctx.structures[index] = record;
|
||||
// 반영이 막히면(측점 · 필수 칸 등) 옛 기록 · 옛 종류 폼으로 되돌리고 알림(조용한 되돌림 없앰 · 323-6)
|
||||
if (record && draft && ctx.structures[index] === draft) {
|
||||
ctx.structures[index] = record;
|
||||
ctx.loadForm(record);
|
||||
showToast(`${next.name}(으)로 못 바꿈 — 폼 칸(측점 · 필수 칸)을 확인하세요.`, "error");
|
||||
}
|
||||
}
|
||||
|
||||
type TypeValues = {
|
||||
|
||||
Reference in New Issue
Block a user