import { useParams } from '@umijs/max'; import { useState } from 'react'; import styles from './index.less'; import { UnityAction } from '@/utils/utils'; const menuList = [ { name: '首页', path: (projectId) => `/home/${projectId}`, }, { name: '工况管理', path: (projectId) => `/smart/work/${projectId}`, }, { name: '系统自检', path: (projectId) => `/self-inspection/${projectId}`, }, { name: '设备管理', path: (projectId) => `/device/${projectId}`, }, { name: '安全管理', path: (projectId) => `/safety/${projectId}`, }, { name: '任务管理', path: (projectId) => `/task-manage/${projectId}`, }, { name: '智能监控', path: (projectId) => `/hardware-controller/${projectId}`, }, { name: '数字孪生', }, ]; function Menu() { const { projectId } = useParams(); const [active, setActive] = useState('首页'); const handleClick = (item) => { setActive(item.name); const path = item?.path(projectId); // history.push(path); console.log(path); UnityAction.sendMsg("menuItem", item.name) }; return (