Files
jongryangje/app/Views/bag/analytics_seasonal_trend.php
taekyoungc a8afaf4af2 style: 표/패널 UI 전면 통일 + 화면설명 드로어·글씨크기·탭 개선
표 디자인
- 모든 표를 가벼운 스타일로 통일(.data-table 경량화: 작은 회색 헤더·연한 구분선·hover)
- 표/패널 바깥 테두리 둥글게(rounded-lg) 일괄 적용, 표 래퍼에 패딩 카드(p-4) 통일
- 표 헤더·데이터 정렬을 전 화면 좌측 기준으로 통일
  - .data-table th/td text-align:left (전역), 흩어진 center/right 정렬 정리
  - 재디자인 Tailwind 표(포장단위·단가·기본코드·담당자·업체·판매대행소·무료대상자·지정판매소)도 셀 좌측화
- 기본정보관리 등 나머지 소메뉴 표를 기본 코드 관리 스타일(가벼운 표·상태 pill)로 재디자인

워크스페이스/공통
- "이 화면 설명" → 새 탭 대신 우측 드로어 팝업(현재 화면과 동시에 보기, Esc·드래그 폭조절)
- 상단바 글씨 크기 조절(A−/A+), 작업 내용에 zoom 적용
- 탭 최대치 도달 시 자동 삭제 대신 안내 토스트, "모두 닫기"(업무 현황 탭은 보존)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 17:26:36 +09:00

105 lines
5.3 KiB
PHP

<?php
$baseYear = (int) ($baseYear ?? (int) date('Y'));
$season = (string) ($season ?? 'spring');
$seasonLabel = (string) ($seasonLabel ?? '봄');
$seasonMonthsLabel = (string) ($seasonMonthsLabel ?? '');
$deviationMin = (float) ($deviationMin ?? 0);
$queried = (bool) ($queried ?? false);
$filters = is_array($filters ?? null) ? $filters : [];
$rows = is_array($rows ?? null) ? $rows : [];
$seasonCatalog = \App\Libraries\BagAnalyticsReportBuilder::seasonCatalog();
$seasonScope = $seasonMonthsLabel !== ''
? $baseYear . '년 ' . $seasonLabel . ' (' . $seasonMonthsLabel . ')'
: (string) $baseYear . '년 ' . $seasonLabel;
?>
<?= view('components/print_header', [
'printTitle' => '계절별 판매 추이 분석',
'printExtraLines' => ['기준: ' . $seasonScope, '(단위: 매)'],
]) ?>
<section class="border-b border-gray-300 p-2 shrink-0 bg-control-panel no-print">
<div class="flex flex-wrap items-center justify-between gap-y-2">
<span class="text-sm font-bold text-gray-700">계절별 판매 추이 분석</span>
<div class="flex gap-2">
<button type="button" onclick="window.print()" class="border border-btn-print-border text-gray-600 px-3 py-1 rounded-sm text-sm">인쇄</button>
<a href="<?= base_url('dashboard') ?>" class="border border-gray-400 text-gray-700 px-3 py-1 rounded-sm text-sm">종료</a>
</div>
</div>
</section>
<section class="p-2 bg-white border-b border-gray-200 no-print text-sm">
<form id="seasonal-trend-form" method="get" action="<?= site_url('bag/analytics/seasonal-trend') ?>" class="flex flex-wrap items-end gap-3">
<input type="hidden" name="search" value="1"/>
<div>
<label class="block text-gray-600 mb-0.5">기준년도</label>
<input type="number" name="base_year" value="<?= (int) $baseYear ?>" min="2000" max="2100" class="border border-gray-300 rounded px-2 py-1 min-w-[7rem] w-28"/>
</div>
<div>
<label class="block text-gray-600 mb-0.5">계절선택</label>
<select name="season" class="border border-gray-300 rounded px-2 py-1 min-w-[14rem] w-full max-w-[18rem]" onchange="this.form.submit()">
<?php foreach ($seasonCatalog as $val => $def): ?>
<option value="<?= esc($val, 'attr') ?>" <?= $season === $val ? 'selected' : '' ?>>
<?= esc((string) $def['label']) ?> (<?= esc((string) $def['months_label']) ?>)
</option>
<?php endforeach; ?>
</select>
</div>
<div>
<label class="block text-gray-600 mb-0.5">편차</label>
<input type="number" name="deviation_min" value="<?= esc((string) $deviationMin) ?>" step="0.01" min="0" class="border border-gray-300 rounded px-2 py-1 w-28"/>
<span class="text-gray-500">% 이상(절대값)</span>
</div>
<button type="submit" class="bg-btn-search text-white px-4 py-1 rounded-sm">조회</button>
</form>
<p class="text-xs text-gray-500 mt-1">
(단위: 매) · 계절을 바꾸면 자동 조회됩니다.
<?php if ($queried && $seasonMonthsLabel !== ''): ?>
· 현재: <strong><?= esc($seasonScope) ?></strong> <strong>판매(sale)</strong> 월평균(계절 3개월 합÷3, 반품·취소 제외) vs 전년 동일 계절
<?php endif; ?>
</p>
</section>
<div class="m-2 border border-gray-300 rounded-lg">
<div class="bg-gray-100 px-3 py-1.5 text-sm font-bold border-b">
계절별 판매 추이 분석 조회 내역
<?php if ($queried): ?> — <?= esc($seasonScope) ?><?php endif; ?>
</div>
<div class="overflow-auto max-h-[28rem]">
<table class="w-full data-table text-sm">
<thead>
<tr>
<th>대행소</th>
<th>지정판매소</th>
<th class="w-24 text-center">판매소번호</th>
<th class="w-20 text-center">성명</th>
<th class="w-24 text-right">전년 계절평균</th>
<th class="w-24 text-right">기준년 계절평균</th>
<th class="w-20 text-right">평균 차</th>
<th class="w-16 text-right">편차(%)</th>
<th class="w-24 text-center">지정일자</th>
</tr>
</thead>
<tbody>
<?php if (! $queried): ?>
<tr><td colspan="9" class="text-center text-gray-400 py-8">조회 조건 입력 후 조회</td></tr>
<?php elseif ($rows === []): ?>
<tr><td colspan="9" class="text-center text-gray-500 py-8">편차 조건(|%|)에 맞는 자료가 없습니다.</td></tr>
<?php endif; ?>
<?php foreach ($rows as $row): ?>
<tr>
<td class="text-left pl-2"><?= esc((string) ($row['agency_name'] ?? '')) ?></td>
<td class="text-left pl-2"><?= esc((string) ($row['shop_name'] ?? '')) ?></td>
<td class="text-center"><?= esc((string) ($row['shop_no'] ?? '')) ?></td>
<td class="text-center"><?= esc((string) ($row['rep_name'] ?? '')) ?></td>
<td class="text-right tabular-nums"><?= number_format((int) ($row['prev_season_avg'] ?? 0)) ?></td>
<td class="text-right tabular-nums"><?= number_format((int) ($row['base_season_avg'] ?? 0)) ?></td>
<td class="text-right tabular-nums"><?= number_format((int) ($row['avg_diff'] ?? 0)) ?></td>
<td class="text-right tabular-nums"><?= esc((string) ($row['deviation_pct'] ?? '0')) ?></td>
<td class="text-center"><?= esc((string) ($row['designated_at'] ?? '')) ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
</div>