카카오톡 인앱 WebView는 서브도메인 간 쿠키를 공유하지 않아 tkds에서 로그인 후 tkfb로 리다이렉트 시 인증이 풀리는 문제. - sso-relay.js: URL hash의 _sso= 토큰을 로컬 쿠키+localStorage로 설정 - gateway dashboard: 로그인 후 redirect URL에 #_sso=<token> 추가 - 전 서비스 HTML: core JS 직전에 sso-relay.js 로드 (81개 파일) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
173 lines
10 KiB
HTML
173 lines
10 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">
|
|
<button id="mobileMenuBtn" onclick="toggleMobileMenu()" class="lg:hidden text-blue-200 hover:text-white">
|
|
<i class="fas fa-bars text-xl"></i>
|
|
</button>
|
|
<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="task">작업별</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>
|
|
<!-- 작업 선택 (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="예: 개인보호구, 작업환경">
|
|
</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/sso-relay.js?v=20260401"></script>
|
|
<script src="/static/js/tksafety-core.js?v=2026040101"></script>
|
|
<script src="/static/js/tksafety-checklist.js?v=2026031401"></script>
|
|
<script>initChecklistPage();</script>
|
|
</body>
|
|
</html>
|