From f340560a5ca8e594dcc50b405a3741a1a58417eb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=8B=8F=E6=9C=A8?= <594326199@qq.com>
Date: Mon, 21 Sep 2026 11:13:38 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=B4=A2=E5=8A=A1=E7=BB=8F?=
=?UTF-8?q?=E8=90=A5=E9=A3=8E=E9=99=A9=E7=AE=A1=E6=8E=A7=E9=A1=B5=E9=9D=A2?=
=?UTF-8?q?=20(#229)=20Co-authored-by:=20=E8=8B=8F=E6=9C=A8=20<594326199@q?=
=?UTF-8?q?q.com>=20Co-committed-by:=20=E8=8B=8F=E6=9C=A8=20<594326199@qq.?=
=?UTF-8?q?com>?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/View/Components/Title.php | 1 +
config/business_navigation.php | 6 ++
.../financial-risk-control/index.blade.php | 56 +++++++++++++++++++
resources/views/business/pages/show.blade.php | 9 +++
tests/Feature/Settings/NavigationTest.php | 21 +++++++
5 files changed, 93 insertions(+)
create mode 100644 resources/views/business/pages/financial-risk-control/index.blade.php
diff --git a/app/View/Components/Title.php b/app/View/Components/Title.php
index 63a7d9ef..a78647e2 100644
--- a/app/View/Components/Title.php
+++ b/app/View/Components/Title.php
@@ -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',
diff --git a/config/business_navigation.php b/config/business_navigation.php
index afb6c2ce..00e865cf 100644
--- a/config/business_navigation.php
+++ b/config/business_navigation.php
@@ -626,6 +626,12 @@ $navigation = [
['slug' => 'financial-analysis', 'title' => '财务经营分析表'],
],
],
+ [
+ 'slug' => 'financial-risk-control',
+ 'title' => '财务经营风险管控',
+ 'icon' => 'security',
+ 'pages' => [],
+ ],
[
'slug' => 'financial-sw',
'title' => '财务SW报表',
diff --git a/resources/views/business/pages/financial-risk-control/index.blade.php b/resources/views/business/pages/financial-risk-control/index.blade.php
new file mode 100644
index 00000000..00f7855a
--- /dev/null
+++ b/resources/views/business/pages/financial-risk-control/index.blade.php
@@ -0,0 +1,56 @@
+
+
+
+
+
+ security
+
+
暂无风险事项
+
风险规则和数据接入后,相关事项将在此展示。
+
+
diff --git a/resources/views/business/pages/show.blade.php b/resources/views/business/pages/show.blade.php
index a0a6a752..457f58f7 100644
--- a/resources/views/business/pages/show.blade.php
+++ b/resources/views/business/pages/show.blade.php
@@ -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']))
@include($content['view'], $content)
diff --git a/tests/Feature/Settings/NavigationTest.php b/tests/Feature/Settings/NavigationTest.php
index e851fb90..12d705f7 100644
--- a/tests/Feature/Settings/NavigationTest.php
+++ b/tests/Feature/Settings/NavigationTest.php
@@ -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]);