chore(admin-ui): introduce list-card component and apply to subscriptions index
This commit is contained in:
@@ -128,6 +128,41 @@
|
|||||||
margin:0;
|
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:标题区 + 描述 + 右侧操作区) */
|
/* 可复用:PageHeader(参考 Ant Design Pro:标题区 + 描述 + 右侧操作区) */
|
||||||
.page-header{
|
.page-header{
|
||||||
width:100%;
|
width:100%;
|
||||||
|
|||||||
@@ -265,9 +265,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<div class="card list-card">
|
||||||
<h3>订阅列表</h3>
|
<div class="list-card-header">
|
||||||
<table>
|
<div>
|
||||||
|
<h3 class="list-card-title">订阅列表</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="list-card-body">
|
||||||
|
<table class="list-card-table">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
@@ -406,6 +411,7 @@
|
|||||||
@endforelse
|
@endforelse
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="pagination-wrap">{{ $subscriptions->links() }}</div>
|
<div class="pagination-wrap">{{ $subscriptions->links() }}</div>
|
||||||
|
|||||||
@@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user