- 페이지 폴더 재구성: safety/, attendance/ 폴더 신규 생성 - work/ → safety/: 이슈 신고, 출입 신청 관련 페이지 이동 - common/ → attendance/: 근태/휴가 관련 페이지 이동 - admin/ 정리: safety-* 파일들을 safety/로 이동 - 사이드바 네비게이션 메뉴 구현 - 카테고리별 메뉴: 작업관리, 안전관리, 근태관리, 시스템관리 - 접기/펼치기 기능 및 상태 저장 - 관리자 전용 메뉴 자동 표시/숨김 - 날씨 API 연동 (기상청 단기예보) - TBM 및 navbar에 현재 날씨 표시 - weatherService.js 추가 - 안전 체크리스트 확장 - 기본/날씨별/작업별 체크 유형 추가 - checklist-manage.html 페이지 추가 - 이슈 신고 시스템 구현 - workIssueController, workIssueModel, workIssueRoutes 추가 - DB 마이그레이션 파일 추가 (실행 대기) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
597 lines
14 KiB
HTML
597 lines
14 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-FB</title>
|
|
<link rel="stylesheet" href="/css/design-system.css">
|
|
<link rel="stylesheet" href="/css/common.css">
|
|
<style>
|
|
.page-container {
|
|
max-width: 1200px;
|
|
margin: 0 auto;
|
|
padding: 1rem;
|
|
}
|
|
|
|
.page-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
margin-bottom: 1.5rem;
|
|
flex-wrap: wrap;
|
|
gap: 1rem;
|
|
}
|
|
|
|
.page-title {
|
|
font-size: 1.5rem;
|
|
font-weight: 700;
|
|
color: var(--text-primary, #111827);
|
|
margin: 0;
|
|
}
|
|
|
|
.btn-add {
|
|
padding: 0.75rem 1.5rem;
|
|
background: linear-gradient(135deg, #3b82f6, #2563eb);
|
|
color: white;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.btn-add:hover {
|
|
background: linear-gradient(135deg, #2563eb, #1d4ed8);
|
|
}
|
|
|
|
/* 탭 메뉴 */
|
|
.tab-menu {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
border-bottom: 2px solid #e5e7eb;
|
|
margin-bottom: 1.5rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.tab-btn {
|
|
padding: 0.75rem 1.5rem;
|
|
background: none;
|
|
border: none;
|
|
border-bottom: 3px solid transparent;
|
|
cursor: pointer;
|
|
font-size: 0.95rem;
|
|
font-weight: 500;
|
|
color: #6b7280;
|
|
transition: all 0.2s;
|
|
margin-bottom: -2px;
|
|
}
|
|
|
|
.tab-btn:hover {
|
|
color: #3b82f6;
|
|
}
|
|
|
|
.tab-btn.active {
|
|
color: #3b82f6;
|
|
border-bottom-color: #3b82f6;
|
|
font-weight: 600;
|
|
}
|
|
|
|
.tab-content {
|
|
display: none;
|
|
}
|
|
|
|
.tab-content.active {
|
|
display: block;
|
|
}
|
|
|
|
/* 체크리스트 카드 */
|
|
.checklist-group {
|
|
background: white;
|
|
border-radius: 12px;
|
|
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
|
|
margin-bottom: 1rem;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.group-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 1rem 1.25rem;
|
|
background: #f9fafb;
|
|
border-bottom: 1px solid #e5e7eb;
|
|
}
|
|
|
|
.group-title {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.75rem;
|
|
font-weight: 600;
|
|
color: #374151;
|
|
}
|
|
|
|
.group-icon {
|
|
font-size: 1.25rem;
|
|
}
|
|
|
|
.group-count {
|
|
background: #e5e7eb;
|
|
color: #6b7280;
|
|
font-size: 0.75rem;
|
|
padding: 0.25rem 0.5rem;
|
|
border-radius: 10px;
|
|
}
|
|
|
|
.checklist-items {
|
|
padding: 0;
|
|
}
|
|
|
|
.checklist-item {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 0.875rem 1.25rem;
|
|
border-bottom: 1px solid #f3f4f6;
|
|
}
|
|
|
|
.checklist-item:last-child {
|
|
border-bottom: none;
|
|
}
|
|
|
|
.item-info {
|
|
flex: 1;
|
|
}
|
|
|
|
.item-name {
|
|
font-weight: 500;
|
|
color: #111827;
|
|
margin-bottom: 0.25rem;
|
|
}
|
|
|
|
.item-meta {
|
|
display: flex;
|
|
gap: 0.75rem;
|
|
font-size: 0.8rem;
|
|
color: #6b7280;
|
|
}
|
|
|
|
.item-badge {
|
|
padding: 0.125rem 0.5rem;
|
|
border-radius: 4px;
|
|
font-size: 0.7rem;
|
|
font-weight: 500;
|
|
}
|
|
|
|
.badge-required {
|
|
background: #fee2e2;
|
|
color: #dc2626;
|
|
}
|
|
|
|
.badge-optional {
|
|
background: #e5e7eb;
|
|
color: #6b7280;
|
|
}
|
|
|
|
.item-actions {
|
|
display: flex;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.btn-icon {
|
|
width: 32px;
|
|
height: 32px;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
border: none;
|
|
border-radius: 6px;
|
|
cursor: pointer;
|
|
transition: all 0.2s;
|
|
}
|
|
|
|
.btn-edit {
|
|
background: #eff6ff;
|
|
color: #3b82f6;
|
|
}
|
|
|
|
.btn-edit:hover {
|
|
background: #dbeafe;
|
|
}
|
|
|
|
.btn-delete {
|
|
background: #fef2f2;
|
|
color: #dc2626;
|
|
}
|
|
|
|
.btn-delete:hover {
|
|
background: #fee2e2;
|
|
}
|
|
|
|
/* 필터/검색 */
|
|
.filter-bar {
|
|
display: flex;
|
|
gap: 1rem;
|
|
margin-bottom: 1.5rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.filter-select {
|
|
padding: 0.5rem 1rem;
|
|
border: 1px solid #e5e7eb;
|
|
border-radius: 6px;
|
|
font-size: 0.9rem;
|
|
min-width: 150px;
|
|
}
|
|
|
|
/* 모달 */
|
|
.modal-overlay {
|
|
display: none;
|
|
position: fixed;
|
|
top: 0;
|
|
left: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
background: rgba(0,0,0,0.5);
|
|
z-index: 1000;
|
|
justify-content: center;
|
|
align-items: center;
|
|
padding: 1rem;
|
|
}
|
|
|
|
.modal-container {
|
|
background: white;
|
|
border-radius: 16px;
|
|
width: 100%;
|
|
max-width: 500px;
|
|
max-height: 90vh;
|
|
overflow: hidden;
|
|
display: flex;
|
|
flex-direction: column;
|
|
}
|
|
|
|
.modal-header {
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
padding: 1.25rem 1.5rem;
|
|
border-bottom: 1px solid #e5e7eb;
|
|
}
|
|
|
|
.modal-title {
|
|
font-size: 1.125rem;
|
|
font-weight: 600;
|
|
margin: 0;
|
|
}
|
|
|
|
.modal-close {
|
|
background: none;
|
|
border: none;
|
|
font-size: 1.5rem;
|
|
color: #6b7280;
|
|
cursor: pointer;
|
|
padding: 0;
|
|
}
|
|
|
|
.modal-body {
|
|
padding: 1.5rem;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.modal-footer {
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
gap: 0.75rem;
|
|
padding: 1rem 1.5rem;
|
|
border-top: 1px solid #e5e7eb;
|
|
background: #f9fafb;
|
|
}
|
|
|
|
.form-group {
|
|
margin-bottom: 1.25rem;
|
|
}
|
|
|
|
.form-label {
|
|
display: block;
|
|
font-weight: 500;
|
|
color: #374151;
|
|
margin-bottom: 0.5rem;
|
|
}
|
|
|
|
.form-input, .form-select, .form-textarea {
|
|
width: 100%;
|
|
padding: 0.75rem;
|
|
border: 1px solid #d1d5db;
|
|
border-radius: 8px;
|
|
font-size: 0.95rem;
|
|
}
|
|
|
|
.form-input:focus, .form-select:focus, .form-textarea:focus {
|
|
outline: none;
|
|
border-color: #3b82f6;
|
|
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
|
|
}
|
|
|
|
.form-textarea {
|
|
min-height: 80px;
|
|
resize: vertical;
|
|
}
|
|
|
|
.form-radio-group {
|
|
display: flex;
|
|
gap: 1rem;
|
|
flex-wrap: wrap;
|
|
}
|
|
|
|
.form-radio {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.form-radio input {
|
|
width: 18px;
|
|
height: 18px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.form-checkbox {
|
|
display: flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.form-checkbox input {
|
|
width: 18px;
|
|
height: 18px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.conditional-fields {
|
|
display: none;
|
|
margin-top: 1rem;
|
|
padding: 1rem;
|
|
background: #f9fafb;
|
|
border-radius: 8px;
|
|
}
|
|
|
|
.conditional-fields.show {
|
|
display: block;
|
|
}
|
|
|
|
.btn-primary {
|
|
padding: 0.75rem 1.5rem;
|
|
background: #3b82f6;
|
|
color: white;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.btn-primary:hover {
|
|
background: #2563eb;
|
|
}
|
|
|
|
.btn-secondary {
|
|
padding: 0.75rem 1.5rem;
|
|
background: #e5e7eb;
|
|
color: #374151;
|
|
border: none;
|
|
border-radius: 8px;
|
|
font-weight: 500;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.btn-secondary:hover {
|
|
background: #d1d5db;
|
|
}
|
|
|
|
.empty-state {
|
|
text-align: center;
|
|
padding: 3rem 1rem;
|
|
color: #9ca3af;
|
|
}
|
|
|
|
.empty-state-icon {
|
|
font-size: 3rem;
|
|
margin-bottom: 1rem;
|
|
}
|
|
|
|
/* 날씨 아이콘 */
|
|
.weather-icon {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
gap: 0.5rem;
|
|
}
|
|
|
|
.weather-icon.rain::before { content: '🌧️'; }
|
|
.weather-icon.snow::before { content: '❄️'; }
|
|
.weather-icon.heat::before { content: '🔥'; }
|
|
.weather-icon.cold::before { content: '🥶'; }
|
|
.weather-icon.wind::before { content: '💨'; }
|
|
.weather-icon.fog::before { content: '🌫️'; }
|
|
.weather-icon.dust::before { content: '😷'; }
|
|
.weather-icon.clear::before { content: '☀️'; }
|
|
|
|
@media (max-width: 768px) {
|
|
.checklist-item {
|
|
flex-direction: column;
|
|
align-items: flex-start;
|
|
gap: 0.75rem;
|
|
}
|
|
|
|
.item-actions {
|
|
width: 100%;
|
|
justify-content: flex-end;
|
|
}
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="navbar-container"></div>
|
|
|
|
<div class="page-container">
|
|
<div class="page-header">
|
|
<h1 class="page-title">안전 체크리스트 관리</h1>
|
|
<button class="btn-add" onclick="openAddModal()">
|
|
<span>+</span> 항목 추가
|
|
</button>
|
|
</div>
|
|
|
|
<!-- 탭 메뉴 -->
|
|
<div class="tab-menu">
|
|
<button class="tab-btn active" data-tab="basic" onclick="switchTab('basic')">
|
|
기본 사항
|
|
</button>
|
|
<button class="tab-btn" data-tab="weather" onclick="switchTab('weather')">
|
|
날씨별
|
|
</button>
|
|
<button class="tab-btn" data-tab="task" onclick="switchTab('task')">
|
|
작업별
|
|
</button>
|
|
</div>
|
|
|
|
<!-- 기본 사항 탭 -->
|
|
<div id="basicTab" class="tab-content active">
|
|
<div id="basicChecklistContainer">
|
|
<!-- 동적 생성 -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 날씨별 탭 -->
|
|
<div id="weatherTab" class="tab-content">
|
|
<div class="filter-bar">
|
|
<select id="weatherFilter" class="filter-select" onchange="filterByWeather()">
|
|
<option value="">모든 날씨 조건</option>
|
|
</select>
|
|
</div>
|
|
<div id="weatherChecklistContainer">
|
|
<!-- 동적 생성 -->
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 작업별 탭 -->
|
|
<div id="taskTab" class="tab-content">
|
|
<div class="filter-bar">
|
|
<select id="workTypeFilter" class="filter-select" onchange="filterByWorkType()">
|
|
<option value="">공정 선택</option>
|
|
</select>
|
|
<select id="taskFilter" class="filter-select" onchange="filterByTask()">
|
|
<option value="">작업 선택</option>
|
|
</select>
|
|
</div>
|
|
<div id="taskChecklistContainer">
|
|
<!-- 동적 생성 -->
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 추가/수정 모달 -->
|
|
<div id="checkModal" class="modal-overlay">
|
|
<div class="modal-container">
|
|
<div class="modal-header">
|
|
<h2 class="modal-title" id="modalTitle">체크 항목 추가</h2>
|
|
<button class="modal-close" onclick="closeModal()">×</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
<form id="checkForm">
|
|
<input type="hidden" id="checkId">
|
|
|
|
<div class="form-group">
|
|
<label class="form-label">유형</label>
|
|
<div class="form-radio-group">
|
|
<label class="form-radio">
|
|
<input type="radio" name="checkType" value="basic" checked onchange="toggleConditionalFields()">
|
|
<span>기본</span>
|
|
</label>
|
|
<label class="form-radio">
|
|
<input type="radio" name="checkType" value="weather" onchange="toggleConditionalFields()">
|
|
<span>날씨별</span>
|
|
</label>
|
|
<label class="form-radio">
|
|
<input type="radio" name="checkType" value="task" onchange="toggleConditionalFields()">
|
|
<span>작업별</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 기본 유형: 카테고리 선택 -->
|
|
<div id="basicFields" class="conditional-fields show">
|
|
<div class="form-group">
|
|
<label class="form-label">카테고리</label>
|
|
<select id="checkCategory" class="form-select">
|
|
<option value="PPE">PPE (개인보호장비)</option>
|
|
<option value="EQUIPMENT">EQUIPMENT (장비점검)</option>
|
|
<option value="ENVIRONMENT">ENVIRONMENT (작업환경)</option>
|
|
<option value="EMERGENCY">EMERGENCY (비상대응)</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 날씨별 유형: 날씨 조건 선택 -->
|
|
<div id="weatherFields" class="conditional-fields">
|
|
<div class="form-group">
|
|
<label class="form-label">날씨 조건</label>
|
|
<select id="weatherCondition" class="form-select">
|
|
<!-- 동적 로드 -->
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 작업별 유형: 공정/작업 선택 -->
|
|
<div id="taskFields" class="conditional-fields">
|
|
<div class="form-group">
|
|
<label class="form-label">공정</label>
|
|
<select id="modalWorkType" class="form-select" onchange="loadModalTasks()">
|
|
<option value="">공정 선택</option>
|
|
</select>
|
|
</div>
|
|
<div class="form-group">
|
|
<label class="form-label">작업</label>
|
|
<select id="modalTask" class="form-select">
|
|
<option value="">작업 선택</option>
|
|
</select>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="form-label">체크 항목</label>
|
|
<input type="text" id="checkItem" class="form-input" placeholder="예: 안전모 착용 확인" required>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="form-label">설명 (선택)</label>
|
|
<textarea id="checkDescription" class="form-textarea" placeholder="항목에 대한 상세 설명"></textarea>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="form-checkbox">
|
|
<input type="checkbox" id="isRequired" checked>
|
|
<span>필수 체크 항목</span>
|
|
</label>
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
<label class="form-label">표시 순서</label>
|
|
<input type="number" id="displayOrder" class="form-input" value="0" min="0">
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn-secondary" onclick="closeModal()">취소</button>
|
|
<button type="button" class="btn-primary" onclick="saveCheck()">저장</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="module" src="/js/api-config.js"></script>
|
|
<script src="/js/auth-check.js" defer></script>
|
|
<script type="module" src="/js/load-navbar.js"></script>
|
|
<script type="module" src="/js/safety-checklist-manage.js"></script>
|
|
</body>
|
|
</html>
|