카카오톡 인앱 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>
183 lines
11 KiB
HTML
183 lines
11 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?v=2026031501">
|
|
</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 p-4 mb-5">
|
|
<div class="filter-bar flex flex-wrap gap-3 items-end">
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">평가유형</label>
|
|
<select id="filterType" onchange="loadProjects()" class="input-field px-3 py-1.5 rounded-lg text-sm">
|
|
<option value="">전체</option>
|
|
<option value="regular">정기</option>
|
|
<option value="adhoc">수시</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">연도</label>
|
|
<select id="filterYear" onchange="loadProjects()" class="input-field px-3 py-1.5 rounded-lg text-sm">
|
|
<option value="">전체</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">제품유형</label>
|
|
<select id="filterProduct" onchange="loadProjects()" class="input-field px-3 py-1.5 rounded-lg text-sm">
|
|
<option value="">전체</option>
|
|
<option value="PKG">PKG</option>
|
|
<option value="VESSEL">VESSEL</option>
|
|
<option value="HX">HX</option>
|
|
<option value="SKID">SKID</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">상태</label>
|
|
<select id="filterStatus" onchange="loadProjects()" class="input-field px-3 py-1.5 rounded-lg text-sm">
|
|
<option value="">전체</option>
|
|
<option value="draft">작성중</option>
|
|
<option value="in_progress">진행중</option>
|
|
<option value="completed">완료</option>
|
|
</select>
|
|
</div>
|
|
<div class="filter-actions">
|
|
<button onclick="openNewProjectModal()" class="px-4 py-1.5 bg-blue-600 text-white rounded-lg text-sm hover:bg-blue-700 font-medium whitespace-nowrap">
|
|
<i class="fas fa-plus mr-1"></i>신규 프로젝트
|
|
</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 테이블 -->
|
|
<div class="bg-white rounded-xl shadow-sm overflow-hidden">
|
|
<div class="overflow-x-auto">
|
|
<table class="visit-table">
|
|
<thead>
|
|
<tr>
|
|
<th>제목</th>
|
|
<th class="text-center">유형</th>
|
|
<th class="text-center">제품</th>
|
|
<th class="text-center">연도</th>
|
|
<th class="text-center">상태</th>
|
|
<th class="text-center">항목수</th>
|
|
<th class="text-center">고위험</th>
|
|
<th class="text-center w-16"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="projectTableBody">
|
|
<tr><td colspan="8" class="text-center text-gray-400 py-8">로딩 중...</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 신규 프로젝트 모달 -->
|
|
<div id="projectModal" class="hidden modal-overlay" onclick="if(event.target===this)closeProjectModal()">
|
|
<div class="modal-content p-6">
|
|
<div class="flex justify-between items-center mb-4">
|
|
<h3 class="text-lg font-semibold">신규 위험성평가 프로젝트</h3>
|
|
<button onclick="closeProjectModal()" class="text-gray-400 hover:text-gray-600"><i class="fas fa-times"></i></button>
|
|
</div>
|
|
<form id="projectForm" onsubmit="submitProject(event)">
|
|
<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>
|
|
<input type="text" id="projectTitle" class="input-field w-full px-3 py-2 rounded-lg text-sm" placeholder="예: 2025년 정기 위험성평가 (PKG)" required>
|
|
</div>
|
|
<div class="grid grid-cols-2 gap-3">
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">평가유형 <span class="text-red-400">*</span></label>
|
|
<select id="projectAssessType" class="input-field w-full px-3 py-2 rounded-lg text-sm" required>
|
|
<option value="regular">정기</option>
|
|
<option value="adhoc">수시</option>
|
|
</select>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">제품유형 <span class="text-red-400">*</span></label>
|
|
<select id="projectProductType" class="input-field w-full px-3 py-2 rounded-lg text-sm" required>
|
|
<option value="PKG">PKG</option>
|
|
<option value="VESSEL">VESSEL</option>
|
|
<option value="HX">HX</option>
|
|
<option value="SKID">SKID</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div class="grid grid-cols-2 gap-3">
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">연도 <span class="text-red-400">*</span></label>
|
|
<input type="number" id="projectYear" class="input-field w-full px-3 py-2 rounded-lg text-sm" min="2020" max="2030" required>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">월 (수시만)</label>
|
|
<select id="projectMonth" class="input-field w-full px-3 py-2 rounded-lg text-sm">
|
|
<option value="">-</option>
|
|
<option value="1">1월</option><option value="2">2월</option><option value="3">3월</option>
|
|
<option value="4">4월</option><option value="5">5월</option><option value="6">6월</option>
|
|
<option value="7">7월</option><option value="8">8월</option><option value="9">9월</option>
|
|
<option value="10">10월</option><option value="11">11월</option><option value="12">12월</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
<div>
|
|
<label class="block text-xs font-medium text-gray-600 mb-1">평가자</label>
|
|
<input type="text" id="projectAssessedBy" class="input-field w-full px-3 py-2 rounded-lg text-sm" placeholder="평가 담당자명">
|
|
</div>
|
|
</div>
|
|
<div class="flex justify-end mt-4 gap-2">
|
|
<button type="button" onclick="closeProjectModal()" 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-risk.js?v=2026031501"></script>
|
|
<script>
|
|
// 연도 필터 옵션 생성
|
|
const yearSelect = document.getElementById('filterYear');
|
|
const curYear = new Date().getFullYear();
|
|
for (let y = curYear; y >= 2022; y--) {
|
|
yearSelect.insertAdjacentHTML('beforeend', `<option value="${y}">${y}</option>`);
|
|
}
|
|
initRiskProjectsPage();
|
|
</script>
|
|
</body>
|
|
</html>
|