From e24e058ab23316ed0f00fab3e5c61110964327df Mon Sep 17 00:00:00 2001 From: fengxiangdebaozi <10845145+fengxiangdebaozi@user.noreply.gitee.com> Date: Fri, 12 Jun 2026 18:32:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend-web/src/components/page-sdebar.css | 52 ++++++++++++++++--- .../src/components/page-sidebar-dark.tsx | 44 ++++++++++++++-- .../src/core/page-layout/sidebar-menu.ts | 2 +- frontend-web/src/pages/StrategyRoutes.tsx | 4 +- .../src/strategy-components/Header.tsx | 17 +++--- 5 files changed, 95 insertions(+), 24 deletions(-) diff --git a/frontend-web/src/components/page-sdebar.css b/frontend-web/src/components/page-sdebar.css index 14497624..d2e9f08a 100644 --- a/frontend-web/src/components/page-sdebar.css +++ b/frontend-web/src/components/page-sdebar.css @@ -43,8 +43,8 @@ width: 100%; height: 75px; margin-top: 13px; - font-family: Noto Sans S Chinese; - font-weight: 500; + font-family: "Source Han Sans SC", "Noto Sans SC", "Noto Sans S Chinese", "Microsoft YaHei", sans-serif; + font-weight: 700; color: #fff; font-size: 20px; display: flex; @@ -111,6 +111,42 @@ word-break: break-all; } +.sidebar-contnet--top-submenu .sidebar-contents { + overflow-y: auto; + overflow-x: hidden; +} + +.sidebar-contnet--top-submenu .item-nav { + height: auto; + min-height: 75px; + padding: 10px 2px; + font-size: 19px; + line-height: 1.35; +} + +.sidebar-contnet--top-submenu .item-nav__label { + width: 3.1em; + max-width: 100%; + padding-left: 0; + letter-spacing: 0; + line-height: 1.35; + text-align: center; + word-break: normal; + overflow-wrap: normal; + white-space: normal; +} + +.sidebar-contnet--top-submenu .item-nav__label--four-char { + width: 2.2em; +} + +.sidebar-contnet--top-submenu .item-nav:hover::after, +.sidebar-contnet--top-submenu .item-nav-active::after, +.sidebar-contnet--top-submenu .item-nav-hovered::after { + top: auto; + bottom: 0; +} + .item-nav-content { width: 155px; height: calc(100vh - 4rem - 20px); @@ -194,10 +230,10 @@ border: 0; background: transparent; padding: 3px 0; - font-family: Noto Sans S Chinese; + font-family: "Source Han Sans SC", "Noto Sans SC", "Noto Sans S Chinese", "Microsoft YaHei", sans-serif; font-size: 18px; line-height: 16px; - font-weight: 500; + font-weight: 700; letter-spacing: 0; color: rgba(255, 255, 255, 0.8); text-align: left; @@ -363,10 +399,10 @@ padding: 0 18px; background: transparent; color: rgba(224, 242, 255, 0.9); - font-family: Noto Sans S Chinese; + font-family: "Source Han Sans SC", "Noto Sans SC", "Noto Sans S Chinese", "Microsoft YaHei", sans-serif; font-size: 16px; line-height: 1; - font-weight: 500; + font-weight: 700; letter-spacing: 0; white-space: nowrap; cursor: pointer; @@ -443,10 +479,10 @@ padding: 0 16px; background: rgba(2, 28, 65, 0.36); color: rgba(221, 242, 255, 0.78); - font-family: Noto Sans S Chinese; + font-family: "Source Han Sans SC", "Noto Sans SC", "Noto Sans S Chinese", "Microsoft YaHei", sans-serif; font-size: 14px; line-height: 1; - font-weight: 500; + font-weight: 700; letter-spacing: 0; white-space: nowrap; cursor: pointer; diff --git a/frontend-web/src/components/page-sidebar-dark.tsx b/frontend-web/src/components/page-sidebar-dark.tsx index 91379f23..15b6f8c8 100644 --- a/frontend-web/src/components/page-sidebar-dark.tsx +++ b/frontend-web/src/components/page-sidebar-dark.tsx @@ -124,6 +124,13 @@ export function PageSidebarDark({ collapsed, onToggleCollapsed }: PageSidebarDar } }; + const handleSecondItemClick = (item: MenuItem) => { + const path = item.path ?? findFirstRoutePath(item.children); + if (path) { + navigate(path); + } + }; + const handleMenuItemClick = (item: MenuItem) => { if (item.children?.length) { toggleExpanded(item.id); @@ -135,6 +142,35 @@ export function PageSidebarDark({ collapsed, onToggleCollapsed }: PageSidebarDar } }; + const activeTopItem = + visibleMenuItems.find((item) => item.id === activeTopId) ?? + visibleMenuItems.find(hasActiveChild) ?? + visibleMenuItems[0]; + const sidebarMenuItemsToRender = inWujieEnv + ? visibleMenuItems + : activeTopItem?.children ?? []; + const isSidebarItemActive = (item: MenuItem) => + inWujieEnv + ? item.id === activeTopId + : item.path + ? pathname === item.path + : hasActiveChild(item); + const handleSidebarItemClick = (item: MenuItem) => { + if (inWujieEnv) { + handleTopItemClick(item); + return; + } + + handleSecondItemClick(item); + }; + const getSidebarLabelClassName = (label: string) => { + if (!inWujieEnv && Array.from(label.trim()).length === 4) { + return "item-nav__label item-nav__label--four-char"; + } + + return "item-nav__label"; + }; + const renderFlyoutMenu = (items: MenuItem[], level = 0) => (