From 9e40e7348151ee057f5d1933943a435b19aa1848 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Tue, 17 Mar 2026 13:37:15 +0800 Subject: [PATCH] ui(platform-orders): add run_id badge quick governance links --- .../admin/platform_orders/index.blade.php | 28 ++++++++++++- ...onRunIdBadgeQuickLinksShouldRenderTest.php | 41 +++++++++++++++++++ 2 files changed, 68 insertions(+), 1 deletion(-) create mode 100644 tests/Feature/AdminPlatformOrderIndexBatchActivationRunIdBadgeQuickLinksShouldRenderTest.php diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index 03874a8..ef42841 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -503,7 +503,25 @@ $batchActivationRunId = trim((string) ($filters['batch_activation_run_id'] ?? '')); @endphp @if($batchActivationRunId !== '') -
+ @php + $runGoFailedUrl = $buildQuickFilterUrl([ + 'batch_activation_run_id' => $batchActivationRunId, + 'sync_status' => 'failed', + 'page' => null, + ]); + $runGoUnsyncedUrl = $buildQuickFilterUrl([ + 'batch_activation_run_id' => $batchActivationRunId, + 'sync_status' => 'unsynced', + 'page' => null, + ]); + $runGoSyncableUrl = $buildQuickFilterUrl([ + 'batch_activation_run_id' => $batchActivationRunId, + 'sync_status' => 'unsynced', + 'syncable_only' => '1', + 'page' => null, + ]); + @endphp +
当前批次筛选
@@ -511,6 +529,14 @@ 清除批次筛选
+
+ 快速查看: + 本批次失败 + + 本批次未同步 + + 本批次可同步重试 +
@endif diff --git a/tests/Feature/AdminPlatformOrderIndexBatchActivationRunIdBadgeQuickLinksShouldRenderTest.php b/tests/Feature/AdminPlatformOrderIndexBatchActivationRunIdBadgeQuickLinksShouldRenderTest.php new file mode 100644 index 0000000..8db2e47 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderIndexBatchActivationRunIdBadgeQuickLinksShouldRenderTest.php @@ -0,0 +1,41 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_platform_orders_page_should_render_run_id_badge_quick_links(): void + { + $this->loginAsPlatformAdmin(); + + $runId = 'BAS_TEST_BADGE_0001'; + $html = $this->get('/admin/platform-orders?batch_activation_run_id=' . $runId) + ->assertOk() + ->getContent(); + + $this->assertStringContainsString('当前 run_id:' . $runId . '', $html); + + // 本批次失败 + $this->assertStringContainsString('batch_activation_run_id=' . $runId, $html); + $this->assertStringContainsString('sync_status=failed', $html); + + // 本批次可同步重试(unsynced + syncable_only=1) + $this->assertStringContainsString('syncable_only=1', $html); + $this->assertStringContainsString('sync_status=unsynced', $html); + } +}