feat: 다수 기능 개선 - 순찰, 출근, 작업분석, 모바일 UI 등
- 순찰/점검 기능 개선 (zone-detail 페이지 추가) - 출근/근태 시스템 개선 (연차 조회, 근무현황) - 작업분석 대분류 그룹화 및 마이그레이션 스크립트 - 모바일 네비게이션 UI 추가 - NAS 배포 도구 및 문서 추가 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,84 @@
|
||||
/**
|
||||
* Migration: Register attendance management pages
|
||||
* Purpose: Add 4 new pages to pages table for attendance management system
|
||||
* Date: 2026-01-29
|
||||
*/
|
||||
|
||||
exports.up = async function(knex) {
|
||||
// 페이지 등록 (실제 pages 테이블 컬럼에 맞춤)
|
||||
await knex('pages').insert([
|
||||
{
|
||||
page_key: 'daily-attendance',
|
||||
page_name: '일일 출퇴근 입력',
|
||||
page_path: '/pages/common/daily-attendance.html',
|
||||
description: '일일 출퇴근 기록 입력 페이지 (관리자/조장)',
|
||||
category: 'common',
|
||||
is_admin_only: false,
|
||||
display_order: 50
|
||||
},
|
||||
{
|
||||
page_key: 'monthly-attendance',
|
||||
page_name: '월별 출퇴근 현황',
|
||||
page_path: '/pages/common/monthly-attendance.html',
|
||||
description: '월별 출퇴근 현황 조회 페이지',
|
||||
category: 'common',
|
||||
is_admin_only: false,
|
||||
display_order: 51
|
||||
},
|
||||
{
|
||||
page_key: 'vacation-management',
|
||||
page_name: '휴가 관리',
|
||||
page_path: '/pages/common/vacation-management.html',
|
||||
description: '휴가 신청 및 승인 관리 페이지',
|
||||
category: 'common',
|
||||
is_admin_only: false,
|
||||
display_order: 52
|
||||
},
|
||||
{
|
||||
page_key: 'attendance-report-comparison',
|
||||
page_name: '출퇴근-작업보고서 대조',
|
||||
page_path: '/pages/admin/attendance-report-comparison.html',
|
||||
description: '출퇴근 기록과 작업보고서 대조 페이지 (관리자)',
|
||||
category: 'admin',
|
||||
is_admin_only: true,
|
||||
display_order: 120
|
||||
}
|
||||
]);
|
||||
|
||||
console.log('✅ 출퇴근 관리 페이지 4개 등록 완료');
|
||||
|
||||
// Admin 사용자(user_id=1)에게 페이지 접근 권한 부여
|
||||
const adminUserId = 1;
|
||||
const pages = await knex('pages')
|
||||
.whereIn('page_key', [
|
||||
'daily-attendance',
|
||||
'monthly-attendance',
|
||||
'vacation-management',
|
||||
'attendance-report-comparison'
|
||||
])
|
||||
.select('id');
|
||||
|
||||
const accessRecords = pages.map(page => ({
|
||||
user_id: adminUserId,
|
||||
page_id: page.id,
|
||||
can_access: true,
|
||||
granted_by: adminUserId
|
||||
}));
|
||||
|
||||
await knex('user_page_access').insert(accessRecords);
|
||||
console.log('✅ Admin 사용자에게 출퇴근 관리 페이지 접근 권한 부여 완료');
|
||||
};
|
||||
|
||||
exports.down = async function(knex) {
|
||||
// 페이지 삭제 (user_page_access는 FK CASCADE로 자동 삭제됨)
|
||||
await knex('pages')
|
||||
.whereIn('page_key', [
|
||||
'daily-attendance',
|
||||
'monthly-attendance',
|
||||
'vacation-management',
|
||||
'attendance-report-comparison'
|
||||
])
|
||||
.delete();
|
||||
|
||||
console.log('✅ 출퇴근 관리 페이지 삭제 완료');
|
||||
};
|
||||
Reference in New Issue
Block a user