feat: 增加招聘会机构管理和场地机构选择
This commit is contained in:
@@ -18,6 +18,14 @@ import type {
|
||||
} from '@/services/jobportal/venueInfo';
|
||||
import { getCmsLineList } from '@/services/area/subway';
|
||||
import { getDictSelectOption, getDictValueEnum } from '@/services/system/dict';
|
||||
import {
|
||||
addJobFairInstitution,
|
||||
getJobFairInstitutionList,
|
||||
} from '@/services/jobportal/jobFairInstitution';
|
||||
import type {
|
||||
JobFairInstitutionForm,
|
||||
JobFairInstitutionItem,
|
||||
} from '@/services/jobportal/jobFairInstitution';
|
||||
import EditModal from './components/EditModal';
|
||||
import VenueBoothMapModal from './components/VenueBoothMapModal';
|
||||
|
||||
@@ -33,6 +41,7 @@ const VenueInfoList: React.FC = () => {
|
||||
const [venueTypeValueEnum, setVenueTypeValueEnum] = useState<Record<string, any>>({});
|
||||
const [venueTypeOptions, setVenueTypeOptions] = useState<any[]>([]);
|
||||
const [lineOptions, setLineOptions] = useState<any[]>([]);
|
||||
const [institutionOptions, setInstitutionOptions] = useState<JobFairInstitutionItem[]>([]);
|
||||
|
||||
const defaultHandler =
|
||||
initialState?.currentUser?.nickName || initialState?.currentUser?.userName || undefined;
|
||||
@@ -58,10 +67,29 @@ const VenueInfoList: React.FC = () => {
|
||||
}
|
||||
}, []);
|
||||
|
||||
const refreshInstitutionOptions = useCallback(async () => {
|
||||
const res = await getJobFairInstitutionList({ current: 1, pageSize: 9999 });
|
||||
if (res.code === 200) {
|
||||
setInstitutionOptions(res.rows || []);
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
refreshVenueTypeOptions();
|
||||
refreshLineOptions();
|
||||
}, [refreshVenueTypeOptions, refreshLineOptions]);
|
||||
refreshInstitutionOptions();
|
||||
}, [refreshVenueTypeOptions, refreshLineOptions, refreshInstitutionOptions]);
|
||||
|
||||
const handleCreateInstitution = async (values: JobFairInstitutionForm) => {
|
||||
const res = await addJobFairInstitution(values);
|
||||
if (res.code === 200 && res.data) {
|
||||
await refreshInstitutionOptions();
|
||||
message.success('机构新增成功');
|
||||
return res.data;
|
||||
}
|
||||
message.error(res.msg || '机构新增失败');
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const handleCreateDictOption = async (values: VenueInfoDictForm) => {
|
||||
const res = await addVenueInfoDictOption(values);
|
||||
@@ -118,6 +146,12 @@ const VenueInfoList: React.FC = () => {
|
||||
dataIndex: 'venueAddress',
|
||||
ellipsis: true,
|
||||
},
|
||||
{
|
||||
title: '所属机构',
|
||||
dataIndex: 'institutionNames',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '联系电话',
|
||||
dataIndex: 'contactPhone',
|
||||
@@ -234,6 +268,9 @@ const VenueInfoList: React.FC = () => {
|
||||
values={currentRow}
|
||||
venueTypeOptions={venueTypeOptions}
|
||||
lineOptions={lineOptions}
|
||||
institutionOptions={institutionOptions}
|
||||
canCreateInstitution={access.hasPerms('cms:jobFairInstitution:add')}
|
||||
onCreateInstitution={handleCreateInstitution}
|
||||
defaultHandler={defaultHandler}
|
||||
onCreateDictOption={handleCreateDictOption}
|
||||
onCancel={() => {
|
||||
|
||||
Reference in New Issue
Block a user