platform_orders index: add is-compact class and compact density styles

This commit is contained in:
萝卜
2026-03-14 12:52:59 +00:00
parent f89cfc206a
commit 70d67db89b
3 changed files with 41 additions and 1 deletions

View File

@@ -86,6 +86,10 @@
.platform-orders-table .col-optional{display:none;}
.platform-orders-table.is-full .col-optional{display:table-cell;}
/* 平台订单列表(精简视图):进一步收敛信息密度 */
.platform-orders-table.is-compact td{padding-top:8px;padding-bottom:8px;}
.platform-orders-table.is-compact .muted-xs{font-size:12px;}
/* 平台订单列表:精简视图也要可达的治理提示(对账/退款不一致) */
.platform-orders-table .governance-hints{margin-bottom:6px;}
.platform-orders-table .governance-hint{line-height:1.4;}

View File

@@ -996,7 +996,7 @@
</div>
</div>
<div class="table-wrap">
<table class="table-nowrap platform-orders-table {{ $isFullView ? 'is-full' : '' }}">
<table class="table-nowrap platform-orders-table {{ $isFullView ? 'is-full' : 'is-compact' }}">
<thead>
<tr>
<th>ID</th>

View File

@@ -0,0 +1,36 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformOrderIndexCompactViewHasIsCompactClassTest 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_compact_view_table_has_is_compact_class_full_view_has_is_full(): void
{
$this->loginAsPlatformAdmin();
$this->get('/admin/platform-orders')
->assertOk()
->assertSee('platform-orders-table is-compact', false)
->assertDontSee('platform-orders-table is-full', false);
$this->get('/admin/platform-orders?view=full')
->assertOk()
->assertSee('platform-orders-table is-full', false)
->assertDontSee('platform-orders-table is-compact', false);
}
}