59 lines
3.1 KiB
HTML
59 lines
3.1 KiB
HTML
{# 分析報表第二層分頁:保留頁面內容與圖表邏輯,只提供一致的報表切換入口。 #}
|
|
{% set _analysis_active = active_page|default('') %}
|
|
{% set _period = analysis_period|default({}) %}
|
|
{% set _period_start = _period.start_date|default('') %}
|
|
{% set _period_end = _period.end_date|default('') %}
|
|
{% set _period_start_month = _period.start_month|default('') %}
|
|
{% set _period_end_month = _period.end_month|default('') %}
|
|
{% set _sales_href = '/sales_analysis' %}
|
|
{% set _daily_href = '/daily_sales' %}
|
|
{% set _growth_href = '/growth_analysis' %}
|
|
{% set _monthly_href = '/monthly_summary_analysis' %}
|
|
{% if _period_start and _period_end %}
|
|
{% set _sales_href = '/sales_analysis?start_date=' ~ _period_start ~ '&end_date=' ~ _period_end %}
|
|
{% endif %}
|
|
{% if _period.is_single_day|default(false) and _period_end %}
|
|
{% set _daily_href = '/daily_sales?date=' ~ _period_end %}
|
|
{% elif _period_end_month %}
|
|
{% set _daily_href = '/daily_sales?month=' ~ _period_end_month %}
|
|
{% endif %}
|
|
{% if _period_start_month and _period_end_month %}
|
|
{% set _growth_href = '/growth_analysis?start_month=' ~ _period_start_month ~ '&end_month=' ~ _period_end_month %}
|
|
{% set _monthly_href = '/monthly_summary_analysis?start_month=' ~ _period_start_month ~ '&end_month=' ~ _period_end_month %}
|
|
{% endif %}
|
|
<nav class="analysis-report-tabs" aria-label="分析報表分頁">
|
|
<a class="analysis-report-tab {% if _analysis_active == 'sales' %}is-active{% endif %}"
|
|
{% if _analysis_active == 'sales' %}aria-current="page"{% endif %}
|
|
href="{{ _sales_href }}" data-analysis-target="sales">
|
|
<i class="fas fa-chart-bar"></i>業績分析
|
|
</a>
|
|
<a class="analysis-report-tab {% if _analysis_active == 'daily_sales' %}is-active{% endif %}"
|
|
{% if _analysis_active == 'daily_sales' %}aria-current="page"{% endif %}
|
|
href="{{ _daily_href }}" data-analysis-target="daily_sales">
|
|
<i class="fas fa-calendar-day"></i>當日業績
|
|
</a>
|
|
<a class="analysis-report-tab {% if _analysis_active == 'growth' %}is-active{% endif %}"
|
|
{% if _analysis_active == 'growth' %}aria-current="page"{% endif %}
|
|
href="{{ _growth_href }}" data-analysis-target="growth">
|
|
<i class="fas fa-chart-line"></i>成長分析
|
|
</a>
|
|
<a class="analysis-report-tab {% if _analysis_active == 'monthly' %}is-active{% endif %}"
|
|
{% if _analysis_active == 'monthly' %}aria-current="page"{% endif %}
|
|
href="{{ _monthly_href }}" data-analysis-target="monthly">
|
|
<i class="fas fa-table"></i>月份總表
|
|
</a>
|
|
{% if metabase_url or grist_url %}
|
|
<span class="analysis-report-tabs-spacer" aria-hidden="true"></span>
|
|
{% endif %}
|
|
{% if metabase_url %}
|
|
<a class="analysis-report-tab is-external {% if _analysis_active == 'metabase' %}is-active{% endif %}" href="{{ metabase_url }}">
|
|
<i class="fas fa-chart-pie"></i>自訂圖表
|
|
</a>
|
|
{% endif %}
|
|
{% if grist_url %}
|
|
<a class="analysis-report-tab is-external {% if _analysis_active == 'grist' %}is-active{% endif %}" href="{{ grist_url }}">
|
|
<i class="fas fa-table-cells"></i>資料協作
|
|
</a>
|
|
{% endif %}
|
|
</nav>
|