fix(M02): 구조물 도면에서 작도 영역 단추 · 자리표 표시 제거
- 구조물 도면(집계표 도면 정보 미리보기 · 도면 수정 편집)은 도각이 없어 작도 영역이 필요 없음 - 저장 문서의 작도 영역 값은 읽지도 쓰지도 않음 - 도면 양식(A1 · 표지 등) 편집은 그대로 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019qWfH6MMhLwjhtLYnDVUXv
This commit is contained in:
@@ -45,6 +45,8 @@ export interface DrawingTemplateOptions {
|
||||
preview?: boolean;
|
||||
/** 좌표 0,0 기준점 십자를 그린다 — 구조물 도면(편집 · 미리보기)만. */
|
||||
originMarker?: boolean;
|
||||
/** 구조물 도면 — 도각이 없으므로 작도 영역 단추 · 자리표(도각 자리) 표시를 없애고, 문서의 작도 영역 값은 무시. */
|
||||
noArea?: boolean;
|
||||
}
|
||||
|
||||
const RECOVERY_PREFIX = "OPEN_WEB_CAD__RECOVERY__";
|
||||
@@ -107,6 +109,7 @@ export function mountDrawingTemplate(
|
||||
options: DrawingTemplateOptions = {},
|
||||
): DrawingTemplateHandle {
|
||||
const readOnly = options.readOnly === true;
|
||||
const noArea = options.noArea === true;
|
||||
const recoveryScope = recoveryScopeOf(options);
|
||||
migrateOldRecovery(options, recoveryScope);
|
||||
let base: DrawingTemplateDoc = doc;
|
||||
@@ -193,7 +196,7 @@ export function mountDrawingTemplate(
|
||||
cad.load(
|
||||
drawing,
|
||||
null,
|
||||
!readOnly,
|
||||
!readOnly && !noArea,
|
||||
{},
|
||||
{
|
||||
recoveryScope,
|
||||
@@ -245,6 +248,10 @@ export function mountDrawingTemplate(
|
||||
|
||||
const getDoc = async (): Promise<DrawingTemplateDoc> => {
|
||||
const { drawing } = await cad.requestSave();
|
||||
if (noArea) {
|
||||
base = { ...base, ...drawing };
|
||||
return base;
|
||||
}
|
||||
const drawingArea = readArea();
|
||||
if (!drawingArea) throw new Error("작도 영역 값이 올바르지 않습니다.");
|
||||
base = { ...base, ...drawing, drawing_area: drawingArea };
|
||||
@@ -252,12 +259,12 @@ export function mountDrawingTemplate(
|
||||
};
|
||||
|
||||
// 한 줄 — 페이지가 머리 칸(headerSlot)을 주면 거기, 아니면 그림 칸 위에 작게.
|
||||
toolbar.append(areaButton, actions);
|
||||
toolbar.append(...(noArea ? [] : [areaButton]), actions);
|
||||
if (options.headerSlot) {
|
||||
toolbar.classList.add("m02-drawing__toolbar--slot");
|
||||
options.headerSlot.append(toolbar);
|
||||
root.append(cad.element);
|
||||
} else root.append(toolbar, cad.element);
|
||||
} else root.append(...(noArea && readOnly ? [] : [toolbar]), cad.element);
|
||||
container.append(root);
|
||||
load(doc);
|
||||
|
||||
|
||||
@@ -379,6 +379,7 @@ export function createStructurePanel(opts: StructurePanelOptions): StructurePane
|
||||
panelsCollapsed: true, // 특성 · 도면층 패널은 접힌 채 — › 를 누르면 펼침
|
||||
preview: true, // 왼쪽 끌기 = 화면 옮기기 · 두 번 누름 = 전체 맞춤
|
||||
originMarker: true, // 좌표 0,0 기준점 십자
|
||||
noArea: true, // 구조물도는 도각이 없음 — 작도 영역 단추 없음
|
||||
});
|
||||
const frame = previewHost.querySelector("iframe");
|
||||
if (frame) hideToolbar(frame);
|
||||
|
||||
@@ -236,6 +236,7 @@ export function createMain(isAdmin: boolean, onSaved?: () => void): MainHandle {
|
||||
onChanged: (d: boolean) => (dirty = d && !readOnly),
|
||||
headerSlot: slot,
|
||||
originMarker: at.kind === "structure",
|
||||
noArea: at.kind === "structure",
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user