企业屏蔽功能开发
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
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:
@@ -11,7 +11,8 @@ import {
|
||||
Progress,
|
||||
Divider,
|
||||
Avatar,
|
||||
message
|
||||
message,
|
||||
Modal
|
||||
} from 'antd';
|
||||
import {
|
||||
ArrowLeftOutlined,
|
||||
@@ -23,7 +24,8 @@ import {
|
||||
TrophyOutlined,
|
||||
FireOutlined,
|
||||
StarOutlined,
|
||||
FlagOutlined
|
||||
FlagOutlined,
|
||||
StopOutlined
|
||||
} from '@ant-design/icons';
|
||||
import { Radar } from '@ant-design/charts';
|
||||
import JobPortalHeader from '@/components/JobPortalHeader';
|
||||
@@ -33,7 +35,7 @@ import {
|
||||
getEmptyCompetitivenessRadar,
|
||||
} from '@/services/jobportal/competitiveness';
|
||||
import { isJobPortalLoggedIn } from '@/utils/jobPortalAuth';
|
||||
import { favoriteJob, unfavoriteJob, applyJob, browseJob, getJobDetail } from '@/services/jobportal/user';
|
||||
import { favoriteJob, unfavoriteJob, applyJob, browseJob, getJobDetail, blockCompany } from '@/services/jobportal/user';
|
||||
import { ensureJobPortalLogin, requireJobPortalUserId } from '@/utils/jobPortalAuth';
|
||||
import { getDictLabel, resolveIndustryLabel } from '@/utils/jobPortalDict';
|
||||
import JobComplaintModal from '@/components/JobComplaintModal';
|
||||
@@ -444,6 +446,37 @@ const JobDetailPage: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const handleBlockCompany = async () => {
|
||||
const companyId = originalJobData?.companyId || originalJobData?.companyVo?.companyId;
|
||||
if (!companyId) {
|
||||
message.error('未获取到企业信息');
|
||||
return;
|
||||
}
|
||||
const userId = await requireJobPortalUserId('屏蔽企业');
|
||||
if (!userId) {
|
||||
return;
|
||||
}
|
||||
Modal.confirm({
|
||||
title: '屏蔽该企业',
|
||||
content: '确定要屏蔽该企业吗?屏蔽后将不再收到该企业的招聘信息。',
|
||||
okText: '确定屏蔽',
|
||||
cancelText: '取消',
|
||||
okButtonProps: { danger: true },
|
||||
onOk: async () => {
|
||||
try {
|
||||
const res = await blockCompany({ userId, companyId });
|
||||
if (res?.code === 200) {
|
||||
message.success('已屏蔽该企业');
|
||||
} else {
|
||||
message.error(res?.msg || '屏蔽失败,请稍后重试');
|
||||
}
|
||||
} catch {
|
||||
message.error('操作失败,请稍后重试');
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="job-detail-page">
|
||||
<JobPortalHeader showSearch={false} showHotJobs={false} />
|
||||
@@ -551,6 +584,15 @@ const JobDetailPage: React.FC = () => {
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<div className="company-block-action">
|
||||
<Button
|
||||
danger
|
||||
icon={<StopOutlined />}
|
||||
onClick={handleBlockCompany}
|
||||
>
|
||||
屏蔽该企业
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
<Divider className="company-section-divider" />
|
||||
<div className="company-description-section">
|
||||
|
||||
Reference in New Issue
Block a user