修复快递资料分页统计首屏不可见 #191

Merged
renshen merged 1 commits from fix/renshen-courier-pagination-visibility into main 2026-09-16 10:23:04 +08:00
2 changed files with 38 additions and 15 deletions

View File

@ -205,13 +205,21 @@
color: var(--vip-danger, #b80000);
}
.courier-information-table-wrap {
overflow-x: auto;
.courier-information-table-panel {
overflow: hidden;
border: 1px solid var(--vip-border, #d8d2c7);
border-radius: 12px;
background: #fff;
}
.courier-information-table-wrap {
overflow: auto;
}
.courier-information-table-wrap.finance-table-scroll-owner {
max-height: max(12rem, calc(100vh - 27.75rem));
}
.courier-information-table {
width: 100%;
min-width: 2260px;
@ -265,6 +273,7 @@
justify-content: space-between;
gap: 12px;
padding: 10px 12px;
border-top: 1px solid var(--vip-border, #d8d2c7);
color: var(--vip-content-muted, #595959);
font-size: 0.75rem;
}
@ -399,8 +408,9 @@
@endif
@if ($tab === 'logs')
<div class="courier-information-table-wrap">
<table class="courier-information-table" style="min-width: 760px" aria-label="快递资料操作日志">
<div class="courier-information-table-panel">
<div class="courier-information-table-wrap">
<table class="courier-information-table" style="min-width: 760px" aria-label="快递资料操作日志">
<thead><tr><th>ID</th><th>快递代码</th><th>操作时间</th><th>创建时间</th><th>修改时间</th></tr></thead>
<tbody>
@forelse ($rows ?? [] as $row)
@ -409,14 +419,16 @@
<tr><td colspan="5" class="courier-information-empty">{{ $courierError ? '数据暂时不可用。' : '当前筛选条件下没有操作日志。' }}</td></tr>
@endforelse
</tbody>
</table>
</table>
</div>
@if ($rows && !$courierError)
<div class="courier-information-footer"><span>第 {{ $rows->currentPage() }} / {{ max($rows->lastPage(), 1) }} 页,本页 {{ $rows->count() }} 条,共 {{ number_format($rows->total()) }} 条</span><nav class="courier-information-pagination" aria-label="操作日志分页"><a class="courier-information-page-link {{ $rows->onFirstPage() ? 'is-disabled' : '' }}" href="{{ $rows->previousPageUrl() ?: '#' }}" aria-label="上一页"><span class="material-icons-outlined" aria-hidden="true">chevron_left</span></a><a class="courier-information-page-link {{ $rows->hasMorePages() ? '' : 'is-disabled' }}" href="{{ $rows->nextPageUrl() ?: '#' }}" aria-label="下一页"><span class="material-icons-outlined" aria-hidden="true">chevron_right</span></a></nav></div>
@endif
</div>
@elseif ($tab === 'express')
<div class="courier-information-table-wrap">
<table class="courier-information-table" aria-label="快递资料">
<div class="courier-information-table-panel">
<div class="courier-information-table-wrap">
<table class="courier-information-table" aria-label="快递资料">
<thead>
<tr>
<th>ID</th><th>快递公司代码</th><th>快递公司名称</th><th>外部编码</th><th>杉橙快递代码</th><th>运费打款方式</th>
@ -449,7 +461,8 @@
<tr><td colspan="26" class="courier-information-empty">{{ $courierError ? '数据暂时不可用。' : '当前筛选条件下没有快递资料。' }}</td></tr>
@endforelse
</tbody>
</table>
</table>
</div>
@if ($rows && !$courierError)
<div class="courier-information-footer">
<span>第 {{ $rows->currentPage() }} / {{ max($rows->lastPage(), 1) }} 页,本页 {{ $rows->count() }} 条,共 {{ number_format($rows->total()) }} 条</span>
@ -461,8 +474,9 @@
@endif
</div>
@elseif ($tab === 'networks')
<div class="courier-information-table-wrap">
<table class="courier-information-table" style="min-width: 1560px" aria-label="快递网点">
<div class="courier-information-table-panel">
<div class="courier-information-table-wrap">
<table class="courier-information-table" style="min-width: 1560px" aria-label="快递网点">
<thead><tr><th>ID</th><th>快递代码</th><th>网点代码</th><th>网点名称</th><th>网点号</th><th>省</th><th>市</th><th>区</th><th>乡镇</th><th>地址</th><th>联系人</th><th>联系电话</th><th>是否启用</th><th>接口平台</th><th>创建时间</th><th>剩余单号</th></tr></thead>
<tbody>
@forelse ($rows ?? [] as $row)
@ -471,14 +485,16 @@
<tr><td colspan="16" class="courier-information-empty">{{ $courierError ? '数据暂时不可用。' : '当前筛选条件下没有网点资料。' }}</td></tr>
@endforelse
</tbody>
</table>
</table>
</div>
@if ($rows && !$courierError)
<div class="courier-information-footer"><span>第 {{ $rows->currentPage() }} / {{ max($rows->lastPage(), 1) }} 页,本页 {{ $rows->count() }} 条,共 {{ number_format($rows->total()) }} 条</span><nav class="courier-information-pagination" aria-label="网点分页"><a class="courier-information-page-link {{ $rows->onFirstPage() ? 'is-disabled' : '' }}" href="{{ $rows->previousPageUrl() ?: '#' }}" aria-label="上一页"><span class="material-icons-outlined" aria-hidden="true">chevron_left</span></a><a class="courier-information-page-link {{ $rows->hasMorePages() ? '' : 'is-disabled' }}" href="{{ $rows->nextPageUrl() ?: '#' }}" aria-label="下一页"><span class="material-icons-outlined" aria-hidden="true">chevron_right</span></a></nav></div>
@endif
</div>
@else
<div class="courier-information-table-wrap">
<table class="courier-information-table" style="min-width: 1120px" aria-label="打款信息">
<div class="courier-information-table-panel">
<div class="courier-information-table-wrap">
<table class="courier-information-table" style="min-width: 1120px" aria-label="打款信息">
<thead><tr><th>ID</th><th>快递代码</th><th>快递名称</th><th>账户类型</th><th>账户</th><th>账户名称</th><th>开户行</th><th>创建时间</th><th>发票信息</th><th>ERP账户ID</th></tr></thead>
<tbody>
@forelse ($rows ?? [] as $row)
@ -487,7 +503,8 @@
<tr><td colspan="10" class="courier-information-empty">{{ $courierError ? '数据暂时不可用。' : '当前筛选条件下没有打款账户。' }}</td></tr>
@endforelse
</tbody>
</table>
</table>
</div>
@if ($rows && !$courierError)
<div class="courier-information-footer"><span>第 {{ $rows->currentPage() }} / {{ max($rows->lastPage(), 1) }} 页,本页 {{ $rows->count() }} 条,共 {{ number_format($rows->total()) }} 条</span><nav class="courier-information-pagination" aria-label="打款信息分页"><a class="courier-information-page-link {{ $rows->onFirstPage() ? 'is-disabled' : '' }}" href="{{ $rows->previousPageUrl() ?: '#' }}" aria-label="上一页"><span class="material-icons-outlined" aria-hidden="true">chevron_left</span></a><a class="courier-information-page-link {{ $rows->hasMorePages() ? '' : 'is-disabled' }}" href="{{ $rows->nextPageUrl() ?: '#' }}" aria-label="下一页"><span class="material-icons-outlined" aria-hidden="true">chevron_right</span></a></nav></div>
@endif

View File

@ -74,7 +74,7 @@ class CourierInformationPageTest extends FeatureTestCase
]);
$this->app->instance(CourierInformationMirrorRepository::class, $repository);
$this->loginAs()
$response = $this->loginAs()
->get(route('business.pages.show', [
'section' => 'courier-payables',
'page' => 'courier-information',
@ -86,6 +86,12 @@ class CourierInformationPageTest extends FeatureTestCase
->assertSeeText('SF')
->assertSeeText('同步正常')
->assertSeeText('可达服务')
->assertSeeText('第 1 / 1 页,本页 1 条,共 1 条')
->assertSee('name="expcode"', false);
$this->assertMatchesRegularExpression(
'/<div class="courier-information-table-panel">\s*<div class="courier-information-table-wrap">.*?<\/table>\s*<\/div>\s*<div class="courier-information-footer">/s',
$response->getContent()
);
}
}