修复平台订单快捷筛选重复锚点冲突

This commit is contained in:
萝卜
2026-03-19 10:55:30 +08:00
parent 4f046a1820
commit 7bd33d0c85
2 changed files with 37 additions and 4 deletions

View File

@@ -311,7 +311,7 @@
</div>
@endif
<div class="card mb-20">
<div class="card mb-20" id="po-quick-filters">
<div class="actions-spread">
<div>
<h3>快捷筛选</h3>
@@ -1024,7 +1024,7 @@
</div>
</div>
<div class="card mb-20">
<div class="card mb-20" id="po-tools-section">
<h3>工具</h3>
<div class="muted mb-10">清除仅影响订单 meta 中的失败标记,不改变订单/订阅状态。</div>
@@ -1197,7 +1197,7 @@
$toolGuards = $toolGuards ?? \App\Support\PlatformOrderToolsGuard::forIndex((array) ($filters ?? []));
@endphp
<div class="tool-grid" data-role="po-tools-grid" aria-label="平台订单工具区网格">
<div class="tool-grid" id="po-tools-grid" data-role="po-tools-grid" aria-label="平台订单工具区网格">
<div class="muted muted-xs mb-10" data-role="po-tools-grid-intro" aria-label="平台订单工具区说明">当前工具区承载导出、批量治理与失败标记清理,请先缩小筛选范围再执行动作;也可使用上方快速定位导航直达目标工具组。</div>
<div class="actions gap-10 mb-10" data-role="po-tools-grid-jump-links" aria-label="平台订单工具区快速定位导航">
<span class="muted muted-xs" data-role="po-tools-grid-jump-links-prefix">快速定位:</span>
@@ -1496,7 +1496,7 @@
</div>
<div class="card list-card">
<div class="card list-card" id="po-list-card">
<div class="list-card-header">
<div>
<h3 class="list-card-title">平台订单列表</h3>

View File

@@ -0,0 +1,33 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexShouldHaveSingleQuickFiltersAnchorTest 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_index_should_have_single_quick_filters_anchor(): void
{
$this->loginAsPlatformAdmin();
$res = $this->get('/admin/platform-orders');
$res->assertOk();
$html = (string) $res->getContent();
$count = substr_count($html, 'id="po-quick-filters"');
$this->assertSame(1, $count, 'po-quick-filters 锚点应只出现一次,避免页面内锚点冲突。');
}
}