feat(performance): KPI 수수료 차감 매출 한 줄·기본 보기 차감 매출·다음 업데이트 카운트다운·일 합계 ROAS

- KPI 는 수수료 차감 매출만 화면 왼쪽 한 줄(금액 + 비교 기간 대비 %), 나머지 카드 제거
- 일자별 표 기본 보기 = 수수료 차감 매출(localStorage 저장값 안 씀)
- 마지막 업데이트 옆 다음 자동 업데이트까지 남은 시간(초 단위 실시간)
- 일 합계 ROAS = 일 합계 금액 ÷ 일 합계 광고비(보기 기준별 roas / roas_net)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-19 23:19:14 +09:00
parent b23774420b
commit ee96c924fc
10 changed files with 151 additions and 57 deletions
+6 -3
View File
@@ -20,7 +20,7 @@ sys.path.insert(0, ROOT)
OUT_DIR = os.path.join(ROOT, "tests", "js", ".out")
from app.modules.performance.ad_spend import build_ad_dashboard # noqa: E402
from app.modules.performance.dashboard import build_dashboard, build_settings # noqa: E402
from app.modules.performance.dashboard import amount_text, build_dashboard, build_settings # noqa: E402
BASE_STUB = ("{% block head_extra %}{% endblock %}<body><main class='erp-page'>{% block content %}{% endblock %}</main>"
"{% block scripts %}{% endblock %}</body>")
@@ -80,9 +80,12 @@ def env() -> jinja2.Environment:
def main() -> None:
os.makedirs(OUT_DIR, exist_ok=True)
e = env()
base = {"user": {"email": "me@test.local"}, "is_admin": True, "nav_items": [], "page_title": "실적", "page_subtitle": ""}
base = {"user": {"email": "me@test.local"}, "is_admin": True, "nav_items": [], "page_title": "실적", "page_subtitle": "",
"unit": "won", "unit_label": "원", "amt": lambda v: amount_text(v)}
ctx = build_dashboard(FakeStore(), kind="week", anchor=date(2026, 10, 7), today=date(2026, 10, 7))
html = e.get_template("performance/index.html").render(**base, active_tab="dashboard", metric="gross", **ctx)
# 다음 자동 업데이트(router._auto_sync_ctx 와 같은 모양) — 화면이 초 단위로 센다
ctx["auto_sync"] = {"next_at": "2026-10-07T10:30:00+09:00", "now": "2026-10-07T10:17:25.000+09:00", "hours": [9, 19], "slot": 30}
html = e.get_template("performance/index.html").render(**base, active_tab="dashboard", metric="net", **ctx)
with open(os.path.join(OUT_DIR, "perf_dash.html"), "w", encoding="utf-8") as f:
f.write(html)
actx = build_ad_dashboard(FakeStore(), kind="month", anchor=date(2026, 10, 7), today=date(2026, 10, 7),