feat: 목록 관리 및 보고서 페이지 개선
- 목록 관리 페이지에 고급 필터링 시스템 추가 - 프로젝트별, 검토상태별, 날짜별 필터링 - 검토 완료/필요 항목 시각적 구분 및 정렬 - 해결 시간 입력 + 확인 버튼으로 검토 완료 처리 - 부적합 조회 페이지에 동일한 필터링 기능 적용 - 검토 상태에 따른 카드 스타일링 (음영 처리) - JavaScript 템플릿 리터럴 오류 수정 - 보고서 페이지 프로젝트별 분석 기능 추가 - 프로젝트 선택 드롭다운 추가 - 총 작업 공수를 프로젝트별 일일공수 데이터로 계산 - 부적합 처리 시간, 카테고리 분석, 상세 목록 모두 프로젝트별 필터링 - localStorage 키 이름 통일 (daily-work-data)
This commit is contained in:
134
frontend/fix-project-id.html
Normal file
134
frontend/fix-project-id.html
Normal file
@@ -0,0 +1,134 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>프로젝트 ID 수정 - M Project</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">
|
||||
</head>
|
||||
<body class="bg-gray-50">
|
||||
<div class="container mx-auto px-4 py-8 max-w-2xl">
|
||||
<div class="bg-white rounded-xl shadow-sm p-6">
|
||||
<h1 class="text-2xl font-bold text-gray-800 mb-6">
|
||||
<i class="fas fa-edit text-blue-500 mr-2"></i>프로젝트 ID 수정
|
||||
</h1>
|
||||
|
||||
<div class="space-y-4">
|
||||
<div class="p-4 bg-blue-50 border border-blue-200 rounded-lg">
|
||||
<h3 class="font-semibold text-blue-800 mb-2">📋 작업 내용</h3>
|
||||
<p class="text-blue-700 text-sm">
|
||||
큰 타임스탬프 ID를 작은 정수 ID로 변경합니다.<br>
|
||||
TKR-25009R 프로젝트 ID: <code>1761264279704</code> → <code>1</code>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="status" class="space-y-2">
|
||||
<!-- 상태 메시지가 여기에 표시됩니다 -->
|
||||
</div>
|
||||
|
||||
<button
|
||||
id="fixBtn"
|
||||
onclick="fixProjectId()"
|
||||
class="w-full bg-blue-500 text-white py-3 px-4 rounded-lg hover:bg-blue-600 transition-colors font-medium"
|
||||
>
|
||||
<i class="fas fa-tools mr-2"></i>프로젝트 ID 수정 시작
|
||||
</button>
|
||||
|
||||
<a href="fix-api-data.html" class="block text-center text-orange-600 hover:text-orange-800 mt-4">
|
||||
<i class="fas fa-wrench mr-1"></i>API 데이터 수정 도구로 이동
|
||||
</a>
|
||||
|
||||
<a href="debug-data.html" class="block text-center text-blue-600 hover:text-blue-800 mt-2">
|
||||
<i class="fas fa-bug mr-1"></i>디버그 도구로 이동
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function addStatus(message, className = 'text-gray-600') {
|
||||
const statusDiv = document.getElementById('status');
|
||||
const p = document.createElement('p');
|
||||
p.className = `text-sm ${className}`;
|
||||
p.innerHTML = `<i class="fas fa-info-circle mr-2"></i>${message}`;
|
||||
statusDiv.appendChild(p);
|
||||
}
|
||||
|
||||
function fixProjectId() {
|
||||
const btn = document.getElementById('fixBtn');
|
||||
btn.disabled = true;
|
||||
btn.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i>수정 중...';
|
||||
|
||||
try {
|
||||
// 1. 프로젝트 데이터 수정
|
||||
const projects = JSON.parse(localStorage.getItem('work-report-projects') || '[]');
|
||||
const mProject = projects.find(p => p.jobNo === 'TKR-25009R');
|
||||
|
||||
if (!mProject) {
|
||||
throw new Error('TKR-25009R 프로젝트를 찾을 수 없습니다.');
|
||||
}
|
||||
|
||||
const oldId = mProject.id;
|
||||
const newId = 1;
|
||||
|
||||
addStatus(`기존 프로젝트 ID: ${oldId}`, 'text-blue-600');
|
||||
addStatus(`새로운 프로젝트 ID: ${newId}`, 'text-blue-600');
|
||||
|
||||
// 프로젝트 ID 변경
|
||||
mProject.id = newId;
|
||||
localStorage.setItem('work-report-projects', JSON.stringify(projects));
|
||||
addStatus('✅ 프로젝트 ID 변경 완료', 'text-green-600');
|
||||
|
||||
// 2. 일일 공수 데이터 수정
|
||||
const dailyWorkData = JSON.parse(localStorage.getItem('daily-work-data') || '[]');
|
||||
let updatedWorkDays = 0;
|
||||
|
||||
dailyWorkData.forEach(dayData => {
|
||||
if (dayData.projects) {
|
||||
dayData.projects.forEach(project => {
|
||||
if (project.projectId == oldId) {
|
||||
project.projectId = newId;
|
||||
project.projectName = 'TKR-25009R - M Project';
|
||||
updatedWorkDays++;
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
localStorage.setItem('daily-work-data', JSON.stringify(dailyWorkData));
|
||||
addStatus(`✅ ${updatedWorkDays}개 일일 공수 데이터 업데이트 완료`, 'text-green-600');
|
||||
|
||||
// 3. localStorage 부적합 사항 수정
|
||||
const localIssues = JSON.parse(localStorage.getItem('work-report-issues') || '[]');
|
||||
let updatedIssues = 0;
|
||||
|
||||
localIssues.forEach(issue => {
|
||||
if (issue.projectId == oldId || issue.project_id == oldId) {
|
||||
issue.projectId = newId;
|
||||
issue.project_id = newId;
|
||||
issue.projectName = 'TKR-25009R - M Project';
|
||||
issue.project_name = 'TKR-25009R - M Project';
|
||||
updatedIssues++;
|
||||
}
|
||||
});
|
||||
|
||||
localStorage.setItem('work-report-issues', JSON.stringify(localIssues));
|
||||
addStatus(`✅ ${updatedIssues}개 localStorage 부적합 사항 업데이트 완료`, 'text-green-600');
|
||||
|
||||
// 완료
|
||||
addStatus('🎉 모든 데이터 ID 수정 완료!', 'text-green-600 font-bold');
|
||||
addStatus('이제 API 데이터 수정 도구를 실행하세요.', 'text-blue-600');
|
||||
|
||||
btn.innerHTML = '<i class="fas fa-check mr-2"></i>완료';
|
||||
btn.className = 'w-full bg-green-500 text-white py-3 px-4 rounded-lg font-medium';
|
||||
|
||||
} catch (error) {
|
||||
addStatus(`❌ 오류 발생: ${error.message}`, 'text-red-600');
|
||||
btn.disabled = false;
|
||||
btn.innerHTML = '<i class="fas fa-redo mr-2"></i>다시 시도';
|
||||
}
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user