diff --git a/tksafety/web/checklist.html b/tksafety/web/checklist.html index 7ab3160..8bb6783 100644 --- a/tksafety/web/checklist.html +++ b/tksafety/web/checklist.html @@ -110,7 +110,7 @@ @@ -162,7 +162,7 @@ - + diff --git a/tksafety/web/static/js/tksafety-checklist.js b/tksafety/web/static/js/tksafety-checklist.js index 456ea01..39fd87f 100644 --- a/tksafety/web/static/js/tksafety-checklist.js +++ b/tksafety/web/static/js/tksafety-checklist.js @@ -137,7 +137,7 @@ function renderWeatherItems() { /* ===== Render worktype items (2-level: work_type → task) ===== */ function renderWorktypeItems() { - const items = checklistItems.filter(i => i.item_type === 'work_type'); + const items = checklistItems.filter(i => i.item_type === 'task'); const container = document.getElementById('worktypeItemsList'); if (!items.length) { container.innerHTML = '
작업별 항목이 없습니다
'; @@ -208,7 +208,7 @@ function openAddItem(tab) { document.getElementById('itemDisplayOrder').value = '0'; // Set type based on tab - const typeMap = { basic: 'basic', weather: 'weather', worktype: 'work_type' }; + const typeMap = { basic: 'basic', weather: 'weather', worktype: 'task' }; document.getElementById('itemType').value = typeMap[tab] || 'basic'; toggleTypeFields(); @@ -251,9 +251,9 @@ function closeItemModal() { function toggleTypeFields() { const type = document.getElementById('itemType').value; document.getElementById('weatherConditionField').classList.toggle('hidden', type !== 'weather'); - document.getElementById('workTypeField').classList.toggle('hidden', type !== 'work_type'); - // Hide task field when type changes away from work_type - if (type !== 'work_type') { + document.getElementById('workTypeField').classList.toggle('hidden', type !== 'task'); + // Hide task field when type changes away from task + if (type !== 'task') { document.getElementById('taskField').classList.add('hidden'); } else { // Show task field if work type is already selected @@ -281,7 +281,7 @@ async function submitItem(e) { data.weather_condition_id = parseInt(document.getElementById('itemWeatherCondition').value) || null; if (!data.weather_condition_id) { showToast('날씨 조건을 선택해주세요', 'error'); return; } } - if (data.item_type === 'work_type') { + if (data.item_type === 'task') { const taskId = parseInt(document.getElementById('itemTask').value) || null; if (!taskId) { showToast('작업을 선택해주세요', 'error'); return; } data.task_id = taskId;