🐛 Fix: Project.name → project_name 속성명 수정 및 보고서 시스템 안정화
- backend/routers/reports.py: project.name을 project.project_name으로 수정 (3곳) - 일일보고서 엑셀 내보내기 오류 해결 - 배포 가이드 업데이트 (DEPLOYMENT_GUIDE_20251028.md) - 프로젝트 속성명 불일치로 인한 500 에러 해결 Fixes: 'Project' object has no attribute 'name' 오류
This commit is contained in:
@@ -339,7 +339,8 @@
|
||||
async function loadProjects() {
|
||||
try {
|
||||
// API에서 최신 프로젝트 데이터 가져오기
|
||||
const response = await fetch('/api/projects/', {
|
||||
const apiUrl = window.API_BASE_URL || 'http://localhost:16080/api';
|
||||
const response = await fetch(`${apiUrl}/projects/`, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${localStorage.getItem('access_token')}`,
|
||||
'Content-Type': 'application/json'
|
||||
|
||||
@@ -287,7 +287,8 @@
|
||||
// 프로젝트 로드
|
||||
async function loadProjects() {
|
||||
try {
|
||||
const response = await fetch('/api/projects/', {
|
||||
const apiUrl = window.API_BASE_URL || 'http://localhost:16080/api';
|
||||
const response = await fetch(`${apiUrl}/projects/`, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${localStorage.getItem('access_token')}`,
|
||||
'Content-Type': 'application/json'
|
||||
|
||||
@@ -323,7 +323,8 @@
|
||||
// 데이터 로드 함수들
|
||||
async function loadProjects() {
|
||||
try {
|
||||
const response = await fetch('/api/projects/', {
|
||||
const apiUrl = window.API_BASE_URL || 'http://localhost:16080/api';
|
||||
const response = await fetch(`${apiUrl}/projects/`, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${localStorage.getItem('access_token')}`,
|
||||
'Content-Type': 'application/json'
|
||||
|
||||
@@ -668,7 +668,8 @@
|
||||
async function loadProjects() {
|
||||
console.log('🔄 프로젝트 로드 시작');
|
||||
try {
|
||||
const response = await fetch('/api/projects/', {
|
||||
const apiUrl = window.API_BASE_URL || 'http://localhost:16080/api';
|
||||
const response = await fetch(`${apiUrl}/projects/`, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${localStorage.getItem('access_token')}`,
|
||||
'Content-Type': 'application/json'
|
||||
|
||||
@@ -465,7 +465,8 @@
|
||||
// 프로젝트 로드
|
||||
async function loadProjects() {
|
||||
try {
|
||||
const response = await fetch('/api/projects/', {
|
||||
const apiUrl = window.API_BASE_URL || 'http://localhost:16080/api';
|
||||
const response = await fetch(`${apiUrl}/projects/`, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${localStorage.getItem('access_token')}`,
|
||||
'Content-Type': 'application/json'
|
||||
@@ -2548,5 +2549,6 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
383
frontend/reports-daily.html
Normal file
383
frontend/reports-daily.html
Normal file
@@ -0,0 +1,383 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>일일보고서 - 작업보고서</title>
|
||||
|
||||
<!-- Tailwind CSS -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
|
||||
<!-- Custom Styles -->
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
}
|
||||
|
||||
.report-card {
|
||||
transition: all 0.2s ease;
|
||||
border-left: 4px solid transparent;
|
||||
}
|
||||
|
||||
.report-card:hover {
|
||||
transform: translateY(-2px);
|
||||
box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
|
||||
border-left-color: #10b981;
|
||||
}
|
||||
|
||||
.stats-card {
|
||||
transition: all 0.2s ease;
|
||||
}
|
||||
|
||||
.stats-card:hover {
|
||||
transform: translateY(-1px);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gray-50 min-h-screen">
|
||||
<!-- 공통 헤더가 여기에 자동으로 삽입됩니다 -->
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="container mx-auto px-4 py-8" style="padding-top: 80px;">
|
||||
<!-- 페이지 헤더 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-gray-900 flex items-center">
|
||||
<i class="fas fa-file-excel text-green-500 mr-3"></i>
|
||||
일일보고서
|
||||
</h1>
|
||||
<p class="text-gray-600 mt-1">품질팀용 관리함 데이터를 엑셀 형태로 내보내세요</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 프로젝트 선택 및 생성 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
|
||||
<div class="space-y-6">
|
||||
<!-- 프로젝트 선택 -->
|
||||
<div>
|
||||
<label class="block text-sm font-medium text-gray-700 mb-3">
|
||||
<i class="fas fa-folder text-blue-500 mr-2"></i>보고서 생성할 프로젝트 선택
|
||||
</label>
|
||||
<select id="reportProjectSelect" class="w-full max-w-md px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-green-500 focus:border-green-500 text-lg">
|
||||
<option value="">프로젝트를 선택하세요</option>
|
||||
</select>
|
||||
<p class="text-sm text-gray-500 mt-2">
|
||||
<i class="fas fa-info-circle mr-1"></i>
|
||||
선택한 프로젝트의 관리함 데이터만 포함됩니다.
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!-- 생성 버튼 -->
|
||||
<div class="flex items-center space-x-4">
|
||||
<button id="generateReportBtn"
|
||||
onclick="generateDailyReport()"
|
||||
class="px-6 py-3 bg-green-600 text-white font-medium rounded-lg hover:bg-green-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed"
|
||||
disabled>
|
||||
<i class="fas fa-download mr-2"></i>일일보고서 생성
|
||||
</button>
|
||||
<button id="previewStatsBtn"
|
||||
onclick="toggleStatsPreview()"
|
||||
class="px-6 py-3 bg-blue-600 text-white font-medium rounded-lg hover:bg-blue-700 transition-colors hidden">
|
||||
<i class="fas fa-chart-bar mr-2"></i>통계 미리보기
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 프로젝트 통계 미리보기 -->
|
||||
<div id="projectStatsCard" class="bg-white rounded-xl shadow-sm p-6 mb-6 hidden">
|
||||
<h2 class="text-xl font-semibold text-gray-900 mb-4">
|
||||
<i class="fas fa-chart-bar text-blue-500 mr-2"></i>프로젝트 현황 미리보기
|
||||
</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4">
|
||||
<div class="stats-card bg-blue-50 p-4 rounded-lg text-center">
|
||||
<div class="text-3xl font-bold text-blue-600 mb-1" id="reportTotalCount">0</div>
|
||||
<div class="text-sm text-blue-700 font-medium">총 신고 수량</div>
|
||||
</div>
|
||||
<div class="stats-card bg-orange-50 p-4 rounded-lg text-center">
|
||||
<div class="text-3xl font-bold text-orange-600 mb-1" id="reportManagementCount">0</div>
|
||||
<div class="text-sm text-orange-700 font-medium">관리처리 현황</div>
|
||||
</div>
|
||||
<div class="stats-card bg-green-50 p-4 rounded-lg text-center">
|
||||
<div class="text-3xl font-bold text-green-600 mb-1" id="reportCompletedCount">0</div>
|
||||
<div class="text-sm text-green-700 font-medium">완료 현황</div>
|
||||
</div>
|
||||
<div class="stats-card bg-red-50 p-4 rounded-lg text-center">
|
||||
<div class="text-3xl font-bold text-red-600 mb-1" id="reportDelayedCount">0</div>
|
||||
<div class="text-sm text-red-700 font-medium">지연 중</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 포함 항목 안내 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold text-gray-900 mb-4">
|
||||
<i class="fas fa-list-check text-gray-500 mr-2"></i>보고서 포함 항목
|
||||
</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<div class="report-card bg-blue-50 p-4 rounded-lg">
|
||||
<div class="flex items-center mb-2">
|
||||
<i class="fas fa-check-circle text-blue-500 mr-2"></i>
|
||||
<span class="font-medium text-blue-800">진행 중 항목</span>
|
||||
</div>
|
||||
<p class="text-sm text-blue-600">무조건 포함됩니다</p>
|
||||
</div>
|
||||
<div class="report-card bg-green-50 p-4 rounded-lg">
|
||||
<div class="flex items-center mb-2">
|
||||
<i class="fas fa-check-circle text-green-500 mr-2"></i>
|
||||
<span class="font-medium text-green-800">완료됨 항목</span>
|
||||
</div>
|
||||
<p class="text-sm text-green-600">첫 내보내기에만 포함, 이후 자동 제외</p>
|
||||
</div>
|
||||
<div class="report-card bg-yellow-50 p-4 rounded-lg">
|
||||
<div class="flex items-center mb-2">
|
||||
<i class="fas fa-info-circle text-yellow-500 mr-2"></i>
|
||||
<span class="font-medium text-yellow-800">프로젝트 통계</span>
|
||||
</div>
|
||||
<p class="text-sm text-yellow-600">상단에 요약 정보 포함</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 최근 생성된 보고서 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-6">
|
||||
<h2 class="text-xl font-semibold text-gray-900 mb-4">
|
||||
<i class="fas fa-history text-gray-500 mr-2"></i>최근 생성된 일일보고서
|
||||
</h2>
|
||||
<div id="recentReports" class="space-y-3">
|
||||
<div class="text-center py-8 text-gray-500">
|
||||
<i class="fas fa-file-excel text-4xl mb-3 opacity-50"></i>
|
||||
<p>아직 생성된 일일보고서가 없습니다.</p>
|
||||
<p class="text-sm">프로젝트를 선택하고 보고서를 생성해보세요!</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- JavaScript -->
|
||||
<script src="/static/js/core/auth-manager.js"></script>
|
||||
<script src="/static/js/core/permissions.js"></script>
|
||||
<script src="/static/js/components/common-header.js"></script>
|
||||
<script src="/static/js/api.js"></script>
|
||||
|
||||
<script>
|
||||
let projects = [];
|
||||
let selectedProjectId = null;
|
||||
|
||||
// 페이지 초기화
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('일일보고서 페이지 로드 시작');
|
||||
|
||||
// AuthManager 로드 대기
|
||||
const checkAuthManager = async () => {
|
||||
if (window.authManager) {
|
||||
try {
|
||||
// 인증 확인
|
||||
const isAuthenticated = await window.authManager.checkAuth();
|
||||
if (!isAuthenticated) {
|
||||
window.location.href = '/login.html';
|
||||
return;
|
||||
}
|
||||
|
||||
// 프로젝트 목록 로드
|
||||
await loadProjects();
|
||||
|
||||
// 공통 헤더 초기화
|
||||
try {
|
||||
const user = JSON.parse(localStorage.getItem('currentUser') || '{}');
|
||||
if (window.commonHeader && user.id) {
|
||||
await window.commonHeader.init(user, 'reports_daily');
|
||||
}
|
||||
} catch (headerError) {
|
||||
console.error('공통 헤더 초기화 오류:', headerError);
|
||||
}
|
||||
|
||||
console.log('일일보고서 페이지 로드 완료');
|
||||
} catch (error) {
|
||||
console.error('페이지 초기화 오류:', error);
|
||||
}
|
||||
} else {
|
||||
setTimeout(checkAuthManager, 100);
|
||||
}
|
||||
};
|
||||
checkAuthManager();
|
||||
});
|
||||
|
||||
// 프로젝트 목록 로드
|
||||
async function loadProjects() {
|
||||
try {
|
||||
const apiUrl = window.API_BASE_URL || 'http://localhost:16080/api';
|
||||
|
||||
const response = await fetch(`${apiUrl}/projects/`, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${localStorage.getItem('access_token')}`
|
||||
}
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
projects = await response.json();
|
||||
populateProjectSelect();
|
||||
} else {
|
||||
console.error('프로젝트 로드 실패:', response.status);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('프로젝트 로드 오류:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// 프로젝트 선택 옵션 채우기
|
||||
function populateProjectSelect() {
|
||||
const select = document.getElementById('reportProjectSelect');
|
||||
|
||||
if (!select) {
|
||||
console.error('reportProjectSelect 요소를 찾을 수 없습니다!');
|
||||
return;
|
||||
}
|
||||
|
||||
select.innerHTML = '<option value="">프로젝트를 선택하세요</option>';
|
||||
|
||||
projects.forEach(project => {
|
||||
const option = document.createElement('option');
|
||||
option.value = project.id;
|
||||
option.textContent = project.project_name || project.name;
|
||||
select.appendChild(option);
|
||||
});
|
||||
}
|
||||
|
||||
// 프로젝트 선택 시 이벤트
|
||||
document.addEventListener('change', async function(e) {
|
||||
if (e.target.id === 'reportProjectSelect') {
|
||||
selectedProjectId = e.target.value;
|
||||
const generateBtn = document.getElementById('generateReportBtn');
|
||||
const previewBtn = document.getElementById('previewStatsBtn');
|
||||
|
||||
if (selectedProjectId) {
|
||||
generateBtn.disabled = false;
|
||||
previewBtn.classList.remove('hidden');
|
||||
await loadProjectStats(selectedProjectId);
|
||||
} else {
|
||||
generateBtn.disabled = true;
|
||||
previewBtn.classList.add('hidden');
|
||||
document.getElementById('projectStatsCard').classList.add('hidden');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 프로젝트 통계 로드
|
||||
async function loadProjectStats(projectId) {
|
||||
try {
|
||||
const apiUrl = window.API_BASE_URL || 'http://localhost:16080/api';
|
||||
const response = await fetch(`${apiUrl}/management/stats?project_id=${projectId}`, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${localStorage.getItem('access_token')}`
|
||||
}
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
const stats = await response.json();
|
||||
|
||||
document.getElementById('reportTotalCount').textContent = stats.total_count || 0;
|
||||
document.getElementById('reportManagementCount').textContent = stats.management_count || 0;
|
||||
document.getElementById('reportCompletedCount').textContent = stats.completed_count || 0;
|
||||
document.getElementById('reportDelayedCount').textContent = stats.delayed_count || 0;
|
||||
} else {
|
||||
console.error('프로젝트 통계 로드 실패:', response.status);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('프로젝트 통계 로드 오류:', error);
|
||||
}
|
||||
}
|
||||
|
||||
// 통계 미리보기 토글
|
||||
function toggleStatsPreview() {
|
||||
const statsCard = document.getElementById('projectStatsCard');
|
||||
statsCard.classList.toggle('hidden');
|
||||
}
|
||||
|
||||
// 일일보고서 생성
|
||||
async function generateDailyReport() {
|
||||
if (!selectedProjectId) {
|
||||
alert('프로젝트를 선택해주세요.');
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
const button = document.getElementById('generateReportBtn');
|
||||
const originalText = button.innerHTML;
|
||||
button.innerHTML = '<i class="fas fa-spinner fa-spin mr-2"></i>생성 중...';
|
||||
button.disabled = true;
|
||||
|
||||
const apiUrl = window.API_BASE_URL || 'http://localhost:16080/api';
|
||||
const response = await fetch(`${apiUrl}/reports/daily-export`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': `Bearer ${localStorage.getItem('access_token')}`
|
||||
},
|
||||
body: JSON.stringify({
|
||||
project_id: parseInt(selectedProjectId)
|
||||
})
|
||||
});
|
||||
|
||||
if (response.ok) {
|
||||
const blob = await response.blob();
|
||||
const url = window.URL.createObjectURL(blob);
|
||||
const a = document.createElement('a');
|
||||
a.style.display = 'none';
|
||||
a.href = url;
|
||||
|
||||
// 파일명 생성 (프로젝트명_일일보고서_날짜.xlsx)
|
||||
const project = projects.find(p => p.id == selectedProjectId);
|
||||
const today = new Date().toISOString().split('T')[0];
|
||||
a.download = `${project.name}_일일보고서_${today}.xlsx`;
|
||||
|
||||
document.body.appendChild(a);
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
document.body.removeChild(a);
|
||||
|
||||
// 성공 메시지 표시
|
||||
showSuccessMessage('일일보고서가 성공적으로 생성되었습니다!');
|
||||
|
||||
} else {
|
||||
const error = await response.text();
|
||||
console.error('보고서 생성 실패:', error);
|
||||
alert('보고서 생성에 실패했습니다. 다시 시도해주세요.');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('보고서 생성 오류:', error);
|
||||
alert('보고서 생성 중 오류가 발생했습니다.');
|
||||
} finally {
|
||||
const button = document.getElementById('generateReportBtn');
|
||||
button.innerHTML = '<i class="fas fa-download mr-2"></i>일일보고서 생성';
|
||||
button.disabled = false;
|
||||
}
|
||||
}
|
||||
|
||||
// 성공 메시지 표시
|
||||
function showSuccessMessage(message) {
|
||||
const successDiv = document.createElement('div');
|
||||
successDiv.className = 'fixed top-4 right-4 bg-green-500 text-white px-6 py-3 rounded-lg shadow-lg z-50';
|
||||
successDiv.innerHTML = `
|
||||
<div class="flex items-center">
|
||||
<i class="fas fa-check-circle mr-2"></i>
|
||||
<span>${message}</span>
|
||||
</div>
|
||||
`;
|
||||
|
||||
document.body.appendChild(successDiv);
|
||||
|
||||
setTimeout(() => {
|
||||
successDiv.remove();
|
||||
}, 3000);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
111
frontend/reports-monthly.html
Normal file
111
frontend/reports-monthly.html
Normal file
@@ -0,0 +1,111 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>월간보고서 - 작업보고서</title>
|
||||
|
||||
<!-- Tailwind CSS -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
|
||||
<!-- Custom Styles -->
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gray-50 min-h-screen">
|
||||
<!-- 공통 헤더가 여기에 자동으로 삽입됩니다 -->
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="container mx-auto px-4 py-8" style="padding-top: 80px;">
|
||||
<!-- 페이지 헤더 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-gray-900 flex items-center">
|
||||
<i class="fas fa-calendar-alt text-purple-500 mr-3"></i>
|
||||
월간보고서
|
||||
</h1>
|
||||
<p class="text-gray-600 mt-1">월간 부적합 발생 현황, 처리 성과 및 개선사항을 종합적으로 분석하세요</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 준비중 안내 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-12 text-center">
|
||||
<div class="max-w-md mx-auto">
|
||||
<div class="w-24 h-24 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-6">
|
||||
<i class="fas fa-calendar-alt text-purple-500 text-3xl"></i>
|
||||
</div>
|
||||
<h2 class="text-2xl font-bold text-gray-900 mb-4">월간보고서 준비중</h2>
|
||||
<p class="text-gray-600 mb-6">
|
||||
월간 부적합 발생 현황, 처리 성과 및 개선사항을 종합한 보고서 기능을 준비하고 있습니다.
|
||||
</p>
|
||||
<div class="bg-purple-50 p-4 rounded-lg">
|
||||
<h3 class="font-semibold text-purple-800 mb-2">예정 기능</h3>
|
||||
<ul class="text-sm text-purple-700 space-y-1">
|
||||
<li>• 월간 부적합 발생 현황</li>
|
||||
<li>• 월간 처리 완료 현황</li>
|
||||
<li>• 부서별 성과 분석</li>
|
||||
<li>• 월간 트렌드 및 개선사항</li>
|
||||
<li>• 경영진 보고용 요약</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<button onclick="window.history.back()"
|
||||
class="px-6 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors">
|
||||
<i class="fas fa-arrow-left mr-2"></i>이전 페이지로
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- JavaScript -->
|
||||
<script src="/static/js/core/auth-manager.js"></script>
|
||||
<script src="/static/js/core/permissions.js"></script>
|
||||
<script src="/static/js/components/common-header.js"></script>
|
||||
<script src="/static/js/api.js"></script>
|
||||
|
||||
<script>
|
||||
// 페이지 초기화
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('월간보고서 페이지 로드 시작');
|
||||
|
||||
// AuthManager 로드 대기
|
||||
const checkAuthManager = async () => {
|
||||
if (window.authManager) {
|
||||
try {
|
||||
// 인증 확인
|
||||
const isAuthenticated = await window.authManager.checkAuth();
|
||||
if (!isAuthenticated) {
|
||||
window.location.href = '/login.html';
|
||||
return;
|
||||
}
|
||||
|
||||
// 공통 헤더 초기화
|
||||
const user = JSON.parse(localStorage.getItem('currentUser') || '{}');
|
||||
if (window.commonHeader && user.id) {
|
||||
await window.commonHeader.init(user, 'reports_monthly');
|
||||
}
|
||||
|
||||
console.log('월간보고서 페이지 로드 완료');
|
||||
} catch (error) {
|
||||
console.error('페이지 초기화 오류:', error);
|
||||
}
|
||||
} else {
|
||||
setTimeout(checkAuthManager, 100);
|
||||
}
|
||||
};
|
||||
checkAuthManager();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
110
frontend/reports-weekly.html
Normal file
110
frontend/reports-weekly.html
Normal file
@@ -0,0 +1,110 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>주간보고서 - 작업보고서</title>
|
||||
|
||||
<!-- Tailwind CSS -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
|
||||
<!-- Custom Styles -->
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gray-50 min-h-screen">
|
||||
<!-- 공통 헤더가 여기에 자동으로 삽입됩니다 -->
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="container mx-auto px-4 py-8" style="padding-top: 80px;">
|
||||
<!-- 페이지 헤더 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-gray-900 flex items-center">
|
||||
<i class="fas fa-calendar-week text-blue-500 mr-3"></i>
|
||||
주간보고서
|
||||
</h1>
|
||||
<p class="text-gray-600 mt-1">주간 단위로 집계된 부적합 현황 및 처리 결과를 확인하세요</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 준비중 안내 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-12 text-center">
|
||||
<div class="max-w-md mx-auto">
|
||||
<div class="w-24 h-24 bg-blue-100 rounded-full flex items-center justify-center mx-auto mb-6">
|
||||
<i class="fas fa-calendar-week text-blue-500 text-3xl"></i>
|
||||
</div>
|
||||
<h2 class="text-2xl font-bold text-gray-900 mb-4">주간보고서 준비중</h2>
|
||||
<p class="text-gray-600 mb-6">
|
||||
주간 단위로 집계된 부적합 현황 및 처리 결과를 정리한 보고서 기능을 준비하고 있습니다.
|
||||
</p>
|
||||
<div class="bg-blue-50 p-4 rounded-lg">
|
||||
<h3 class="font-semibold text-blue-800 mb-2">예정 기능</h3>
|
||||
<ul class="text-sm text-blue-700 space-y-1">
|
||||
<li>• 주간 부적합 발생 현황</li>
|
||||
<li>• 주간 처리 완료 현황</li>
|
||||
<li>• 부서별 처리 성과</li>
|
||||
<li>• 주간 트렌드 분석</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="mt-6">
|
||||
<button onclick="window.history.back()"
|
||||
class="px-6 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors">
|
||||
<i class="fas fa-arrow-left mr-2"></i>이전 페이지로
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
<!-- JavaScript -->
|
||||
<script src="/static/js/core/auth-manager.js"></script>
|
||||
<script src="/static/js/core/permissions.js"></script>
|
||||
<script src="/static/js/components/common-header.js"></script>
|
||||
<script src="/static/js/api.js"></script>
|
||||
|
||||
<script>
|
||||
// 페이지 초기화
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('주간보고서 페이지 로드 시작');
|
||||
|
||||
// AuthManager 로드 대기
|
||||
const checkAuthManager = async () => {
|
||||
if (window.authManager) {
|
||||
try {
|
||||
// 인증 확인
|
||||
const isAuthenticated = await window.authManager.checkAuth();
|
||||
if (!isAuthenticated) {
|
||||
window.location.href = '/login.html';
|
||||
return;
|
||||
}
|
||||
|
||||
// 공통 헤더 초기화
|
||||
const user = JSON.parse(localStorage.getItem('currentUser') || '{}');
|
||||
if (window.commonHeader && user.id) {
|
||||
await window.commonHeader.init(user, 'reports_weekly');
|
||||
}
|
||||
|
||||
console.log('주간보고서 페이지 로드 완료');
|
||||
} catch (error) {
|
||||
console.error('페이지 초기화 오류:', error);
|
||||
}
|
||||
} else {
|
||||
setTimeout(checkAuthManager, 100);
|
||||
}
|
||||
};
|
||||
checkAuthManager();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
212
frontend/reports.html
Normal file
212
frontend/reports.html
Normal file
@@ -0,0 +1,212 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>보고서 - 작업보고서</title>
|
||||
|
||||
<!-- Tailwind CSS -->
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
|
||||
<!-- Font Awesome -->
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
|
||||
|
||||
<!-- Custom Styles -->
|
||||
<style>
|
||||
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');
|
||||
|
||||
body {
|
||||
font-family: 'Inter', sans-serif;
|
||||
}
|
||||
|
||||
.report-card {
|
||||
transition: all 0.3s ease;
|
||||
border-left: 4px solid transparent;
|
||||
}
|
||||
|
||||
.report-card:hover {
|
||||
transform: translateY(-4px);
|
||||
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
|
||||
border-left-color: #3b82f6;
|
||||
}
|
||||
|
||||
.report-card.daily-report {
|
||||
border-left-color: #10b981;
|
||||
}
|
||||
|
||||
.report-card.daily-report:hover {
|
||||
border-left-color: #059669;
|
||||
}
|
||||
|
||||
.gradient-bg {
|
||||
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
|
||||
}
|
||||
|
||||
.stats-card {
|
||||
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body class="bg-gray-50">
|
||||
<!-- 공통 헤더 -->
|
||||
<div id="commonHeader"></div>
|
||||
|
||||
<!-- Main Content -->
|
||||
<main class="container mx-auto px-4 py-8" style="padding-top: 80px;">
|
||||
<!-- 페이지 헤더 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
|
||||
<div class="flex items-center justify-between mb-4">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold text-gray-900 flex items-center">
|
||||
<i class="fas fa-chart-bar text-red-500 mr-3"></i>
|
||||
보고서
|
||||
</h1>
|
||||
<p class="text-gray-600 mt-1">다양한 보고서를 생성하고 관리할 수 있습니다</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 보고서 카테고리 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-6 mb-6">
|
||||
<h2 class="text-xl font-semibold text-gray-900 mb-4">
|
||||
<i class="fas fa-list text-gray-500 mr-2"></i>보고서 유형 선택
|
||||
</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4">
|
||||
<!-- 일일보고서 -->
|
||||
<a href="/reports-daily.html" class="report-card bg-green-50 p-4 rounded-lg hover:bg-green-100 transition-colors">
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<div class="w-10 h-10 bg-green-100 rounded-lg flex items-center justify-center">
|
||||
<i class="fas fa-file-excel text-green-600"></i>
|
||||
</div>
|
||||
<span class="bg-green-100 text-green-800 text-xs font-medium px-2 py-1 rounded-full">
|
||||
사용 가능
|
||||
</span>
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-gray-900 mb-2">일일보고서</h3>
|
||||
<p class="text-sm text-gray-600 mb-3">
|
||||
관리함 데이터를 기반으로 품질팀용 일일보고서를 엑셀 형태로 생성합니다.
|
||||
</p>
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-xs text-green-600 font-medium">
|
||||
<i class="fas fa-check-circle mr-1"></i>진행중 항목 포함
|
||||
</span>
|
||||
<i class="fas fa-arrow-right text-gray-400"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- 주간보고서 -->
|
||||
<a href="/reports-weekly.html" class="report-card bg-blue-50 p-4 rounded-lg hover:bg-blue-100 transition-colors">
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<div class="w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center">
|
||||
<i class="fas fa-calendar-week text-blue-600"></i>
|
||||
</div>
|
||||
<span class="bg-yellow-100 text-yellow-800 text-xs font-medium px-2 py-1 rounded-full">
|
||||
준비중
|
||||
</span>
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-gray-900 mb-2">주간보고서</h3>
|
||||
<p class="text-sm text-gray-600 mb-3">
|
||||
주간 단위로 집계된 부적합 현황 및 처리 결과를 정리한 보고서입니다.
|
||||
</p>
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-xs text-blue-600 font-medium">
|
||||
<i class="fas fa-calendar mr-1"></i>주간 집계
|
||||
</span>
|
||||
<i class="fas fa-arrow-right text-gray-400"></i>
|
||||
</div>
|
||||
</a>
|
||||
|
||||
<!-- 월간보고서 -->
|
||||
<a href="/reports-monthly.html" class="report-card bg-purple-50 p-4 rounded-lg hover:bg-purple-100 transition-colors">
|
||||
<div class="flex items-center justify-between mb-3">
|
||||
<div class="w-10 h-10 bg-purple-100 rounded-lg flex items-center justify-center">
|
||||
<i class="fas fa-calendar-alt text-purple-600"></i>
|
||||
</div>
|
||||
<span class="bg-yellow-100 text-yellow-800 text-xs font-medium px-2 py-1 rounded-full">
|
||||
준비중
|
||||
</span>
|
||||
</div>
|
||||
<h3 class="text-lg font-semibold text-gray-900 mb-2">월간보고서</h3>
|
||||
<p class="text-sm text-gray-600 mb-3">
|
||||
월간 부적합 발생 현황, 처리 성과 및 개선사항을 종합한 보고서입니다.
|
||||
</p>
|
||||
<div class="flex items-center justify-between">
|
||||
<span class="text-xs text-purple-600 font-medium">
|
||||
<i class="fas fa-chart-line mr-1"></i>월간 분석
|
||||
</span>
|
||||
<i class="fas fa-arrow-right text-gray-400"></i>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 보고서 안내 -->
|
||||
<div class="bg-white rounded-xl shadow-sm p-6">
|
||||
<h2 class="text-xl font-semibold text-gray-900 mb-4">
|
||||
<i class="fas fa-info-circle text-blue-500 mr-2"></i>보고서 이용 안내
|
||||
</h2>
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
|
||||
<div class="space-y-3">
|
||||
<h3 class="font-semibold text-gray-800">📊 일일보고서</h3>
|
||||
<ul class="text-sm text-gray-600 space-y-1">
|
||||
<li>• 관리함의 진행 중 항목 무조건 포함</li>
|
||||
<li>• 완료됨 항목은 첫 내보내기에만 포함</li>
|
||||
<li>• 프로젝트별 개별 생성</li>
|
||||
<li>• 엑셀 형태로 다운로드</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="space-y-3">
|
||||
<h3 class="font-semibold text-gray-800">🚀 향후 계획</h3>
|
||||
<ul class="text-sm text-gray-600 space-y-1">
|
||||
<li>• 주간보고서: 주간 집계 및 트렌드 분석</li>
|
||||
<li>• 월간보고서: 월간 성과 및 개선사항</li>
|
||||
<li>• 자동 이메일 발송 기능</li>
|
||||
<li>• 대시보드 형태의 실시간 리포트</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
|
||||
|
||||
<!-- JavaScript -->
|
||||
<script src="/static/js/core/auth-manager.js"></script>
|
||||
<script src="/static/js/core/permissions.js"></script>
|
||||
<script src="/static/js/components/common-header.js"></script>
|
||||
<script src="/static/js/api.js"></script>
|
||||
|
||||
<script>
|
||||
// 페이지 초기화
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
console.log('보고서 메인 페이지 로드 시작');
|
||||
|
||||
// AuthManager 로드 대기
|
||||
const checkAuthManager = async () => {
|
||||
if (window.authManager) {
|
||||
try {
|
||||
// 인증 확인
|
||||
const isAuthenticated = await window.authManager.checkAuth();
|
||||
if (!isAuthenticated) {
|
||||
window.location.href = '/login.html';
|
||||
return;
|
||||
}
|
||||
|
||||
// 공통 헤더 초기화
|
||||
const user = JSON.parse(localStorage.getItem('currentUser') || '{}');
|
||||
if (window.commonHeader && user.id) {
|
||||
await window.commonHeader.init(user, 'reports');
|
||||
}
|
||||
|
||||
console.log('보고서 메인 페이지 로드 완료');
|
||||
} catch (error) {
|
||||
console.error('페이지 초기화 오류:', error);
|
||||
}
|
||||
} else {
|
||||
setTimeout(checkAuthManager, 100);
|
||||
}
|
||||
};
|
||||
checkAuthManager();
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -93,7 +93,33 @@ class CommonHeader {
|
||||
url: '/reports.html',
|
||||
pageName: 'reports',
|
||||
color: 'text-red-600',
|
||||
bgColor: 'bg-red-50 hover:bg-red-100'
|
||||
bgColor: 'bg-red-50 hover:bg-red-100',
|
||||
subMenus: [
|
||||
{
|
||||
id: 'reports_daily',
|
||||
title: '일일보고서',
|
||||
icon: 'fas fa-file-excel',
|
||||
url: '/reports-daily.html',
|
||||
pageName: 'reports_daily',
|
||||
color: 'text-green-600'
|
||||
},
|
||||
{
|
||||
id: 'reports_weekly',
|
||||
title: '주간보고서',
|
||||
icon: 'fas fa-calendar-week',
|
||||
url: '/reports-weekly.html',
|
||||
pageName: 'reports_weekly',
|
||||
color: 'text-blue-600'
|
||||
},
|
||||
{
|
||||
id: 'reports_monthly',
|
||||
title: '월간보고서',
|
||||
icon: 'fas fa-calendar-alt',
|
||||
url: '/reports-monthly.html',
|
||||
pageName: 'reports_monthly',
|
||||
color: 'text-purple-600'
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
id: 'projects_manage',
|
||||
|
||||
@@ -46,7 +46,8 @@ class PagePermissionManager {
|
||||
|
||||
try {
|
||||
// API에서 사용자별 페이지 권한 가져오기
|
||||
const response = await fetch(`/api/users/${this.currentUser.id}/page-permissions`, {
|
||||
const apiUrl = window.API_BASE_URL || 'http://localhost:16080/api';
|
||||
const response = await fetch(`${apiUrl}/users/${this.currentUser.id}/page-permissions`, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${localStorage.getItem('access_token')}`
|
||||
}
|
||||
@@ -198,7 +199,8 @@ class PagePermissionManager {
|
||||
}
|
||||
|
||||
try {
|
||||
const response = await fetch('/api/page-permissions/grant', {
|
||||
const apiUrl = window.API_BASE_URL || 'http://localhost:16080/api';
|
||||
const response = await fetch(`${apiUrl}/page-permissions/grant`, {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
@@ -230,7 +232,8 @@ class PagePermissionManager {
|
||||
*/
|
||||
async getUserPagePermissions(userId) {
|
||||
try {
|
||||
const response = await fetch(`/api/users/${userId}/page-permissions`, {
|
||||
const apiUrl = window.API_BASE_URL || 'http://localhost:16080/api';
|
||||
const response = await fetch(`${apiUrl}/users/${userId}/page-permissions`, {
|
||||
headers: {
|
||||
'Authorization': `Bearer ${localStorage.getItem('access_token')}`
|
||||
}
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
* M-Project 작업보고서 시스템
|
||||
*/
|
||||
|
||||
const CACHE_NAME = 'mproject-v1.0.0';
|
||||
const STATIC_CACHE = 'mproject-static-v1.0.0';
|
||||
const DYNAMIC_CACHE = 'mproject-dynamic-v1.0.0';
|
||||
const CACHE_NAME = 'mproject-v1.0.1';
|
||||
const STATIC_CACHE = 'mproject-static-v1.0.1';
|
||||
const DYNAMIC_CACHE = 'mproject-dynamic-v1.0.1';
|
||||
|
||||
// 캐시할 정적 리소스
|
||||
const STATIC_ASSETS = [
|
||||
|
||||
Reference in New Issue
Block a user