import React from 'react' import FitFullScreen from '@/components/common/FitFullScreen' import '@/assets/css/pages/tools-framework.scss' import Icon from '@ant-design/icons' import { toolsJsonObjects } from '@/router/tools.tsx' import HideScrollbar, { HideScrollbarElement } from '@/components/common/HideScrollbar.tsx' import { getLocalStorage, setLocalStorage } from '@/utils/common.ts' const ToolsFramework: React.FC = () => { const hideScrollbarRef = useRef(null) const [submenuTop, setSubmenuTop] = useState(0) const [submenuLeft, setSubmenuLeft] = useState(0) const [hideSidebar, setHideSidebar] = useState(getLocalStorage('hideSidebar') === 'false') const switchSidebar = () => { setHideSidebar(!hideSidebar) setLocalStorage('hideSidebar', hideSidebar ? 'true' : 'false') setTimeout(() => { hideScrollbarRef.current?.refreshLayout() }, 300) } const showSubmenu = (e: React.MouseEvent) => { const parentElement = e.currentTarget.parentElement if (parentElement && parentElement.childElementCount === 2) { const parentClientRect = parentElement.getBoundingClientRect() if (parentClientRect.top <= screen.height / 2) { setSubmenuTop(parentClientRect.top) } else { setSubmenuTop( parentClientRect.top - (parentElement.lastElementChild?.clientHeight ?? 0) + e.currentTarget.clientHeight ) } setSubmenuLeft(parentClientRect.right) } } return ( <>
氮工具
  • isPending ? 'pending' : isActive ? 'active' : '' } >
    {toolsJsonObjects[0].icon ? ( ) : undefined}
    {toolsJsonObjects[0].name}
  • isPending ? ' pending' : isActive ? ' active' : '' } >
    {toolsJsonObjects[1].icon ? ( ) : undefined}
    {toolsJsonObjects[1].name}
    {toolsJsonObjects.map((tool) => { return tool.menu && tool.id !== 'tools' && tool.id !== 'tools-all' ? (
  • isPending ? 'pending' : isActive ? 'active' : '' } >
    {tool.icon ? ( ) : undefined}
    {tool.name}
    {tool.children ? (
      {tool.children.map((subTool) => { return subTool.menu ? (
    • isPending ? 'pending' : isActive ? 'active' : '' } > {subTool.name}
    • ) : undefined })}
    ) : undefined}
  • ) : undefined })}
未登录
) } export default ToolsFramework