feat(tksafety): 체크리스트 작업별 항목에 tkuser 작업(task) 참조 연동

- getAllChecks: tasks/work_types/weather_conditions JOIN + 프론트엔드 필드명 alias
- createCheck/updateCheck: item_type→check_type 등 프론트-DB 필드 매핑
- 모달에 작업(task) 드롭다운 추가, 공정 선택 시 동적 로드
- renderWorktypeItems: work_type → task 2단 그룹핑
- openEditItem: async/await로 task 목록 로드 후 값 설정

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
Hyungi Ahn
2026-03-13 21:07:29 +09:00
parent e8076a8550
commit 07aac305d6
4 changed files with 104 additions and 24 deletions

View File

@@ -122,11 +122,18 @@
</div>
<!-- 작업유형 (work_type only) -->
<div id="workTypeField" class="hidden">
<label class="block text-xs font-medium text-gray-600 mb-1">작업 유형 <span class="text-red-400">*</span></label>
<label class="block text-xs font-medium text-gray-600 mb-1">공정 <span class="text-red-400">*</span></label>
<select id="itemWorkType" class="input-field w-full px-3 py-2 rounded-lg text-sm">
<option value="">선택</option>
</select>
</div>
<!-- 작업 선택 (work_type 선택 시 표시) -->
<div id="taskField" class="hidden">
<label class="block text-xs font-medium text-gray-600 mb-1">작업 <span class="text-red-400">*</span></label>
<select id="itemTask" class="input-field w-full px-3 py-2 rounded-lg text-sm">
<option value="">공정을 먼저 선택하세요</option>
</select>
</div>
<div>
<label class="block text-xs font-medium text-gray-600 mb-1">카테고리</label>
<input type="text" id="itemCategory" class="input-field w-full px-3 py-2 rounded-lg text-sm" placeholder="예: 개인보호구, 작업환경">
@@ -155,7 +162,7 @@
</div>
<script src="/static/js/tksafety-core.js?v=3"></script>
<script src="/static/js/tksafety-checklist.js"></script>
<script src="/static/js/tksafety-checklist.js?v=2"></script>
<script>initChecklistPage();</script>
</body>
</html>