新增财务经营风险管控页面 (#229)
Co-authored-by: 苏木 <594326199@qq.com> Co-committed-by: 苏木 <594326199@qq.com>
This commit is contained in:
parent
cf29972218
commit
f340560a5c
@ -60,6 +60,7 @@ class Title extends Component
|
||||
$context = Str::lower($routeName . ' ' . request()->path());
|
||||
|
||||
$icons = [
|
||||
'financial-risk-control' => 'security',
|
||||
'store-receiving-bills' => 'account_balance_wallet',
|
||||
'marketing-account-bills' => 'account_balance_wallet',
|
||||
'supplier-payables' => 'local_shipping',
|
||||
|
||||
@ -626,6 +626,12 @@ $navigation = [
|
||||
['slug' => 'financial-analysis', 'title' => '财务经营分析表'],
|
||||
],
|
||||
],
|
||||
[
|
||||
'slug' => 'financial-risk-control',
|
||||
'title' => '财务经营风险管控',
|
||||
'icon' => 'security',
|
||||
'pages' => [],
|
||||
],
|
||||
[
|
||||
'slug' => 'financial-sw',
|
||||
'title' => '财务SW报表',
|
||||
|
||||
@ -0,0 +1,56 @@
|
||||
<style>
|
||||
.financial-risk-control-empty {
|
||||
display: flex;
|
||||
min-height: 22rem;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-top: 1.5rem;
|
||||
padding: 2rem;
|
||||
border: 1px solid var(--vip-border, #D8D2C7);
|
||||
border-radius: 0.75rem;
|
||||
background: #FFFFFF;
|
||||
color: #171717;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.financial-risk-control-empty__icon {
|
||||
display: inline-flex;
|
||||
width: 3rem;
|
||||
height: 3rem;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 1rem;
|
||||
border-radius: 50%;
|
||||
background: #F7F0DE;
|
||||
color: var(--vip-content-accent-dark, #856632);
|
||||
}
|
||||
|
||||
.financial-risk-control-empty__icon .material-icons-outlined {
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
.financial-risk-control-empty__title {
|
||||
margin: 0;
|
||||
font-size: 0.875rem;
|
||||
font-weight: 600;
|
||||
line-height: 1.25;
|
||||
}
|
||||
|
||||
.financial-risk-control-empty__description {
|
||||
max-width: 32rem;
|
||||
margin: 0.5rem auto 0;
|
||||
color: #595959;
|
||||
font-size: 0.8125rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
</style>
|
||||
|
||||
<section class="financial-risk-control-empty" aria-labelledby="financial-risk-control-empty-title">
|
||||
<div>
|
||||
<span class="financial-risk-control-empty__icon" aria-hidden="true">
|
||||
<span class="material-icons-outlined">security</span>
|
||||
</span>
|
||||
<h2 class="financial-risk-control-empty__title" id="financial-risk-control-empty-title">暂无风险事项</h2>
|
||||
<p class="financial-risk-control-empty__description">风险规则和数据接入后,相关事项将在此展示。</p>
|
||||
</div>
|
||||
</section>
|
||||
@ -611,6 +611,7 @@
|
||||
|
||||
@php
|
||||
$pageView = null;
|
||||
$sectionView = null;
|
||||
|
||||
if ($page) {
|
||||
$viewName = 'business.pages.' . $section['slug'] . '.' . $page['slug'];
|
||||
@ -622,11 +623,19 @@
|
||||
if (view()->exists($viewName)) {
|
||||
$pageView = $viewName;
|
||||
}
|
||||
} else {
|
||||
$viewName = 'business.pages.' . $section['slug'] . '.index';
|
||||
|
||||
if (view()->exists($viewName)) {
|
||||
$sectionView = $viewName;
|
||||
}
|
||||
}
|
||||
@endphp
|
||||
|
||||
@if (in_array($section['slug'], ['courier-payables', 'courier-payables-final'], true) && empty($page))
|
||||
@include('business.pages.courier-payables.final-workspace')
|
||||
@elseif ($sectionView)
|
||||
@include($sectionView)
|
||||
@elseif (!empty($content) && !empty($content['view']))
|
||||
<section class="business-content-section" aria-label="{{ $activeContentTitle }}">
|
||||
@include($content['view'], $content)
|
||||
|
||||
@ -43,6 +43,27 @@ class NavigationTest extends FeatureTestCase
|
||||
->assertDontSeeText('进销存报表字段和数据来源尚未定义。');
|
||||
}
|
||||
|
||||
public function testFinancialRiskControlPageIsAvailableBetweenFinancialReports(): void
|
||||
{
|
||||
$navigation = BusinessNavigation::all();
|
||||
$slugs = array_column($navigation, 'slug');
|
||||
$riskControlIndex = array_search('financial-risk-control', $slugs, true);
|
||||
|
||||
$this->assertNotFalse($riskControlIndex);
|
||||
$this->assertSame('financial-operations', $slugs[$riskControlIndex - 1]);
|
||||
$this->assertSame('financial-sw', $slugs[$riskControlIndex + 1]);
|
||||
$this->assertSame('财务经营风险管控', $navigation[$riskControlIndex]['title']);
|
||||
$this->assertSame('security', $navigation[$riskControlIndex]['icon']);
|
||||
$this->assertSame([], $navigation[$riskControlIndex]['pages']);
|
||||
|
||||
$this->loginAs()
|
||||
->get(route('business.pages.show', ['section' => 'financial-risk-control']))
|
||||
->assertOk()
|
||||
->assertSeeText('财务经营风险管控')
|
||||
->assertSeeText('暂无风险事项')
|
||||
->assertSee('/workspace/financial-risk-control', false);
|
||||
}
|
||||
|
||||
public function testGroupedNavigationKeepsRestrictedPagePermissions(): void
|
||||
{
|
||||
$this->user->roles()->sync([Role::where('name', 'manager')->firstOrFail()->id]);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user