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