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.PRICE.key,
|
||||
'구매일': ASSET_SCHEMA.PURCHASE_YM.key,
|
||||
'시작일': '시작일',
|
||||
'납품업체': ASSET_SCHEMA.VENDOR.key,
|
||||
'비고': ASSET_SCHEMA.REMARKS.key,
|
||||
'플랫폼명': ASSET_SCHEMA.PLATFORM.key,
|
||||
@@ -79,10 +80,11 @@ const SW_FORM_HTML = `
|
||||
|
||||
<!-- Group 4: 관리 정보 -->
|
||||
<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" 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"><label for="sw-구매일">구매일자</label><input type="date" 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 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 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 typeGroup = document.getElementById('sw-license-type-group');
|
||||
const expiryGroup = document.getElementById('sw-expiry-group');
|
||||
const startGroup = document.getElementById('sw-start-group');
|
||||
|
||||
if (type === '클라우드') {
|
||||
cloudFields.forEach(el => (el as HTMLElement).style.display = 'flex');
|
||||
@@ -140,10 +143,12 @@ function applySwTypeUI(type: string) {
|
||||
if (keyGroup) keyGroup.style.display = 'none';
|
||||
if (typeGroup) typeGroup.style.display = 'flex';
|
||||
if (expiryGroup) expiryGroup.style.display = 'flex';
|
||||
if (startGroup) startGroup.style.display = 'flex';
|
||||
} else if (type === '영구SW') {
|
||||
if (keyGroup) keyGroup.style.display = 'flex';
|
||||
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');
|
||||
});
|
||||
|
||||
// YYYYMM 입력 제한 로직 (숫자 6자리)
|
||||
document.getElementById('sw-구매일')?.addEventListener('input', (e) => {
|
||||
const target = e.target as HTMLInputElement;
|
||||
target.value = target.value.replace(/[^0-9]/g, '').substring(0, 6);
|
||||
});
|
||||
// 날짜 필드는 type="date"로 변경되어 별도 제한 로직 불필요
|
||||
|
||||
saveBtn.addEventListener('click', () => {
|
||||
if (!currentSwAsset) return;
|
||||
|
||||
Reference in New Issue
Block a user