fix: 자산 추가/수정 모달에서 서비스 구분 필드 노출 조건 수정 (구분이 서버 또는 유형이 서버PC인 경우만)

This commit is contained in:
이태훈
2026-06-25 10:30:26 +09:00
parent afd89322bb
commit 2137ee364c

View File

@@ -74,7 +74,7 @@ class HwAssetModal extends BaseModal {
<label>${ASSET_SCHEMA.HW_STATUS.ui}</label>
<select id="hw-hw_status" name="hw_status">${generateOptionsHTML(HW_STATUS_LIST)}</select>
</div>
<div class="form-group">
<div class="form-group service-type-field">
<label>${ASSET_SCHEMA.SERVICE_TYPE.ui}</label>
<select id="hw-service_type" name="service_type">
<option value="외부">외부</option>
@@ -691,8 +691,10 @@ class HwAssetModal extends BaseModal {
const hasSN = !['사무가구', 'PC부품'].includes(category);
const isParts = ['PC부품', '사무가구'].includes(category);
const showRemote = category === '서버' || type.includes('서버');
const showServiceType = category === '서버' || type === '서버PC';
document.querySelectorAll('.remote-section, .remote-field, .monitoring-field').forEach(el => (el as HTMLElement).style.display = showRemote ? '' : 'none');
document.querySelectorAll('.service-type-field').forEach(el => (el as HTMLElement).style.display = showServiceType ? '' : 'none');
document.querySelectorAll('.net-only').forEach(el => (el as HTMLElement).style.display = showNet ? '' : 'none');
document.querySelectorAll('.spec-only').forEach(el => (el as HTMLElement).style.display = hasSpec ? '' : 'none');
document.querySelectorAll('.location-section, .location-field').forEach(el => (el as HTMLElement).style.display = (isInfra || category === '공간정보장비') ? '' : 'none');