11
Some checks failed
Node CI / build (14.x, macOS-latest) (push) Has been cancelled
Node CI / build (14.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (14.x, windows-latest) (push) Has been cancelled
Node CI / build (16.x, macOS-latest) (push) Has been cancelled
Node CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node CI / build (16.x, windows-latest) (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
coverage CI / build (push) Has been cancelled
Node pnpm CI / build (16.x, macOS-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, ubuntu-latest) (push) Has been cancelled
Node pnpm CI / build (16.x, windows-latest) (push) Has been cancelled

This commit is contained in:
francis-fh
2026-06-18 02:30:11 +08:00
parent 4f484f1d00
commit e7616b0c8e
35 changed files with 5815 additions and 19 deletions

View File

@@ -0,0 +1,98 @@
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 { getOutdoorFairList } 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';
const OutdoorFairDetail: React.FC = () => {
const [searchParams] = useSearchParams();
const fairId = Number(searchParams.get('id'));
const [fairInfo, setFairInfo] = useState<OutdoorFairItem | null>(null);
const [loading, setLoading] = useState(true);
const [activeTab, setActiveTab] = useState('fair-info');
const fetchFairInfo = async () => {
setLoading(true);
try {
const res = await getOutdoorFairList({ current: 1, pageSize: 100 });
const found = res.rows.find((item) => item.id === fairId);
if (found) {
setFairInfo(found);
} else {
message.error('未找到该招聘会信息');
}
} finally {
setLoading(false);
}
};
useEffect(() => {
if (fairId) {
fetchFairInfo();
}
}, [fairId]);
const tabItems = [
{ key: 'fair-info', label: '招聘会管理' },
{ key: 'booth', label: '展位管理' },
{ key: 'company-review', label: '参会单位管理' },
{ key: 'attendee', label: '参会人员管理' },
{ key: 'device', label: '入场设备管理' },
{ key: 'statistics', label: '数据统计' },
];
return (
<PageContainer
header={{
title: fairInfo ? `招聘会详情 — ${fairInfo.title}` : '加载中...',
onBack: () => history.back(),
extra: [
<Button key="back" icon={<ArrowLeftOutlined />} onClick={() => history.back()}>
</Button>,
],
}}
>
<Spin spinning={loading}>
{fairInfo && (
<Tabs
activeKey={activeTab}
onChange={setActiveTab}
items={tabItems.map((tab) => ({
key: tab.key,
label: tab.label,
children: (() => {
switch (tab.key) {
case 'fair-info':
return <FairInfoTab fairId={fairId} fairInfo={fairInfo} onFairUpdate={fetchFairInfo} />;
case 'booth':
return <BoothTab fairId={fairId} />;
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} />;
default:
return null;
}
})(),
}))}
/>
)}
</Spin>
</PageContainer>
);
};
export default OutdoorFairDetail;