feat(admin-dashboard): add 7d trend meta summary
This commit is contained in:
@@ -322,6 +322,25 @@
|
||||
box-shadow:var(--adm-shadow-sm);
|
||||
}
|
||||
|
||||
/* 迷你图表的摘要行(用于展示合计/峰值等口径,参考 Ant Design Pro 的 card extra/meta 文案) */
|
||||
.adm-mini-meta{
|
||||
margin-top:8px;
|
||||
display:flex;
|
||||
flex-wrap:wrap;
|
||||
gap:6px;
|
||||
align-items:center;
|
||||
color:var(--adm-text-secondary, #64748b);
|
||||
font-size:12px;
|
||||
}
|
||||
|
||||
.adm-mini-meta-item strong{
|
||||
color:var(--adm-text, #0f172a);
|
||||
}
|
||||
|
||||
.adm-mini-meta-sep{
|
||||
color:var(--adm-text-muted, #94a3b8);
|
||||
}
|
||||
|
||||
.adm-mini-chart.is-empty,
|
||||
.adm-mini-rank.is-empty,
|
||||
.adm-mini-share.is-empty{
|
||||
|
||||
@@ -97,6 +97,24 @@
|
||||
|
||||
<div class="adm-mini-chart" data-role="platform-order-trend-7d-chart" data-points='@json($trendPoints)'></div>
|
||||
|
||||
@php
|
||||
$trendPaidTotal = 0.0;
|
||||
$trendOrdersTotal = 0;
|
||||
$trendPaidMax = 0.0;
|
||||
foreach ($trendRows as $r) {
|
||||
$trendPaidTotal += (float) ($r['paid_sum'] ?? 0);
|
||||
$trendOrdersTotal += (int) ($r['count'] ?? 0);
|
||||
$trendPaidMax = max($trendPaidMax, (float) ($r['paid_sum'] ?? 0));
|
||||
}
|
||||
@endphp
|
||||
<div class="adm-mini-meta" data-role="platform-order-trend-7d-meta">
|
||||
<span class="adm-mini-meta-item">7天合计已付:<strong>¥{{ number_format($trendPaidTotal, 2) }}</strong></span>
|
||||
<span class="adm-mini-meta-sep">|</span>
|
||||
<span class="adm-mini-meta-item">7天订单数:<strong>{{ (int) $trendOrdersTotal }}</strong></span>
|
||||
<span class="adm-mini-meta-sep">|</span>
|
||||
<span class="adm-mini-meta-item">峰值:<strong>¥{{ number_format($trendPaidMax, 2) }}</strong></span>
|
||||
</div>
|
||||
|
||||
<table class="mt-10" data-role="platform-order-trend-7d">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -79,6 +79,7 @@ class AdminDashboardPlatformOrderTrend7dShouldRenderTest extends TestCase
|
||||
|
||||
$res->assertSee('data-role="platform-order-trend-7d"', false);
|
||||
$res->assertSee('data-role="platform-order-trend-7d-chart"', false);
|
||||
$res->assertSee('data-role="platform-order-trend-7d-meta"', false);
|
||||
$res->assertSee('近7天平台订单(按天)');
|
||||
|
||||
// 断言日期行出现(只验证两个代表点)
|
||||
|
||||
Reference in New Issue
Block a user