feat(performance): 직접 추가 쇼핑몰(수동 입력)·쇼핑몰 그룹·설정 드래그 순서
- 마이그레이션 009: perf_marketplaces.is_custom·is_group·parent_code - 설정: [+ 쇼핑몰 추가(수동 입력)]·[+ 그룹 추가], 이름 변경·삭제, 직접 추가 쇼핑몰 그룹 select - custom_ 코드는 registry.get_adapter 가 수동 입력 전용 어댑터(CustomManualAdapter)로 - 매출 실적 표: 그룹 열 = 보이는 하위 쇼핑몰 합계(일 합계엔 안 더함), ▾/▸ 하위 열 접기(localStorage) - 설정 표 ⠿ 드래그 → PUT /api/marketplace-order → sort_order, 화면 순서는 ordered_marketplaces 한 곳 - 테스트: test_custom_groups.py, perf_groups.browser.test.js 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=20261021a" />{% endblock %}
|
||||
{% block head_extra %}<link rel="stylesheet" href="/static/performance.css?v=20261022a" />{% endblock %}
|
||||
|
||||
{%- macro when(v) -%}{{ (v or '')[:16] | replace('T', ' ') or '—' }}{%- endmacro -%}
|
||||
|
||||
@@ -41,10 +41,30 @@
|
||||
{% if is_admin %}<th></th>{% endif %}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for r in rows %}
|
||||
<tr data-code="{{ r.code }}" data-name="{{ r.name }}">
|
||||
<th class="perf-td-label" scope="row">{{ r.name }}</th>
|
||||
{# 드래그 단위(2026-10-22) = tbody 하나 — 그룹 없는 행 하나 또는 그룹 + 하위 쇼핑몰(하위는 그 안에서만 순서 변경) #}
|
||||
{% for b in blocks %}
|
||||
<tbody class="perf-sort-block{% if b.row.is_group %} is-group-block{% endif %}">
|
||||
{% for r in [b.row] + b.children %}
|
||||
{% if r.is_group %}
|
||||
<tr class="perf-group-row" data-code="{{ r.code }}" data-name="{{ r.name }}" data-group="1">
|
||||
<th class="perf-td-label" scope="row">
|
||||
{% if is_admin %}<span class="perf-drag" title="끌어서 순서 변경(그룹은 하위 쇼핑몰과 함께 움직임)" aria-hidden="true">⠿</span>{% endif %}
|
||||
<span class="perf-group-name">{{ r.name }}</span> <span class="perf-pill">그룹</span>
|
||||
</th>
|
||||
<td colspan="{{ 7 if is_admin else 2 }}" class="perf-muted">하위 쇼핑몰 {{ r.children }}곳 — 매출 실적에서 그룹 열 = 하위 쇼핑몰 매출 합계(수수료도 쇼핑몰별 요율로 계산해 합침)</td>
|
||||
{% if is_admin %}
|
||||
<td class="perf-nowrap">
|
||||
<button type="button" class="erp-btn erp-btn-ghost erp-btn-sm" data-act="rename">이름 변경</button>
|
||||
<button type="button" class="erp-btn erp-btn-ghost erp-btn-sm perf-del-btn" data-act="delete">삭제</button>
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% else %}
|
||||
<tr data-code="{{ r.code }}" data-name="{{ r.name }}"{% if r.parent %} class="perf-child-row" data-parent="{{ r.parent }}"{% endif %}{% if r.is_custom %} data-custom="1"{% endif %}>
|
||||
<th class="perf-td-label" scope="row">
|
||||
{% if is_admin %}<span class="perf-drag" title="끌어서 순서 변경" aria-hidden="true">⠿</span>{% endif %}
|
||||
{% if r.parent %}<span class="perf-child-mark" aria-hidden="true">└</span>{% endif %}{{ r.name }}{% if r.is_custom %} <span class="perf-pill" title="실적 설정에서 직접 추가한 쇼핑몰">직접 추가</span>{% endif %}
|
||||
</th>
|
||||
{% if is_admin %}
|
||||
<td class="perf-center">
|
||||
<label class="perf-switch" title="사용 여부">
|
||||
@@ -85,17 +105,37 @@
|
||||
<td class="perf-muted perf-nowrap" title="마지막 시도: {{ when(r.last_sync_at) }}">{{ when(r.last_success_sync_at) }}</td>
|
||||
{% if is_admin %}
|
||||
<td class="perf-nowrap">
|
||||
{% if not r.manual_only %}
|
||||
{% if r.is_custom %}
|
||||
<select class="erp-input perf-group-sel" data-act-group title="그룹 — 그룹으로 묶으면 매출 실적에서 그룹 열이 하위 쇼핑몰 매출 합계">
|
||||
<option value="">그룹 없음</option>
|
||||
{% for g in groups %}<option value="{{ g.code }}"{% if r.parent == g.code %} selected{% endif %}>{{ g.name }}</option>{% endfor %}
|
||||
</select>
|
||||
<button type="button" class="erp-btn erp-btn-ghost erp-btn-sm" data-act="rename">이름 변경</button>
|
||||
<button type="button" class="erp-btn erp-btn-ghost erp-btn-sm perf-del-btn" data-act="delete">삭제</button>
|
||||
{% elif not r.manual_only %}
|
||||
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" data-act="creds">설정</button>
|
||||
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" data-act="test">연결 테스트</button>
|
||||
{% endif %}
|
||||
</td>
|
||||
{% endif %}
|
||||
</tr>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</div>
|
||||
{% if is_admin %}
|
||||
<div class="perf-add-row">
|
||||
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" id="perf-add-shop"
|
||||
title="API 연동 없이 실적 일자별 표에 매출을 직접 입력하는 쇼핑몰을 추가">+ 쇼핑몰 추가(수동 입력)</button>
|
||||
<button type="button" class="erp-btn erp-btn-outline erp-btn-sm" id="perf-add-group"
|
||||
title="직접 추가한 쇼핑몰을 묶는 그룹 — 그룹 매출 = 하위 쇼핑몰 매출 합계">+ 그룹 추가</button>
|
||||
<span class="perf-muted">⠿ 를 끌어 순서를 바꾸면 매출 실적 열 순서에 그대로 반영됩니다. 그룹은 직접 추가한 쇼핑몰만 묶을 수 있습니다.</span>
|
||||
{% if not custom_ready %}<span class="perf-notice is-warn">쇼핑몰 직접 추가·그룹은 performance_db 마이그레이션 009
|
||||
(scripts/sql/performance_db_009_custom_marketplaces.sql)을 적용해야 쓸 수 있습니다.</span>{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<p class="perf-foot perf-muted">
|
||||
수수료율은 <b>적용 시작일</b>부터 반영되고, 그 전 실적은 예전 요율로 계산됩니다(과거 실적이 바뀌지 않음).
|
||||
{% if is_admin %}상태에 마우스를 올리면 마지막 연결 테스트 시각과 최근 오류를 볼 수 있습니다.{% endif %}
|
||||
@@ -219,4 +259,4 @@
|
||||
</section>
|
||||
{% endblock %}
|
||||
|
||||
{% block scripts %}<script src="/static/performance.js?v=20261021b" defer></script>{% endblock %}
|
||||
{% block scripts %}<script src="/static/performance.js?v=20261022a" defer></script>{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user