From b22eb61541330f3fbdb3137b428d2b366e208cb4 Mon Sep 17 00:00:00 2001 From: renshen <1005457301@qq.com> Date: Mon, 19 Oct 2026 11:13:49 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=EF=BC=9A=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E6=A1=86=E5=8F=B3=E4=BE=A7=E5=A2=9E=E5=8A=A0=E5=B8=B8?= =?UTF-8?q?=E7=94=A8=E7=BD=91=E5=9D=80=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 搜索框右侧新增书签按钮,点开显示 config/sidebar_links.php 中配置的网址,新标签页打开 - 未配置时给出去哪里加的提示 - 补充导航测试 --- config/sidebar_links.php | 12 ++++ .../components/layouts/admin/menu.blade.php | 67 ++++++++++++++++++- tests/Feature/Settings/NavigationTest.php | 23 ++++++- 3 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 config/sidebar_links.php diff --git a/config/sidebar_links.php b/config/sidebar_links.php new file mode 100644 index 00000000..ba0ae652 --- /dev/null +++ b/config/sidebar_links.php @@ -0,0 +1,12 @@ + '聚水潭 ERP', 'url' => 'https://example.com'], +*/ + +return [ +]; diff --git a/resources/views/components/layouts/admin/menu.blade.php b/resources/views/components/layouts/admin/menu.blade.php index 573b1a4f..23406227 100644 --- a/resources/views/components/layouts/admin/menu.blade.php +++ b/resources/views/components/layouts/admin/menu.blade.php @@ -162,6 +162,32 @@ } .prototype-tag-filter input::placeholder { color: rgba(240, 228, 191, 0.45); } .prototype-tag-filter input:focus { border-color: var(--vip-sidebar-gold, #F0E4BF); background: rgba(240, 228, 191, 0.12); } + .prototype-tag-filter__row { display: flex; align-items: center; gap: 0.375rem; } + .prototype-tag-filter__row input { flex: 1 1 auto; width: auto; min-width: 0; } + .sidebar-links__toggle { + display: inline-flex; + height: 2rem; + flex: 0 0 auto; + align-items: center; + gap: 0.125rem; + padding: 0 0.4rem; + border: 1px solid rgba(240, 228, 191, 0.25); + border-radius: 0.375rem; + background: rgba(240, 228, 191, 0.06); + color: var(--vip-sidebar-gold, #F0E4BF); + font: inherit; + font-size: 0.6875rem; + cursor: pointer; + } + .sidebar-links__toggle:hover, + .sidebar-links__toggle[aria-expanded="true"] { border-color: rgba(240, 228, 191, 0.45); background: rgba(240, 228, 191, 0.14); } + .sidebar-links__toggle:focus-visible { outline: 2px solid var(--vip-sidebar-gold, #F0E4BF); outline-offset: 2px; } + .sidebar-links__toggle .material-icons-outlined { font-size: 1rem; } + .sidebar-links__panel { margin: 0.375rem 0 0; padding: 0.25rem; border: 1px solid rgba(240, 228, 191, 0.18); border-radius: 0.375rem; background: rgba(5, 5, 6, 0.4); max-height: 15rem; overflow-y: auto; } + .sidebar-links__item { display: flex; align-items: center; gap: 0.5rem; padding: 0.4rem 0.5rem; border-radius: 0.25rem; color: var(--vip-sidebar-gold-soft, #DDD0AA); font-size: 0.75rem; text-decoration: none; } + .sidebar-links__item:hover { background: rgba(240, 228, 191, 0.08); color: var(--vip-sidebar-gold, #F0E4BF); } + .sidebar-links__item .material-icons-outlined { font-size: 0.875rem; } + .sidebar-links__empty { padding: 0.4rem 0.5rem; color: rgba(240, 228, 191, 0.55); font-size: 0.6875rem; line-height: 1.4; } .prototype-tag-empty { padding: 0.35rem 0.75rem; color: rgba(240, 228, 191, 0.5); font-size: 0.75rem; } .prototype-tag-navigation { margin: 0 -0.25rem 1.25rem; } .prototype-tag-group { margin-bottom: 1.15rem; } @@ -175,7 +201,46 @@
- + @php + $sidebarLinks = collect(config('sidebar_links', [])) + ->filter(fn ($link) => is_array($link) && ! empty($link['url'])) + ->values(); + @endphp +
+ + +
+ +
diff --git a/tests/Feature/Settings/NavigationTest.php b/tests/Feature/Settings/NavigationTest.php index 525cca47..0fbe7a51 100644 --- a/tests/Feature/Settings/NavigationTest.php +++ b/tests/Feature/Settings/NavigationTest.php @@ -205,7 +205,28 @@ class NavigationTest extends FeatureTestCase ->assertSee('data-open-tabs-list', false) ->assertSee('caiwu.open-pages.v1.', false) // 目录 iframe 里的子页面不再重复渲染这条标签栏。 - ->assertSee('window.self !== window.top', false); + ->assertSee('window.self !== window.top', false) + // 搜索框右侧的常用网址入口。 + ->assertSee('data-sidebar-links-toggle', false) + ->assertSee('data-sidebar-links', false); + } + + public function test_sidebar_quick_links_render_from_config(): void + { + config(['sidebar_links' => [ + ['title' => '聚水潭 ERP', 'url' => 'https://example.com/jst'], + ['title' => '京麦工作台', 'url' => 'https://example.com/jd'], + ]]); + + $this->loginAs() + ->get(route('business.pages.show', [ + 'section' => 'financial-risk-control', + 'page' => 'store-violation-alert', + ])) + ->assertOk() + ->assertSee('href="https://example.com/jst"', false) + ->assertSeeText('聚水潭 ERP') + ->assertSee('target="_blank"', false); } public function testProcessStatisticsPageIsAvailableUnderRiskControl(): void