fix(mgmt-perf): 차트 탭 동기화, 한글 파일명 복원
- 섹션 id를 ASCII(mgmt-sec-*)로 통일하고 isSectionActive를 state 기준으로 변경 - multipart 파일명 UTF-8 복원(decodeMultipartFilename) 후 스냅샷 메타에 저장 - Chart.js 미로드·UM 누락 시 조기 종료 및 README 정리 Made-with: Cursor
This commit is contained in:
@@ -11,17 +11,31 @@
|
||||
console.error("mgmt-perf: invalid JSON", err);
|
||||
return;
|
||||
}
|
||||
if (typeof Chart === "undefined") {
|
||||
console.error("mgmt-perf: Chart.js not loaded");
|
||||
return;
|
||||
}
|
||||
const UM = P.UM;
|
||||
if (!UM || typeof UM !== "object") {
|
||||
console.error("mgmt-perf: payload missing UM");
|
||||
return;
|
||||
}
|
||||
const ORDER_CAT = P.ORDER_CAT;
|
||||
const CUSTS = P.CUSTS;
|
||||
const RISK_ROWS = P.RISK_ROWS;
|
||||
const ORDER_DATA = P.ORDER_DATA;
|
||||
const MODELS = P.MODELS;
|
||||
const FORECAST = P.FORECAST;
|
||||
/** HTML id / data-section — 한글 id는 브라우저·정규화 이슈로 getElementById가 실패할 수 있어 ASCII만 사용 */
|
||||
const SECTION = {
|
||||
SALES: "mgmt-sec-sales",
|
||||
ORDER: "mgmt-sec-order",
|
||||
FORECAST: "mgmt-sec-forecast",
|
||||
};
|
||||
let state = {
|
||||
currentDivision: 'all',
|
||||
currentMonth: 'all',
|
||||
currentSection: '매출현황',
|
||||
currentSection: SECTION.SALES,
|
||||
charts: {}
|
||||
};
|
||||
|
||||
@@ -40,8 +54,7 @@ let state = {
|
||||
}
|
||||
|
||||
function isSectionActive(sectionId) {
|
||||
const el = document.getElementById(sectionId);
|
||||
return !!(el && el.classList.contains("active"));
|
||||
return state.currentSection === sectionId;
|
||||
}
|
||||
|
||||
// Initialize (iframe에서도 DOMContentLoaded가 이미 지난 경우 대비)
|
||||
@@ -129,7 +142,7 @@ let state = {
|
||||
const monthIdx = mon === "all" ? [0, 1, 2] : [parseInt(mon, 10) - 1];
|
||||
|
||||
// 매출현황 탭이 보일 때만 KPI·매출 차트 렌더 (숨겨진 영역에 그리면 Chart.js 높이 0)
|
||||
if (isSectionActive("매출현황")) {
|
||||
if (isSectionActive(SECTION.SALES)) {
|
||||
document.getElementById("overviewMode").style.display = isOverviewMode ? "block" : "none";
|
||||
document.getElementById("divisionDetailMode").style.display = isOverviewMode ? "none" : "block";
|
||||
if (isOverviewMode) {
|
||||
@@ -146,14 +159,14 @@ let state = {
|
||||
}
|
||||
|
||||
const omr = document.getElementById("orderModelRow");
|
||||
if (omr && isSectionActive("수주현황")) {
|
||||
if (omr && isSectionActive(SECTION.ORDER)) {
|
||||
omr.style.display = modelDisplay;
|
||||
}
|
||||
|
||||
if (isSectionActive("수주현황")) {
|
||||
if (isSectionActive(SECTION.ORDER)) {
|
||||
renderOrderSection();
|
||||
}
|
||||
if (isSectionActive("예상전망")) {
|
||||
if (isSectionActive(SECTION.FORECAST)) {
|
||||
renderForecastSection();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user