代码修改
This commit is contained in:
1 parent
3ad920457a
commit
e24e058ab2
5 files changed
+95
-24
No files matched your search
@@ -43,8 +43,8 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
height: 75px;
|
height: 75px;
|
||||||
margin-top: 13px;
|
margin-top: 13px;
|
||||||
font-family: Noto Sans S Chinese;
|
font-family: "Source Han Sans SC", "Noto Sans SC", "Noto Sans S Chinese", "Microsoft YaHei", sans-serif;
|
||||||
font-weight: 500;
|
font-weight: 700;
|
||||||
color: #fff;
|
color: #fff;
|
||||||
font-size: 20px;
|
font-size: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@@ -111,6 +111,42 @@
|
|||||||
word-break: break-all;
|
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 {
|
.item-nav-content {
|
||||||
width: 155px;
|
width: 155px;
|
||||||
height: calc(100vh - 4rem - 20px);
|
height: calc(100vh - 4rem - 20px);
|
||||||
@@ -194,10 +230,10 @@
|
|||||||
border: 0;
|
border: 0;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
padding: 3px 0;
|
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;
|
font-size: 18px;
|
||||||
line-height: 16px;
|
line-height: 16px;
|
||||||
font-weight: 500;
|
font-weight: 700;
|
||||||
letter-spacing: 0;
|
letter-spacing: 0;
|
||||||
color: rgba(255, 255, 255, 0.8);
|
color: rgba(255, 255, 255, 0.8);
|
||||||
text-align: left;
|
text-align: left;
|
||||||
@@ -363,10 +399,10 @@
|
|||||||
padding: 0 18px;
|
padding: 0 18px;
|
||||||
background: transparent;
|
background: transparent;
|
||||||
color: rgba(224, 242, 255, 0.9);
|
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;
|
font-size: 16px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
font-weight: 500;
|
font-weight: 700;
|
||||||
letter-spacing: 0;
|
letter-spacing: 0;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
@@ -443,10 +479,10 @@
|
|||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
background: rgba(2, 28, 65, 0.36);
|
background: rgba(2, 28, 65, 0.36);
|
||||||
color: rgba(221, 242, 255, 0.78);
|
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;
|
font-size: 14px;
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
font-weight: 500;
|
font-weight: 700;
|
||||||
letter-spacing: 0;
|
letter-spacing: 0;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
|||||||
@@ -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) => {
|
const handleMenuItemClick = (item: MenuItem) => {
|
||||||
if (item.children?.length) {
|
if (item.children?.length) {
|
||||||
toggleExpanded(item.id);
|
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) => (
|
const renderFlyoutMenu = (items: MenuItem[], level = 0) => (
|
||||||
<div className={`sidebar-flyout-list sidebar-flyout-list--level-${level}`}>
|
<div className={`sidebar-flyout-list sidebar-flyout-list--level-${level}`}>
|
||||||
{items.map((item) => {
|
{items.map((item) => {
|
||||||
@@ -181,7 +217,7 @@ export function PageSidebarDark({ collapsed, onToggleCollapsed }: PageSidebarDar
|
|||||||
return (
|
return (
|
||||||
<aside className={`sidebar-contnet ${inWujieEnv ? "" : "sidebar-contnet--top-submenu"}`}>
|
<aside className={`sidebar-contnet ${inWujieEnv ? "" : "sidebar-contnet--top-submenu"}`}>
|
||||||
<div className="sidebar-contents">
|
<div className="sidebar-contents">
|
||||||
{visibleMenuItems.map((item) => (
|
{sidebarMenuItemsToRender.map((item) => (
|
||||||
<div
|
<div
|
||||||
key={item.id}
|
key={item.id}
|
||||||
className="item-nav-group"
|
className="item-nav-group"
|
||||||
@@ -198,10 +234,10 @@ export function PageSidebarDark({ collapsed, onToggleCollapsed }: PageSidebarDar
|
|||||||
<div className="item-nav-wrap">
|
<div className="item-nav-wrap">
|
||||||
<button
|
<button
|
||||||
type="button"
|
type="button"
|
||||||
className={`item-nav ${item.id === activeTopId ? "item-nav-active" : ""} ${hoveredTopId === item.id ? "item-nav-hovered" : ""}`}
|
className={`item-nav ${isSidebarItemActive(item) ? "item-nav-active" : ""} ${hoveredTopId === item.id ? "item-nav-hovered" : ""}`}
|
||||||
onClick={() => handleTopItemClick(item)}
|
onClick={() => handleSidebarItemClick(item)}
|
||||||
>
|
>
|
||||||
<span className="item-nav__label">{item.label}</span>
|
<span className={getSidebarLabelClassName(item.label)}>{item.label}</span>
|
||||||
</button>
|
</button>
|
||||||
{inWujieEnv && item.children?.length && hoveredTopId === item.id ? (
|
{inWujieEnv && item.children?.length && hoveredTopId === item.id ? (
|
||||||
<span className="item-nav-hover-bridge" aria-hidden="true" />
|
<span className="item-nav-hover-bridge" aria-hidden="true" />
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ export const sidebarMenuItems: MenuItem[] = [
|
|||||||
// { id: "expert-qa", label: "专家问答", icon: Brain, path: "/page/strategy/qa/expert-qa" },
|
// { id: "expert-qa", label: "专家问答", icon: Brain, path: "/page/strategy/qa/expert-qa" },
|
||||||
{
|
{
|
||||||
id: "qa-zzjc",
|
id: "qa-zzjc",
|
||||||
label: "zzjc支持",
|
label: "zzJC支持",
|
||||||
icon: Bot,
|
icon: Bot,
|
||||||
path: "/page/strategy/agents/6bf/chats/new",
|
path: "/page/strategy/agents/6bf/chats/new",
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -78,11 +78,11 @@ export default function StrategyRoutes() {
|
|||||||
<Route index element={<Navigate to="xk-task-jc" replace />} />
|
<Route index element={<Navigate to="xk-task-jc" replace />} />
|
||||||
<Route
|
<Route
|
||||||
path="xk-task-jc"
|
path="xk-task-jc"
|
||||||
element={<TaskXkFrom gopath="#/pageIndie/pageHome/pageSwrw" />}
|
element={<TaskXkFrom gopath="/#/pageIndie/pageHome/pageSwrw" />}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="xk-task-dispatch"
|
path="xk-task-dispatch"
|
||||||
element={<TaskXkFrom gopath="#/pageIndie/pageJczl" />}
|
element={<TaskXkFrom gopath="/#/pageIndie/pageJczl" />}
|
||||||
/>
|
/>
|
||||||
<Route
|
<Route
|
||||||
path="effect-task-pg"
|
path="effect-task-pg"
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ const Header = ({ collapsed }: HeaderProps) => {
|
|||||||
const { pathname } = useLocation();
|
const { pathname } = useLocation();
|
||||||
const isAdmin = getStoredAuth()?.system_role === "admin";
|
const isAdmin = getStoredAuth()?.system_role === "admin";
|
||||||
const visibleMenuItems = useSidebarMenuItems(!!isAdmin);
|
const visibleMenuItems = useSidebarMenuItems(!!isAdmin);
|
||||||
const showTopSubmenu = isDark && !collapsed && !isWujieEnv();
|
const showTopNav = isDark && !collapsed && !isWujieEnv();
|
||||||
|
|
||||||
const hasActiveChild = (item: MenuItem): boolean => {
|
const hasActiveChild = (item: MenuItem): boolean => {
|
||||||
if (item.path && pathname === item.path) {
|
if (item.path && pathname === item.path) {
|
||||||
@@ -64,11 +64,10 @@ const Header = ({ collapsed }: HeaderProps) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const activeTopItem = visibleMenuItems.find(hasActiveChild);
|
const activeTopItem = visibleMenuItems.find(hasActiveChild);
|
||||||
const topSubNavItems = activeTopItem?.children ?? [];
|
const activeSecondItem = activeTopItem?.children?.find(hasActiveChild);
|
||||||
const activeSecondItem = topSubNavItems.find(hasActiveChild);
|
|
||||||
const thirdSubNavItems = activeSecondItem?.children ?? [];
|
const thirdSubNavItems = activeSecondItem?.children ?? [];
|
||||||
|
|
||||||
const handleTopSubNavClick = (item: MenuItem) => {
|
const handleNavItemClick = (item: MenuItem) => {
|
||||||
const path = item.path ?? findFirstRoutePath(item.children);
|
const path = item.path ?? findFirstRoutePath(item.children);
|
||||||
if (path) {
|
if (path) {
|
||||||
navigate(path);
|
navigate(path);
|
||||||
@@ -103,10 +102,10 @@ const Header = ({ collapsed }: HeaderProps) => {
|
|||||||
CM助手
|
CM助手
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
{showTopSubmenu && topSubNavItems.length ? (
|
{showTopNav && visibleMenuItems.length ? (
|
||||||
<nav className="top-submenu-bar" aria-label="二级菜单">
|
<nav className="top-submenu-bar" aria-label="二级菜单">
|
||||||
<div className="top-submenu-list">
|
<div className="top-submenu-list">
|
||||||
{topSubNavItems.map((item) => {
|
{visibleMenuItems.map((item) => {
|
||||||
const isSelected = item.path ? pathname === item.path : hasActiveChild(item);
|
const isSelected = item.path ? pathname === item.path : hasActiveChild(item);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -114,7 +113,7 @@ const Header = ({ collapsed }: HeaderProps) => {
|
|||||||
key={item.id}
|
key={item.id}
|
||||||
type="button"
|
type="button"
|
||||||
className={`top-submenu-item ${isSelected ? "top-submenu-item--active" : ""}`}
|
className={`top-submenu-item ${isSelected ? "top-submenu-item--active" : ""}`}
|
||||||
onClick={() => handleTopSubNavClick(item)}
|
onClick={() => handleNavItemClick(item)}
|
||||||
>
|
>
|
||||||
{item.label}
|
{item.label}
|
||||||
</button>
|
</button>
|
||||||
@@ -219,7 +218,7 @@ const Header = ({ collapsed }: HeaderProps) => {
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</header>
|
</header>
|
||||||
{showTopSubmenu && thirdSubNavItems.length ? (
|
{showTopNav && thirdSubNavItems.length ? (
|
||||||
<nav className="third-submenu-bar" aria-label="三级菜单">
|
<nav className="third-submenu-bar" aria-label="三级菜单">
|
||||||
<div className="third-submenu-list">
|
<div className="third-submenu-list">
|
||||||
{thirdSubNavItems.map((item) => {
|
{thirdSubNavItems.map((item) => {
|
||||||
@@ -230,7 +229,7 @@ const Header = ({ collapsed }: HeaderProps) => {
|
|||||||
key={item.id}
|
key={item.id}
|
||||||
type="button"
|
type="button"
|
||||||
className={`third-submenu-item ${isSelected ? "third-submenu-item--active" : ""}`}
|
className={`third-submenu-item ${isSelected ? "third-submenu-item--active" : ""}`}
|
||||||
onClick={() => handleTopSubNavClick(item)}
|
onClick={() => handleNavItemClick(item)}
|
||||||
>
|
>
|
||||||
{item.label}
|
{item.label}
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
Reference in new issue
Block a user