chore(admin-ui): introduce list-card component and apply to subscriptions index

This commit is contained in:
萝卜
2026-03-16 01:13:32 +08:00
parent efa4b321e6
commit 6cb53435b1
3 changed files with 79 additions and 3 deletions

View File

@@ -128,6 +128,41 @@
margin:0;
}
/* 可复用List Card列表页统一卡片标题区/操作区/表格区) */
.list-card{
padding:0;
}
.list-card-header{
padding:14px 16px;
display:flex;
align-items:flex-start;
justify-content:space-between;
gap:12px;
}
.list-card-title{
margin:0;
}
.list-card-subtitle{
margin-top:6px;
}
.list-card-body{
border-top:1px solid var(--adm-border-color, #e5e7eb);
padding:0;
}
.list-card-table{
margin:0;
}
.list-card-table th,
.list-card-table td{
padding:12px 12px;
}
/* 可复用PageHeader参考 Ant Design Pro标题区 + 描述 + 右侧操作区) */
.page-header{
width:100%;

View File

@@ -265,9 +265,14 @@
</div>
</div>
<div class="card">
<h3>订阅列表</h3>
<table>
<div class="card list-card">
<div class="list-card-header">
<div>
<h3 class="list-card-title">订阅列表</h3>
</div>
</div>
<div class="list-card-body">
<table class="list-card-table">
<thead>
<tr>
<th>ID</th>
@@ -407,6 +412,7 @@
</tbody>
</table>
</div>
</div>
<div class="pagination-wrap">{{ $subscriptions->links() }}</div>
@endsection

View File

@@ -0,0 +1,35 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminSiteSubscriptionsIndexShouldUseListCardStructureTest 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_admin_site_subscriptions_index_should_use_list_card_structure(): void
{
$this->loginAsPlatformAdmin();
$response = $this->get('/admin/site-subscriptions');
$response->assertOk();
// 护栏:订阅列表区域应使用统一 List Card 结构,便于全站列表页风格统一。
$response->assertSee('list-card', false);
$response->assertSee('list-card-header', false);
$response->assertSee('list-card-body', false);
$response->assertSee('list-card-table', false);
}
}