fix: 独立账户页只展示所选账户类型 (#1147)

独立账户页移除账户类型切换栏,只展示通过卡片进入时所选的账户类型。
This commit is contained in:
shanshi 2026-11-13 10:23:55 +08:00
parent 45dade3c26
commit 81ef31a657
2 changed files with 14 additions and 9 deletions

View File

@ -785,7 +785,7 @@
@endif
<div class="ledger-column-picker" data-ledger-column-picker data-column-storage-key="caiwu.financial-ledger.accounts.preferences.v5.{{ auth()->id() }}.{{ company_id() }}">
<button class="ledger-btn" type="button" data-ledger-column-toggle aria-expanded="false"><span class="material-icons-outlined" aria-hidden="true">view_column</span>列设置</button>
<div class="ledger-column-panel" data-ledger-column-panel role="group" aria-label="选择账户总表展示列" hidden>
<div class="ledger-column-panel" data-ledger-column-panel role="group" aria-label="选择{{ $standaloneAccountView === null ? '账户总表' : $standaloneAccountTitle }}展示列" hidden>
<p class="ledger-column-help">拖动字段可调整列顺序;拖动表头右侧边界可调整列宽,双击边界恢复默认。</p>
<div class="ledger-column-options" data-ledger-column-options></div>
<div class="ledger-column-actions"><span data-ledger-column-count></span><div class="ledger-column-action-group"><button type="button" data-ledger-column-all>显示全部</button><button type="button" data-ledger-column-reset>恢复默认</button></div></div>
@ -794,13 +794,15 @@
<div class="ledger-actions"><button class="ledger-btn primary" type="submit"><span class="material-icons-outlined">search</span>查询</button><a class="ledger-btn" href="{{ $accountViewResetUrl }}"><span class="material-icons-outlined">refresh</span>重置</a><a class="ledger-btn" href="{{ route('business.financial-ledger.accounts.template') }}" download data-account-template-download><span class="material-icons-outlined">download</span>导出录入模板</a></div>
<div class="ledger-download-status" data-account-template-download-status role="status" aria-live="polite" hidden>下载已开始,请查看浏览器下载目录。</div>
</form>
<nav class="ledger-subtabbar" aria-label="账户总表账户分类">
<a class="ledger-subtab {{ $accountView === 'bank' ? 'is-active' : '' }}" href="{{ $accountViewUrl('bank') }}" @if ($accountView === 'bank') aria-current="page" @endif>银行账户</a>
<a class="ledger-subtab {{ $accountView === 'non_store' ? 'is-active' : '' }}" href="{{ $accountViewUrl('non_store') }}" @if ($accountView === 'non_store') aria-current="page" @endif>支付宝</a>
<a class="ledger-subtab {{ $accountView === 'wangshang' ? 'is-active' : '' }}" href="{{ $accountViewUrl('wangshang') }}" @if ($accountView === 'wangshang') aria-current="page" @endif>网商银行</a>
<a class="ledger-subtab {{ $accountView === 'wallet' ? 'is-active' : '' }}" href="{{ $accountViewUrl('wallet') }}" @if ($accountView === 'wallet') aria-current="page" @endif>网银账户</a>
<a class="ledger-subtab {{ $accountView === 'other' ? 'is-active' : '' }}" href="{{ $accountViewUrl('other') }}" @if ($accountView === 'other') aria-current="page" @endif>其他账户</a>
</nav>
@if ($standaloneAccountView === null)
<nav class="ledger-subtabbar" aria-label="账户总表账户分类">
<a class="ledger-subtab {{ $accountView === 'bank' ? 'is-active' : '' }}" href="{{ $accountViewUrl('bank') }}" @if ($accountView === 'bank') aria-current="page" @endif>银行账户</a>
<a class="ledger-subtab {{ $accountView === 'non_store' ? 'is-active' : '' }}" href="{{ $accountViewUrl('non_store') }}" @if ($accountView === 'non_store') aria-current="page" @endif>支付宝</a>
<a class="ledger-subtab {{ $accountView === 'wangshang' ? 'is-active' : '' }}" href="{{ $accountViewUrl('wangshang') }}" @if ($accountView === 'wangshang') aria-current="page" @endif>网商银行</a>
<a class="ledger-subtab {{ $accountView === 'wallet' ? 'is-active' : '' }}" href="{{ $accountViewUrl('wallet') }}" @if ($accountView === 'wallet') aria-current="page" @endif>网银账户</a>
<a class="ledger-subtab {{ $accountView === 'other' ? 'is-active' : '' }}" href="{{ $accountViewUrl('other') }}" @if ($accountView === 'other') aria-current="page" @endif>其他账户</a>
</nav>
@endif
@if ($canEditAccounts)
<dialog class="ledger-company-dialog" data-ledger-company-dialog data-ledger-accounts-url="{{ $accountViewResetUrl }}" aria-labelledby="ledger-company-dialog-title">
<form class="ledger-company-form" method="POST" action="{{ route('business.financial-ledger.accounts.store') }}" data-ledger-company-form>
@ -1110,7 +1112,7 @@
@include('business.pages.financial-ledger.partials.pagination', [
'rows' => $ledgerAccounts,
'paginationKey' => 'accounts',
'paginationLabel' => '账户总表分页',
'paginationLabel' => ($standaloneAccountView === null ? '账户总表' : $standaloneAccountTitle) . '分页',
])
</section>

View File

@ -223,6 +223,9 @@ class FinanceLedgerNavigationTest extends FeatureTestCase
$this->assertStringContainsString('data-ledger-standalone-account="' . $view . '"', $html);
$this->assertStringNotContainsString('data-ledger-tab="flows"', $html);
$this->assertStringNotContainsString('aria-label="账户总表账户分类"', $html);
$this->assertStringContainsString('账户基本信息 - ' . $definition['title'], $html);
$this->assertStringContainsString('aria-label="' . $definition['title'] . '分页"', $html);
$this->assertStringContainsString('action="' . e($url) . '"', $html);
$this->assertStringContainsString('href="' . e($backUrl) . '"', $html);
}