Files
TK-FB-Project/web-ui/css/my-dashboard.css
Hyungi Ahn 70630b380a feat: 작업자-계정 통합 및 연차/출근 관리 시스템 구축
모든 작업자가 개인 계정으로 로그인하여 본인의 연차와 출근 기록을 확인할 수 있는 시스템을 구축했습니다.

주요 기능:
- 작업자-계정 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>
2026-01-19 09:49:48 +09:00

351 lines
5.4 KiB
CSS

/* My Dashboard CSS */
.dashboard-container {
max-width: 1200px;
margin: 0 auto;
padding: 2rem 1.5rem;
background: #f8f9fa;
min-height: 100vh;
}
.back-button {
display: inline-flex;
align-items: center;
gap: 0.5rem;
padding: 0.75rem 1.5rem;
background: rgba(255, 255, 255, 0.9);
color: #495057;
text-decoration: none;
border-radius: 0.5rem;
font-weight: 500;
margin-bottom: 1.5rem;
transition: all 0.3s ease;
box-shadow: 0 0.125rem 0.25rem rgba(0,0,0,0.1);
}
.back-button:hover {
background: white;
color: #007bff;
transform: translateY(-0.0625rem);
}
.page-header {
text-align: center;
margin-bottom: 2rem;
}
.page-header h1 {
font-size: 2rem;
color: #333;
margin-bottom: 0.5rem;
}
.page-header p {
color: #666;
font-size: 1.1rem;
}
/* 사용자 정보 카드 */
.user-info-card {
background: white;
border-radius: 0.75rem;
padding: 1.5rem;
margin-bottom: 2rem;
box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
}
.info-row {
display: flex;
gap: 2rem;
flex-wrap: wrap;
}
.info-item {
display: flex;
gap: 0.5rem;
}
.info-item .label {
font-weight: 600;
color: #555;
}
/* 연차 정보 위젯 */
.vacation-widget {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border-radius: 0.75rem;
padding: 2rem;
margin-bottom: 2rem;
box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.15);
}
.vacation-widget h2 {
margin-bottom: 1.5rem;
}
.vacation-summary {
display: flex;
justify-content: space-around;
margin-bottom: 1.5rem;
}
.vacation-summary .stat {
text-align: center;
}
.vacation-summary .label {
display: block;
font-size: 0.9rem;
opacity: 0.9;
margin-bottom: 0.5rem;
}
.vacation-summary .value {
display: block;
font-size: 2rem;
font-weight: 700;
}
.progress-bar {
height: 1.5rem;
background: rgba(255,255,255,0.2);
border-radius: 0.75rem;
overflow: hidden;
}
.progress {
height: 100%;
background: rgba(255,255,255,0.8);
transition: width 0.5s ease;
}
/* 캘린더 섹션 */
.calendar-section {
background: white;
border-radius: 0.75rem;
padding: 2rem;
margin-bottom: 2rem;
box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
}
.calendar-section h2 {
margin-bottom: 1rem;
}
.calendar-controls {
display: flex;
justify-content: center;
align-items: center;
gap: 2rem;
margin-bottom: 1.5rem;
}
.calendar-controls button {
background: #667eea;
color: white;
border: none;
border-radius: 0.5rem;
padding: 0.5rem 1rem;
cursor: pointer;
font-size: 1rem;
}
.calendar-controls button:hover {
background: #764ba2;
}
.calendar-grid {
display: grid;
grid-template-columns: repeat(7, 1fr);
gap: 0.5rem;
}
.calendar-header {
text-align: center;
font-weight: 600;
padding: 0.5rem;
background: #f8f9fa;
border-radius: 0.25rem;
}
.calendar-day {
aspect-ratio: 1;
display: flex;
align-items: center;
justify-content: center;
border-radius: 0.25rem;
background: #f8f9fa;
cursor: pointer;
transition: all 0.2s ease;
}
.calendar-day:hover:not(.empty) {
transform: scale(1.05);
}
.calendar-day.empty {
background: transparent;
}
.calendar-day.normal {
background: #d4edda;
color: #155724;
}
.calendar-day.late {
background: #fff3cd;
color: #856404;
}
.calendar-day.vacation {
background: #d1ecf1;
color: #0c5460;
}
.calendar-day.absent {
background: #f8d7da;
color: #721c24;
}
.calendar-legend {
display: flex;
justify-content: center;
gap: 1.5rem;
margin-top: 1.5rem;
flex-wrap: wrap;
}
.calendar-legend span {
display: flex;
align-items: center;
gap: 0.5rem;
font-size: 0.9rem;
}
.dot {
width: 1rem;
height: 1rem;
border-radius: 50%;
}
.dot.normal {
background: #d4edda;
}
.dot.late {
background: #fff3cd;
}
.dot.vacation {
background: #d1ecf1;
}
.dot.absent {
background: #f8d7da;
}
/* 근무 시간 통계 */
.work-hours-stats {
background: white;
border-radius: 0.75rem;
padding: 2rem;
margin-bottom: 2rem;
box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
}
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
gap: 1.5rem;
margin-top: 1.5rem;
}
.stat-card {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
padding: 1.5rem;
border-radius: 0.75rem;
text-align: center;
}
.stat-card .label {
display: block;
font-size: 0.9rem;
opacity: 0.9;
margin-bottom: 0.5rem;
}
.stat-card .value {
display: block;
font-size: 2rem;
font-weight: 700;
}
/* 최근 작업 보고서 */
.recent-reports {
background: white;
border-radius: 0.75rem;
padding: 2rem;
margin-bottom: 2rem;
box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.1);
}
.recent-reports h2 {
margin-bottom: 1.5rem;
}
.report-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 1rem;
border-bottom: 1px solid #e9ecef;
}
.report-item:last-child {
border-bottom: none;
}
.report-item .date {
color: #666;
font-size: 0.9rem;
}
.report-item .project {
flex: 1;
margin: 0 1rem;
font-weight: 500;
}
.report-item .hours {
color: #667eea;
font-weight: 600;
}
.empty-message {
text-align: center;
color: #999;
padding: 2rem;
}
/* 반응형 */
@media (max-width: 768px) {
.dashboard-container {
padding: 1rem;
}
.vacation-summary {
flex-direction: column;
gap: 1rem;
}
.calendar-grid {
gap: 0.25rem;
}
.calendar-legend {
gap: 0.75rem;
}
}