모든 작업자가 개인 계정으로 로그인하여 본인의 연차와 출근 기록을 확인할 수 있는 시스템을 구축했습니다. 주요 기능: - 작업자-계정 1:1 통합 (기존 작업자 자동 계정 생성) - 연차 관리 시스템 (연도별 잔액 관리) - 출근 기록 시스템 (일일 근태 기록) - 나의 대시보드 페이지 (개인 정보 조회) 데이터베이스: - workers 테이블에 salary, base_annual_leave 컬럼 추가 - work_attendance_types, vacation_types 테이블 생성 - daily_attendance_records 테이블 생성 - worker_vacation_balance 테이블 생성 - 기존 작업자 자동 계정 생성 (username: 이름 기반) - Guest 역할 추가 백엔드 API: - 한글→영문 변환 유틸리티 (hangulToRoman.js) - UserRoutes에 개인 정보 조회 API 추가 - GET /api/users/me (내 정보) - GET /api/users/me/attendance-records (출근 기록) - GET /api/users/me/vacation-balance (연차 잔액) - GET /api/users/me/work-reports (작업 보고서) - GET /api/users/me/monthly-stats (월별 통계) 프론트엔드: - 나의 대시보드 페이지 (my-dashboard.html) - 연차 정보 위젯 (총/사용/잔여) - 월별 출근 캘린더 - 근무 시간 통계 - 최근 작업 보고서 목록 - 네비게이션 바에 "나의 대시보드" 메뉴 추가 배포 시 주의사항: - 마이그레이션 실행 필요 - 자동 생성된 계정 초기 비밀번호: 1234 - 작업자들에게 첫 로그인 후 비밀번호 변경 안내 필요 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
287 lines
8.0 KiB
HTML
287 lines
8.0 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/main-layout.css">
|
|
<link rel="stylesheet" href="/css/admin.css">
|
|
<script src="/js/auth-check.js" defer></script>
|
|
</head>
|
|
<body>
|
|
<div class="main-layout">
|
|
<div id="navbar-container"></div>
|
|
|
|
<div class="content-wrapper">
|
|
<div id="sidebar-container"></div>
|
|
|
|
<div id="content-container">
|
|
<div class="page-header">
|
|
<h1>👤 사용자 관리</h1>
|
|
<p class="subtitle">시스템 사용자를 등록하고 관리합니다.</p>
|
|
</div>
|
|
|
|
<!-- 내 비밀번호 변경 -->
|
|
<div class="card">
|
|
<h3>🔐 내 비밀번호 변경</h3>
|
|
<form id="myPasswordForm" class="form-horizontal">
|
|
<div class="form-row">
|
|
<input type="password" id="currentPassword" placeholder="현재 비밀번호" required />
|
|
<input type="password" id="newPassword" placeholder="새 비밀번호" required />
|
|
<input type="password" id="confirmPassword" placeholder="새 비밀번호 확인" required />
|
|
<button type="submit" class="btn btn-warning">내 비밀번호 변경</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- 등록 폼 -->
|
|
<div class="card">
|
|
<h3>새 사용자 등록</h3>
|
|
<form id="userForm" class="form-horizontal">
|
|
<div class="form-row">
|
|
<input type="text" id="username" placeholder="아이디" required />
|
|
<input type="password" id="password" placeholder="비밀번호" required />
|
|
<input type="text" id="name" placeholder="이름" required />
|
|
</div>
|
|
<div class="form-row">
|
|
<select id="access_level" required>
|
|
<option value="">권한 선택</option>
|
|
<option value="worker">작업자</option>
|
|
<option value="group_leader">그룹장</option>
|
|
<option value="support_team">지원팀</option>
|
|
<option value="admin">관리자</option>
|
|
<option value="system">시스템</option>
|
|
</select>
|
|
<select id="worker_id">
|
|
<option value="">작업자 연결 (선택)</option>
|
|
</select>
|
|
<button type="submit" class="btn btn-primary">등록</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- 사용자 비밀번호 변경 (시스템 권한자만) -->
|
|
<div class="card" id="systemPasswordChangeCard" style="display: none;">
|
|
<h3>🔑 사용자 비밀번호 변경 (시스템 권한자 전용)</h3>
|
|
<form id="userPasswordForm" class="form-horizontal">
|
|
<div class="form-row">
|
|
<select id="targetUserId" required>
|
|
<option value="">사용자 선택</option>
|
|
</select>
|
|
<input type="password" id="targetNewPassword" placeholder="새 비밀번호" required />
|
|
<button type="submit" class="btn btn-danger">비밀번호 변경</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<!-- 사용자 목록 -->
|
|
<div class="card">
|
|
<h3>등록된 사용자</h3>
|
|
<div class="table-responsive">
|
|
<table class="data-table">
|
|
<thead>
|
|
<tr>
|
|
<th>ID</th>
|
|
<th>아이디</th>
|
|
<th>이름</th>
|
|
<th>권한</th>
|
|
<th>연결 작업자</th>
|
|
<th>작업</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="userTableBody">
|
|
<tr><td colspan="6" class="text-center">불러오는 중...</td></tr>
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- 페이지 권한 관리 모달 -->
|
|
<div id="pageAccessModal" class="modal" style="display: none;">
|
|
<div class="modal-content large">
|
|
<div class="modal-header">
|
|
<h2>🔐 페이지 접근 권한 관리</h2>
|
|
<span class="close">×</span>
|
|
</div>
|
|
<div class="modal-body">
|
|
<div class="user-info-section">
|
|
<h3 id="modalUserInfo">사용자 정보</h3>
|
|
<p id="modalUserRole" class="text-muted"></p>
|
|
</div>
|
|
|
|
<div class="page-access-grid">
|
|
<div class="category-section" id="dashboardPages">
|
|
<h4>📊 대시보드</h4>
|
|
<div class="page-list" id="dashboardPageList"></div>
|
|
</div>
|
|
|
|
<div class="category-section" id="managementPages">
|
|
<h4>⚙️ 관리</h4>
|
|
<div class="page-list" id="managementPageList"></div>
|
|
</div>
|
|
|
|
<div class="category-section" id="commonPages">
|
|
<h4>📝 공통</h4>
|
|
<div class="page-list" id="commonPageList"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" onclick="closePageAccessModal()">취소</button>
|
|
<button type="button" class="btn btn-primary" onclick="savePageAccessChanges()">저장</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
/* 모달 스타일 */
|
|
.modal {
|
|
display: none;
|
|
position: fixed;
|
|
z-index: 1000;
|
|
left: 0;
|
|
top: 0;
|
|
width: 100%;
|
|
height: 100%;
|
|
overflow: auto;
|
|
background-color: rgba(0,0,0,0.5);
|
|
}
|
|
|
|
.modal-content {
|
|
background-color: #fefefe;
|
|
margin: 5% auto;
|
|
padding: 0;
|
|
border: 1px solid #888;
|
|
width: 90%;
|
|
max-width: 800px;
|
|
border-radius: 8px;
|
|
box-shadow: 0 4px 20px rgba(0,0,0,0.2);
|
|
}
|
|
|
|
.modal-content.large {
|
|
max-width: 1000px;
|
|
}
|
|
|
|
.modal-header {
|
|
padding: 20px;
|
|
background-color: #4CAF50;
|
|
color: white;
|
|
border-radius: 8px 8px 0 0;
|
|
display: flex;
|
|
justify-content: space-between;
|
|
align-items: center;
|
|
}
|
|
|
|
.modal-header h2 {
|
|
margin: 0;
|
|
font-size: 1.5rem;
|
|
}
|
|
|
|
.modal-body {
|
|
padding: 30px;
|
|
max-height: 600px;
|
|
overflow-y: auto;
|
|
}
|
|
|
|
.modal-footer {
|
|
padding: 15px 20px;
|
|
background-color: #f1f1f1;
|
|
border-radius: 0 0 8px 8px;
|
|
display: flex;
|
|
justify-content: flex-end;
|
|
gap: 10px;
|
|
}
|
|
|
|
.close {
|
|
color: white;
|
|
font-size: 28px;
|
|
font-weight: bold;
|
|
cursor: pointer;
|
|
transition: color 0.3s;
|
|
}
|
|
|
|
.close:hover,
|
|
.close:focus {
|
|
color: #ddd;
|
|
}
|
|
|
|
.user-info-section {
|
|
margin-bottom: 30px;
|
|
padding: 15px;
|
|
background-color: #f8f9fa;
|
|
border-radius: 5px;
|
|
}
|
|
|
|
.user-info-section h3 {
|
|
margin: 0 0 5px 0;
|
|
color: #333;
|
|
}
|
|
|
|
.page-access-grid {
|
|
display: grid;
|
|
gap: 20px;
|
|
}
|
|
|
|
.category-section h4 {
|
|
margin: 0 0 15px 0;
|
|
color: #4CAF50;
|
|
font-size: 1.1rem;
|
|
padding-bottom: 10px;
|
|
border-bottom: 2px solid #4CAF50;
|
|
}
|
|
|
|
.page-list {
|
|
display: flex;
|
|
flex-direction: column;
|
|
gap: 10px;
|
|
}
|
|
|
|
.page-item {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 12px;
|
|
background-color: #fff;
|
|
border: 1px solid #ddd;
|
|
border-radius: 5px;
|
|
transition: all 0.3s;
|
|
}
|
|
|
|
.page-item:hover {
|
|
background-color: #f8f9fa;
|
|
box-shadow: 0 2px 8px rgba(0,0,0,0.1);
|
|
}
|
|
|
|
.page-item input[type="checkbox"] {
|
|
margin-right: 15px;
|
|
width: 20px;
|
|
height: 20px;
|
|
cursor: pointer;
|
|
}
|
|
|
|
.page-item label {
|
|
flex: 1;
|
|
cursor: pointer;
|
|
font-size: 1rem;
|
|
margin: 0;
|
|
}
|
|
|
|
.page-item .page-path {
|
|
font-size: 0.85rem;
|
|
color: #666;
|
|
margin-left: 10px;
|
|
}
|
|
|
|
.text-muted {
|
|
color: #6c757d;
|
|
font-size: 0.9rem;
|
|
}
|
|
</style>
|
|
|
|
<script type="module" src="/js/load-navbar.js"></script>
|
|
<script type="module" src="/js/load-sidebar.js"></script>
|
|
<script type="module" src="/js/manage-user.js"></script>
|
|
</body>
|
|
</html> |