Files
tk-factory-services/system1-factory/web/pages/admin/departments.html
Hyungi Ahn d36303101e feat: 모바일 UX 대폭 개선 + PWA 구현 + 로그인 루프 수정
- 모바일 하단 네비: 메뉴 제거, 4개 핵심 기능(홈/TBM/작업보고/출근) SVG 아이콘
- 모바일 사이드바 스킵: 768px 이하에서 사이드바 미로드, 레이아웃 오프셋 해결
- 모바일 헤더: 햄버거 메뉴 숨김, 본문 margin/overflow 정리
- TBM 모바일: 풀스크린 모달, 저장 버튼 하단 고정, 터치 UX 개선
- PWA: manifest.json, sw.js(network-first), 앱 아이콘, iOS 메타태그, 킬스위치
- 로그인 무한루프 수정: 토큰 만료 검증, 쿠키 정리, loginPage 경로 수정
- 신고 메뉴 tkreport 리다이렉트: navbar + sidebar cross-system-link 적용
- TBM API: 작업장별 안전점검 체크리스트 조회 엔드포인트 추가
- 안전점검 체크리스트 관리 UI 개선
- tkuser: 이슈유형 관리 기능 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-24 08:20:50 +09:00

317 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>부서 관리 | (주)테크니컬코리아</title>
<link rel="stylesheet" href="/css/design-system.css">
<link rel="stylesheet" href="/css/admin-pages.css?v=8">
<link rel="icon" type="image/png" href="/img/favicon.png">
<script src="/js/api-base.js"></script>
<script src="/js/app-init.js?v=3" defer></script>
<script src="https://instant.page/5.2.0" type="module"></script>
<style>
.department-grid {
display: grid;
grid-template-columns: 350px 1fr;
gap: 1.5rem;
margin-top: 1rem;
}
.department-list-panel {
background: white;
border-radius: 0.5rem;
padding: 1rem;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.department-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem 1rem;
border-radius: 0.5rem;
cursor: pointer;
transition: all 0.2s;
margin-bottom: 0.5rem;
border: 1px solid #e5e7eb;
}
.department-item:hover {
background: #f3f4f6;
}
.department-item.active {
background: #eff6ff;
border-color: #3b82f6;
}
.department-info {
display: flex;
flex-direction: column;
gap: 0.25rem;
}
.department-name {
font-weight: 600;
color: #1f2937;
}
.department-count {
font-size: 0.875rem;
color: #6b7280;
}
.department-actions {
display: flex;
gap: 0.5rem;
}
.btn-icon {
padding: 0.375rem;
border-radius: 0.375rem;
background: transparent;
border: none;
cursor: pointer;
color: #6b7280;
transition: all 0.2s;
}
.btn-icon:hover {
background: #e5e7eb;
color: #1f2937;
}
.btn-icon.danger:hover {
background: #fee2e2;
color: #dc2626;
}
.worker-list-panel {
background: white;
border-radius: 0.5rem;
padding: 1rem;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.worker-list-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1rem;
padding-bottom: 0.75rem;
border-bottom: 1px solid #e5e7eb;
}
.worker-list-title {
font-size: 1.125rem;
font-weight: 600;
color: #1f2937;
}
.worker-card {
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.75rem 1rem;
border: 1px solid #e5e7eb;
border-radius: 0.5rem;
margin-bottom: 0.5rem;
transition: all 0.2s;
}
.worker-card:hover {
border-color: #d1d5db;
background: #f9fafb;
}
.worker-card.selected {
background: #eff6ff;
border-color: #3b82f6;
}
.worker-info-row {
display: flex;
align-items: center;
gap: 1rem;
}
.worker-avatar {
width: 40px;
height: 40px;
border-radius: 50%;
background: #e5e7eb;
display: flex;
align-items: center;
justify-content: center;
font-weight: 600;
color: #4b5563;
}
.worker-details {
display: flex;
flex-direction: column;
}
.worker-name {
font-weight: 600;
color: #1f2937;
}
.worker-job {
font-size: 0.875rem;
color: #6b7280;
}
.bulk-actions {
display: none;
gap: 0.5rem;
padding: 0.75rem;
background: #f3f4f6;
border-radius: 0.5rem;
margin-bottom: 1rem;
}
.bulk-actions.visible {
display: flex;
}
.modal-backdrop {
display: none;
position: fixed;
inset: 0;
background: rgba(0,0,0,0.5);
z-index: 100;
}
.modal-backdrop.show {
display: flex;
align-items: center;
justify-content: center;
}
.modal-content {
background: white;
border-radius: 0.75rem;
padding: 1.5rem;
width: 90%;
max-width: 500px;
box-shadow: 0 20px 25px -5px rgba(0,0,0,0.1);
}
.modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 1.5rem;
}
.modal-title {
font-size: 1.25rem;
font-weight: 600;
color: #1f2937;
}
.form-group {
margin-bottom: 1rem;
}
.form-label {
display: block;
font-weight: 500;
margin-bottom: 0.5rem;
color: #374151;
}
.form-input, .form-select, .form-textarea {
width: 100%;
padding: 0.625rem 0.75rem;
border: 1px solid #d1d5db;
border-radius: 0.5rem;
font-size: 0.875rem;
}
.form-textarea {
min-height: 80px;
resize: vertical;
}
.modal-footer {
display: flex;
justify-content: flex-end;
gap: 0.75rem;
margin-top: 1.5rem;
}
@media (max-width: 768px) {
.department-grid {
grid-template-columns: 1fr;
}
}
</style>
</head>
<body>
<div id="navbar-container"></div>
<div class="page-container">
<main class="main-content">
<div class="dashboard-main">
<div class="page-header">
<div class="page-title-section">
<h1 class="page-title">부서 관리</h1>
<p class="page-description">부서를 등록하고 작업자를 부서별로 관리합니다</p>
</div>
<div class="page-actions">
<button class="btn btn-primary" onclick="openDepartmentModal()">새 부서 등록</button>
</div>
</div>
<div class="department-grid">
<!-- 부서 목록 패널 -->
<div class="department-list-panel">
<h3 style="margin-bottom: 1rem; font-size: 1rem; color: #374151;">부서 목록</h3>
<div id="departmentList">
<!-- 부서 목록이 여기에 동적으로 생성됩니다 -->
</div>
</div>
<!-- 작업자 목록 패널 -->
<div class="worker-list-panel">
<div class="worker-list-header">
<span class="worker-list-title" id="workerListTitle">부서를 선택하세요</span>
<button class="btn btn-secondary btn-sm" id="addWorkerBtn" style="display: none;" onclick="openAddWorkerModal()">
작업자 추가
</button>
</div>
<!-- 일괄 작업 영역 -->
<div class="bulk-actions" id="bulkActions">
<span style="font-size: 0.875rem; color: #374151;"><strong id="selectedCount">0</strong>명 선택됨</span>
<select class="form-select" id="moveToDepartment" style="width: 150px; margin-left: auto;">
<option value="">부서 이동...</option>
</select>
<button class="btn btn-primary btn-sm" onclick="moveSelectedWorkers()">이동</button>
</div>
<div id="workerList">
<div style="text-align: center; padding: 2rem; color: #9ca3af;">
왼쪽에서 부서를 선택하면 해당 부서의 작업자가 표시됩니다.
</div>
</div>
</div>
</div>
</div>
</main>
</div>
<!-- 부서 등록/수정 모달 -->
<div class="modal-backdrop" id="departmentModal">
<div class="modal-content">
<div class="modal-header">
<h2 class="modal-title" id="departmentModalTitle">새 부서 등록</h2>
<button class="btn-icon" onclick="closeDepartmentModal()">&times;</button>
</div>
<form id="departmentForm" onsubmit="saveDepartment(event)">
<input type="hidden" id="departmentId">
<div class="form-group">
<label class="form-label">부서명 *</label>
<input type="text" class="form-input" id="departmentName" required placeholder="예: 생산팀, 품질관리팀">
</div>
<div class="form-group">
<label class="form-label">상위 부서</label>
<select class="form-select" id="parentDepartment">
<option value="">없음 (최상위 부서)</option>
</select>
</div>
<div class="form-group">
<label class="form-label">설명</label>
<textarea class="form-textarea" id="departmentDescription" placeholder="부서 설명을 입력하세요"></textarea>
</div>
<div class="form-group">
<label class="form-label">표시 순서</label>
<input type="number" class="form-input" id="displayOrder" value="0" min="0">
</div>
<div class="form-group">
<label style="display: flex; align-items: center; gap: 0.5rem;">
<input type="checkbox" id="isActive" checked>
<span>활성화</span>
</label>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" onclick="closeDepartmentModal()">취소</button>
<button type="submit" class="btn btn-primary">저장</button>
</div>
</form>
</div>
</div>
<script src="/js/department-management.js"></script>
</body>
</html>