feat(dashboard): 연차/연장근로 통합 + 연차 상세 모달
- 백엔드: type_code ANNUAL 매칭 실패 → 전체 합산으로 수정 details에 balance_type, expires_at 포함 - 프론트: 2열 카드 → 통합 리스트 (연차 탭 + 연장근로 행) - 연차 행 클릭 → 상세 모달 (이월/정기/장기/경조사 breakdown) 이월 소진/만료 isExpired() 적용 - 내 메뉴에서 "내 연차 정보" 자동 제거 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -37,15 +37,17 @@ const DashboardController = {
|
||||
const details = vacationRows.map(v => ({
|
||||
type_name: v.type_name,
|
||||
type_code: v.type_code,
|
||||
balance_type: v.balance_type || 'AUTO',
|
||||
expires_at: v.expires_at || null,
|
||||
total: parseFloat(v.total_days) || 0,
|
||||
used: parseFloat(v.used_days) || 0,
|
||||
remaining: parseFloat(v.remaining_days) || 0
|
||||
}));
|
||||
|
||||
const annualRow = vacationRows.find(v => v.type_code === 'ANNUAL');
|
||||
const totalDays = annualRow ? parseFloat(annualRow.total_days) || 0 : 0;
|
||||
const usedDays = annualRow ? parseFloat(annualRow.used_days) || 0 : 0;
|
||||
const remainingDays = annualRow ? parseFloat(annualRow.remaining_days) || 0 : 0;
|
||||
// 모든 balance_type 합산
|
||||
const totalDays = vacationRows.reduce((s, v) => s + (parseFloat(v.total_days) || 0), 0);
|
||||
const usedDays = vacationRows.reduce((s, v) => s + (parseFloat(v.used_days) || 0), 0);
|
||||
const remainingDays = totalDays - usedDays;
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
|
||||
Reference in New Issue
Block a user