import './index.less'; import { message } from 'antd'; import useHistory from '@/hooks/route/useHistory'; import Title from './Title'; const Image = { 1: require('/public/images/home/home-1.png'), 2: require('/public/images/home/home-2.png'), 3: require('/public/images/home/home-3.png'), }; interface GuideProps { title: string; data: GuideItemProps[]; } interface GuideItemProps { key: string; name: string; english: string; url: string; param?: Record; index?: number; auth: boolean; img?: string; } const GuideItem = (props: GuideItemProps) => { const history = useHistory(); const jumpPage = () => { if (props.url && props.auth) { history.push(`${props.url}`, props.param); } else { message.warning('暂无权限,请联系管理员'); } }; return (
{`STP${props.index}`}
{props.name}
); }; const GuideHome = (props: GuideProps) => { return (
<div> {props.data.map((item, index) => ( <GuideItem {...item} index={index + 1} key={item.key} /> ))} </div> </div> ); }; export default GuideHome;