feat(mgmt-perf): 대시보드 연도·분기 조회(스냅샷별 로드)

- getPayloadRowForPeriod, listDistinctPeriods
- /dashboard/business-performance?year=&quarter= 및 상단 GET 폼
- 해당 기간 업로드 없을 때 샘플+안내

Made-with: Cursor
This commit is contained in:
2026-04-13 20:05:35 +09:00
parent dc7fca414e
commit 3872c32a91
4 changed files with 227 additions and 8 deletions

View File

@@ -139,6 +139,55 @@
opacity: 0.5;
cursor: not-allowed;
}
.mgmt-dash-period-toolbar {
display: flex;
flex-wrap: wrap;
align-items: flex-end;
gap: 12px;
margin-bottom: 12px;
padding: 12px 14px;
background: #f9fafb;
border: 1px solid #e5e7eb;
border-radius: 10px;
font-size: 13px;
}
.mgmt-dash-period-toolbar label {
display: flex;
flex-direction: column;
gap: 4px;
font-weight: 500;
color: #374151;
}
.mgmt-dash-period-toolbar select {
min-width: 110px;
padding: 8px 10px;
border-radius: 6px;
border: 1px solid #d1d5db;
background: #fff;
font-size: 14px;
}
.btn-mgmt-period {
padding: 8px 16px;
border-radius: 8px;
border: none;
background: #1d4ed8;
color: #fff;
font-weight: 600;
cursor: pointer;
font-size: 14px;
}
.btn-mgmt-period:hover {
background: #1e40af;
}
.mgmt-dash-empty-hint {
margin: 0 0 12px;
padding: 10px 12px;
font-size: 13px;
color: #92400e;
background: #fffbeb;
border: 1px solid #fde68a;
border-radius: 8px;
}
</style>
</head>
<body>
@@ -157,6 +206,31 @@
<div class="mgmt-perf-split">
<section class="mgmt-dash-panel" aria-labelledby="mgmt-dash-heading">
<h2 id="mgmt-dash-heading">대시보드 조회</h2>
<form class="mgmt-dash-period-toolbar" method="get" action="/dashboard/business-performance">
<label>
연도
<select name="year" aria-label="조회 연도">
<% var _yopts = typeof yearOptions !== 'undefined' && yearOptions && yearOptions.length ? yearOptions : [typeof viewYear !== 'undefined' ? viewYear : 2026]; %>
<% _yopts.forEach(function (yy) { %>
<option value="<%= yy %>" <%= (typeof viewYear !== 'undefined' && Number(viewYear) === Number(yy)) ? 'selected' : '' %>><%= yy %>년</option>
<% }); %>
</select>
</label>
<label>
분기
<select name="quarter" aria-label="조회 분기">
<% [1, 2, 3, 4].forEach(function (qn) { %>
<option value="<%= qn %>" <%= (typeof viewQuarter !== 'undefined' && Number(viewQuarter) === qn) ? 'selected' : '' %>><%= qn %>분기 (Q<%= qn %>)</option>
<% }); %>
</select>
</label>
<button type="submit" class="btn-mgmt-period">조회</button>
</form>
<% if (typeof noSnapshotForPeriod !== 'undefined' && noSnapshotForPeriod) { %>
<p class="mgmt-dash-empty-hint" role="status">
선택한 연도·분기에 저장된 업로드가 없어 기본 샘플 데이터를 표시합니다. 해당 기간 엑셀을 업로드하면 여기에 반영됩니다.
</p>
<% } %>
<div class="mgmt-dash-inline-wrap">
<div class="mgmt-perf-embed" id="mgmtPerfDashRoot">
<%- include('partials/mgmt_perf_dashboard_container', {