- Phase 1: 모든 서비스 헤더에 알림 벨 UI 추가 (notification-bell.js) - Phase 2: VAPID Web Push 구독/전송 (push-sw.js, pushSubscription API) - Phase 3: 내부 알림 API + notifyHelper로 서비스간 알림 연동 - tksafety: 출입 승인/반려, 안전교육 완료, 방문자 체크인 - tkpurchase: 일용공 신청, 작업보고서 제출 - system2-report: 신고 접수/확인/처리완료 - Phase 4: 30일 이상 알림 자동 정리 cron, Redis 캐싱 - CORS에 tkuser/tkpurchase/tksafety 서브도메인 추가 - HTML cache busting 버전 갱신 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
162 lines
9.6 KiB
HTML
162 lines
9.6 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="ko">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>체크리스트 관리 - TK 안전관리</title>
|
|
<script src="https://cdn.tailwindcss.com"></script>
|
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
|
<link rel="stylesheet" href="/static/css/tksafety.css">
|
|
</head>
|
|
<body>
|
|
<!-- Header -->
|
|
<header class="bg-blue-700 text-white sticky top-0 z-50">
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
<div class="flex justify-between items-center h-14">
|
|
<div class="flex items-center gap-3">
|
|
<i class="fas fa-shield-alt text-xl text-blue-200"></i>
|
|
<h1 class="text-lg font-semibold">TK 안전관리</h1>
|
|
</div>
|
|
<div class="flex items-center gap-4">
|
|
<div id="headerUserName" class="text-sm font-medium hidden sm:block">-</div>
|
|
<div id="headerUserAvatar" class="w-8 h-8 bg-blue-600 rounded-full flex items-center justify-center text-sm font-semibold">-</div>
|
|
<button onclick="doLogout()" class="text-blue-200 hover:text-white" title="로그아웃"><i class="fas fa-sign-out-alt"></i></button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</header>
|
|
|
|
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 fade-in">
|
|
<div class="flex gap-6">
|
|
<!-- Sidebar Nav -->
|
|
<nav id="sideNav" class="hidden lg:flex flex-col gap-1 w-48 flex-shrink-0 pt-2"></nav>
|
|
|
|
<!-- Main -->
|
|
<div class="flex-1 min-w-0">
|
|
<!-- 탭 -->
|
|
<div class="bg-white rounded-xl shadow-sm mb-5">
|
|
<div class="flex border-b">
|
|
<button onclick="switchTab('basic')" id="tabBasic" class="checklist-tab active flex-1 py-3 text-sm font-medium text-center border-b-2 transition-colors">
|
|
<i class="fas fa-list-check mr-1"></i>기본 항목
|
|
</button>
|
|
<button onclick="switchTab('weather')" id="tabWeather" class="checklist-tab flex-1 py-3 text-sm font-medium text-center border-b-2 transition-colors">
|
|
<i class="fas fa-cloud-sun mr-1"></i>날씨별 항목
|
|
</button>
|
|
<button onclick="switchTab('worktype')" id="tabWorktype" class="checklist-tab flex-1 py-3 text-sm font-medium text-center border-b-2 transition-colors">
|
|
<i class="fas fa-hard-hat mr-1"></i>작업별 항목
|
|
</button>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 기본 항목 탭 -->
|
|
<div id="panelBasic" class="tab-panel">
|
|
<div class="bg-white rounded-xl shadow-sm p-5">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h2 class="text-base font-semibold text-gray-800"><i class="fas fa-list-check text-blue-500 mr-2"></i>기본 체크리스트 항목</h2>
|
|
<button onclick="openAddItem('basic')" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 text-sm font-medium">
|
|
<i class="fas fa-plus mr-1"></i>항목 추가
|
|
</button>
|
|
</div>
|
|
<div id="basicItemsList" class="space-y-2">
|
|
<div class="text-center text-gray-400 py-8">로딩 중...</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 날씨별 항목 탭 -->
|
|
<div id="panelWeather" class="tab-panel hidden">
|
|
<div class="bg-white rounded-xl shadow-sm p-5 mb-5">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h2 class="text-base font-semibold text-gray-800"><i class="fas fa-cloud-sun text-blue-500 mr-2"></i>날씨별 체크리스트 항목</h2>
|
|
<button onclick="openAddItem('weather')" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 text-sm font-medium">
|
|
<i class="fas fa-plus mr-1"></i>항목 추가
|
|
</button>
|
|
</div>
|
|
<div id="weatherItemsList" class="space-y-4">
|
|
<div class="text-center text-gray-400 py-8">로딩 중...</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 작업별 항목 탭 -->
|
|
<div id="panelWorktype" class="tab-panel hidden">
|
|
<div class="bg-white rounded-xl shadow-sm p-5">
|
|
<div class="flex items-center justify-between mb-4">
|
|
<h2 class="text-base font-semibold text-gray-800"><i class="fas fa-hard-hat text-blue-500 mr-2"></i>작업별 체크리스트 항목</h2>
|
|
<button onclick="openAddItem('worktype')" class="px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 text-sm font-medium">
|
|
<i class="fas fa-plus mr-1"></i>항목 추가
|
|
</button>
|
|
</div>
|
|
<div id="worktypeItemsList" class="space-y-4">
|
|
<div class="text-center text-gray-400 py-8">로딩 중...</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 항목 추가/수정 모달 -->
|
|
<div id="itemModal" class="hidden modal-overlay" onclick="if(event.target===this)closeItemModal()">
|
|
<div class="modal-content p-6">
|
|
<div class="flex justify-between items-center mb-4">
|
|
<h3 id="itemModalTitle" class="text-lg font-semibold">체크리스트 항목 추가</h3>
|
|
<button onclick="closeItemModal()" class="text-gray-400 hover:text-gray-600"><i class="fas fa-times"></i></button>
|
|
</div>
|
|
<form id="itemForm">
|
|
<div class="grid grid-cols-1 gap-3">
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">유형 <span class="text-red-400">*</span></label>
|
|
<select id="itemType" class="input-field w-full px-3 py-2 rounded-lg text-sm" required>
|
|
<option value="basic">기본</option>
|
|
<option value="weather">날씨별</option>
|
|
<option value="work_type">작업별</option>
|
|
</select>
|
|
</div>
|
|
<!-- 날씨 조건 (weather type only) -->
|
|
<div id="weatherConditionField" class="hidden">
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">날씨 조건 <span class="text-red-400">*</span></label>
|
|
<select id="itemWeatherCondition" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
|
<option value="">선택</option>
|
|
</select>
|
|
</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>
|
|
<select id="itemWorkType" 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="예: 개인보호구, 작업환경">
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">점검 항목 <span class="text-red-400">*</span></label>
|
|
<input type="text" id="itemContent" class="input-field w-full px-3 py-2 rounded-lg text-sm" placeholder="점검 항목 내용" required>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">표시 순서</label>
|
|
<input type="number" id="itemDisplayOrder" class="input-field w-full px-3 py-2 rounded-lg text-sm" value="0" min="0">
|
|
</div>
|
|
<div class="flex items-center">
|
|
<label class="flex items-center gap-2 cursor-pointer">
|
|
<input type="checkbox" id="itemIsActive" checked class="h-4 w-4 text-blue-500 rounded border-gray-300">
|
|
<span class="text-sm text-gray-700">활성화</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-end mt-4 gap-2">
|
|
<button type="button" onclick="closeItemModal()" class="px-4 py-2 border rounded-lg text-sm hover:bg-gray-50">취소</button>
|
|
<button type="submit" class="px-4 py-2 bg-blue-600 text-white rounded-lg text-sm hover:bg-blue-700">저장</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
|
|
<script src="/static/js/tksafety-core.js?v=3"></script>
|
|
<script src="/static/js/tksafety-checklist.js"></script>
|
|
<script>initChecklistPage();</script>
|
|
</body>
|
|
</html>
|