feat: implement participating companies and jobs tabs in outdoor fair detail
- Add ParticipatingCompaniesTab component to manage participating companies. - Add ParticipatingJobsTab component to manage jobs associated with participating companies. - Remove StatisticsTab component as it is no longer needed. - Update OutdoorFairDetail to include new tabs for participating companies and jobs. - Modify API services to support fetching and managing participating companies and jobs. - Update types to reflect changes in job and company data structures.
This commit is contained in:
@@ -7,10 +7,8 @@ import { getOutdoorFairInfo } from '@/services/jobportal/outdoorFair';
|
||||
import type { OutdoorFairItem } from '@/services/jobportal/outdoorFair';
|
||||
import FairInfoTab from './components/FairInfoTab';
|
||||
import BoothTab from './components/BoothTab';
|
||||
import CompanyReviewTab from './components/CompanyReviewTab';
|
||||
import AttendeeTab from './components/AttendeeTab';
|
||||
import DeviceTab from './components/DeviceTab';
|
||||
import StatisticsTab from './components/StatisticsTab';
|
||||
import ParticipatingCompaniesTab from './components/ParticipatingCompaniesTab';
|
||||
import ParticipatingJobsTab from './components/ParticipatingJobsTab';
|
||||
|
||||
const OutdoorFairDetail: React.FC = () => {
|
||||
const [searchParams] = useSearchParams();
|
||||
@@ -18,7 +16,6 @@ const OutdoorFairDetail: React.FC = () => {
|
||||
const [fairInfo, setFairInfo] = useState<OutdoorFairItem | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [activeTab, setActiveTab] = useState('fair-info');
|
||||
const [fairInfoRefreshKey, setFairInfoRefreshKey] = useState(0);
|
||||
|
||||
const fetchFairInfo = async () => {
|
||||
setLoading(true);
|
||||
@@ -42,18 +39,13 @@ const OutdoorFairDetail: React.FC = () => {
|
||||
|
||||
const tabItems = [
|
||||
{ key: 'fair-info', label: '招聘会管理' },
|
||||
{ key: 'participating-companies', label: '参会企业' },
|
||||
{ key: 'participating-jobs', label: '参会岗位' },
|
||||
{ key: 'booth', label: '展位图' },
|
||||
{ key: 'company-review', label: '参会单位管理' },
|
||||
{ key: 'attendee', label: '参会人员管理' },
|
||||
{ key: 'device', label: '入场设备管理' },
|
||||
{ key: 'statistics', label: '数据统计' },
|
||||
];
|
||||
|
||||
const handleTabChange = (key: string) => {
|
||||
setActiveTab(key);
|
||||
if (key === 'fair-info') {
|
||||
setFairInfoRefreshKey((prev) => prev + 1);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -83,20 +75,15 @@ const OutdoorFairDetail: React.FC = () => {
|
||||
<FairInfoTab
|
||||
fairId={fairId}
|
||||
fairInfo={fairInfo}
|
||||
refreshKey={fairInfoRefreshKey}
|
||||
onFairUpdate={fetchFairInfo}
|
||||
/>
|
||||
);
|
||||
case 'booth':
|
||||
return <BoothTab fairId={fairId} fairInfo={fairInfo} />;
|
||||
case 'company-review':
|
||||
return <CompanyReviewTab fairId={fairId} />;
|
||||
case 'attendee':
|
||||
return <AttendeeTab fairId={fairId} />;
|
||||
case 'device':
|
||||
return <DeviceTab fairId={fairId} />;
|
||||
case 'statistics':
|
||||
return <StatisticsTab fairId={fairId} />;
|
||||
case 'participating-companies':
|
||||
return <ParticipatingCompaniesTab fairId={fairId} />;
|
||||
case 'participating-jobs':
|
||||
return <ParticipatingJobsTab fairId={fairId} />;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user