import React, { useState, useEffect } from 'react'; import { history, useSearchParams } from '@umijs/max'; import { PageContainer } from '@ant-design/pro-components'; import { Tabs, Button, Spin, message } from 'antd'; import { ArrowLeftOutlined } from '@ant-design/icons'; import { getOutdoorFairInfo } from '@/services/jobportal/outdoorFair'; import type { OutdoorFairItem } from '@/services/jobportal/outdoorFair'; import FairInfoTab from './components/FairInfoTab'; import BoothTab from './components/BoothTab'; import ParticipatingCompaniesTab from './components/ParticipatingCompaniesTab'; import ParticipatingJobsTab from './components/ParticipatingJobsTab'; import AttendeeTab from './components/AttendeeTab'; import DeviceTab from './components/DeviceTab'; const OutdoorFairDetail: React.FC = () => { const [searchParams] = useSearchParams(); const fairId = Number(searchParams.get('id')); const [fairInfo, setFairInfo] = useState(null); const [loading, setLoading] = useState(true); const [activeTab, setActiveTab] = useState('fair-info'); const fetchFairInfo = async () => { setLoading(true); try { const res = await getOutdoorFairInfo(fairId); if (res.code === 200 && res.data) { setFairInfo(res.data); } else { message.error(res.msg || '未找到该招聘会信息'); } } finally { setLoading(false); } }; useEffect(() => { if (fairId) { fetchFairInfo(); } }, [fairId]); const tabItems = [ { key: 'fair-info', label: '招聘会管理' }, { key: 'participating-companies', label: '参会企业' }, { key: 'participating-jobs', label: '参会岗位' }, { key: 'attendee', label: '参会人员管理' }, { key: 'device', label: '设备管理' }, { key: 'booth', label: '展位图' }, ]; const handleTabChange = (key: string) => { setActiveTab(key); }; return ( history.back(), extra: [ , ], }} > {fairInfo && ( ({ key: tab.key, label: tab.label, children: (() => { switch (tab.key) { case 'fair-info': return ( ); case 'booth': return ; case 'participating-companies': return ; case 'participating-jobs': return ; case 'attendee': return ; case 'device': return ; default: return null; } })(), }))} /> )} ); }; export default OutdoorFairDetail;