fix: restore Cloud tab under SW menu, change date fields to yyyy-mm-dd, add start_date field
This commit is contained in:
@@ -28,6 +28,7 @@ const SW_FIELD_MAP: Record<string, string> = {
|
|||||||
'수량': ASSET_SCHEMA.QTY.key,
|
'수량': ASSET_SCHEMA.QTY.key,
|
||||||
'금액': ASSET_SCHEMA.PRICE.key,
|
'금액': ASSET_SCHEMA.PRICE.key,
|
||||||
'구매일': ASSET_SCHEMA.PURCHASE_YM.key,
|
'구매일': ASSET_SCHEMA.PURCHASE_YM.key,
|
||||||
|
'시작일': '시작일',
|
||||||
'납품업체': ASSET_SCHEMA.VENDOR.key,
|
'납품업체': ASSET_SCHEMA.VENDOR.key,
|
||||||
'비고': ASSET_SCHEMA.REMARKS.key,
|
'비고': ASSET_SCHEMA.REMARKS.key,
|
||||||
'플랫폼명': ASSET_SCHEMA.PLATFORM.key,
|
'플랫폼명': ASSET_SCHEMA.PLATFORM.key,
|
||||||
@@ -79,10 +80,11 @@ const SW_FORM_HTML = `
|
|||||||
|
|
||||||
<!-- Group 4: 관리 정보 -->
|
<!-- Group 4: 관리 정보 -->
|
||||||
<div class="form-section-title">관리 및 비고</div>
|
<div class="form-section-title">관리 및 비고</div>
|
||||||
<div class="form-group sw-standard-field"><label for="sw-구매일">${ASSET_SCHEMA.PURCHASE_YM.ui}</label><input type="text" id="sw-구매일" placeholder="YYYYMM" maxlength="6" /></div>
|
<div class="form-group sw-standard-field"><label for="sw-구매일">구매일자</label><input type="date" id="sw-구매일" /></div>
|
||||||
<div class="form-group sw-standard-field" id="sw-expiry-group"><label for="sw-만료일">${ASSET_SCHEMA.EXPIRY.ui}</label><input type="text" id="sw-만료일" /></div>
|
<div class="form-group sw-standard-field" id="sw-start-group"><label for="sw-시작일">시작일</label><input type="date" id="sw-시작일" /></div>
|
||||||
|
<div class="form-group sw-standard-field" id="sw-expiry-group"><label for="sw-만료일">${ASSET_SCHEMA.EXPIRY.ui}</label><input type="date" id="sw-만료일" /></div>
|
||||||
<div class="form-group sw-standard-field"><label for="sw-납품업체">${ASSET_SCHEMA.VENDOR.ui}</label><input type="text" id="sw-납품업체" /></div>
|
<div class="form-group sw-standard-field"><label for="sw-납품업체">${ASSET_SCHEMA.VENDOR.ui}</label><input type="text" id="sw-납품업체" /></div>
|
||||||
<div class="form-group full-width"><label for="sw-비고">${ASSET_SCHEMA.REMARKS.ui}</label><textarea id="hw-비고" rows="2"></textarea></div>
|
<div class="form-group full-width"><label for="sw-비고">${ASSET_SCHEMA.REMARKS.ui}</label><textarea id="sw-비고" rows="2"></textarea></div>
|
||||||
|
|
||||||
<div id="sw-user-section" class="user-management-section" style="margin-top: 2rem;">
|
<div id="sw-user-section" class="user-management-section" style="margin-top: 2rem;">
|
||||||
<div class="section-header" style="display:flex; justify-content:space-between; align-items:center; margin-bottom:1rem;">
|
<div class="section-header" style="display:flex; justify-content:space-between; align-items:center; margin-bottom:1rem;">
|
||||||
@@ -127,6 +129,7 @@ function applySwTypeUI(type: string) {
|
|||||||
const keyGroup = document.getElementById('sw-license-key-group');
|
const keyGroup = document.getElementById('sw-license-key-group');
|
||||||
const typeGroup = document.getElementById('sw-license-type-group');
|
const typeGroup = document.getElementById('sw-license-type-group');
|
||||||
const expiryGroup = document.getElementById('sw-expiry-group');
|
const expiryGroup = document.getElementById('sw-expiry-group');
|
||||||
|
const startGroup = document.getElementById('sw-start-group');
|
||||||
|
|
||||||
if (type === '클라우드') {
|
if (type === '클라우드') {
|
||||||
cloudFields.forEach(el => (el as HTMLElement).style.display = 'flex');
|
cloudFields.forEach(el => (el as HTMLElement).style.display = 'flex');
|
||||||
@@ -140,10 +143,12 @@ function applySwTypeUI(type: string) {
|
|||||||
if (keyGroup) keyGroup.style.display = 'none';
|
if (keyGroup) keyGroup.style.display = 'none';
|
||||||
if (typeGroup) typeGroup.style.display = 'flex';
|
if (typeGroup) typeGroup.style.display = 'flex';
|
||||||
if (expiryGroup) expiryGroup.style.display = 'flex';
|
if (expiryGroup) expiryGroup.style.display = 'flex';
|
||||||
|
if (startGroup) startGroup.style.display = 'flex';
|
||||||
} else if (type === '영구SW') {
|
} else if (type === '영구SW') {
|
||||||
if (keyGroup) keyGroup.style.display = 'flex';
|
if (keyGroup) keyGroup.style.display = 'flex';
|
||||||
if (typeGroup) typeGroup.style.display = 'none';
|
if (typeGroup) typeGroup.style.display = 'none';
|
||||||
if (expiryGroup) expiryGroup.style.display = 'none'; // 영구는 유지보수 기간이 비고에 들어가는 경우가 많아 만료일 숨김 처리
|
if (expiryGroup) expiryGroup.style.display = 'none';
|
||||||
|
if (startGroup) startGroup.style.display = 'flex';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -212,11 +217,7 @@ export function initSwModal(onSave: () => void, closeModalsCb: () => void) {
|
|||||||
if (currentSwAsset) openSwModal(currentSwAsset, 'view');
|
if (currentSwAsset) openSwModal(currentSwAsset, 'view');
|
||||||
});
|
});
|
||||||
|
|
||||||
// YYYYMM 입력 제한 로직 (숫자 6자리)
|
// 날짜 필드는 type="date"로 변경되어 별도 제한 로직 불필요
|
||||||
document.getElementById('sw-구매일')?.addEventListener('input', (e) => {
|
|
||||||
const target = e.target as HTMLInputElement;
|
|
||||||
target.value = target.value.replace(/[^0-9]/g, '').substring(0, 6);
|
|
||||||
});
|
|
||||||
|
|
||||||
saveBtn.addEventListener('click', () => {
|
saveBtn.addEventListener('click', () => {
|
||||||
if (!currentSwAsset) return;
|
if (!currentSwAsset) return;
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ const MENU_CONFIG = {
|
|||||||
},
|
},
|
||||||
sw: {
|
sw: {
|
||||||
label: '소프트웨어',
|
label: '소프트웨어',
|
||||||
tabs: ['대시보드', '구독SW', '영구SW']
|
tabs: ['대시보드', '구독SW', '영구SW', '클라우드']
|
||||||
},
|
},
|
||||||
ops: {
|
ops: {
|
||||||
label: '운영 서비스',
|
label: '운영 서비스',
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ export function renderSWTable(mainContent: HTMLElement) {
|
|||||||
} else if (state.activeCategory === 'sw') {
|
} else if (state.activeCategory === 'sw') {
|
||||||
if (tab === '구독SW' || tab === '영구SW') {
|
if (tab === '구독SW' || tab === '영구SW') {
|
||||||
renderSwList(container);
|
renderSwList(container);
|
||||||
|
} else if (tab === '클라우드') {
|
||||||
|
renderCloudList(container);
|
||||||
} else {
|
} else {
|
||||||
container.innerHTML = `<div style="padding:2rem; color:var(--text-muted);">"${tab}" 탭에 대한 소프트웨어 리스트 뷰가 정의되지 않았습니다.</div>`;
|
container.innerHTML = `<div style="padding:2rem; color:var(--text-muted);">"${tab}" 탭에 대한 소프트웨어 리스트 뷰가 정의되지 않았습니다.</div>`;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user