import { MyPageContainer, useCurrentPermissions } from '@/common'; import { useNavigate, useSearchParams } from '@umijs/max'; import type { TabsProps } from 'antd'; import { Button, Tabs } from 'antd'; import { useEffect, useState } from 'react'; import IsVisited from './components/IsVisited'; import NoVisited from './components/NoVisited'; export default function Index({ title = '工单回访' }) { const getCurrentPermissions = useCurrentPermissions(); const [searchParams] = useSearchParams(); const [activeKey, setActiveKey] = useState('1'); const navigate = useNavigate(); const items: TabsProps['items'] = getCurrentPermissions({ NoVisited: { key: 'NoVisited', label: '未回访工单', children: , }, IsVisited: { key: 'IsVisited', label: '已回访工单', children: , }, }); useEffect(() => { if (searchParams?.get('key')) { setActiveKey(searchParams?.get('key') || '1'); } }, []); return ( navigate('/work_order/work_bi')} > 返回工单BI ), }} /> ); }