refactor(472-2 2-B 세션 끌림): 서버 Node 묶음(design-calc · sc · co)이 화면 · 세션 코드를 안 끔
- 그림 신원표 = 새 common_util_pick_tag(tagShape · pipeTagId) — 관 id 는 화면이 열 때(usePipeIds) 세션 장부를 꽂음 · 안 꽂으면 옛 자리 이름(장부가 프로젝트 모를 때와 같은 값) - 구조물 그림 다섯(Box · Culvert · Ford · Ford_Pavement · Revetment)이 design_pipe_ids · design_pick_match 대신 이것을 씀 - Culvert_Wire 한계 토스트 = 알림 창구(setCulvertNotice) — 화면 Cross_View 가 토스트를 꽂음 · Wire 가 ui_template · Section_Common 안 끔 - 472-3 알려진 끌림 다섯 걷음(b_page_state · pick_match · pipe_ids · selection · Section_Common) · 남은 줄 = 헬퍼 정규식 헛잡음 - 헬퍼 286_1 흉내 → 진짜 pick_tag · 폴더 지침 끌림 줄 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
/* =============================================================================
|
||||
* common_util/common_util_pick_tag.ts
|
||||
* 그린 형상의 신원표(323-5) — 구조물 그림(카드 · 서버 Node 묶음)이 쓰는 몫만.
|
||||
*
|
||||
* 관 id 는 세션 장부(`design_pipe_ids`)가 정함 — 화면이 열 때(`usePipeIds`) `setPipeTagSource` 로 꽂음.
|
||||
* 안 꽂혔으면(서버 Node · 시험) 옛 자리 이름 `pipe-{누가거리}` — 장부가 프로젝트를 모를 때와 같은 값.
|
||||
* 묶음이 세션(`b_page_state`)을 안 끌게 갈라냄(472-2).
|
||||
* ========================================================================== */
|
||||
|
||||
let pipeSource: ((chainageM: number) => string) | null = null;
|
||||
|
||||
/** 관 id 원천 — 화면이 세션 장부를 꽂음(null = 옛 자리 이름). */
|
||||
export function setPipeTagSource(source: ((chainageM: number) => string) | null): void {
|
||||
pipeSource = source;
|
||||
}
|
||||
|
||||
/** 그 자리 관의 신원표 id. */
|
||||
export function pipeTagId(chainageM: number): string {
|
||||
return pipeSource ? pipeSource(chainageM) : `pipe-${chainageM.toFixed(2)}`;
|
||||
}
|
||||
|
||||
/** 그린 형상에 신원표를 닮(부분 없으면 통째 형상). */
|
||||
export function tagShape(el: Element, structureId: string | null, part?: string | null): void {
|
||||
if (structureId) el.setAttribute("data-structure-id", structureId);
|
||||
if (part) el.setAttribute("data-part", part);
|
||||
}
|
||||
Reference in New Issue
Block a user