From e4d958b5f2698a88ac8ba3171b0b8b2bde3a7a67 Mon Sep 17 00:00:00 2001 From: Taehoon Date: Tue, 21 Apr 2026 17:56:29 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20PC=20=EC=83=81=EC=84=B8=20=EC=9C=A0?= =?UTF-8?q?=ED=98=95(=EA=B0=9C=EC=9D=B8PC,=20=EC=84=9C=EB=B2=84)=20?= =?UTF-8?q?=EC=84=A0=ED=83=9D=20=EB=B0=8F=20UI=20=EC=A0=9C=EC=96=B4=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EB=B3=B5=EA=B5=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Modal/HWModal.ts | 60 ++++++++++++++------------------- 1 file changed, 25 insertions(+), 35 deletions(-) diff --git a/src/components/Modal/HWModal.ts b/src/components/Modal/HWModal.ts index f43b102..9ee4e25 100644 --- a/src/components/Modal/HWModal.ts +++ b/src/components/Modal/HWModal.ts @@ -245,7 +245,7 @@ function applyTypeSpecificUI(type: string) { opTitle: document.getElementById('hw-op-title') }; - // 1. 초기화 (모든 유동 섹션 숨김) + // 1. 초기화 serverOnly.forEach(el => (el as HTMLElement).style.display = 'none'); nonServer.forEach(el => (el as HTMLElement).style.display = 'none'); locationFields.forEach(el => (el as HTMLElement).style.display = 'none'); @@ -254,12 +254,31 @@ function applyTypeSpecificUI(type: string) { if (groups.type) groups.type.style.display = 'flex'; if (groups.opTitle) groups.opTitle.style.display = 'flex'; - // 2. 유형별 정밀 규칙 적용 (사용자 정의 100% 일치) - if (type === '서버') { + // 2. PC 유형일 때 상세용도 선택창 노출 (복구 핵심) + if (type === 'PC' || type === '개인PC' || type === '노트북') { + if (groups.detailPurpose) groups.detailPurpose.style.display = 'flex'; + + // 상세용도가 '서버'인 경우 서버용 필드 노출, 아니면 일반 PC용 필드 노출 + if (detailPurpose === '서버') { + serverOnly.forEach(el => (el as HTMLElement).style.display = 'flex'); + locationFields.forEach(el => (el as HTMLElement).style.display = 'flex'); + if (groups.networkTitle) groups.networkTitle.style.display = 'flex'; + ['ip', 'ip2', 'remote', 'serverId', 'serverPw', 'monitoring', 'model', 'os', 'cpu', 'ram', 'ssd1', 'ssd2'].forEach(k => { + if (groups[k]) groups[k]!.style.display = 'flex'; + }); + } else { + nonServer.forEach(el => (el as HTMLElement).style.display = 'flex'); + if (groups.specTitle) groups.specTitle.style.display = 'flex'; + ['model', 'os', 'cpu', 'ram', 'ssd1', 'ssd2', 'hwSpec', 'ipNonServer'].forEach(k => { + if (groups[k]) groups[k]!.style.display = 'flex'; + }); + } + } + else if (type === '서버') { serverOnly.forEach(el => (el as HTMLElement).style.display = 'flex'); locationFields.forEach(el => (el as HTMLElement).style.display = 'flex'); Object.values(groups).forEach(g => { if (g) g.style.display = 'flex'; }); - } + } else if (['스토리지', 'NAS', 'DAS'].includes(type)) { serverOnly.forEach(el => (el as HTMLElement).style.display = 'flex'); locationFields.forEach(el => (el as HTMLElement).style.display = 'flex'); @@ -268,41 +287,12 @@ function applyTypeSpecificUI(type: string) { if (groups.specTitle) groups.specTitle.style.display = 'flex'; if (groups.model) groups.model.style.display = 'flex'; if (groups.ssd1) groups.ssd1.style.display = 'flex'; - if (groups.ssd2) groups.ssd2.style.display = 'flex'; } - else if (type === 'PC' || type === '노트북') { - if (type === 'PC' && groups.detailPurpose) groups.detailPurpose.style.display = 'flex'; - nonServer.forEach(el => (el as HTMLElement).style.display = 'flex'); - if (groups.specTitle) groups.specTitle.style.display = 'flex'; - ['model', 'os', 'cpu', 'ram', 'ssd1', 'ssd2', 'hwSpec', 'ipNonServer'].forEach(k => { - if (groups[k]) groups[k]!.style.display = 'flex'; - }); - if (type === 'PC' && detailPurpose === '서버') { - locationFields.forEach(el => (el as HTMLElement).style.display = 'flex'); - if (groups.networkTitle) groups.networkTitle.style.display = 'flex'; - ['ip', 'ip2', 'remote', 'serverId', 'serverPw', 'monitoring'].forEach(k => { - if (groups[k]) groups[k]!.style.display = 'flex'; - }); - if (groups.ipNonServer) groups.ipNonServer.style.display = 'none'; - } - } - else if (['CPU', 'GPU', '모바일'].includes(type)) { + else { + // 기타 유형 (CPU, RAM, 모바일 등) if (groups.specTitle) groups.specTitle.style.display = 'flex'; if (groups.model) groups.model.style.display = 'flex'; } - else if (type === 'RAM') { - if (groups.specTitle) groups.specTitle.style.display = 'flex'; - if (groups.ram) groups.ram.style.display = 'flex'; - } - else if (type === 'HDD') { - if (groups.specTitle) groups.specTitle.style.display = 'flex'; - if (groups.ssd1) groups.ssd1.style.display = 'flex'; - } - else if (type === '태블릿') { - if (groups.specTitle) groups.specTitle.style.display = 'flex'; - if (groups.model) groups.model.style.display = 'flex'; - if (groups.ssd1) groups.ssd1.style.display = 'flex'; - } } function fillHwFormData(asset: HardwareAsset) {