feat(batch): 批次页增加失败占比可点击入口

This commit is contained in:
萝卜
2026-03-17 16:33:32 +08:00
parent 408050666f
commit 5e7987f6b6
2 changed files with 95 additions and 0 deletions

View File

@@ -22,6 +22,10 @@
$fallbackMatched = (int) (data_get($fallbackCounts, 'matched') ?? 0);
$fallbackFailed = (int) (data_get($fallbackCounts, 'failed') ?? 0);
$matchedForRatio = $hasSummary ? $matched : $fallbackMatched;
$failedForRatio = $hasSummary ? $failed : $fallbackFailed;
$failedRatioPct = $matchedForRatio > 0 ? round(($failedForRatio / $matchedForRatio) * 100, 1) : 0.0;
$SYNC_ERROR_KEYWORD_LINK_MAX_LEN = (int) config('saasshop.platform_orders.sync_error_keyword_link_max_len', 200);
$SYNC_ERROR_KEYWORD_LINK_MAX_LEN = max(50, min(1000, $SYNC_ERROR_KEYWORD_LINK_MAX_LEN));
$SYNC_FAILED_REASON_TRUNCATE_LEN = (int) config('saasshop.platform_orders.sync_failed_reason_display_truncate_len', 60);
@@ -69,6 +73,12 @@
<div class="card">
<h3>成功 / 失败</h3>
<div class="metric-number">{{ $hasSummary ? ($success . ' / ' . $failed) : ('- / ' . $fallbackFailed) }}</div>
@if(($governanceLinks['failed'] ?? '') !== '' && $matchedForRatio > 0)
<div class="muted muted-xs">失败占比:
<a class="link" data-role="batch-failed-ratio-link" href="{{ $governanceLinks['failed'] }}">{{ $failedRatioPct }}%</a>
<span class="muted">{{ $failedForRatio }}/{{ $matchedForRatio }}</span>
</div>
@endif
</div>
</div>