feat: add venue information management and detail view
- Added routes for venue information maintenance and detail views. - Implemented venue information detail page with data fetching and display. - Created edit modal for adding and editing venue information with form validation. - Integrated venue type and line options for selection in the edit modal. - Enhanced outdoor fair management to include venue binding and details. - Updated services to handle venue information CRUD operations.
This commit is contained in:
@@ -17,6 +17,7 @@ import type {
|
||||
OutdoorFairDictForm,
|
||||
} from '@/services/jobportal/outdoorFair';
|
||||
import { getDictSelectOption, getDictValueEnum } from '@/services/system/dict';
|
||||
import { getVenueInfoList } from '@/services/jobportal/venueInfo';
|
||||
import EditModal from './components/EditModal';
|
||||
|
||||
const OUTDOOR_FAIR_TYPE_DICT = 'outdoor_fair_type';
|
||||
@@ -31,6 +32,7 @@ const OutdoorFairList: React.FC = () => {
|
||||
const [fairTypeOptions, setFairTypeOptions] = useState<any[]>([]);
|
||||
const [regionValueEnum, setRegionValueEnum] = useState<Record<string, any>>({});
|
||||
const [regionOptions, setRegionOptions] = useState<any[]>([]);
|
||||
const [venueOptions, setVenueOptions] = useState<any[]>([]);
|
||||
|
||||
const refreshDictOptions = useCallback(async () => {
|
||||
const [typeValueEnum, typeOptions, regionEnum, regionSelectOptions] = await Promise.all([
|
||||
@@ -49,6 +51,24 @@ const OutdoorFairList: React.FC = () => {
|
||||
refreshDictOptions();
|
||||
}, [refreshDictOptions]);
|
||||
|
||||
const refreshVenueOptions = useCallback(async () => {
|
||||
const res = await getVenueInfoList({ current: 1, pageSize: 999 });
|
||||
if (res.code === 200) {
|
||||
setVenueOptions(
|
||||
(res.rows || []).map((item) => ({
|
||||
label: item.venueName,
|
||||
value: item.id,
|
||||
venueAddress: item.venueAddress,
|
||||
floorCount: item.floorCount,
|
||||
})),
|
||||
);
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
refreshVenueOptions();
|
||||
}, [refreshVenueOptions]);
|
||||
|
||||
const handleCreateDictOption = async (values: OutdoorFairDictForm) => {
|
||||
const res = await addOutdoorFairDictOption(values);
|
||||
if (res.code === 200) {
|
||||
@@ -101,6 +121,24 @@ const OutdoorFairList: React.FC = () => {
|
||||
valueType: 'select',
|
||||
valueEnum: regionValueEnum,
|
||||
},
|
||||
{
|
||||
title: '绑定场地',
|
||||
dataIndex: 'venueName',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) =>
|
||||
record.venueId && record.venueName ? (
|
||||
<Button
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() => history.push(`/jobfair/venue-info/detail?id=${record.venueId}`)}
|
||||
>
|
||||
{record.venueName}
|
||||
</Button>
|
||||
) : (
|
||||
'--'
|
||||
),
|
||||
},
|
||||
{
|
||||
title: '举办地址',
|
||||
dataIndex: 'address',
|
||||
@@ -216,6 +254,7 @@ const OutdoorFairList: React.FC = () => {
|
||||
hostUnit: params.hostUnit,
|
||||
fairType: params.fairType,
|
||||
region: params.region,
|
||||
venueId: params.venueId,
|
||||
} as OutdoorFairListParams);
|
||||
return { data: res.rows, total: res.total, success: true };
|
||||
}}
|
||||
@@ -239,6 +278,7 @@ const OutdoorFairList: React.FC = () => {
|
||||
values={currentRow}
|
||||
fairTypeOptions={fairTypeOptions}
|
||||
regionOptions={regionOptions}
|
||||
venueOptions={venueOptions}
|
||||
onCreateDictOption={handleCreateDictOption}
|
||||
onCancel={() => {
|
||||
setModalVisible(false);
|
||||
|
||||
Reference in New Issue
Block a user