feat(platform-orders): add copy run_id buttons in bas/bmpa run badges

This commit is contained in:
萝卜
2026-03-18 04:19:27 +08:00
parent f27e395a51
commit 59910e05aa
2 changed files with 40 additions and 0 deletions

View File

@@ -548,6 +548,7 @@
<div class="muted governance-block-body">
<div>
当前 BAS run_id<strong>{{ $batchActivationRunId }}</strong>
<button type="button" class="btn btn-secondary btn-sm" data-action="copy-text" data-copy-text="{{ $batchActivationRunId }}" data-copy-label="BAS run_id">复制 run_id</button>
<span class="muted"></span>
<a class="btn btn-secondary btn-sm" href="{!! $safeFullUrlWithQuery(['batch_activation_run_id' => null, 'page' => null]) !!}">清除 BAS 批次筛选</a>
</div>
@@ -602,6 +603,7 @@
<div class="muted governance-block-body">
<div>
当前 BMPA run_id<strong>{{ $batchBmpaRunId }}</strong>
<button type="button" class="btn btn-secondary btn-sm" data-action="copy-text" data-copy-text="{{ $batchBmpaRunId }}" data-copy-label="BMPA run_id">复制 run_id</button>
<span class="muted"></span>
<a class="btn btn-secondary btn-sm" href="{!! $safeFullUrlWithQuery(['batch_bmpa_run_id' => null, 'page' => null]) !!}">清除 BMPA 批次筛选</a>
</div>

View File

@@ -0,0 +1,38 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexBatchRunIdBadgesShouldRenderCopyButtonsTest extends TestCase
{
use RefreshDatabase;
protected function loginAsPlatformAdmin(): void
{
$this->seed();
$this->post('/admin/login', [
'email' => 'platform.admin@demo.local',
'password' => 'Platform@123456',
])->assertRedirect('/admin');
}
public function test_platform_orders_page_batch_run_id_badges_should_render_copy_buttons(): void
{
$this->loginAsPlatformAdmin();
$html = $this->get('/admin/platform-orders?batch_activation_run_id=BAS_COPY_0001&batch_bmpa_run_id=BMPA_COPY_0001')
->assertOk()
->getContent();
// BAS 徽章区 copy
$this->assertStringContainsString('data-copy-label="BAS run_id"', $html);
$this->assertStringContainsString('data-copy-text="BAS_COPY_0001"', $html);
// BMPA 徽章区 copy
$this->assertStringContainsString('data-copy-label="BMPA run_id"', $html);
$this->assertStringContainsString('data-copy-text="BMPA_COPY_0001"', $html);
}
}