chore(admin-ui): unify list table empty state styling and class usage

This commit is contained in:
萝卜
2026-03-16 01:40:28 +08:00
parent 61153ddae1
commit 7d291a7906
6 changed files with 84 additions and 3 deletions

View File

@@ -178,6 +178,12 @@
background:var(--adm-table-row-hover-bg, rgba(22, 119, 255, .04)); background:var(--adm-table-row-hover-bg, rgba(22, 119, 255, .04));
} }
.list-card-table .table-empty{
padding:24px 12px;
text-align:center;
background:rgba(15, 23, 42, .02);
}
/* 可复用PageHeader参考 Ant Design Pro标题区 + 描述 + 右侧操作区) */ /* 可复用PageHeader参考 Ant Design Pro标题区 + 描述 + 右侧操作区) */
.page-header{ .page-header{
width:100%; width:100%;

View File

@@ -304,7 +304,7 @@
</tr> </tr>
@empty @empty
<tr> <tr>
<td colspan="12" class="muted">暂无套餐数据,当前阶段先把套餐主表与总台目录立起来,后续可继续接套餐创建、授权项与订阅关联。</td> <td colspan="12" class="muted table-empty">暂无套餐数据,当前阶段先把套餐主表与总台目录立起来,后续可继续接套餐创建、授权项与订阅关联。</td>
</tr> </tr>
@endforelse @endforelse
</tbody> </tbody>

View File

@@ -1544,7 +1544,7 @@
</tr> </tr>
@empty @empty
<tr> <tr>
<td colspan="18" class="muted">暂无平台订单,当前阶段骨架已就位,可继续补套餐下单、支付回执与订阅生效链路。</td> <td colspan="18" class="muted table-empty">暂无平台订单,当前阶段骨架已就位,可继续补套餐下单、支付回执与订阅生效链路。</td>
</tr> </tr>
@endforelse @endforelse
</tbody> </tbody>

View File

@@ -406,7 +406,7 @@
</tr> </tr>
@empty @empty
<tr> <tr>
<td colspan="13" class="muted">暂无订阅数据,当前阶段先把订阅主表与总台目录立起来,后续再接订阅创建/激活/续费链路。</td> <td colspan="13" class="muted table-empty">暂无订阅数据,当前阶段先把订阅主表与总台目录立起来,后续再接订阅创建/激活/续费链路。</td>
</tr> </tr>
@endforelse @endforelse
</tbody> </tbody>

View File

@@ -0,0 +1,41 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminBillingListsEmptyRowsShouldUseTableEmptyClassTest 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_billing_lists_empty_rows_should_use_table_empty_class(): void
{
$this->loginAsPlatformAdmin();
// 使用“不可能命中”的 keyword 强制列表进入空集合,从而验证空态 td 的统一 class。
$kw = '___no_such_keyword_' . uniqid() . '___';
$platformOrders = $this->get('/admin/platform-orders?keyword=' . urlencode($kw));
$platformOrders->assertOk();
$platformOrders->assertSee('table-empty', false);
$subscriptions = $this->get('/admin/site-subscriptions?keyword=' . urlencode($kw));
$subscriptions->assertOk();
$subscriptions->assertSee('table-empty', false);
$plans = $this->get('/admin/plans?keyword=' . urlencode($kw));
$plans->assertOk();
$plans->assertSee('table-empty', false);
}
}

View File

@@ -0,0 +1,34 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminComponentsCssListCardTableEmptyStateShouldBeCenteredTest 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_components_css_list_card_table_empty_state_should_be_centered(): void
{
$this->loginAsPlatformAdmin();
$css = file_get_contents(public_path('css/admin-components.css'));
$this->assertIsString($css);
// 空状态行table-empty应统一居中 + 留白,避免每页空态体验不一致。
$this->assertStringContainsString('.list-card-table .table-empty{', $css);
$this->assertStringContainsString('text-align:center', $css);
$this->assertStringContainsString('padding:24px 12px', $css);
}
}