feat(performance): 매출 실적 표 열 너비 자동·날짜 열 고정·그룹 구분·접기 애니메이션
- 열 너비 = 내용 길이(표가 100% 로 늘지 않음, 모든 기간 같음), 날짜 열 고정 너비 → 자동 - 가로 스크롤해도 날짜 열 고정(sticky) - 그룹 열(진한 보라·묶음 선)과 하위 열(옅은 보라·위 띠) 구분, 마지막 하위 열 오른쪽 선 - 접기 단추 22px ⊟/⊞, 펼치고 접을 때 열 너비 애니메이션 - perf_manual.test.js 를 10/21 변경(앞날 입력·계산식 글자 그대로 전송)에 맞게 고침 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{% extends "erp_base.html" %}
|
||||
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/performance.css?v=20261022a" />{% endblock %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/performance.css?v=20261022b" />{% endblock %}
|
||||
|
||||
{%- macro won(v) -%}
|
||||
{%- if v is none -%}<span class="perf-na"></span>
|
||||
@@ -135,14 +135,17 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="erp-table-wrap perf-table-wrap">
|
||||
<table class="perf-table perf-main">
|
||||
{#- perf-autofit(2026-10-22) = 열 너비는 내용 길이만큼, 날짜 열은 가로 스크롤해도 고정 -#}
|
||||
<table class="perf-table perf-main perf-autofit">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="perf-th-label">{% if period_kind == 'year' %}월{% else %}날짜{% endif %}</th>
|
||||
{#- 그룹(2026-10-22) — 그룹 열 = 보이는 하위 쇼핑몰 합계, ▾ 로 하위 열 접기/펴기(이 브라우저에 기억) -#}
|
||||
{#- 그룹(2026-10-22) — 그룹 열 = 보이는 하위 쇼핑몰 합계, ⊟/⊞ 로 하위 열 접기/펴기(이 브라우저에 기억, 펼치고 접을 때 애니메이션).
|
||||
하위 열은 .perf-gc 로 내용을 감싼다 — 접을 때 그 너비를 0 으로 줄여 열이 부드럽게 닫힌다. is-glast = 그룹의 마지막 하위 열(오른쪽 묶음 선) -#}
|
||||
{% for col in cols %}{% set c = col.code %}
|
||||
{% if col.kind == 'group' %}<th class="perf-th-group" data-group-head="{{ c }}" title="{{ names[c] }} — 하위 쇼핑몰 {{ group_members[c] | length }}곳 매출 합계"><button type="button" class="perf-gtoggle" data-group-toggle="{{ c }}" aria-expanded="true" title="하위 쇼핑몰 접기/펴기">▾</button>{{ short_names[c] }}</th>
|
||||
{% else %}<th{% if col.kind == 'child' %} class="perf-th-child" data-group-child="{{ col.group }}"{% endif %} title="{{ names[c] }}{% if c in manual_codes %} — 수동 입력(날짜 칸을 눌러 입력){% endif %}">{{ short_names[c] }}{% if c in manual_codes %} <span class="perf-manual-mark" aria-label="수동 입력">✎</span>{% endif %}</th>{% endif %}
|
||||
{% set glast = col.kind == 'child' and (not loop.nextitem or loop.nextitem.group != col.group) %}
|
||||
{% if col.kind == 'group' %}<th class="perf-th-group" data-group-head="{{ c }}" title="{{ names[c] }} — 하위 쇼핑몰 {{ group_members[c] | length }}곳 매출 합계"><span class="perf-gh"><button type="button" class="perf-gtoggle" data-group-toggle="{{ c }}" aria-expanded="true" aria-label="{{ short_names[c] }} 하위 쇼핑몰 접기" title="하위 쇼핑몰 접기/펴기"><svg viewBox="0 0 18 18" width="18" height="18" aria-hidden="true"><rect class="g-box" x="1" y="1" width="16" height="16" rx="4"/><path class="g-h" d="M5 9h8"/><path class="g-v" d="M9 5v8"/></svg></button><span>{{ short_names[c] }}</span></span></th>
|
||||
{% else %}<th{% if col.kind == 'child' %} class="perf-th-child{% if glast %} is-glast{% endif %}" data-group-child="{{ col.group }}"{% endif %} title="{{ names[c] }}{% if c in manual_codes %} — 수동 입력(날짜 칸을 눌러 입력){% endif %}">{% if col.kind == 'child' %}<div class="perf-gc">{% endif %}{{ short_names[c] }}{% if c in manual_codes %} <span class="perf-manual-mark" aria-label="수동 입력">✎</span>{% endif %}{% if col.kind == 'child' %}</div>{% endif %}</th>{% endif %}
|
||||
{% endfor %}
|
||||
<th class="perf-th-total">{% if period_kind == 'year' %}월 합계{% else %}일 합계{% endif %}</th>
|
||||
</tr>
|
||||
@@ -156,18 +159,20 @@
|
||||
{% for col in cols %}
|
||||
{% set c = col.code %}
|
||||
{% set m = r.cells[c] %}
|
||||
{% set glast = col.kind == 'child' and (not loop.nextitem or loop.nextitem.group != col.group) %}
|
||||
{% set gattr %}{% if col.kind == 'child' %} data-group-child="{{ col.group }}"{% endif %}{% endset %}
|
||||
{% set gc0 %}{% if col.kind == 'child' %}<div class="perf-gc">{% endif %}{% endset %}{% set gc1 %}{% if col.kind == 'child' %}</div>{% endif %}{% endset %}
|
||||
{% if col.kind == 'group' %}
|
||||
<td class="perf-num perf-td-group" data-group-cell="{{ c }}">{{ m3(m) }}</td>
|
||||
{% elif r.kind == 'day' and c in manual_codes %}
|
||||
{% set is_manual = (r.date ~ '|' ~ c) in manual_cells %}
|
||||
{% set fx = (formula_cells or {}).get(r.date ~ '|' ~ c) %}
|
||||
<td class="perf-num is-manual-cell{% if is_manual %} is-manual{% endif %}{% if fx %} is-formula{% endif %}"{{ gattr }} data-manual-code="{{ c }}" data-date="{{ r.date }}"
|
||||
<td class="perf-num is-manual-cell{% if is_manual %} is-manual{% endif %}{% if fx %} is-formula{% endif %}{% if glast %} is-glast{% endif %}"{{ gattr }} data-manual-code="{{ c }}" data-date="{{ r.date }}"
|
||||
data-manual-value="{{ m.gross if is_manual else '' }}"{% if fx %} data-formula="{{ fx }}"{% endif %} tabindex="0"
|
||||
title="{% if fx %}계산식 {{ fx }} — 눌러 고치기{% elif is_manual %}수동 입력값 — 눌러 고치기(비우고 저장하면 API 값){% else %}눌러 총매출 직접 입력(1000+2000 같은 계산식도 됨){% endif %}">{{ m3(m) }}{{ adl(r.ads[c]) }}</td>
|
||||
title="{% if fx %}계산식 {{ fx }} — 눌러 고치기{% elif is_manual %}수동 입력값 — 눌러 고치기(비우고 저장하면 API 값){% else %}눌러 총매출 직접 입력(1000+2000 같은 계산식도 됨){% endif %}">{{ gc0 }}{{ m3(m) }}{{ adl(r.ads[c]) }}{{ gc1 }}</td>
|
||||
{% else %}
|
||||
<td class="perf-num{% if r['from'] and (m.gross or m.commission) %} is-link{% endif %}"{{ gattr }}
|
||||
{% if r['from'] %}data-code="{{ c }}" data-from="{{ r['from'] }}" data-to="{{ r['to'] }}"{% endif %}>{{ m3(m) }}{{ adl(r.ads[c]) }}</td>
|
||||
<td class="perf-num{% if r['from'] and (m.gross or m.commission) %} is-link{% endif %}{% if glast %} is-glast{% endif %}"{{ gattr }}
|
||||
{% if r['from'] %}data-code="{{ c }}" data-from="{{ r['from'] }}" data-to="{{ r['to'] }}"{% endif %}>{{ gc0 }}{{ m3(m) }}{{ adl(r.ads[c]) }}{{ gc1 }}</td>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
<td class="perf-num perf-td-total">{{ m3(r.total) }}{% if r.ads_total %}{{ adl_total(r.ads_total) }}{% endif %}</td>
|
||||
@@ -283,4 +288,4 @@
|
||||
} | tojson }}</script>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}<script src="/static/performance.js?v=20261022a" defer></script>{% endblock %}
|
||||
{% block scripts %}<script src="/static/performance.js?v=20261022b" defer></script>{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user