diff --git a/index.html b/index.html index a013dec..46989d3 100644 --- a/index.html +++ b/index.html @@ -61,6 +61,13 @@ 입력값 + + + 교각코핑 상면기초 하단지반고말뚝 (mm)코핑 폭×길이받침 + + + + 코핑·말뚝 입력 수정 diff --git a/src/main.ts b/src/main.ts index 00edc1f..6f219f5 100644 --- a/src/main.ts +++ b/src/main.ts @@ -476,6 +476,42 @@ function renderHeader(): void { // --- results panel (시안 ① 입력값 · 계산 결과) ---------------------------------------- type Pair = [string, string]; +/** 입력값 for every pier in one table; the row of the active pier is marked, and a row click makes that pier active. */ +function renderInputTable(): void { + const table = $('inputs-all'); + const body = table.tBodies[0]; + body.replaceChildren(); + for (const p of state.piers) { + const inp = p.input; + const front = inp.bearings.filter((b) => b.row === '전열').length; + const back = inp.bearings.filter((b) => b.row === '후열').length; + const tr = el('tr', undefined, p.input.name === state.active ? 'active' : undefined); + tr.tabIndex = 0; + tr.addEventListener('click', () => selectPier(p.input.name)); + tr.addEventListener('keydown', (e) => { + if (e.key === 'Enter' || e.key === ' ') selectPier(p.input.name); + }); + const cells = [ + inp.name, + f3(inp.copingTopEl), + f3(inp.footingBottomEl), + f3(inp.groundEl), + String(inp.pileLengthMm), + `${inp.copingWidthMm}×${inp.copingLengthMm}`, + `${front}·${back}`, + ]; + for (const v of cells) tr.appendChild(el('td', v)); + body.appendChild(tr); + } +} + +function selectPier(name: string): void { + state.active = name; + state.rebarSelection = new Set(); + setupScene(); + renderAll(); +} + function fillKv(dl: HTMLElement, pairs: Pair[]): void { dl.replaceChildren(); for (const [k, v] of pairs) { @@ -495,6 +531,10 @@ function renderPanels(): void { $('viewer-title').textContent = pier ? `${pier.input.name} · ${pier.input.type} 교각 형상` : '교각 3D 뷰'; $('origin').textContent = m ? `원점 = 교각 중심 (${pt(m.pivot)})` : ''; + renderInputTable(); + $('inputs-active').textContent = pier ? `활성 교각 ${pier.input.name} 상세 (표의 행을 누르면 바뀜)` : ''; + $('edit-title').textContent = pier ? `코핑·말뚝 입력 수정 · ${pier.input.name}` : '코핑·말뚝 입력 수정'; + if (!pier) { fillKv($('inputs'), []); fillKv($('res-axis'), []); diff --git a/src/style.css b/src/style.css index 0b8e1f8..73fc116 100644 --- a/src/style.css +++ b/src/style.css @@ -811,5 +811,12 @@ body { background: #eef1f4; font-family: 'Noto Sans KR', system-ui, sans-serif; .footing-grid { grid-template-columns: 1fr; } } +/* 입력값: one row per pier; the table scrolls sideways in the narrow left panel. */ +.pier-table-wrap { overflow-x: auto; margin-bottom: 8px; } +#inputs-all { font-size: 12px; width: 100%; } +#inputs-all th, #inputs-all td { white-space: nowrap; padding: 4px 6px; } +#inputs-all tbody tr { cursor: pointer; } +#inputs-all tbody tr.active td { background: #e3edf8; font-weight: 700; } + /* Import preview: all piers' 받침·IP rows scroll inside the dialog. */ .pv-scroll { max-height: 240px; overflow: auto; }
입력값