Files
tk-factory-services/system1-factory/web/pages/admin/departments.html
Hyungi Ahn 9fda89a374 feat: 안전 코드 tksafety 이관 + 사용자 관리 정리 + UI Tailwind 전환
Phase 1: tksafety에 출입신청/체크리스트 API·웹 추가, tkfb 안전 코드 삭제
Phase 2: 사용자 관리 페이지 삭제, API 축소, 알림 수신자 tkuser 이관
Phase 3: tkuser 권한 페이지 정의 업데이트
Phase 4: 전체 34개 페이지 Tailwind CSS + tkfb-core.js 전환,
         미사용 CSS 20개·인프라 JS 10개·템플릿·컴포넌트 삭제

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-13 10:46:22 +09:00

333 lines
12 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/tkfb.css">
<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 class="bg-gray-50">
<header class="bg-orange-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" class="lg:hidden text-orange-200 hover:text-white"><i class="fas fa-bars text-xl"></i></button>
<i class="fas fa-industry text-xl text-orange-200"></i>
<h1 class="text-lg font-semibold">TK 공장관리</h1>
</div>
<div class="flex items-center gap-4">
<span id="headerUserName" class="text-sm hidden sm:block">-</span>
<div id="headerUserAvatar" class="w-8 h-8 bg-orange-600 rounded-full flex items-center justify-center text-sm font-bold">-</div>
<button onclick="doLogout()" class="text-orange-200 hover:text-white" title="로그아웃"><i class="fas fa-sign-out-alt"></i></button>
</div>
</div>
</div>
</header>
<div id="mobileOverlay" class="hidden fixed inset-0 bg-black/50 z-30 lg:hidden"></div>
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4 fade-in">
<div class="flex gap-6">
<nav id="sideNav" class="hidden lg:flex flex-col gap-1 w-52 flex-shrink-0 pt-2 fixed lg:static z-40 bg-white lg:bg-transparent p-4 lg:p-0 rounded-lg lg:rounded-none shadow-lg lg:shadow-none top-14 left-0 bottom-0 overflow-y-auto"></nav>
<div class="flex-1 min-w-0">
<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>
</div>
</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="/static/js/tkfb-core.js"></script>
<script src="/js/api-base.js?v=3"></script>
<script src="/js/department-management.js"></script>
<script>initAuth();</script>
</body>
</html>