feat(frontend): 프로젝트 분석 페이지 전체 리팩토링

- 600줄에 달하는 project-analysis.js를 API, Data, UI, Controller 네 개의 모듈로 분리
- 복잡한 데이터 처리 로직과 UI 렌더링 로직을 분리하여 유지보수성 극대화
- 전역 상태를 최소화하고 데이터 흐름을 명확하게 개선
This commit is contained in:
2025-07-28 14:43:22 +09:00
parent 7c5a985166
commit 187c3fec07
2 changed files with 10 additions and 10 deletions

View File

@@ -761,7 +761,7 @@ const getStatistics = async (start_date, end_date) => {
WHERE report_date BETWEEN ? AND ? WHERE report_date BETWEEN ? AND ?
`; `;
const [overallRows] = await db.query(overallSql, [start_date, end_date]); const [overallRows] = await db.query(overallSql, [start_date, end_date]);
const dailyStatsSql = ` const dailyStatsSql = `
SELECT SELECT
report_date, report_date,

View File

@@ -14,12 +14,12 @@ let currentProcessedData = null;
async function searchReports() { async function searchReports() {
const dateInput = document.getElementById('reportDate'); const dateInput = document.getElementById('reportDate');
const selectedDate = dateInput.value; const selectedDate = dateInput.value;
if (!selectedDate) { if (!selectedDate) {
showError('날짜를 선택해주세요.'); showError('날짜를 선택해주세요.');
return; return;
} }
showLoading(true); showLoading(true);
currentProcessedData = null; // 새 검색이 시작되면 이전 데이터 초기화 currentProcessedData = null; // 새 검색이 시작되면 이전 데이터 초기화
@@ -27,11 +27,11 @@ async function searchReports() {
const rawData = await fetchReportData(selectedDate); const rawData = await fetchReportData(selectedDate);
currentProcessedData = processReportData(rawData, selectedDate); currentProcessedData = processReportData(rawData, selectedDate);
renderReport(currentProcessedData); renderReport(currentProcessedData);
} catch (error) { } catch (error) {
showError(error.message); showError(error.message);
renderReport(null); // 에러 발생 시 데이터 없는 화면 표시 renderReport(null); // 에러 발생 시 데이터 없는 화면 표시
} finally { } finally {
showLoading(false); showLoading(false);
} }
} }
@@ -68,7 +68,7 @@ function initializePage() {
setTimeout(() => window.location.href = '/index.html', 2000); setTimeout(() => window.location.href = '/index.html', 2000);
return; return;
} }
setupEventListeners(); setupEventListeners();
// 페이지 로드 시 오늘 날짜로 자동 검색 // 페이지 로드 시 오늘 날짜로 자동 검색