Compare commits
11 Commits
FengHui
...
25ba8dc0da
| Author | SHA1 | Date | |
|---|---|---|---|
| 25ba8dc0da | |||
| 4db3255997 | |||
| c6d665c370 | |||
| 5213215c65 | |||
| 5faf09c467 | |||
| 4ae042dd76 | |||
| 1c9216dbbb | |||
| b4b17f2ada | |||
| 2fbba8a993 | |||
| b937b189c2 | |||
| 95c31a359a |
@@ -278,18 +278,18 @@ export default [
|
||||
{
|
||||
name: '公共招聘会列表',
|
||||
path: '/jobfair/public-job-fair',
|
||||
component: './Jobfair/Publicjobfair',
|
||||
component: './Jobfair/PublicJobFair',
|
||||
},
|
||||
{
|
||||
name: '招聘会详情',
|
||||
path: '/jobfair/public-job-fair/detail',
|
||||
component: './Jobfair/Publicjobfair/Detail',
|
||||
component: './Jobfair/PublicJobFair/Detail',
|
||||
access: 'canViewPublicJobFairDetail',
|
||||
},
|
||||
{
|
||||
name: '报名人员',
|
||||
path: '/jobfair/public-job-fair/signups',
|
||||
component: './Jobfair/Publicjobfair/Signups',
|
||||
component: './Jobfair/PublicJobFair/Signups',
|
||||
},
|
||||
{
|
||||
name: '线下招聘会管理',
|
||||
@@ -301,6 +301,11 @@ export default [
|
||||
path: '/jobfair/venue-info',
|
||||
component: './Jobfair/Venueinfo',
|
||||
},
|
||||
{
|
||||
name: '机构管理',
|
||||
path: '/jobfair/institution',
|
||||
component: './Jobfair/Institution',
|
||||
},
|
||||
{
|
||||
name: '场地信息详情',
|
||||
path: '/jobfair/venue-info/detail',
|
||||
|
||||
288
docs/pc-jobseeker-api-audit.md
Normal file
288
docs/pc-jobseeker-api-audit.md
Normal file
@@ -0,0 +1,288 @@
|
||||
# PC 求职者端接口调用深度审查
|
||||
|
||||
> 审查日期:2026-07-23
|
||||
> 审查对象:`shz-admin` 中由 PC 求职者路由、其共享头部组件及求职者专用弹窗实际引用的接口调用。
|
||||
> 本文是**前端静态调用清单**,并用测试环境匿名首页的实际网络记录交叉验证;不代表后端已对每个接口的权限、字段和错误码逐一验收。
|
||||
|
||||
## 1. 结论摘要
|
||||
|
||||
| 项目 | 结果 |
|
||||
| --- | --- |
|
||||
| 求职者路由数 | 21 条(首页、职位、招聘会、简历、个人中心、政策、直播等) |
|
||||
| 已识别的不同“方法 + 路径”调用 | **60 条** |
|
||||
| `/cms/` 类调用 | **33 条** |
|
||||
| 非 `/cms/` 的 App / SSO / 会话调用 | **27 条** |
|
||||
| 直接 `fetch` / `axios` 调用 | 未发现;页面统一通过 Umi `request` 发起 |
|
||||
| 风险结论 | 求职者端大量直接调用 `/cms/` 路径,其中包含个人资料、收藏、投递、投诉、消息、屏蔽企业、字典、行业及政策导出。路径命名与“CMS 是后台接口”的边界不一致,需要后端按求职者身份做强制鉴权和资源归属校验。 |
|
||||
|
||||
**最重要的审查发现:**`/cms/` 不能仅凭前端路径前缀被视为“后台专用且不会被求职者调用”。本项目的 PC 求职者代码已实际引用 33 个此类端点。若后端仅凭 URI 前缀而不是用户角色、数据归属和操作权限做控制,会形成越权风险。
|
||||
|
||||
## 2. 审查范围与方法
|
||||
|
||||
### 覆盖范围
|
||||
|
||||
1. 路由定义:[config/routes.ts](../config/routes.ts#L40) 的 `/job-portal/**` 分支。
|
||||
2. 页面代码:`src/pages/JobPortal/**`。
|
||||
3. 求职者页面必经的共享组件:
|
||||
- [JobPortalHeader](../src/components/JobPortalHeader/index.tsx)
|
||||
- [JobComplaintModal](../src/components/JobComplaintModal/index.tsx)
|
||||
- [JobTitleSelector](../src/components/JobTitleSelector.tsx)
|
||||
4. 由上述页面/组件导入的 service:`services/jobportal`、`services/common/jobTitle`、`services/cms/policyInfo`、`services/cms/jobComplaint`、`services/classify/industry`、`services/system/dict`、`services/Management/list`、`services/session` 与 SSO 辅助模块。
|
||||
|
||||
### 识别规则
|
||||
|
||||
- 以 `request(...)`、下载请求和页面内直接 `request(...)` 为接口调用源。
|
||||
- 仅列出从求职者路由实际可达的调用;同一 URI 的不同 HTTP 方法视为不同接口。
|
||||
- **CMS 类接口**:请求字符串中包含 `/cms/`。本分类基于调用路径,不推断后端最终的角色授权。
|
||||
- 纯管理端 service 中未被求职者页面导入的方法不纳入清单。
|
||||
|
||||
### 生产路径换算
|
||||
|
||||
[src/app.tsx](../src/app.tsx#L269) 为生产请求配置了当前域名下的 `/api/shihezi/` 基址,并会将源码请求参数开头的 `/api` 去掉。因此表中的“源码 request 路径”会在测试环境实际成为:
|
||||
|
||||
```text
|
||||
源码:/api/cms/job/recommend
|
||||
实际:https://test.xjshzly.longbiosphere.com/api/shihezi/cms/job/recommend
|
||||
|
||||
源码:/app/job/123
|
||||
实际:https://test.xjshzly.longbiosphere.com/api/shihezi/app/job/123
|
||||
```
|
||||
|
||||
文中使用源码路径,方便与前端代码逐字对照;部署时请统一在此前面补上 `/api/shihezi`。
|
||||
|
||||
## 3. 测试环境实测证据
|
||||
|
||||
### 入口
|
||||
|
||||
- 用户提供的入口:`https://test.xjshzly.longbiosphere.com/shihezi/`
|
||||
- 恢复后最终路由:`/shihezi/job-portal`
|
||||
- 身份:未登录的 PC 求职者;没有读取浏览器 Cookie、Storage 或 Token,也没有执行写操作。
|
||||
|
||||
### 首屏真实请求
|
||||
|
||||
| 源码请求路径 | 实际状态 | 关联代码 | 说明 |
|
||||
| --- | --: | --- | --- |
|
||||
| `GET /api/app/common/jobTitle/treeselect` | 502 | 首页、职位列表、简历、职位选择组件 | 职位树加载失败。 |
|
||||
| `GET /api/cms/job/recommend?order=2` | 502 | 首页、全局头部、职位列表 | 热门职位加载失败。 |
|
||||
|
||||
页面在请求失败时仍呈现示例职位卡片,属于前端兜底展示,不能视为接口成功返回真实业务数据。该 502 是审查时刻的测试环境可用性快照,不影响下文静态调用覆盖结论。
|
||||
|
||||
## 4. 求职者路由与功能边界
|
||||
|
||||
| 路由 | 页面 | 核心功能 | 调用类别 |
|
||||
| --- | --- | --- | --- |
|
||||
| `/job-portal` | 首页 | 职位分类、热门推荐 | App + CMS |
|
||||
| `/job-portal/list` | 职位列表 | 搜索、职位详情预览、收藏/投递/投诉/屏蔽 | App + CMS |
|
||||
| `/job-portal/detail` | 职位详情 | 详情、竞争力、收藏/投递/投诉/屏蔽 | App + CMS |
|
||||
| `/job-portal/job-fair` | 招聘会 | 线上与线下招聘会列表、日历与摘要 | App |
|
||||
| `/job-portal/job-fair/detail` | 招聘会详情 | 招聘会详情、线上关联岗位 | App |
|
||||
| `/job-portal/resume` | 简历 | 基础资料、工作经历、技能维护 | App + CMS |
|
||||
| `/job-portal/personal-center` | 个人中心 | 个人统计与资料展示 | CMS |
|
||||
| `/job-portal/personal-center/applications` | 已投递 | 已投岗位 | CMS |
|
||||
| `/job-portal/personal-center/favorites` | 收藏 | 收藏列表、取消收藏 | CMS |
|
||||
| `/job-portal/personal-center/footprints` | 足迹 | 浏览足迹 | CMS |
|
||||
| `/job-portal/personal-center/showcase` | 我的风采 | 文件上传、查询、删除 | App |
|
||||
| `/job-portal/personal-center/interviews` | 面试邀约 | 查询、接受/拒绝 | App |
|
||||
| `/job-portal/personal-center/complaints` | 我的投诉 | 查询、撤销投诉 | CMS |
|
||||
| `/job-portal/personal-center/blocked-companies` | 屏蔽企业 | 查询、解除屏蔽 | CMS |
|
||||
| `/job-portal/message` | 消息 | 查询、已读、删除、全部已读 | CMS |
|
||||
| `/job-portal/career-recommendation` | 职业推荐 | 读取当前求职者资料 | CMS |
|
||||
| `/job-portal/policy` | 政策列表 | 门户政策、按用户类型筛选、下载 | App + CMS |
|
||||
| `/job-portal/policy/detail` | 政策详情 | 门户政策详情 | App + CMS |
|
||||
| `/job-portal/live-recruitment` | 直播带岗 | 直播列表 | App |
|
||||
| `/job-portal/profile` | 我的 | 读取客户端缓存展示,未发现新增远程请求 | 无新增 |
|
||||
|
||||
`JobPortalHeader` 会被绝大多数页面复用,因而其中的职位联想、热门职位和登录后消息未读数请求是**跨路由调用**。
|
||||
|
||||
## 5. CMS 类接口清单(33 条)
|
||||
|
||||
> 这是本次审查的重点。所有条目均由求职者端页面或其共用组件导入并调用;“需登录”表示前端存在登录/用户 ID 前置校验或该功能显然依赖个人数据,最终权限仍必须由后端校验。
|
||||
|
||||
| ID | 方法与源码 request 路径 | 用途与主要参数/请求体 | 调用页面/组件 | 登录/触发条件 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| C01 | `GET /api/cms/job/recommend` | 职位推荐;`order=2` 为热门,`order=0,isPublish=1,jobCategory` 为分类列表;可带 `jobTitle` | 首页、职位列表、`JobPortalHeader` | 公共浏览 |
|
||||
| C02 | `POST /api/cms/userworkexperiences` | 新增工作经历:`companyName,position,startDate,endDate,description` | 简历 | 需登录 |
|
||||
| C03 | `GET /api/cms/appUser/getUserInfo` | 当前求职者资料 | 职业推荐、简历、登录身份预取 | 需登录 |
|
||||
| C04 | `GET /api/cms/appUser/getMyTj` | 我的投递/收藏等统计 | 个人中心 | 需登录 |
|
||||
| C05 | `GET /api/cms/job/getAppUserYhsq` | 已投递岗位;`userId` | 已投递 | 需登录 |
|
||||
| C06 | `GET /api/cms/job/getAppUserYhsc` | 收藏岗位;`userId` | 收藏 | 需登录 |
|
||||
| C07 | `GET /api/cms/job/getAppUserYhfwzj` | 浏览足迹;`userId` | 足迹 | 需登录 |
|
||||
| C08 | `POST /api/cms/job/collection` | 收藏岗位:`jobId,userId` | 职位列表、职位详情 | 需登录 |
|
||||
| C09 | `POST /api/cms/job/collectionCancel` | 取消收藏:`jobId,userId` | 职位列表、职位详情、收藏 | 需登录 |
|
||||
| C10 | `PUT /api/cms/jobApply` | 投递岗位:`jobId,userId` | 职位列表、职位详情 | 需登录 |
|
||||
| C11 | `POST /api/cms/job/browse` | 记录职位浏览:`jobId` | 职位列表、职位详情 | 需登录后触发 |
|
||||
| C12 | `GET /api/cms/notice/appNoticList` | 消息列表;`pageNum,pageSize,noticeType,isRead` | 消息 | 需登录 |
|
||||
| C13 | `GET /api/cms/notice/appNoticReadList` | 未读消息数量/列表 | 消息 | 需登录 |
|
||||
| C14 | `GET /api/cms/notice/noticTotal` | 消息总数与未读数 | 消息、全局头部 | 需登录 |
|
||||
| C15 | `GET /api/cms/notice/appNoticYdList` | 已读消息列表;`pageNum,pageSize` | 消息 | 需登录 |
|
||||
| C16 | `POST /api/cms/notice/read/sysNotice?id={id}` | 标记单条消息已读 | 消息 | 需登录 |
|
||||
| C17 | `POST /api/cms/appUser/markAllMessagesRead` | 标记全部消息已读 | 消息 | 需登录 |
|
||||
| C18 | `DELETE /api/cms/notice/deleteNotice/{id}` | 删除消息 | 消息 | 需登录 |
|
||||
| C19 | `POST /api/cms/jobComplaint` | 提交岗位投诉:`userId,jobId,complaintType,complaintContent,contactPhone` | 职位投诉弹窗 | 需登录 |
|
||||
| C20 | `POST /api/cms/blockCompany` | 屏蔽企业:`userId,companyId` | 职位列表、职位详情 | 需登录 |
|
||||
| C21 | `GET /api/cms/blockCompany/list` | 屏蔽企业列表;`pageNum,pageSize` | 屏蔽企业 | 需登录 |
|
||||
| C22 | `DELETE /api/cms/blockCompany/{id}` | 解除指定屏蔽记录 | 屏蔽企业 | 需登录 |
|
||||
| C23 | `GET /api/cms/dict/data/type/{dictType}` | CMS 字典值;详见下一节的字典类型 | 首页、职位、简历、个人中心、投诉、政策 | 公共展示/依页面而定 |
|
||||
| C24 | `GET /api/cms/dict/jobCategory` | 简历技能分类联想;`name` | 简历 | 需登录 |
|
||||
| C25 | `GET /api/cms/industry/treeselect` | 行业树 | 职位列表、职位详情 | 公共浏览 |
|
||||
| C26 | `PUT /api/cms/appUser` | 更新简历基础信息/求职意向 | 简历 | 需登录 |
|
||||
| C27 | `DELETE /api/cms/userworkexperiences/{id}` | 删除工作经历 | 简历 | 需登录 |
|
||||
| C28 | `PUT /api/cms/userworkexperiences` | 编辑工作经历;含 `id` 与经历字段 | 简历 | 需登录 |
|
||||
| C29 | `PUT /api/cms/appskill/edit` | 修改技能:`id,userId,name,levels` | 简历 | 需登录 |
|
||||
| C30 | `POST /api/cms/appskill/add` | 新增技能:`name,levels` | 简历 | 需登录 |
|
||||
| C31 | `GET /api/cms/jobComplaint/listSelf` | 当前用户投诉列表;`currentPage,pageSize,complaintType,complaintStatus` | 我的投诉 | 需登录 |
|
||||
| C32 | `DELETE /api/cms/jobComplaint/{id}` | 撤销投诉 | 我的投诉 | 需登录 |
|
||||
| C33 | `GET /api/cms/policyInfo/exportUtil?id={id}` | 下载政策文件,响应为 Blob | 政策列表 | 公共入口可见,后端应决定下载权限 |
|
||||
|
||||
### C23:求职者端实际请求的 CMS 字典类型
|
||||
|
||||
`getDictValueEnum(type, isDigital, true)` 会固定落到 C23。已从调用点枚举到:
|
||||
|
||||
| 字典类型 | 使用位置 |
|
||||
| ----------------- | ------------------------ |
|
||||
| `company_nature` | 首页、职位列表、职位详情 |
|
||||
| `education` | 职位列表、简历、个人中心 |
|
||||
| `scale` | 职位列表、职位详情 |
|
||||
| `sex` | 简历、个人中心 |
|
||||
| `area` | 简历、个人中心 |
|
||||
| `age` | 简历、个人中心 |
|
||||
| `complaint_type` | 投诉弹窗、我的投诉 |
|
||||
| `user_type` | 政策列表、政策详情 |
|
||||
| `policy_category` | 政策列表 |
|
||||
|
||||
实现依据:[getDictValueEnum](../src/services/system/dict.ts#L34)、[行业树 service](../src/services/classify/industry.ts#L17)、[求职者 user service](../src/services/jobportal/user.ts#L3)。
|
||||
|
||||
## 6. 非 CMS 接口清单(27 条)
|
||||
|
||||
| ID | 方法与源码 request 路径 | 用途与主要参数/请求体 | 调用页面/组件 | 登录/触发条件 |
|
||||
| --- | --- | --- | --- | --- |
|
||||
| P01 | `GET /api/app/common/jobTitle/treeselect` | 职位/职位分类树 | 首页、职位列表、简历、职位选择组件 | 公共浏览 |
|
||||
| P02 | `GET /api/app/job/suggest` | 搜索联想:`keyword,limit` | `JobPortalHeader` | 输入关键词时 |
|
||||
| P03 | `GET /app/job/{jobId}` | 职位详情,注释说明含 `isApply,isCollection` | 职位列表、职位详情 | 公共详情;状态字段依登录态 |
|
||||
| P04 | `GET /app/job/competitiveness/{jobId}` | 职位竞争力、匹配分、排行、雷达数据 | 职位列表、职位详情 | 需登录,前端未登录时不请求 |
|
||||
| P05 | `POST /app/file/upload?bussinessid={userId}` | 上传“我的风采”文件,`multipart/form-data` | 我的风采 | 需登录、用户选择文件 |
|
||||
| P06 | `GET /app/file/list` | 查询“我的风采”文件;`bussinessid` | 我的风采 | 需登录 |
|
||||
| P07 | `DELETE /app/file/{id}` | 删除“我的风采”文件 | 我的风采 | 需登录 |
|
||||
| P08 | `DELETE /api/app/appskill/{id}` | 删除技能 | 简历 | 需登录 |
|
||||
| P09 | `GET /api/app/interview/list` | 我的面试邀约;`userId` | 面试邀约 | 需登录 |
|
||||
| P10 | `PUT /api/app/interview/status/{id}` | 接受/拒绝邀约;请求体 `{status}` | 面试邀约 | 需登录 |
|
||||
| P11 | `GET /api/app/policyInfo/portalList` | 门户政策列表 | 政策列表 | 公共浏览 |
|
||||
| P12 | `GET /api/app/policyInfo/detail/{id}` | 门户政策详情 | 政策详情 | 公共浏览 |
|
||||
| P13 | `GET /api/app/live/list` | 直播带岗列表;可带 `title,companyName` | 直播带岗 | 公共浏览 |
|
||||
| P14 | `GET /app/jobfair/public/jobfair/page` | 线上招聘会分页;`pageNum,pageSize,jobFairTitle,zphjbsj` | 招聘会 | 公共浏览 |
|
||||
| P15 | `GET /app/outdoor-fair/page` | 线下招聘会分页;参数同 P14 | 招聘会 | 公共浏览 |
|
||||
| P16 | `GET /app/jobfair/public/jobfair/dates` | 线上招聘会日期集合 | 招聘会 | 公共浏览 |
|
||||
| P17 | `GET /app/outdoor-fair/dates` | 线下招聘会日期集合 | 招聘会 | 公共浏览 |
|
||||
| P18 | `GET /app/jobfair/public/jobfair/currentMonth` | 当月线上招聘会摘要 | 招聘会 | 公共浏览 |
|
||||
| P19 | `GET /app/outdoor-fair/currentMonth` | 当月线下招聘会摘要 | 招聘会 | 公共浏览 |
|
||||
| P20 | `GET /app/jobfair/public/jobfair/currentQuarter` | 本季度线上招聘会摘要 | 招聘会 | 公共浏览 |
|
||||
| P21 | `GET /app/outdoor-fair/currentQuarter` | 本季度线下招聘会摘要 | 招聘会 | 公共浏览 |
|
||||
| P22 | `GET /app/jobfair/public/jobfair/detail` | 线上招聘会详情;`jobFairId` | 招聘会详情 | 公共浏览 |
|
||||
| P23 | `GET /app/outdoor-fair/{jobFairId}` | 线下招聘会详情 | 招聘会详情 | 公共浏览 |
|
||||
| P24 | `GET /app/jobfair/public/jobfair/enterprises-with-jobs-by-job-fair-id` | 线上招聘会企业及关联岗位;`jobFairId` | 招聘会详情 | 仅线上招聘会 |
|
||||
| P25 | `POST /api/sso/pcms/code/login` | 第三方 `code` 换取会话;请求体 `{code}`,不附现有 Token | 根路径/`login-tow` 的 SSO 过渡 | URL 含 `code` |
|
||||
| P26 | `POST /api/sso/pc/code/login` | 第三方 `token` 换取会话;请求体 `{code: token}`,不附现有 Token | 根路径/`login-tow` 的 SSO 过渡 | URL 含 `token` |
|
||||
| P27 | `GET /api/getInfo` | 当前会话用户资料;首页在“有 Token 但缓存未就绪”时补拉 | 首页、身份预取 | 有有效会话 |
|
||||
|
||||
实现依据:[职位通用 service](../src/services/common/jobTitle.ts#L3)、[招聘会 service](../src/services/jobportal/jobFair.ts#L139)、[竞争力 service](../src/services/jobportal/competitiveness.ts#L30)、[政策门户 service](../src/services/cms/policyInfo.ts#L12)、[SSO service](../src/services/jobportal/auth.ts#L10)。
|
||||
|
||||
## 7. 调用链和登录边界
|
||||
|
||||
```text
|
||||
浏览器 /shihezi/
|
||||
└─ 前端路由 /job-portal
|
||||
├─ 全局头部:P02、C01;登录后还会调用 C14
|
||||
├─ 首页:P01、C01、C23;有会话且缓存缺失时 P27
|
||||
├─ 职位列表/详情:P01、P03、P04、C01、C08~C11、C19、C20、C23、C25
|
||||
├─ 简历:P01、P08、C02、C03、C23、C24、C26~C30
|
||||
├─ 个人中心:C03~C07、C21~C23、C31~C32、P05~P07、P09~P10
|
||||
├─ 消息:C12~C18
|
||||
├─ 政策:P11~P12、C23、C33
|
||||
├─ 招聘会:P14~P24
|
||||
├─ 直播带岗:P13
|
||||
└─ 第三方进入:P25 / P26
|
||||
```
|
||||
|
||||
前端会在收藏、投递、投诉、屏蔽、简历和个人中心入口执行登录/用户 ID 前置校验;实现见 [jobPortalAuth.ts](../src/utils/jobPortalAuth.ts#L111)。这是用户体验保护,**不是**后端授权边界。特别是请求体中显式携带 `userId` 的 C05~C10、C19、C20 以及 P05/P06/P09,后端必须从认证主体推导用户 ID,或至少校验参数与认证主体一致。
|
||||
|
||||
## 8. 代码审查发现与建议
|
||||
|
||||
### 高优先级:CMS 路径在求职者端广泛使用
|
||||
|
||||
- **证据**:C01~C33 全部存在于求职者可达调用链,其中写操作至少包括收藏、取消收藏、投递、浏览记录、消息已读/删除、投诉、屏蔽、简历编辑、工作经历、技能维护及政策下载。
|
||||
- **风险**:若网关/后端将 `/cms/**` 视为后台路由,可能导致求职端功能被错误拒绝;反过来,若为兼容而放宽 `/cms/**`,则容易放大管理后台能力暴露面。
|
||||
- **建议**:
|
||||
1. 优先为求职者能力建立 `/app/**` 或 `/portal/**` 的专用 DTO、Controller 与权限策略;不要继续把“后台资源的 URI”作为前端契约。
|
||||
2. 迁移前,后端应按“求职者角色 + 资源归属”对全部 C05~C10、C19~C22、C26~C32 做强制校验。
|
||||
3. 迁移时保留短期兼容层,记录 `/cms/**` 的求职者访问量,确认无调用后再下线旧路由。
|
||||
|
||||
### 高优先级:`userId` 由客户端传入的水平越权面
|
||||
|
||||
涉及 C05~C10、C19、C20、P05、P06、P09。前端虽然通常从当前用户缓存读取 ID,但浏览器请求可被篡改。
|
||||
|
||||
- 后端不应信任请求中的 `userId` 来决定数据所有者。
|
||||
- 对“查看自己的投递/收藏/足迹/面试/文件”“增删自己的简历、投诉、屏蔽”等操作,应以认证 Token 的 subject 为准。
|
||||
- 若保留 `userId` 兼容字段,至少断言它等于当前登录求职者;不匹配时返回 403 并记录审计日志。
|
||||
|
||||
### 中优先级:方法与注释/命名不一致,容易误审权限
|
||||
|
||||
源码中存在多处注释与真实 HTTP 合约不一致:
|
||||
|
||||
- `favoriteJob` 注释写为 `/api/job-portal/list`,真实为 `POST /api/cms/job/collection`。
|
||||
- `unfavoriteJob` 注释写为 `DELETE /app/company/card/collection`,真实为 `POST /api/cms/job/collectionCancel`。
|
||||
- `applyJob` 注释写 `POST /api/cms/jobApply/apply`,真实为 `PUT /api/cms/jobApply`。
|
||||
- 多个消息函数的注释写 `appUser/*`,真实路径为 `notice/*`。
|
||||
|
||||
建议以 OpenAPI/接口类型为单一事实来源,自动生成 service;至少在服务函数名、JSDoc、HTTP 方法与实际 path 四者之间增加契约测试。
|
||||
|
||||
### 中优先级:匿名首页存在接口 502,且 UI 回退会掩盖问题
|
||||
|
||||
审查时 P01 与 C01 均返回 502,但首页仍展示静态示例岗位。建议:
|
||||
|
||||
- 生产环境不要把演示招聘数据作为接口失败的静默回退,改为明确的“加载失败/重试”状态。
|
||||
- 为 P01 和 C01 增加测试环境健康检查、网关 upstream 监控与告警。
|
||||
- UI 事件中记录去敏后的请求失败码和功能上下文,便于区分“暂无数据”与“网关故障”。
|
||||
|
||||
### 中优先级:政策下载混入 CMS 资源边界
|
||||
|
||||
政策列表/详情使用 P11/P12 门户接口,但下载使用 C33 的 `/cms/policyInfo/exportUtil`。建议提供对应的门户下载端点,并明确是否允许匿名下载、是否需要鉴权和审计。
|
||||
|
||||
### 低优先级:响应类型与权限语义需收敛
|
||||
|
||||
- `getJobDetail`、文件接口等返回类型过于宽泛(如 `API.Result` 或未显式类型),会削弱调用端对字段与错误码的约束。
|
||||
- 建议将列表、详情、写操作、下载和分页响应定义为独立类型;对 401、403、404、409 和 5xx 在 UI 层做一致处理。
|
||||
|
||||
## 9. 后端复核清单
|
||||
|
||||
在后端/网关侧逐项核查以下内容,才能把本前端审查升级为完整安全验收:
|
||||
|
||||
1. 对 C01~C33 所有实际路由,导出 Controller 映射、允许角色、认证注解和数据范围规则。
|
||||
2. 对所有含 `userId` 的 C05~C10、C19、C20、P05、P06、P09,验证越权请求会得到 403,而不会读取或写入他人数据。
|
||||
3. 对 C02、C26~C32 的写操作,确认审计字段(创建人、更新人、时间、操作来源)由服务端写入,不接受客户端伪造。
|
||||
4. 对 C33、P05~P07 的文件接口,验证文件归属、下载授权、MIME/大小限制、路径穿越防护与病毒扫描策略。
|
||||
5. 对 P25/P26 的 SSO 换票,确认 `code`/`token` 一次性、时效、重放防护、来源校验和 Token 不出现在日志中。
|
||||
6. 修复/定位测试环境 P01、C01 的 502 后,再分别用匿名求职者和测试登录求职者做只读接口冒烟测试。
|
||||
|
||||
## 10. 可复现的审查命令
|
||||
|
||||
以下命令只读取代码,可用于后续补充或复核:
|
||||
|
||||
```bash
|
||||
# 列出求职者路由
|
||||
rg -n "job-portal" config/routes.ts
|
||||
|
||||
# 找出求职者页面直接发起的 request
|
||||
rg -n "request\\(" src/pages/JobPortal src/components/JobPortalHeader \
|
||||
src/components/JobComplaintModal src/components/JobTitleSelector.tsx
|
||||
|
||||
# 找出涉及 CMS 的 service 调用
|
||||
rg -n "['\\\"]/api/cms/" src/pages/JobPortal src/services/jobportal \
|
||||
src/services/common src/services/cms src/services/classify src/services/system src/services/Management
|
||||
```
|
||||
|
||||
## 11. 未纳入范围
|
||||
|
||||
- 纯管理端、企业端、系统工具和小程序的接口。
|
||||
- 后端 Controller、数据库、网关权限的逐条实现验证。
|
||||
- 已被 service 定义但没有被求职者可达页面调用的管理端接口。
|
||||
- 本次没有使用测试账号执行任何写接口;表中所有写操作均来自静态调用链审查。
|
||||
@@ -7,7 +7,7 @@ BUILD_DIR="${BUILD_DIR:-${ROOT_DIR}/shihezi}"
|
||||
DEPLOY_HOST="${DEPLOY_HOST:-47.111.103.66}"
|
||||
DEPLOY_USER="${DEPLOY_USER:-root}"
|
||||
DEPLOY_SSH_PORT="${DEPLOY_SSH_PORT:-22}"
|
||||
DEPLOY_PATH="${DEPLOY_PATH:-/opt/service/project/shz-admin/dist}"
|
||||
DEPLOY_PATH="${DEPLOY_PATH:-/opt/service/project/shihezi}"
|
||||
YARN_CMD="${YARN_CMD:-yarn}"
|
||||
|
||||
SKIP_INSTALL=0
|
||||
@@ -39,7 +39,7 @@ usage() {
|
||||
|
||||
默认配置(均可通过环境变量覆盖):
|
||||
DEPLOY_USER SSH 用户名,默认 root
|
||||
DEPLOY_PATH 服务器上的前端静态文件目录,默认 /opt/service/project/shz-admin/dist
|
||||
DEPLOY_PATH 服务器上的前端静态文件目录,默认 /opt/service/project/shihezi
|
||||
DEPLOY_HOST SSH 主机,默认 47.111.103.66
|
||||
DEPLOY_SSH_PORT SSH 端口,默认 22
|
||||
BUILD_DIR 本地构建目录,默认 ./shihezi(由 config/config.ts 的 outputPath 决定)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import React, { useEffect, useRef, useState } from 'react';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import { useAccess } from '@umijs/max';
|
||||
import {
|
||||
PageContainer,
|
||||
@@ -11,6 +12,7 @@ import {
|
||||
import {
|
||||
Tabs,
|
||||
Card,
|
||||
DatePicker,
|
||||
Row,
|
||||
Col,
|
||||
Statistic,
|
||||
@@ -32,6 +34,7 @@ import {
|
||||
DeleteOutlined,
|
||||
EditOutlined,
|
||||
SettingOutlined,
|
||||
EyeOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import { getDictValueEnum } from '@/services/system/dict';
|
||||
import {
|
||||
@@ -44,13 +47,21 @@ import type {
|
||||
CrossCityAllianceItem,
|
||||
CrossCityAllianceForm,
|
||||
} from '@/services/jobfair/crossCityAlliance';
|
||||
import { getCrossDomainJobs } from '@/services/jobfair/publicJobFair';
|
||||
import { getCrossDomainJobs, getCrossDomainStatistics } from '@/services/jobfair/publicJobFair';
|
||||
import type { CrossDomainJobItem } from '@/services/jobfair/publicJobFair';
|
||||
|
||||
const { Title, Text } = Typography;
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
const PAGE_SIZE_FOR_STATS = 10000;
|
||||
|
||||
const getDefaultDateRange = (): [Dayjs, Dayjs] => [dayjs().subtract(1, 'month'), dayjs()];
|
||||
|
||||
const getDateRangePresets = () => [
|
||||
{ label: '近7天', value: [dayjs().subtract(6, 'day'), dayjs()] as [Dayjs, Dayjs] },
|
||||
{ label: '近1个月', value: getDefaultDateRange() },
|
||||
];
|
||||
|
||||
const getValueEnumText = (valueEnum: any, value?: string | number) => {
|
||||
if (value === undefined || value === null || value === '') return '-';
|
||||
const option = valueEnum[String(value)] || valueEnum[Number(value)];
|
||||
@@ -273,7 +284,8 @@ const CitySelectTab: React.FC<CitySelectTabProps> = ({
|
||||
</Spin>
|
||||
<div style={{ marginTop: 12, color: '#888' }}>
|
||||
已选择 {selectedCities.length > 0 ? selectedCities.length + ' 个区域' : '全部区域'}
|
||||
<span style={{ marginLeft: 8 }}>(选择区域后,到「各地市就业信息」查看对应岗位)</span>
|
||||
{/* 暂时隐藏各地市就业信息栏目,保留原提示便于后续恢复。 */}
|
||||
{/* <span style={{ marginLeft: 8 }}>(选择区域后,到「各地市就业信息」查看对应岗位)</span> */}
|
||||
</div>
|
||||
</Card>
|
||||
</div>
|
||||
@@ -379,12 +391,13 @@ const JobsTab: React.FC<{ selectedCities: string[] }> = ({ selectedCities }) =>
|
||||
// ==================== 数据统计 Tab ====================
|
||||
|
||||
const DataStatsTab: React.FC = () => {
|
||||
const [dateRange, setDateRange] = useState<[Dayjs, Dayjs]>(getDefaultDateRange());
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [stats, setStats] = useState({
|
||||
totalCities: 0,
|
||||
totalCompanies: 0,
|
||||
totalJobs: 0,
|
||||
totalVacancies: 0,
|
||||
totalViews: 0,
|
||||
industryDistribution: [] as { industry: string; count: number; percentage: string }[],
|
||||
monthlyJobs: [] as { month: string; count: number }[],
|
||||
});
|
||||
@@ -393,17 +406,26 @@ const DataStatsTab: React.FC = () => {
|
||||
const loadStats = async () => {
|
||||
setLoading(true);
|
||||
try {
|
||||
const [cityRes, jobRes] = await Promise.all([
|
||||
getCrossCityAllianceList({ pageSize: PAGE_SIZE_FOR_STATS }),
|
||||
getCrossDomainJobs({ current: 1, pageSize: PAGE_SIZE_FOR_STATS }),
|
||||
const startDate = dateRange[0].format('YYYY-MM-DD');
|
||||
const endDate = dateRange[1].format('YYYY-MM-DD');
|
||||
const [statisticsRes, jobRes] = await Promise.all([
|
||||
getCrossDomainStatistics({ startDate, endDate }),
|
||||
getCrossDomainJobs({
|
||||
startDate,
|
||||
endDate,
|
||||
current: 1,
|
||||
pageSize: PAGE_SIZE_FOR_STATS,
|
||||
}),
|
||||
]);
|
||||
const jobs = jobRes.rows || [];
|
||||
const companyIds = new Set(
|
||||
jobs
|
||||
.map((job) => job.companyId)
|
||||
.filter((companyId) => companyId !== undefined && companyId !== null),
|
||||
if (statisticsRes.code !== 200 || !statisticsRes.data) {
|
||||
throw new Error(statisticsRes.msg || '跨域招聘会统计加载失败');
|
||||
}
|
||||
|
||||
// 岗位可能被多场跨域招聘会引用,图表也必须按岗位 ID 去重。
|
||||
const jobs = Array.from(
|
||||
new Map((jobRes.rows || []).map((job) => [String(job.jobId), job])).values(),
|
||||
);
|
||||
const totalJobs = jobRes.total || jobs.length;
|
||||
const totalJobs = statisticsRes.data.jobCount;
|
||||
const industryCount = jobs.reduce<Record<string, number>>((acc, job) => {
|
||||
const industry = job.industry || '其他';
|
||||
acc[industry] = (acc[industry] || 0) + 1;
|
||||
@@ -417,10 +439,10 @@ const DataStatsTab: React.FC = () => {
|
||||
}, {});
|
||||
|
||||
setStats({
|
||||
totalCities: cityRes.total || cityRes.rows?.length || 0,
|
||||
totalCompanies: companyIds.size,
|
||||
totalCompanies: statisticsRes.data.companyCount,
|
||||
totalJobs,
|
||||
totalVacancies: jobs.reduce((sum, job) => sum + (Number(job.vacancies) || 0), 0),
|
||||
totalVacancies: statisticsRes.data.demandCount,
|
||||
totalViews: statisticsRes.data.viewCount,
|
||||
industryDistribution: Object.entries(industryCount).map(([industry, count]) => ({
|
||||
industry,
|
||||
count,
|
||||
@@ -430,12 +452,14 @@ const DataStatsTab: React.FC = () => {
|
||||
.sort(([a], [b]) => a.localeCompare(b))
|
||||
.map(([month, count]) => ({ month, count })),
|
||||
});
|
||||
} catch (error: any) {
|
||||
message.error(error?.message || '跨域招聘会统计加载失败,请稍后重试');
|
||||
} finally {
|
||||
setLoading(false);
|
||||
}
|
||||
};
|
||||
loadStats();
|
||||
}, []);
|
||||
}, [dateRange]);
|
||||
|
||||
const industryColumns = [
|
||||
{ title: '行业', dataIndex: 'industry', key: 'industry' },
|
||||
@@ -457,38 +481,44 @@ const DataStatsTab: React.FC = () => {
|
||||
return (
|
||||
<Spin spinning={loading}>
|
||||
<div style={{ padding: '0 0 24px 0' }}>
|
||||
<Card style={{ marginBottom: 16 }}>
|
||||
<Space wrap>
|
||||
<span>统计时间</span>
|
||||
<RangePicker
|
||||
value={dateRange}
|
||||
allowClear={false}
|
||||
presets={getDateRangePresets()}
|
||||
onChange={(value) => {
|
||||
if (value?.[0] && value?.[1]) {
|
||||
setDateRange(value as [Dayjs, Dayjs]);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</Space>
|
||||
</Card>
|
||||
|
||||
<Row gutter={[16, 16]} style={{ marginBottom: 24 }}>
|
||||
<Col xs={24} sm={6}>
|
||||
<Col xs={24} sm={12} lg={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="联盟城市数"
|
||||
value={stats.totalCities}
|
||||
prefix={<EnvironmentOutlined />}
|
||||
suffix="个"
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col xs={24} sm={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="参会企业总数"
|
||||
title="参会企业"
|
||||
value={stats.totalCompanies}
|
||||
prefix={<BankOutlined />}
|
||||
suffix="家"
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col xs={24} sm={6}>
|
||||
<Col xs={24} sm={12} lg={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="发布岗位总数"
|
||||
title="发布岗位数"
|
||||
value={stats.totalJobs}
|
||||
prefix={<FileTextOutlined />}
|
||||
suffix="个"
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col xs={24} sm={6}>
|
||||
<Col xs={24} sm={12} lg={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="招聘需求人数"
|
||||
@@ -498,6 +528,16 @@ const DataStatsTab: React.FC = () => {
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col xs={24} sm={12} lg={6}>
|
||||
<Card>
|
||||
<Statistic
|
||||
title="岗位浏览量"
|
||||
value={stats.totalViews}
|
||||
prefix={<EyeOutlined />}
|
||||
suffix="次"
|
||||
/>
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row gutter={[16, 16]}>
|
||||
@@ -524,6 +564,11 @@ const DataStatsTab: React.FC = () => {
|
||||
</Card>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Card size="small" title="统计口径">
|
||||
仅统计时间范围内招聘会类型为“线上”且标记为“跨域”的招聘会;参会企业按有效报名企业统计,即使企业未选择岗位也计入。岗位、招聘需求人数和浏览量均按岗位
|
||||
ID 去重,招聘数为空、填写“若干”或非正数时按 1 人计算。
|
||||
</Card>
|
||||
</div>
|
||||
</Spin>
|
||||
);
|
||||
@@ -563,6 +608,7 @@ const CrossCityFair: React.FC = () => {
|
||||
};
|
||||
|
||||
const tabItems = [
|
||||
/* 暂时隐藏各地市就业信息栏目,保留原实现便于后续恢复。
|
||||
{
|
||||
key: 'city-jobs',
|
||||
label: (
|
||||
@@ -573,6 +619,7 @@ const CrossCityFair: React.FC = () => {
|
||||
),
|
||||
children: <JobsTab selectedCities={selectedCities} />,
|
||||
},
|
||||
*/
|
||||
{
|
||||
key: 'statistics',
|
||||
label: (
|
||||
@@ -612,7 +659,7 @@ const CrossCityFair: React.FC = () => {
|
||||
}}
|
||||
>
|
||||
<Card>
|
||||
<Tabs defaultActiveKey="city-jobs" items={tabItems} tabBarStyle={{ marginBottom: 0 }} />
|
||||
<Tabs defaultActiveKey="statistics" items={tabItems} tabBarStyle={{ marginBottom: 0 }} />
|
||||
</Card>
|
||||
|
||||
<AllianceManageModal
|
||||
|
||||
@@ -1,209 +1,306 @@
|
||||
import React, { useEffect, useMemo, useState } from 'react';
|
||||
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
||||
import dayjs, { Dayjs } from 'dayjs';
|
||||
import {
|
||||
Button,
|
||||
Card,
|
||||
Col,
|
||||
DatePicker,
|
||||
Empty,
|
||||
Row,
|
||||
Segmented,
|
||||
Select,
|
||||
Spin,
|
||||
Statistic,
|
||||
Table,
|
||||
Typography,
|
||||
message,
|
||||
} from 'antd';
|
||||
import { ArrowDownOutlined, ArrowUpOutlined } from '@ant-design/icons';
|
||||
import { InfoCircleOutlined } from '@ant-design/icons';
|
||||
import { PageContainer } from '@ant-design/pro-components';
|
||||
import { Line } from '@ant-design/charts';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import { getOutdoorFairStatistics } from '@/services/jobportal/outdoorFair';
|
||||
import type {
|
||||
OutdoorFairStatisticsResult,
|
||||
OutdoorFairStatisticsSeriesItem,
|
||||
} from '@/services/jobportal/outdoorFair';
|
||||
import { getPublicJobFairList } from '@/services/jobfair/publicJobFair';
|
||||
import { getOutdoorFairList } from '@/services/jobportal/outdoorFair';
|
||||
import {
|
||||
getFairStatisticsSummary,
|
||||
type FairStatisticsFairItem,
|
||||
type FairStatisticsSummary,
|
||||
type RecruitmentFairType,
|
||||
} from '@/services/jobfair/fairStatistics';
|
||||
|
||||
const { RangePicker } = DatePicker;
|
||||
const { Text } = Typography;
|
||||
|
||||
type Granularity = 'day' | 'week' | 'month' | 'year';
|
||||
type StatisticsScope = 'single' | 'range';
|
||||
|
||||
const GRAN_OPTIONS: { label: string; value: Granularity }[] = [
|
||||
{ label: '按日', value: 'day' },
|
||||
{ label: '按周', value: 'week' },
|
||||
{ label: '按月', value: 'month' },
|
||||
{ label: '按年', value: 'year' },
|
||||
interface FairOption {
|
||||
value: string;
|
||||
label: string;
|
||||
}
|
||||
|
||||
const formatDate = (value: any): string | undefined =>
|
||||
value && typeof value.format === 'function' ? value.format('YYYY-MM-DD') : undefined;
|
||||
|
||||
const getDefaultDateRange = (): [Dayjs, Dayjs] => [dayjs().subtract(1, 'month'), dayjs()];
|
||||
|
||||
const getDateRangePresets = () => [
|
||||
{ label: '近7天', value: [dayjs().subtract(6, 'day'), dayjs()] as [Dayjs, Dayjs] },
|
||||
{ label: '近1个月', value: getDefaultDateRange() },
|
||||
];
|
||||
|
||||
const formatBound = (value: any, suffix: string): string | undefined => {
|
||||
if (value && typeof value.format === 'function') {
|
||||
return `${value.format('YYYY-MM-DD')} ${suffix}`;
|
||||
}
|
||||
return undefined;
|
||||
};
|
||||
|
||||
const FairStatistics: React.FC = () => {
|
||||
const [granularity, setGranularity] = useState<Granularity>('month');
|
||||
const [dateRange, setDateRange] = useState<any>(null);
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [result, setResult] = useState<OutdoorFairStatisticsResult | null>(null);
|
||||
const [fairType, setFairType] = useState<RecruitmentFairType>('online');
|
||||
const [scope, setScope] = useState<StatisticsScope>('range');
|
||||
const [fairOptions, setFairOptions] = useState<FairOption[]>([]);
|
||||
const [selectedFairId, setSelectedFairId] = useState<string>();
|
||||
const [dateRange, setDateRange] = useState<any>(getDefaultDateRange());
|
||||
const [loadingFairs, setLoadingFairs] = useState(false);
|
||||
const [loadingSummary, setLoadingSummary] = useState(false);
|
||||
const [summary, setSummary] = useState<FairStatisticsSummary>();
|
||||
|
||||
const fetchStats = async (gran: Granularity, range: any) => {
|
||||
setLoading(true);
|
||||
const interactionLabel = fairType === 'online' ? '投递岗位数' : '签到数';
|
||||
const interactionUnit = fairType === 'online' ? '个' : '人次';
|
||||
|
||||
const loadFairOptions = useCallback(async (type: RecruitmentFairType) => {
|
||||
setLoadingFairs(true);
|
||||
try {
|
||||
const res = await getOutdoorFairStatistics({
|
||||
granularity: gran,
|
||||
startTime: formatBound(range?.[0], '00:00:00'),
|
||||
endTime: formatBound(range?.[1], '23:59:59'),
|
||||
});
|
||||
if (res?.code === 200 && res.data) {
|
||||
setResult(res.data);
|
||||
if (type === 'online') {
|
||||
const res = await getPublicJobFairList({ pageNum: 1, pageSize: 1000, jobFairType: '1' });
|
||||
if (res.code !== 200) {
|
||||
message.error(res.msg || '线上招聘会列表加载失败');
|
||||
setFairOptions([]);
|
||||
return;
|
||||
}
|
||||
setFairOptions(
|
||||
(res.rows || []).map((item) => ({
|
||||
value: String(item.jobFairId),
|
||||
label: `${item.jobFairTitle}${item.jobFairStartTime ? `(${item.jobFairStartTime})` : ''}`,
|
||||
})),
|
||||
);
|
||||
} else {
|
||||
message.error(res?.msg || '统计失败');
|
||||
const res = await getOutdoorFairList({ current: 1, pageSize: 1000 });
|
||||
if (res.code !== 200) {
|
||||
message.error(res.msg || '户外招聘会列表加载失败');
|
||||
setFairOptions([]);
|
||||
return;
|
||||
}
|
||||
setFairOptions(
|
||||
(res.rows || []).map((item) => ({
|
||||
value: String(item.id),
|
||||
label: `${item.title}${item.holdTime ? `(${item.holdTime})` : ''}`,
|
||||
})),
|
||||
);
|
||||
}
|
||||
} catch (e) {
|
||||
message.error('统计失败');
|
||||
} catch {
|
||||
message.error('招聘会列表加载失败,请稍后重试');
|
||||
setFairOptions([]);
|
||||
} finally {
|
||||
setLoading(false);
|
||||
setLoadingFairs(false);
|
||||
}
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
loadFairOptions(fairType);
|
||||
}, [fairType, loadFairOptions]);
|
||||
|
||||
const handleFairTypeChange = (type: RecruitmentFairType) => {
|
||||
if (type === fairType) return;
|
||||
|
||||
// 切换类型时同步清空条件,避免新类型携带旧类型招聘会 ID 发起查询。
|
||||
setSelectedFairId(undefined);
|
||||
setDateRange(getDefaultDateRange());
|
||||
setSummary(undefined);
|
||||
setFairOptions([]);
|
||||
setFairType(type);
|
||||
};
|
||||
|
||||
// 粒度或日期变化即查询;区间半选(只选了一端)不查询,避免中途无效查询
|
||||
useEffect(() => {
|
||||
const complete = dateRange && dateRange[0] && dateRange[1];
|
||||
const empty = !dateRange || (!dateRange[0] && !dateRange[1]);
|
||||
if (complete) {
|
||||
fetchStats(granularity, dateRange);
|
||||
} else if (empty) {
|
||||
fetchStats(granularity, null);
|
||||
const queryReady = useMemo(() => {
|
||||
if (scope === 'single') return Boolean(selectedFairId);
|
||||
return Boolean(dateRange?.[0] && dateRange?.[1]);
|
||||
}, [dateRange, scope, selectedFairId]);
|
||||
|
||||
const loadSummary = useCallback(async () => {
|
||||
if (!queryReady) {
|
||||
setSummary(undefined);
|
||||
return;
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [granularity, dateRange]);
|
||||
setLoadingSummary(true);
|
||||
try {
|
||||
const res = await getFairStatisticsSummary({
|
||||
fairType,
|
||||
fairId: scope === 'single' ? selectedFairId : undefined,
|
||||
startDate: scope === 'range' ? formatDate(dateRange?.[0]) : undefined,
|
||||
endDate: scope === 'range' ? formatDate(dateRange?.[1]) : undefined,
|
||||
});
|
||||
if (res.code === 200 && res.data) {
|
||||
setSummary(res.data);
|
||||
} else {
|
||||
setSummary(undefined);
|
||||
message.error(res.msg || '统计数据加载失败');
|
||||
}
|
||||
} catch {
|
||||
setSummary(undefined);
|
||||
message.error('统计数据加载失败,请稍后重试');
|
||||
} finally {
|
||||
setLoadingSummary(false);
|
||||
}
|
||||
}, [dateRange, fairType, queryReady, scope, selectedFairId]);
|
||||
|
||||
const chartData = useMemo(() => {
|
||||
if (!result?.series) return [];
|
||||
const rows: { time: string; category: string; value: number }[] = [];
|
||||
result.series.forEach((item: OutdoorFairStatisticsSeriesItem) => {
|
||||
rows.push({ time: item.time, category: '招聘会数', value: item.fairCount });
|
||||
rows.push({ time: item.time, category: '参会单位数', value: item.companyCount });
|
||||
rows.push({ time: item.time, category: '职位数', value: item.jobCount });
|
||||
});
|
||||
return rows;
|
||||
}, [result]);
|
||||
useEffect(() => {
|
||||
loadSummary();
|
||||
}, [loadSummary]);
|
||||
|
||||
const columns: ColumnsType<OutdoorFairStatisticsSeriesItem> = [
|
||||
{ title: '时间', dataIndex: 'time', width: 140 },
|
||||
{ title: '招聘会数', dataIndex: 'fairCount', width: 120 },
|
||||
{ title: '参会单位数', dataIndex: 'companyCount', width: 120 },
|
||||
{ title: '职位数', dataIndex: 'jobCount', width: 120 },
|
||||
const columns: ColumnsType<FairStatisticsFairItem> = useMemo(
|
||||
() => [
|
||||
{ title: '招聘会名称', dataIndex: 'fairTitle', ellipsis: true },
|
||||
{ title: '起始时间', dataIndex: 'startTime', width: 180, render: (value) => value || '--' },
|
||||
{ title: '参会单位数', dataIndex: 'companyCount', width: 110, align: 'right' },
|
||||
{ title: '职位数', dataIndex: 'jobCount', width: 90, align: 'right' },
|
||||
{ title: '需求人数', dataIndex: 'demandCount', width: 100, align: 'right' },
|
||||
{ title: interactionLabel, dataIndex: 'interactionCount', width: 120, align: 'right' },
|
||||
],
|
||||
[interactionLabel],
|
||||
);
|
||||
|
||||
const statisticsCards = [
|
||||
{ title: '参会单位数', value: summary?.companyCount ?? 0, suffix: '家' },
|
||||
{ title: '职位数', value: summary?.jobCount ?? 0, suffix: '个' },
|
||||
{ title: '需求人数', value: summary?.demandCount ?? 0, suffix: '人' },
|
||||
{ title: interactionLabel, value: summary?.interactionCount ?? 0, suffix: interactionUnit },
|
||||
];
|
||||
|
||||
return (
|
||||
<PageContainer
|
||||
header={{ title: '招聘会数据统计' }}
|
||||
content="按年/周/月/日维度统计时间区间内的招聘会趋势,含累计发布招聘会数及同比、环比。"
|
||||
content="分别统计线上招聘会与户外招聘会;可查看单场招聘会,或按招聘会起始时间汇总一个时间段。"
|
||||
>
|
||||
<Card style={{ marginBottom: 16 }}>
|
||||
<Row gutter={16} align="middle">
|
||||
<Row gutter={[16, 16]} align="middle">
|
||||
<Col>
|
||||
<span style={{ marginRight: 8 }}>统计粒度</span>
|
||||
<Button.Group>
|
||||
<Button
|
||||
type={fairType === 'online' ? 'primary' : 'default'}
|
||||
onClick={() => handleFairTypeChange('online')}
|
||||
>
|
||||
线上招聘会
|
||||
</Button>
|
||||
<Button
|
||||
type={fairType === 'outdoor' ? 'primary' : 'default'}
|
||||
onClick={() => handleFairTypeChange('outdoor')}
|
||||
>
|
||||
户外招聘会
|
||||
</Button>
|
||||
</Button.Group>
|
||||
</Col>
|
||||
<Col>
|
||||
<span style={{ marginRight: 8 }}>统计范围</span>
|
||||
<Segmented
|
||||
value={granularity}
|
||||
onChange={(v) => setGranularity(v as Granularity)}
|
||||
options={GRAN_OPTIONS}
|
||||
value={scope}
|
||||
options={[
|
||||
{ label: '统计单场', value: 'single' },
|
||||
{ label: '按起始时间统计', value: 'range' },
|
||||
]}
|
||||
onChange={(value) => {
|
||||
const nextScope = value as StatisticsScope;
|
||||
if (nextScope === 'range' && !dateRange) {
|
||||
setDateRange(getDefaultDateRange());
|
||||
}
|
||||
setScope(nextScope);
|
||||
setSummary(undefined);
|
||||
}}
|
||||
/>
|
||||
</Col>
|
||||
<Col flex="auto">
|
||||
<span style={{ marginRight: 8, marginLeft: 16 }}>时间区间</span>
|
||||
<RangePicker
|
||||
value={dateRange}
|
||||
onChange={(v) => setDateRange(v)}
|
||||
style={{ width: 360 }}
|
||||
/>
|
||||
{scope === 'single' ? (
|
||||
<Select
|
||||
allowClear
|
||||
showSearch
|
||||
placeholder={`请选择一场${fairType === 'online' ? '线上' : '户外'}招聘会`}
|
||||
optionFilterProp="label"
|
||||
loading={loadingFairs}
|
||||
value={selectedFairId}
|
||||
options={fairOptions}
|
||||
onChange={(value) => setSelectedFairId(value)}
|
||||
style={{ width: '100%', minWidth: 320 }}
|
||||
/>
|
||||
) : (
|
||||
<RangePicker
|
||||
value={dateRange}
|
||||
allowClear={false}
|
||||
presets={getDateRangePresets()}
|
||||
onChange={(value) => setDateRange(value)}
|
||||
style={{ width: '100%', minWidth: 320 }}
|
||||
placeholder={['起始日期', '结束日期']}
|
||||
/>
|
||||
)}
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
|
||||
<Spin spinning={loading}>
|
||||
{result ? (
|
||||
<>
|
||||
<Row gutter={16} style={{ marginBottom: 16 }}>
|
||||
<Col span={8}>
|
||||
<Card>
|
||||
<Statistic title="累计发布招聘会数" value={result.totals.fairCount} />
|
||||
<div style={{ marginTop: 8 }}>
|
||||
<RateText label="同比" rate={result.yoy?.rate} />
|
||||
<span style={{ marginLeft: 16 }}>
|
||||
<RateText label="环比" rate={result.mom?.rate} />
|
||||
</span>
|
||||
</div>
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Card>
|
||||
<Statistic title="参会单位数" value={result.totals.companyCount} />
|
||||
</Card>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Card>
|
||||
<Statistic title="职位数" value={result.totals.jobCount} />
|
||||
</Card>
|
||||
</Col>
|
||||
<Spin spinning={loadingSummary}>
|
||||
<Card
|
||||
title={
|
||||
summary
|
||||
? `统计结果(共 ${summary.fairCount} 场${fairType === 'online' ? '线上' : '户外'}招聘会)`
|
||||
: '统计结果'
|
||||
}
|
||||
style={{ marginBottom: 16 }}
|
||||
>
|
||||
{queryReady ? (
|
||||
<Row gutter={[16, 16]}>
|
||||
{statisticsCards.map((item) => (
|
||||
<Col key={item.title} xs={24} sm={12} lg={6}>
|
||||
<Card
|
||||
size="small"
|
||||
style={{ background: item.title === interactionLabel ? '#f0f5ff' : '#fafafa' }}
|
||||
>
|
||||
<Statistic title={item.title} value={item.value} suffix={item.suffix} />
|
||||
</Card>
|
||||
</Col>
|
||||
))}
|
||||
</Row>
|
||||
) : (
|
||||
<Empty
|
||||
description={
|
||||
scope === 'single' ? '请选择一场招聘会' : '请选择完整的起始日期和结束日期'
|
||||
}
|
||||
/>
|
||||
)}
|
||||
</Card>
|
||||
|
||||
<Card title="招聘会趋势" style={{ marginBottom: 16 }} bodyStyle={{ padding: 12 }}>
|
||||
{chartData.length > 0 ? (
|
||||
<Line
|
||||
height={320}
|
||||
data={chartData}
|
||||
xField="time"
|
||||
yField="value"
|
||||
seriesField="category"
|
||||
smooth
|
||||
legend={{ position: 'bottom' }}
|
||||
tooltip={{
|
||||
fields: ['value'],
|
||||
}}
|
||||
/>
|
||||
) : (
|
||||
<Empty description="所选区间无数据" />
|
||||
)}
|
||||
</Card>
|
||||
|
||||
<Card title="分时段明细" bordered={false}>
|
||||
<Table<OutdoorFairStatisticsSeriesItem>
|
||||
rowKey="time"
|
||||
dataSource={result.series || []}
|
||||
columns={columns}
|
||||
pagination={false}
|
||||
size="small"
|
||||
/>
|
||||
</Card>
|
||||
</>
|
||||
) : (
|
||||
<Empty description="暂无数据" />
|
||||
{summary && (
|
||||
<Card title="涉及招聘会明细" style={{ marginBottom: 16 }} bodyStyle={{ paddingTop: 8 }}>
|
||||
<Table<FairStatisticsFairItem>
|
||||
rowKey="fairId"
|
||||
columns={columns}
|
||||
dataSource={summary.fairs || []}
|
||||
pagination={false}
|
||||
size="small"
|
||||
scroll={{ x: 860 }}
|
||||
/>
|
||||
</Card>
|
||||
)}
|
||||
</Spin>
|
||||
|
||||
<Card
|
||||
size="small"
|
||||
title={
|
||||
<span>
|
||||
<InfoCircleOutlined style={{ color: '#1677ff', marginRight: 8 }} />
|
||||
统计口径
|
||||
</span>
|
||||
}
|
||||
>
|
||||
<Row gutter={[24, 8]}>
|
||||
<Col xs={24} lg={12}>
|
||||
需求人数取岗位招聘数;招聘数填写“若干”、为空或非正数时,按 1 人计算。
|
||||
</Col>
|
||||
<Col xs={24} lg={12}>
|
||||
{fairType === 'online'
|
||||
? '线上招聘会统计投递岗位数,即本场有效招聘会岗位中至少有一条有效投递记录的岗位数。'
|
||||
: '户外招聘会不提供报名投递简历,统计现场签到记录数,不显示投递岗位数。'}
|
||||
</Col>
|
||||
</Row>
|
||||
</Card>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
const RateText: React.FC<{ label: string; rate?: number | null }> = ({ label, rate }) => {
|
||||
if (rate === null || rate === undefined) {
|
||||
return (
|
||||
<Text type="secondary">
|
||||
{label}:--
|
||||
</Text>
|
||||
);
|
||||
}
|
||||
const up = rate >= 0;
|
||||
const color = up ? '#cf1322' : '#3f8600';
|
||||
const pct = `${(rate * 100).toFixed(1)}%`;
|
||||
return (
|
||||
<Text style={{ color }}>
|
||||
{label}:
|
||||
{up ? <ArrowUpOutlined /> : <ArrowDownOutlined />} {pct}
|
||||
</Text>
|
||||
);
|
||||
};
|
||||
|
||||
export default FairStatistics;
|
||||
|
||||
172
src/pages/Jobfair/Institution/index.tsx
Normal file
172
src/pages/Jobfair/Institution/index.tsx
Normal file
@@ -0,0 +1,172 @@
|
||||
import React, { useRef, useState } from 'react';
|
||||
import { useAccess } from '@umijs/max';
|
||||
import { Button, message, Modal } from 'antd';
|
||||
import {
|
||||
ActionType,
|
||||
ModalForm,
|
||||
PageContainer,
|
||||
ProColumns,
|
||||
ProFormText,
|
||||
ProFormTextArea,
|
||||
ProTable,
|
||||
} from '@ant-design/pro-components';
|
||||
import { DeleteOutlined, EditOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
import {
|
||||
addJobFairInstitution,
|
||||
deleteJobFairInstitution,
|
||||
getJobFairInstitutionList,
|
||||
updateJobFairInstitution,
|
||||
} from '@/services/jobportal/jobFairInstitution';
|
||||
import type {
|
||||
JobFairInstitutionForm,
|
||||
JobFairInstitutionItem,
|
||||
} from '@/services/jobportal/jobFairInstitution';
|
||||
|
||||
const InstitutionManagement: React.FC = () => {
|
||||
const access = useAccess();
|
||||
const actionRef = useRef<ActionType>();
|
||||
const [formOpen, setFormOpen] = useState(false);
|
||||
const [currentRow, setCurrentRow] = useState<JobFairInstitutionItem>();
|
||||
|
||||
const handleDelete = (record: JobFairInstitutionItem) => {
|
||||
Modal.confirm({
|
||||
title: '确认删除',
|
||||
content: `确定要删除机构「${record.institutionName}」吗?如果该机构已被场地使用,需要先解除场地关联。`,
|
||||
onOk: async () => {
|
||||
const res = await deleteJobFairInstitution(record.id);
|
||||
if (res.code === 200) {
|
||||
message.success('删除成功');
|
||||
actionRef.current?.reload();
|
||||
} else {
|
||||
message.error(res.msg || '删除失败');
|
||||
}
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
const columns: ProColumns<JobFairInstitutionItem>[] = [
|
||||
{
|
||||
title: '机构名称',
|
||||
dataIndex: 'institutionName',
|
||||
ellipsis: true,
|
||||
width: 260,
|
||||
},
|
||||
{
|
||||
title: '机构简介',
|
||||
dataIndex: 'institutionIntro',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '创建时间',
|
||||
dataIndex: 'createTime',
|
||||
valueType: 'dateTime',
|
||||
hideInSearch: true,
|
||||
width: 180,
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
width: 160,
|
||||
fixed: 'right',
|
||||
render: (_, record) => [
|
||||
<Button
|
||||
key="edit"
|
||||
type="link"
|
||||
size="small"
|
||||
icon={<EditOutlined />}
|
||||
hidden={!access.hasPerms('cms:jobFairInstitution:edit')}
|
||||
onClick={() => {
|
||||
setCurrentRow(record);
|
||||
setFormOpen(true);
|
||||
}}
|
||||
>
|
||||
编辑
|
||||
</Button>,
|
||||
<Button
|
||||
key="delete"
|
||||
type="link"
|
||||
size="small"
|
||||
danger
|
||||
icon={<DeleteOutlined />}
|
||||
hidden={!access.hasPerms('cms:jobFairInstitution:remove')}
|
||||
onClick={() => handleDelete(record)}
|
||||
>
|
||||
删除
|
||||
</Button>,
|
||||
],
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<PageContainer>
|
||||
<ProTable<JobFairInstitutionItem>
|
||||
headerTitle="机构列表"
|
||||
actionRef={actionRef}
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
search={{ labelWidth: 'auto' }}
|
||||
scroll={{ x: 'max-content' }}
|
||||
request={async (params) => {
|
||||
const res = await getJobFairInstitutionList({
|
||||
institutionName: params.institutionName,
|
||||
current: params.current,
|
||||
pageSize: params.pageSize,
|
||||
});
|
||||
return { data: res.rows || [], total: res.total || 0, success: res.code === 200 };
|
||||
}}
|
||||
toolBarRender={() => [
|
||||
<Button
|
||||
key="add"
|
||||
type="primary"
|
||||
icon={<PlusOutlined />}
|
||||
hidden={!access.hasPerms('cms:jobFairInstitution:add')}
|
||||
onClick={() => {
|
||||
setCurrentRow(undefined);
|
||||
setFormOpen(true);
|
||||
}}
|
||||
>
|
||||
新增机构
|
||||
</Button>,
|
||||
]}
|
||||
/>
|
||||
|
||||
<ModalForm<JobFairInstitutionForm>
|
||||
title={currentRow ? '编辑机构' : '新增机构'}
|
||||
open={formOpen}
|
||||
initialValues={currentRow}
|
||||
modalProps={{ destroyOnClose: true, onCancel: () => setFormOpen(false) }}
|
||||
onFinish={async (values) => {
|
||||
const res = currentRow
|
||||
? await updateJobFairInstitution({ ...values, id: currentRow.id })
|
||||
: await addJobFairInstitution(values);
|
||||
if (res.code === 200) {
|
||||
message.success(currentRow ? '修改成功' : '新增成功');
|
||||
setFormOpen(false);
|
||||
setCurrentRow(undefined);
|
||||
actionRef.current?.reload();
|
||||
return true;
|
||||
}
|
||||
message.error(res.msg || '操作失败');
|
||||
return false;
|
||||
}}
|
||||
>
|
||||
<ProFormText
|
||||
name="institutionName"
|
||||
label="机构名称"
|
||||
rules={[{ required: true, message: '请输入机构名称' }]}
|
||||
fieldProps={{ maxLength: 200, showCount: true }}
|
||||
placeholder="请输入机构名称"
|
||||
/>
|
||||
<ProFormTextArea
|
||||
name="institutionIntro"
|
||||
label="机构简介"
|
||||
fieldProps={{ maxLength: 2000, showCount: true, rows: 5 }}
|
||||
placeholder="请输入机构简介"
|
||||
/>
|
||||
</ModalForm>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
export default InstitutionManagement;
|
||||
@@ -0,0 +1,63 @@
|
||||
import React, { useRef } from 'react';
|
||||
import { ActionType, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import { getCompanyUnsubscribes } from '@/services/jobportal/outdoorFairDetail';
|
||||
|
||||
interface Props {
|
||||
fairId: number;
|
||||
}
|
||||
|
||||
const CompanyUnsubscribeTab: React.FC<Props> = ({ fairId }) => {
|
||||
const actionRef = useRef<ActionType>();
|
||||
|
||||
const columns: ProColumns<API.OutdoorFairDetail.CompanyUnsubscribe>[] = [
|
||||
{
|
||||
title: '企业名称',
|
||||
dataIndex: 'companyName',
|
||||
ellipsis: true,
|
||||
order: 1,
|
||||
},
|
||||
{ title: '联系人', dataIndex: 'contactPerson', width: 120, hideInSearch: true },
|
||||
{ title: '联系电话', dataIndex: 'contactPhone', width: 150, hideInSearch: true },
|
||||
{
|
||||
title: '退订原因',
|
||||
dataIndex: 'reason',
|
||||
ellipsis: true,
|
||||
hideInSearch: true,
|
||||
render: (_, record) => <span title={record.reason}>{record.reason}</span>,
|
||||
},
|
||||
{
|
||||
title: '退订时间',
|
||||
dataIndex: 'unsubscribeTime',
|
||||
valueType: 'dateTime',
|
||||
width: 180,
|
||||
hideInSearch: true,
|
||||
},
|
||||
];
|
||||
|
||||
return (
|
||||
<ProTable<API.OutdoorFairDetail.CompanyUnsubscribe>
|
||||
headerTitle="企业退订记录"
|
||||
actionRef={actionRef}
|
||||
rowKey="id"
|
||||
columns={columns}
|
||||
search={{ labelWidth: 'auto' }}
|
||||
options={false}
|
||||
scroll={{ x: 'max-content' }}
|
||||
pagination={{ pageSize: 10 }}
|
||||
request={async (params) => {
|
||||
const res = await getCompanyUnsubscribes(fairId, {
|
||||
current: params.current,
|
||||
pageSize: params.pageSize,
|
||||
companyName: params.companyName,
|
||||
});
|
||||
return {
|
||||
data: res.rows || [],
|
||||
total: res.total || 0,
|
||||
success: res.code === 200,
|
||||
};
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
export default CompanyUnsubscribeTab;
|
||||
@@ -139,9 +139,9 @@ const FairInfoTab: React.FC<Props> = ({ fairInfo, onFairUpdate }) => {
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="展位数量">{fairInfo.boothCount}</Descriptions.Item>
|
||||
<Descriptions.Item label="举办时间">{fairInfo.holdTime}</Descriptions.Item>
|
||||
<Descriptions.Item label="截止时间">{fairInfo.endTime}</Descriptions.Item>
|
||||
<Descriptions.Item label="开放申请">{fairInfo.applyStartTime}</Descriptions.Item>
|
||||
<Descriptions.Item label="截止申请">{fairInfo.applyEndTime}</Descriptions.Item>
|
||||
<Descriptions.Item label="结束时间">{fairInfo.endTime}</Descriptions.Item>
|
||||
<Descriptions.Item label="报名开始时间">{fairInfo.applyStartTime}</Descriptions.Item>
|
||||
<Descriptions.Item label="报名截止时间">{fairInfo.applyEndTime}</Descriptions.Item>
|
||||
<Descriptions.Item label="线上申请">
|
||||
{fairInfo.onlineApply ? '是' : '否'}
|
||||
</Descriptions.Item>
|
||||
|
||||
@@ -9,6 +9,7 @@ import FairInfoTab from './components/FairInfoTab';
|
||||
import BoothTab from './components/BoothTab';
|
||||
import ParticipatingCompaniesTab from './components/ParticipatingCompaniesTab';
|
||||
import ParticipatingJobsTab from './components/ParticipatingJobsTab';
|
||||
import CompanyUnsubscribeTab from './components/CompanyUnsubscribeTab';
|
||||
import AttendeeTab from './components/AttendeeTab';
|
||||
import DeviceTab from './components/DeviceTab';
|
||||
|
||||
@@ -42,6 +43,7 @@ const OutdoorFairDetail: React.FC = () => {
|
||||
const tabItems = [
|
||||
{ key: 'fair-info', label: '招聘会管理' },
|
||||
{ key: 'participating-companies', label: '参会企业' },
|
||||
{ key: 'company-unsubscribe', label: '企业退订' },
|
||||
{ key: 'participating-jobs', label: '参会岗位' },
|
||||
{ key: 'attendee', label: '参会人员管理' },
|
||||
{ key: 'device', label: '设备管理' },
|
||||
@@ -86,6 +88,8 @@ const OutdoorFairDetail: React.FC = () => {
|
||||
return <BoothTab fairId={fairId} fairInfo={fairInfo} />;
|
||||
case 'participating-companies':
|
||||
return <ParticipatingCompaniesTab fairId={fairId} />;
|
||||
case 'company-unsubscribe':
|
||||
return <CompanyUnsubscribeTab fairId={fairId} />;
|
||||
case 'participating-jobs':
|
||||
return <ParticipatingJobsTab fairId={fairId} />;
|
||||
case 'attendee':
|
||||
|
||||
@@ -35,9 +35,9 @@ const CompanyFairDetailModal: React.FC<Props> = ({ fair, open, onCancel }) => (
|
||||
<Descriptions.Item label="展位数量">{fair.boothCount ?? '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="已预定摊位数">{fair.reservedBoothCount ?? 0}</Descriptions.Item>
|
||||
<Descriptions.Item label="举办时间">{fair.holdTime || '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="截止时间">{fair.endTime || '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="开放申请">{fair.applyStartTime || '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="截止申请">{fair.applyEndTime || '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="结束时间">{fair.endTime || '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="报名开始时间">{fair.applyStartTime || '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="报名截止时间">{fair.applyEndTime || '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="线上申请">
|
||||
<Tag color={fair.onlineApply ? 'green' : 'default'}>{fair.onlineApply ? '是' : '否'}</Tag>
|
||||
</Descriptions.Item>
|
||||
|
||||
@@ -10,6 +10,7 @@ import {
|
||||
} from '@ant-design/pro-components';
|
||||
import { Button, Divider, Form, Image, Input, message, Modal, Space, Upload } from 'antd';
|
||||
import { PlusOutlined, UploadOutlined } from '@ant-design/icons';
|
||||
import dayjs from 'dayjs';
|
||||
import type {
|
||||
OutdoorFairItem,
|
||||
OutdoorFairForm,
|
||||
@@ -140,6 +141,19 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
}
|
||||
};
|
||||
|
||||
const validateRegistrationDeadline = (_rule: unknown, value: unknown) => {
|
||||
const holdTime = form.getFieldValue('holdTime');
|
||||
if (!value || !holdTime) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
const deadline = dayjs(value as any);
|
||||
const fairHoldTime = dayjs(holdTime);
|
||||
if (!deadline.isValid() || !fairHoldTime.isValid() || !deadline.isAfter(fairHoldTime)) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return Promise.reject(new Error('报名截止时间不能晚于招聘会举办时间'));
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
title={values ? '编辑线下招聘会' : '新增线下招聘会'}
|
||||
@@ -270,25 +284,29 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
/>
|
||||
<ProFormDateTimePicker
|
||||
name="endTime"
|
||||
label="截止时间"
|
||||
label="结束时间"
|
||||
width="md"
|
||||
rules={[{ required: true, message: '请选择截止时间' }]}
|
||||
rules={[{ required: true, message: '请选择招聘会结束时间' }]}
|
||||
fieldProps={{ format: 'YYYY-MM-DD HH:mm:ss' }}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
<ProForm.Group>
|
||||
<ProFormDateTimePicker
|
||||
name="applyStartTime"
|
||||
label="开放申请"
|
||||
label="报名开始时间"
|
||||
width="md"
|
||||
rules={[{ required: true, message: '请选择开放申请时间' }]}
|
||||
rules={[{ required: true, message: '请选择报名开始时间' }]}
|
||||
fieldProps={{ format: 'YYYY-MM-DD HH:mm:ss' }}
|
||||
/>
|
||||
<ProFormDateTimePicker
|
||||
name="applyEndTime"
|
||||
label="截止申请"
|
||||
label="报名截止时间"
|
||||
width="md"
|
||||
rules={[{ required: true, message: '请选择截止申请时间' }]}
|
||||
dependencies={['holdTime']}
|
||||
rules={[
|
||||
{ required: true, message: '请选择报名截止时间' },
|
||||
{ validator: validateRegistrationDeadline },
|
||||
]}
|
||||
fieldProps={{ format: 'YYYY-MM-DD HH:mm:ss' }}
|
||||
/>
|
||||
</ProForm.Group>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
||||
import { useAccess, history, useModel } from '@umijs/max';
|
||||
import { Button, message, Modal, QRCode, Tag, Typography } from 'antd';
|
||||
import { Button, Form, Input, message, Modal, QRCode, Tag, Typography } from 'antd';
|
||||
import { ActionType, PageContainer, ProColumns, ProTable } from '@ant-design/pro-components';
|
||||
import {
|
||||
PlusOutlined,
|
||||
@@ -9,6 +9,7 @@ import {
|
||||
EyeOutlined,
|
||||
QrcodeOutlined,
|
||||
UnorderedListOutlined,
|
||||
ExportOutlined,
|
||||
} from '@ant-design/icons';
|
||||
import {
|
||||
getOutdoorFairList,
|
||||
@@ -17,7 +18,10 @@ import {
|
||||
deleteOutdoorFair,
|
||||
addOutdoorFairDictOption,
|
||||
signupOutdoorFair,
|
||||
unsubscribeOutdoorFair,
|
||||
getMyOutdoorFairQrCode,
|
||||
getOutdoorFairMiniProgramQrCode,
|
||||
exportOutdoorFair,
|
||||
} from '@/services/jobportal/outdoorFair';
|
||||
import type {
|
||||
OutdoorFairItem,
|
||||
@@ -25,6 +29,7 @@ import type {
|
||||
OutdoorFairForm,
|
||||
OutdoorFairDictForm,
|
||||
OutdoorFairCompanyQrCodeInfo,
|
||||
OutdoorFairMiniProgramQrCodeInfo,
|
||||
} from '@/services/jobportal/outdoorFair';
|
||||
import { getParticipatingJobs } from '@/services/jobportal/outdoorFairDetail';
|
||||
import { getDictSelectOption, getDictValueEnum } from '@/services/system/dict';
|
||||
@@ -34,6 +39,8 @@ import EditModal from './components/EditModal';
|
||||
import CompanyBoothMapModal from './components/CompanyBoothMapModal';
|
||||
import CompanyFairDetailModal from './components/CompanyFairDetailModal';
|
||||
import JobEditModal from './Detail/components/JobEditModal';
|
||||
import FairExportModal from '../components/FairExportModal';
|
||||
import type { RecruitmentFairExportParams } from '@/services/jobfair/recruitmentFairExport';
|
||||
|
||||
const OUTDOOR_FAIR_TYPE_DICT = 'outdoor_fair_type';
|
||||
const OUTDOOR_FAIR_REGION_DICT = 'outdoor_fair_region';
|
||||
@@ -51,8 +58,16 @@ const OutdoorFairList: React.FC = () => {
|
||||
const [jobEditModalOpen, setJobEditModalOpen] = useState(false);
|
||||
const [qrModalOpen, setQrModalOpen] = useState(false);
|
||||
const [qrInfo, setQrInfo] = useState<OutdoorFairCompanyQrCodeInfo | null>(null);
|
||||
const [miniProgramQrModalOpen, setMiniProgramQrModalOpen] = useState(false);
|
||||
const [miniProgramQrInfo, setMiniProgramQrInfo] =
|
||||
useState<OutdoorFairMiniProgramQrCodeInfo | null>(null);
|
||||
const [miniProgramQrLoadingFairId, setMiniProgramQrLoadingFairId] = useState<number>();
|
||||
const [rejectReasonModalOpen, setRejectReasonModalOpen] = useState(false);
|
||||
const [rejectReason, setRejectReason] = useState('');
|
||||
const [unsubscribeModalOpen, setUnsubscribeModalOpen] = useState(false);
|
||||
const [unsubscribeFair, setUnsubscribeFair] = useState<OutdoorFairItem | null>(null);
|
||||
const [unsubscribeSubmitting, setUnsubscribeSubmitting] = useState(false);
|
||||
const [unsubscribeForm] = Form.useForm();
|
||||
const [companyDetailFair, setCompanyDetailFair] = useState<OutdoorFairItem | null>(null);
|
||||
const [companyBoothFair, setCompanyBoothFair] = useState<OutdoorFairItem | null>(null);
|
||||
const [fairTypeValueEnum, setFairTypeValueEnum] = useState<Record<string, any>>({});
|
||||
@@ -64,6 +79,7 @@ const OutdoorFairList: React.FC = () => {
|
||||
const [experienceEnum, setExperienceEnum] = useState<any>({});
|
||||
const [areaEnum, setAreaEnum] = useState<any>({});
|
||||
const [jobTypeEnum, setJobTypeEnum] = useState<any>({});
|
||||
const [exportModalOpen, setExportModalOpen] = useState(false);
|
||||
|
||||
const renderReviewStatus = (status?: string) => {
|
||||
const map: Record<string, { color: string; text: string }> = {
|
||||
@@ -191,6 +207,23 @@ const OutdoorFairList: React.FC = () => {
|
||||
}
|
||||
};
|
||||
|
||||
const openMiniProgramQrCode = async (record: OutdoorFairItem) => {
|
||||
setMiniProgramQrLoadingFairId(record.id);
|
||||
try {
|
||||
const res = await getOutdoorFairMiniProgramQrCode(record.id);
|
||||
if (res.code === 200 && res.data?.imageData) {
|
||||
setMiniProgramQrInfo(res.data);
|
||||
setMiniProgramQrModalOpen(true);
|
||||
} else {
|
||||
message.error(res.msg || '小程序二维码加载失败');
|
||||
}
|
||||
} catch (error) {
|
||||
message.error('小程序二维码加载失败,请稍后重试');
|
||||
} finally {
|
||||
setMiniProgramQrLoadingFairId(undefined);
|
||||
}
|
||||
};
|
||||
|
||||
const openJobList = (record: OutdoorFairItem) => {
|
||||
setSelectedFair(record);
|
||||
setJobListModalOpen(true);
|
||||
@@ -206,6 +239,39 @@ const OutdoorFairList: React.FC = () => {
|
||||
setRejectReasonModalOpen(true);
|
||||
};
|
||||
|
||||
const openUnsubscribe = (record: OutdoorFairItem) => {
|
||||
setUnsubscribeFair(record);
|
||||
unsubscribeForm.resetFields();
|
||||
setUnsubscribeModalOpen(true);
|
||||
};
|
||||
|
||||
const handleUnsubscribe = async () => {
|
||||
let values: { reason: string };
|
||||
try {
|
||||
values = await unsubscribeForm.validateFields();
|
||||
} catch {
|
||||
return;
|
||||
}
|
||||
if (!unsubscribeFair) return;
|
||||
setUnsubscribeSubmitting(true);
|
||||
try {
|
||||
const res = await unsubscribeOutdoorFair(unsubscribeFair.id, values.reason);
|
||||
if (res.code === 200) {
|
||||
message.success('退订成功');
|
||||
setUnsubscribeModalOpen(false);
|
||||
setUnsubscribeFair(null);
|
||||
unsubscribeForm.resetFields();
|
||||
actionRef.current?.reload();
|
||||
} else {
|
||||
message.error(res.msg || '退订失败');
|
||||
}
|
||||
} catch {
|
||||
message.error('退订失败,请稍后重试');
|
||||
} finally {
|
||||
setUnsubscribeSubmitting(false);
|
||||
}
|
||||
};
|
||||
|
||||
const openCompanyDetail = (record: OutdoorFairItem) => {
|
||||
setCompanyDetailFair(record);
|
||||
};
|
||||
@@ -214,6 +280,17 @@ const OutdoorFairList: React.FC = () => {
|
||||
setCompanyBoothFair(record);
|
||||
};
|
||||
|
||||
const handleExport = async (params: RecruitmentFairExportParams) => {
|
||||
message.loading('正在导出...');
|
||||
try {
|
||||
await exportOutdoorFair(params);
|
||||
message.success('导出成功');
|
||||
setExportModalOpen(false);
|
||||
} catch {
|
||||
message.error('导出失败');
|
||||
}
|
||||
};
|
||||
|
||||
const jobColumns: ProColumns<API.OutdoorFairDetail.PostedJob>[] = [
|
||||
{ title: '岗位名称', dataIndex: 'jobTitle', ellipsis: true },
|
||||
{
|
||||
@@ -311,19 +388,19 @@ const OutdoorFairList: React.FC = () => {
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '截止时间',
|
||||
title: '结束时间',
|
||||
dataIndex: 'endTime',
|
||||
valueType: 'dateTime',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '开放申请',
|
||||
title: '报名开始时间',
|
||||
dataIndex: 'applyStartTime',
|
||||
valueType: 'dateTime',
|
||||
hideInSearch: true,
|
||||
},
|
||||
{
|
||||
title: '截止申请',
|
||||
title: '报名截止时间',
|
||||
dataIndex: 'applyEndTime',
|
||||
valueType: 'dateTime',
|
||||
hideInSearch: true,
|
||||
@@ -374,7 +451,7 @@ const OutdoorFairList: React.FC = () => {
|
||||
{
|
||||
title: '操作',
|
||||
valueType: 'option',
|
||||
width: isEnterprise ? 520 : 160,
|
||||
width: isEnterprise ? 520 : 260,
|
||||
fixed: 'right',
|
||||
render: (_, record) => [
|
||||
isEnterprise && !record.signedUp ? (
|
||||
@@ -409,13 +486,37 @@ const OutdoorFairList: React.FC = () => {
|
||||
查看报名岗位
|
||||
</Button>
|
||||
) : null,
|
||||
isEnterprise &&
|
||||
record.signedUp &&
|
||||
record.reviewStatus === '1' &&
|
||||
access.hasPerms('cms:outdoorFair:unsubscribe') ? (
|
||||
<Button
|
||||
key="unsubscribe"
|
||||
type="link"
|
||||
size="small"
|
||||
danger
|
||||
onClick={() => openUnsubscribe(record)}
|
||||
>
|
||||
退订
|
||||
</Button>
|
||||
) : null,
|
||||
isEnterprise ? (
|
||||
<Button key="companyDetail" type="link" size="small" onClick={() => openCompanyDetail(record)}>
|
||||
<Button
|
||||
key="companyDetail"
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() => openCompanyDetail(record)}
|
||||
>
|
||||
招聘会详情
|
||||
</Button>
|
||||
) : null,
|
||||
isEnterprise && record.signedUp && record.reviewStatus === '1' ? (
|
||||
<Button key="boothMap" type="link" size="small" onClick={() => openCompanyBoothMap(record)}>
|
||||
<Button
|
||||
key="boothMap"
|
||||
type="link"
|
||||
size="small"
|
||||
onClick={() => openCompanyBoothMap(record)}
|
||||
>
|
||||
查看展位图
|
||||
</Button>
|
||||
) : null,
|
||||
@@ -429,6 +530,17 @@ const OutdoorFairList: React.FC = () => {
|
||||
>
|
||||
详情
|
||||
</Button>,
|
||||
<Button
|
||||
key="miniProgramQrCode"
|
||||
type="link"
|
||||
size="small"
|
||||
icon={<QrcodeOutlined />}
|
||||
loading={miniProgramQrLoadingFairId === record.id}
|
||||
hidden={isEnterprise || !access.hasPerms('cms:outdoorFair:qrcode')}
|
||||
onClick={() => openMiniProgramQrCode(record)}
|
||||
>
|
||||
小程序二维码
|
||||
</Button>,
|
||||
<Button
|
||||
key="edit"
|
||||
type="link"
|
||||
@@ -491,6 +603,14 @@ const OutdoorFairList: React.FC = () => {
|
||||
>
|
||||
新增
|
||||
</Button>,
|
||||
<Button
|
||||
key="export"
|
||||
icon={<ExportOutlined />}
|
||||
hidden={!access.hasPerms('cms:outdoorFair:export')}
|
||||
onClick={() => setExportModalOpen(true)}
|
||||
>
|
||||
导出
|
||||
</Button>,
|
||||
]}
|
||||
/>
|
||||
<EditModal
|
||||
@@ -552,6 +672,55 @@ const OutdoorFairList: React.FC = () => {
|
||||
</div>
|
||||
)}
|
||||
</Modal>
|
||||
<Modal
|
||||
title={
|
||||
miniProgramQrInfo?.envVersion === 'trial'
|
||||
? '招聘会小程序二维码(体验版)'
|
||||
: '招聘会小程序二维码'
|
||||
}
|
||||
open={miniProgramQrModalOpen}
|
||||
width={420}
|
||||
footer={[
|
||||
<Button
|
||||
key="close"
|
||||
type="primary"
|
||||
onClick={() => {
|
||||
setMiniProgramQrModalOpen(false);
|
||||
setMiniProgramQrInfo(null);
|
||||
}}
|
||||
>
|
||||
关闭
|
||||
</Button>,
|
||||
]}
|
||||
destroyOnHidden
|
||||
onCancel={() => {
|
||||
setMiniProgramQrModalOpen(false);
|
||||
setMiniProgramQrInfo(null);
|
||||
}}
|
||||
>
|
||||
{miniProgramQrInfo?.imageData && (
|
||||
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center' }}>
|
||||
<img
|
||||
src={miniProgramQrInfo.imageData}
|
||||
alt="招聘会小程序二维码"
|
||||
style={{ width: 260, height: 260, objectFit: 'contain' }}
|
||||
/>
|
||||
<Typography.Text strong style={{ marginTop: 16, fontSize: 16 }}>
|
||||
请使用微信扫码
|
||||
</Typography.Text>
|
||||
{miniProgramQrInfo.envVersion === 'trial' && (
|
||||
<Typography.Text type="warning" style={{ marginTop: 8 }}>
|
||||
当前为体验版,仅项目成员或体验成员可扫码访问
|
||||
</Typography.Text>
|
||||
)}
|
||||
{miniProgramQrInfo.permanent && (
|
||||
<Typography.Text type="secondary" style={{ marginTop: 8 }}>
|
||||
此小程序码长期有效,无需定期更换
|
||||
</Typography.Text>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</Modal>
|
||||
<Modal
|
||||
title="驳回原因"
|
||||
open={rejectReasonModalOpen}
|
||||
@@ -566,6 +735,31 @@ const OutdoorFairList: React.FC = () => {
|
||||
{rejectReason}
|
||||
</Typography.Paragraph>
|
||||
</Modal>
|
||||
<Modal
|
||||
title={unsubscribeFair ? `退订招聘会 — ${unsubscribeFair.title}` : '退订招聘会'}
|
||||
open={unsubscribeModalOpen}
|
||||
destroyOnClose
|
||||
confirmLoading={unsubscribeSubmitting}
|
||||
onOk={handleUnsubscribe}
|
||||
okText="确认退订"
|
||||
cancelText="取消"
|
||||
onCancel={() => {
|
||||
if (unsubscribeSubmitting) return;
|
||||
setUnsubscribeModalOpen(false);
|
||||
setUnsubscribeFair(null);
|
||||
unsubscribeForm.resetFields();
|
||||
}}
|
||||
>
|
||||
<Form form={unsubscribeForm} layout="vertical">
|
||||
<Form.Item
|
||||
name="reason"
|
||||
label="退订原因"
|
||||
rules={[{ required: true, whitespace: true, message: '请填写退订原因' }]}
|
||||
>
|
||||
<Input.TextArea rows={5} maxLength={500} showCount placeholder="请说明退订原因" />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
<CompanyFairDetailModal
|
||||
fair={companyDetailFair}
|
||||
open={!!companyDetailFair}
|
||||
@@ -635,6 +829,15 @@ const OutdoorFairList: React.FC = () => {
|
||||
actionRef.current?.reload();
|
||||
}}
|
||||
/>
|
||||
<FairExportModal
|
||||
open={exportModalOpen}
|
||||
channel="outdoor"
|
||||
fairTypeOptions={fairTypeOptions}
|
||||
regionOptions={regionOptions}
|
||||
venueOptions={venueOptions}
|
||||
onCancel={() => setExportModalOpen(false)}
|
||||
onExport={handleExport}
|
||||
/>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -22,6 +22,8 @@ import {
|
||||
} from '@/services/jobfair/publicJobFair';
|
||||
import EditModal from './components/EditModal';
|
||||
import CompanyJobManageModal from './components/CompanyJobManageModal';
|
||||
import FairExportModal from '../components/FairExportModal';
|
||||
import type { RecruitmentFairExportParams } from '@/services/jobfair/recruitmentFairExport';
|
||||
|
||||
const PublicJobFairList: React.FC = () => {
|
||||
const access = useAccess();
|
||||
@@ -36,6 +38,7 @@ const PublicJobFairList: React.FC = () => {
|
||||
const [jobFairRegionTypeEnum, setJobFairRegionTypeEnum] = useState<any>({});
|
||||
const [yesNoEnum, setYesNoEnum] = useState<any>({});
|
||||
const [selectedRowKeys, setSelectedRowKeys] = useState<React.Key[]>([]);
|
||||
const [exportModalOpen, setExportModalOpen] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
getDictValueEnum('job_fair_type', true).then(setJobFairTypeEnum);
|
||||
@@ -76,27 +79,23 @@ const PublicJobFairList: React.FC = () => {
|
||||
});
|
||||
};
|
||||
|
||||
const buildListSearchParams = (values: Record<string, any>): API.PublicJobFair.ListParams => {
|
||||
const { dateRange, current, pageSize, ...rest } = values || {};
|
||||
const params = { ...rest } as API.PublicJobFair.ListParams;
|
||||
if (dateRange?.[0] && dateRange?.[1]) {
|
||||
params.startDate = dateRange[0];
|
||||
params.endDate = dateRange[1];
|
||||
}
|
||||
return params;
|
||||
};
|
||||
|
||||
const handleExport = async () => {
|
||||
const handleExport = async (params: RecruitmentFairExportParams) => {
|
||||
message.loading('正在导出...');
|
||||
try {
|
||||
const searchVal = formRef.current?.getFieldsValue();
|
||||
await exportPublicJobFair(buildListSearchParams(searchVal || {}));
|
||||
await exportPublicJobFair(params);
|
||||
message.success('导出成功');
|
||||
setExportModalOpen(false);
|
||||
} catch {
|
||||
message.error('导出失败');
|
||||
}
|
||||
};
|
||||
|
||||
const dictOptions = (valueEnum: Record<string, any>) =>
|
||||
Object.entries(valueEnum).map(([value, item]) => ({
|
||||
value,
|
||||
label: item?.text || item?.label || value,
|
||||
}));
|
||||
|
||||
const columns: ProColumns<API.PublicJobFair.JobFairItem>[] = [
|
||||
{
|
||||
title: '时间范围',
|
||||
@@ -124,6 +123,7 @@ const PublicJobFairList: React.FC = () => {
|
||||
hideInSearch: true,
|
||||
ellipsis: true,
|
||||
},
|
||||
/* 暂时隐藏线上招聘会列表中的招聘会类型字段,保留原实现便于后续恢复。
|
||||
{
|
||||
title: '类型',
|
||||
dataIndex: 'jobFairType',
|
||||
@@ -131,6 +131,7 @@ const PublicJobFairList: React.FC = () => {
|
||||
valueEnum: jobFairTypeEnum,
|
||||
render: (_, record) => <DictTag enums={jobFairTypeEnum} value={record.jobFairType} />,
|
||||
},
|
||||
*/
|
||||
{
|
||||
title: '区域类型',
|
||||
dataIndex: 'jobFairRegionType',
|
||||
@@ -336,7 +337,12 @@ const PublicJobFairList: React.FC = () => {
|
||||
批量删除
|
||||
</Button>
|
||||
),
|
||||
<Button key="export" icon={<ExportOutlined />} onClick={handleExport}>
|
||||
<Button
|
||||
key="export"
|
||||
icon={<ExportOutlined />}
|
||||
hidden={!access.hasPerms('cms:publicJobFair:export')}
|
||||
onClick={() => setExportModalOpen(true)}
|
||||
>
|
||||
导出
|
||||
</Button>,
|
||||
]}
|
||||
@@ -373,6 +379,14 @@ const PublicJobFairList: React.FC = () => {
|
||||
setCurrentJobFair(undefined);
|
||||
}}
|
||||
/>
|
||||
<FairExportModal
|
||||
open={exportModalOpen}
|
||||
channel="online"
|
||||
fairTypeOptions={dictOptions(jobFairTypeEnum)}
|
||||
regionOptions={dictOptions(jobFairRegionTypeEnum)}
|
||||
onCancel={() => setExportModalOpen(false)}
|
||||
onExport={handleExport}
|
||||
/>
|
||||
</PageContainer>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -8,9 +8,21 @@ import {
|
||||
getVenueInfo,
|
||||
updateVenueInfo,
|
||||
} from '@/services/jobportal/venueInfo';
|
||||
import type { VenueInfoDictForm, VenueInfoForm, VenueInfoItem } from '@/services/jobportal/venueInfo';
|
||||
import type {
|
||||
VenueInfoDictForm,
|
||||
VenueInfoForm,
|
||||
VenueInfoItem,
|
||||
} 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';
|
||||
|
||||
const VENUE_TYPE_DICT = 'venue_info_type';
|
||||
@@ -25,6 +37,7 @@ const VenueInfoDetail: React.FC = () => {
|
||||
const [venueTypeOptions, setVenueTypeOptions] = useState<any[]>([]);
|
||||
const [venueTypeValueEnum, setVenueTypeValueEnum] = useState<Record<string, any>>({});
|
||||
const [lineOptions, setLineOptions] = useState<any[]>([]);
|
||||
const [institutionOptions, setInstitutionOptions] = useState<JobFairInstitutionItem[]>([]);
|
||||
|
||||
const fetchVenueInfo = useCallback(async () => {
|
||||
if (!venueId) {
|
||||
@@ -45,10 +58,11 @@ const VenueInfoDetail: React.FC = () => {
|
||||
}, [venueId]);
|
||||
|
||||
const refreshOptions = useCallback(async () => {
|
||||
const [valueEnum, options, lineRes] = await Promise.all([
|
||||
const [valueEnum, options, lineRes, institutionRes] = await Promise.all([
|
||||
getDictValueEnum(VENUE_TYPE_DICT),
|
||||
getDictSelectOption(VENUE_TYPE_DICT),
|
||||
getCmsLineList({ current: '1', pageSize: '999' } as any),
|
||||
getJobFairInstitutionList({ current: 1, pageSize: 9999 }),
|
||||
]);
|
||||
setVenueTypeValueEnum(valueEnum);
|
||||
setVenueTypeOptions(options);
|
||||
@@ -60,8 +74,23 @@ const VenueInfoDetail: React.FC = () => {
|
||||
})),
|
||||
);
|
||||
}
|
||||
if (institutionRes.code === 200) {
|
||||
setInstitutionOptions(institutionRes.rows || []);
|
||||
}
|
||||
}, []);
|
||||
|
||||
const handleCreateInstitution = async (values: JobFairInstitutionForm) => {
|
||||
const res = await addJobFairInstitution(values);
|
||||
if (res.code === 200 && res.data) {
|
||||
const listRes = await getJobFairInstitutionList({ current: 1, pageSize: 9999 });
|
||||
if (listRes.code === 200) setInstitutionOptions(listRes.rows || []);
|
||||
message.success('机构新增成功');
|
||||
return res.data;
|
||||
}
|
||||
message.error(res.msg || '机构新增失败');
|
||||
return undefined;
|
||||
};
|
||||
|
||||
useEffect(() => {
|
||||
fetchVenueInfo();
|
||||
refreshOptions();
|
||||
@@ -80,11 +109,7 @@ const VenueInfoDetail: React.FC = () => {
|
||||
|
||||
const venueTypeLabel = (val?: string) => {
|
||||
if (!val) return '--';
|
||||
return (
|
||||
venueTypeValueEnum[val]?.text ||
|
||||
venueTypeValueEnum[val]?.label ||
|
||||
val
|
||||
);
|
||||
return venueTypeValueEnum[val]?.text || venueTypeValueEnum[val]?.label || val;
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -120,27 +145,20 @@ const VenueInfoDetail: React.FC = () => {
|
||||
<Descriptions.Item label="场地面积">
|
||||
{venueInfo.venueArea != null ? `${venueInfo.venueArea} ㎡` : '--'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="展位数量">
|
||||
{venueInfo.floorCount ?? '--'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="展位数量">{venueInfo.floorCount ?? '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="场地地址" span={2}>
|
||||
{venueInfo.venueAddress || '--'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="联系电话">
|
||||
{venueInfo.contactPhone || '--'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="联系电话">{venueInfo.contactPhone || '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="乘坐线路" span={3}>
|
||||
{venueInfo.routeLineNames || '--'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="经办日期">
|
||||
{venueInfo.handleDate || '--'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="经办机构">
|
||||
{venueInfo.handleOrg || '--'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="经办人">
|
||||
{venueInfo.handler || '--'}
|
||||
<Descriptions.Item label="经办日期">{venueInfo.handleDate || '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="经办机构">{venueInfo.handleOrg || '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="所属机构" span={3}>
|
||||
{venueInfo.institutionNames || '--'}
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="经办人">{venueInfo.handler || '--'}</Descriptions.Item>
|
||||
<Descriptions.Item label="备注" span={3}>
|
||||
{venueInfo.remark || '--'}
|
||||
</Descriptions.Item>
|
||||
@@ -155,6 +173,9 @@ const VenueInfoDetail: React.FC = () => {
|
||||
values={venueInfo}
|
||||
venueTypeOptions={venueTypeOptions}
|
||||
lineOptions={lineOptions}
|
||||
institutionOptions={institutionOptions}
|
||||
canCreateInstitution={access.hasPerms('cms:jobFairInstitution:add')}
|
||||
onCreateInstitution={handleCreateInstitution}
|
||||
onCreateDictOption={handleCreateDictOption}
|
||||
onCancel={() => setEditModalOpen(false)}
|
||||
onSubmit={async (values: VenueInfoForm) => {
|
||||
|
||||
@@ -10,6 +10,10 @@ import {
|
||||
} from '@ant-design/pro-components';
|
||||
import { Button, Divider, Form, Input, Modal, Space } from 'antd';
|
||||
import { PlusOutlined } from '@ant-design/icons';
|
||||
import type {
|
||||
JobFairInstitutionForm,
|
||||
JobFairInstitutionItem,
|
||||
} from '@/services/jobportal/jobFairInstitution';
|
||||
import type {
|
||||
VenueInfoDictForm,
|
||||
VenueInfoForm,
|
||||
@@ -21,8 +25,13 @@ interface EditModalProps {
|
||||
values?: VenueInfoItem;
|
||||
venueTypeOptions: any[];
|
||||
lineOptions: any[];
|
||||
institutionOptions: JobFairInstitutionItem[];
|
||||
canCreateInstitution: boolean;
|
||||
defaultHandler?: string;
|
||||
onCreateDictOption: (values: VenueInfoDictForm) => Promise<boolean>;
|
||||
onCreateInstitution: (
|
||||
values: JobFairInstitutionForm,
|
||||
) => Promise<JobFairInstitutionItem | undefined>;
|
||||
onCancel: () => void;
|
||||
onSubmit: (values: VenueInfoForm) => Promise<void>;
|
||||
}
|
||||
@@ -44,8 +53,11 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
values,
|
||||
venueTypeOptions,
|
||||
lineOptions,
|
||||
institutionOptions,
|
||||
canCreateInstitution,
|
||||
defaultHandler,
|
||||
onCreateDictOption,
|
||||
onCreateInstitution,
|
||||
onCancel,
|
||||
onSubmit,
|
||||
}) => {
|
||||
@@ -53,6 +65,9 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
const [dictModalOpen, setDictModalOpen] = useState(false);
|
||||
const [dictInputValue, setDictInputValue] = useState('');
|
||||
const [dictSubmitLoading, setDictSubmitLoading] = useState(false);
|
||||
const [institutionModalOpen, setInstitutionModalOpen] = useState(false);
|
||||
const [institutionSubmitLoading, setInstitutionSubmitLoading] = useState(false);
|
||||
const [institutionForm] = Form.useForm<JobFairInstitutionForm>();
|
||||
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
@@ -61,6 +76,7 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
form.setFieldsValue({
|
||||
...values,
|
||||
routeLineIds: splitRouteLineIds(values.routeLineIds),
|
||||
institutionIds: values.institutionIds || [],
|
||||
});
|
||||
} else {
|
||||
form.setFieldsValue({
|
||||
@@ -111,6 +127,45 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
}
|
||||
};
|
||||
|
||||
const renderInstitutionDropdown = (menu: React.ReactElement): React.ReactElement => (
|
||||
<>
|
||||
{menu}
|
||||
{canCreateInstitution && (
|
||||
<>
|
||||
<Divider style={{ margin: '8px 0' }} />
|
||||
<Space style={{ padding: '0 8px 8px' }}>
|
||||
<Button
|
||||
type="link"
|
||||
icon={<PlusOutlined />}
|
||||
onMouseDown={(event) => event.preventDefault()}
|
||||
onClick={() => {
|
||||
institutionForm.resetFields();
|
||||
setInstitutionModalOpen(true);
|
||||
}}
|
||||
>
|
||||
快速新增机构
|
||||
</Button>
|
||||
</Space>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
|
||||
const handleInstitutionModalOk = async () => {
|
||||
try {
|
||||
const values = await institutionForm.validateFields();
|
||||
setInstitutionSubmitLoading(true);
|
||||
const created = await onCreateInstitution(values);
|
||||
if (created) {
|
||||
const selectedIds = (form.getFieldValue('institutionIds') || []) as number[];
|
||||
form.setFieldValue('institutionIds', [...selectedIds, created.id]);
|
||||
setInstitutionModalOpen(false);
|
||||
}
|
||||
} finally {
|
||||
setInstitutionSubmitLoading(false);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<ModalForm
|
||||
title={values ? '编辑场地' : '添加场地'}
|
||||
@@ -190,6 +245,21 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
}}
|
||||
placeholder="请选择乘坐线路"
|
||||
/>
|
||||
<ProFormSelect
|
||||
name="institutionIds"
|
||||
label="所属机构"
|
||||
mode="multiple"
|
||||
options={institutionOptions.map((item) => ({
|
||||
label: item.institutionName,
|
||||
value: item.id,
|
||||
}))}
|
||||
fieldProps={{
|
||||
showSearch: true,
|
||||
optionFilterProp: 'label',
|
||||
dropdownRender: renderInstitutionDropdown,
|
||||
}}
|
||||
placeholder="请选择所属机构,可多选"
|
||||
/>
|
||||
<ProFormTextArea
|
||||
name="remark"
|
||||
label="备注"
|
||||
@@ -224,6 +294,27 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
onPressEnter={handleDictModalOk}
|
||||
/>
|
||||
</Modal>
|
||||
<Modal
|
||||
title="快速新增机构"
|
||||
open={institutionModalOpen}
|
||||
confirmLoading={institutionSubmitLoading}
|
||||
onOk={handleInstitutionModalOk}
|
||||
onCancel={() => setInstitutionModalOpen(false)}
|
||||
destroyOnClose
|
||||
>
|
||||
<Form form={institutionForm} layout="vertical">
|
||||
<Form.Item
|
||||
name="institutionName"
|
||||
label="机构名称"
|
||||
rules={[{ required: true, message: '请输入机构名称' }]}
|
||||
>
|
||||
<Input maxLength={200} showCount placeholder="请输入机构名称" />
|
||||
</Form.Item>
|
||||
<Form.Item name="institutionIntro" label="机构简介">
|
||||
<Input.TextArea maxLength={2000} showCount rows={4} placeholder="请输入机构简介" />
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
</ModalForm>
|
||||
);
|
||||
};
|
||||
|
||||
@@ -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={() => {
|
||||
|
||||
265
src/pages/Jobfair/components/FairExportModal.tsx
Normal file
265
src/pages/Jobfair/components/FairExportModal.tsx
Normal file
@@ -0,0 +1,265 @@
|
||||
import React, { useEffect } from 'react';
|
||||
import type { Dayjs } from 'dayjs';
|
||||
import { Button, Col, DatePicker, Form, Input, Modal, Row, Select, Space } from 'antd';
|
||||
import type {
|
||||
RecruitmentFairExportChannel,
|
||||
RecruitmentFairExportParams,
|
||||
RecruitmentFairExportType,
|
||||
} from '@/services/jobfair/recruitmentFairExport';
|
||||
|
||||
const { RangePicker } = DatePicker;
|
||||
|
||||
interface Option {
|
||||
label?: React.ReactNode;
|
||||
text?: React.ReactNode;
|
||||
value: string | number | boolean;
|
||||
}
|
||||
|
||||
interface FormValues {
|
||||
exportType: RecruitmentFairExportType;
|
||||
title?: string;
|
||||
hostUnit?: string;
|
||||
fairType?: string;
|
||||
region?: string;
|
||||
venueId?: number;
|
||||
address?: string;
|
||||
startRange?: [Dayjs, Dayjs];
|
||||
endRange?: [Dayjs, Dayjs];
|
||||
applyRange?: [Dayjs, Dayjs];
|
||||
createRange?: [Dayjs, Dayjs];
|
||||
fairStatus?: RecruitmentFairExportParams['fairStatus'];
|
||||
isCrossDomain?: string;
|
||||
onlineApply?: boolean;
|
||||
reviewStatus?: RecruitmentFairExportParams['reviewStatus'];
|
||||
}
|
||||
|
||||
interface Props {
|
||||
open: boolean;
|
||||
channel: RecruitmentFairExportChannel;
|
||||
fairTypeOptions?: Option[];
|
||||
regionOptions?: Option[];
|
||||
venueOptions?: Option[];
|
||||
onCancel: () => void;
|
||||
onExport: (params: RecruitmentFairExportParams) => Promise<void>;
|
||||
}
|
||||
|
||||
const toOptions = (options: Option[] = []) =>
|
||||
options.map((item) => ({
|
||||
label: item.label ?? item.text,
|
||||
value: item.value,
|
||||
}));
|
||||
|
||||
const dateRange = (range?: [Dayjs, Dayjs]) =>
|
||||
range
|
||||
? {
|
||||
start: range[0].format('YYYY-MM-DD HH:mm:ss'),
|
||||
end: range[1].format('YYYY-MM-DD HH:mm:ss'),
|
||||
}
|
||||
: undefined;
|
||||
|
||||
const FairExportModal: React.FC<Props> = ({
|
||||
open,
|
||||
channel,
|
||||
fairTypeOptions,
|
||||
regionOptions,
|
||||
venueOptions,
|
||||
onCancel,
|
||||
onExport,
|
||||
}) => {
|
||||
const [form] = Form.useForm<FormValues>();
|
||||
const isOnline = channel === 'online';
|
||||
|
||||
useEffect(() => {
|
||||
if (open) {
|
||||
form.resetFields();
|
||||
form.setFieldsValue({ exportType: 'companies' });
|
||||
}
|
||||
}, [form, open]);
|
||||
|
||||
const submit = async (values: FormValues) => {
|
||||
const start = dateRange(values.startRange);
|
||||
const end = dateRange(values.endRange);
|
||||
const apply = dateRange(values.applyRange);
|
||||
const create = dateRange(values.createRange);
|
||||
await onExport({
|
||||
exportType: values.exportType,
|
||||
title: values.title?.trim() || undefined,
|
||||
hostUnit: values.hostUnit?.trim() || undefined,
|
||||
fairType: values.fairType,
|
||||
region: values.region,
|
||||
venueId: values.venueId,
|
||||
address: values.address?.trim() || undefined,
|
||||
startTime: start?.start,
|
||||
endTime: end?.end,
|
||||
applyStartTime: apply?.start,
|
||||
applyEndTime: apply?.end,
|
||||
createStartTime: create?.start,
|
||||
createEndTime: create?.end,
|
||||
fairStatus: values.fairStatus,
|
||||
isCrossDomain: isOnline ? values.isCrossDomain : undefined,
|
||||
onlineApply: isOnline ? undefined : values.onlineApply,
|
||||
reviewStatus: values.reviewStatus,
|
||||
});
|
||||
};
|
||||
|
||||
return (
|
||||
<Modal
|
||||
title={`${isOnline ? '线上' : '户外'}招聘会参会数据导出`}
|
||||
open={open}
|
||||
width={820}
|
||||
destroyOnClose
|
||||
footer={null}
|
||||
onCancel={onCancel}
|
||||
>
|
||||
<Form<FormValues>
|
||||
form={form}
|
||||
layout="vertical"
|
||||
initialValues={{ exportType: 'companies' }}
|
||||
onFinish={submit}
|
||||
>
|
||||
<Form.Item
|
||||
label="导出内容"
|
||||
name="exportType"
|
||||
rules={[{ required: true, message: '请选择导出内容' }]}
|
||||
>
|
||||
<Select
|
||||
options={[
|
||||
{ label: '导出所有参会企业', value: 'companies' },
|
||||
{ label: '导出所有参加岗位', value: 'jobs' },
|
||||
{ label: '导出企业和岗位(每个企业一个 sheet)', value: 'companyJobs' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Form.Item label="招聘会标题" name="title">
|
||||
<Input allowClear placeholder="支持模糊查询" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="举办单位" name="hostUnit">
|
||||
<Input allowClear placeholder="支持模糊查询" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label="招聘会类型" name="fairType">
|
||||
<Select allowClear options={toOptions(fairTypeOptions)} placeholder="全部" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={8}>
|
||||
<Form.Item label={isOnline ? '区域类型' : '举办区域'} name="region">
|
||||
<Select allowClear options={toOptions(regionOptions)} placeholder="全部" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
{!isOnline && (
|
||||
<Col span={8}>
|
||||
<Form.Item label="场地" name="venueId">
|
||||
<Select
|
||||
allowClear
|
||||
showSearch
|
||||
optionFilterProp="label"
|
||||
options={toOptions(venueOptions)}
|
||||
placeholder="全部"
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
)}
|
||||
<Col span={8}>
|
||||
<Form.Item label="举办地址" name="address">
|
||||
<Input allowClear placeholder="支持模糊查询" />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col span={12}>
|
||||
<Form.Item label="招聘会开始时间范围" name="startRange">
|
||||
<RangePicker showTime format="YYYY-MM-DD HH:mm:ss" style={{ width: '100%' }} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="招聘会结束时间范围" name="endRange">
|
||||
<RangePicker showTime format="YYYY-MM-DD HH:mm:ss" style={{ width: '100%' }} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="报名时间范围" name="applyRange">
|
||||
<RangePicker showTime format="YYYY-MM-DD HH:mm:ss" style={{ width: '100%' }} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
<Col span={12}>
|
||||
<Form.Item label="创建时间范围" name="createRange">
|
||||
<RangePicker showTime format="YYYY-MM-DD HH:mm:ss" style={{ width: '100%' }} />
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Row gutter={16}>
|
||||
<Col span={8}>
|
||||
<Form.Item label="举办状态" name="fairStatus">
|
||||
<Select
|
||||
allowClear
|
||||
placeholder="全部"
|
||||
options={[
|
||||
{ label: '未举办', value: 'NOT_STARTED' },
|
||||
{ label: '正在举办', value: 'ONGOING' },
|
||||
{ label: '已举办', value: 'ENDED' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
{isOnline ? (
|
||||
<Col span={8}>
|
||||
<Form.Item label="是否跨域" name="isCrossDomain">
|
||||
<Select
|
||||
allowClear
|
||||
placeholder="全部"
|
||||
options={[
|
||||
{ label: '是', value: 'Y' },
|
||||
{ label: '否', value: 'N' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
) : (
|
||||
<Col span={8}>
|
||||
<Form.Item label="是否开启线上申请" name="onlineApply">
|
||||
<Select
|
||||
allowClear
|
||||
placeholder="全部"
|
||||
options={[
|
||||
{ label: '是', value: true },
|
||||
{ label: '否', value: false },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
)}
|
||||
<Col span={8}>
|
||||
<Form.Item label="审核状态" name="reviewStatus">
|
||||
<Select
|
||||
allowClear
|
||||
placeholder="全部"
|
||||
options={[
|
||||
{ label: '待审核', value: '0' },
|
||||
{ label: '审核通过', value: '1' },
|
||||
{ label: '审核不通过', value: '2' },
|
||||
]}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
<Space style={{ width: '100%', justifyContent: 'flex-end' }}>
|
||||
<Button onClick={onCancel}>取消</Button>
|
||||
<Button type="primary" htmlType="submit">
|
||||
开始导出
|
||||
</Button>
|
||||
</Space>
|
||||
</Form>
|
||||
</Modal>
|
||||
);
|
||||
};
|
||||
|
||||
export default FairExportModal;
|
||||
45
src/services/jobfair/fairStatistics.ts
Normal file
45
src/services/jobfair/fairStatistics.ts
Normal file
@@ -0,0 +1,45 @@
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
const BASE_URL = '/api/cms/fair-statistics';
|
||||
|
||||
export type RecruitmentFairType = 'online' | 'outdoor';
|
||||
|
||||
export interface FairStatisticsFairItem {
|
||||
fairId: string;
|
||||
fairTitle: string;
|
||||
startTime?: string;
|
||||
companyCount: number;
|
||||
jobCount: number;
|
||||
demandCount: number;
|
||||
/** 线上为投递岗位数,户外为签到数。 */
|
||||
interactionCount: number;
|
||||
}
|
||||
|
||||
export interface FairStatisticsSummary {
|
||||
fairType: RecruitmentFairType;
|
||||
fairCount: number;
|
||||
companyCount: number;
|
||||
jobCount: number;
|
||||
demandCount: number;
|
||||
interactionCount: number;
|
||||
fairs: FairStatisticsFairItem[];
|
||||
}
|
||||
|
||||
export interface FairStatisticsSummaryParams {
|
||||
fairType: RecruitmentFairType;
|
||||
/** 传该值时统计一场招聘会。 */
|
||||
fairId?: string;
|
||||
/** 与 fairId 二选一,按招聘会起始时间统计。 */
|
||||
startDate?: string;
|
||||
endDate?: string;
|
||||
}
|
||||
|
||||
export async function getFairStatisticsSummary(params: FairStatisticsSummaryParams) {
|
||||
return request<{ code: number; msg?: string; data?: FairStatisticsSummary }>(
|
||||
`${BASE_URL}/summary`,
|
||||
{
|
||||
method: 'GET',
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
@@ -1,5 +1,6 @@
|
||||
import { request } from '@umijs/max';
|
||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||
import type { RecruitmentFairExportParams } from './recruitmentFairExport';
|
||||
|
||||
const BASE_URL = '/api/cms/publicJobFair';
|
||||
|
||||
@@ -29,6 +30,7 @@ export interface PublicJobFairJobForm {
|
||||
export interface CrossDomainJobItem {
|
||||
jobId: number;
|
||||
jobTitle: string;
|
||||
view?: number;
|
||||
minSalary?: number;
|
||||
maxSalary?: number;
|
||||
education?: string;
|
||||
@@ -48,6 +50,10 @@ export interface CrossDomainJobItem {
|
||||
export interface CrossDomainJobParams {
|
||||
/** 逗号分隔的城市名称 */
|
||||
cityNames?: string;
|
||||
/** 招聘会起始日期(含当天) */
|
||||
startDate?: string;
|
||||
/** 招聘会起始日期(含当天) */
|
||||
endDate?: string;
|
||||
current?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
@@ -68,6 +74,30 @@ export async function getCrossDomainJobs(params?: CrossDomainJobParams) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 查询跨域线上招聘会的去重统计。 */
|
||||
export interface CrossDomainStatisticsParams {
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
}
|
||||
|
||||
export interface CrossDomainStatistics {
|
||||
fairCount: number;
|
||||
companyCount: number;
|
||||
jobCount: number;
|
||||
demandCount: number;
|
||||
viewCount: number;
|
||||
}
|
||||
|
||||
export async function getCrossDomainStatistics(params: CrossDomainStatisticsParams) {
|
||||
return request<{ code: number; msg?: string; data?: CrossDomainStatistics }>(
|
||||
`${BASE_URL}/cross-domain-statistics`,
|
||||
{
|
||||
method: 'GET',
|
||||
params,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/** 查询招聘会列表 */
|
||||
export async function getPublicJobFairList(params?: API.PublicJobFair.ListParams) {
|
||||
return request<API.PublicJobFair.ListResult>(`${BASE_URL}/list`, {
|
||||
@@ -227,6 +257,10 @@ export async function getJobFairCompanies(jobFairId: string) {
|
||||
}
|
||||
|
||||
/** 导出招聘会 */
|
||||
export async function exportPublicJobFair(params?: API.PublicJobFair.ListParams) {
|
||||
return downLoadXlsx(`${BASE_URL}/export`, { params }, `job_fair_${new Date().getTime()}.xlsx`);
|
||||
export async function exportPublicJobFair(params: RecruitmentFairExportParams) {
|
||||
return downLoadXlsx(
|
||||
`${BASE_URL}/export`,
|
||||
{ params },
|
||||
`online_fair_participants_${new Date().getTime()}.xlsx`,
|
||||
);
|
||||
}
|
||||
|
||||
37
src/services/jobfair/recruitmentFairExport.ts
Normal file
37
src/services/jobfair/recruitmentFairExport.ts
Normal file
@@ -0,0 +1,37 @@
|
||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||
|
||||
export type RecruitmentFairExportType = 'companies' | 'jobs' | 'companyJobs';
|
||||
|
||||
export interface RecruitmentFairExportParams {
|
||||
exportType: RecruitmentFairExportType;
|
||||
title?: string;
|
||||
hostUnit?: string;
|
||||
fairType?: string;
|
||||
region?: string;
|
||||
venueId?: number;
|
||||
venueName?: string;
|
||||
address?: string;
|
||||
startTime?: string;
|
||||
endTime?: string;
|
||||
applyStartTime?: string;
|
||||
applyEndTime?: string;
|
||||
createStartTime?: string;
|
||||
createEndTime?: string;
|
||||
fairStatus?: 'NOT_STARTED' | 'ONGOING' | 'ENDED';
|
||||
isCrossDomain?: string;
|
||||
onlineApply?: boolean;
|
||||
reviewStatus?: '0' | '1' | '2';
|
||||
}
|
||||
|
||||
export type RecruitmentFairExportChannel = 'online' | 'outdoor';
|
||||
|
||||
/** 下载线上/户外招聘会参会数据 Excel。 */
|
||||
export function exportRecruitmentFair(
|
||||
channel: RecruitmentFairExportChannel,
|
||||
params: RecruitmentFairExportParams,
|
||||
) {
|
||||
const endpoint =
|
||||
channel === 'online' ? '/api/cms/publicJobFair/export' : '/api/cms/outdoor-fair/export';
|
||||
const filePrefix = channel === 'online' ? 'online_fair' : 'outdoor_fair';
|
||||
return downLoadXlsx(endpoint, { params }, `${filePrefix}_participants_${Date.now()}.xlsx`);
|
||||
}
|
||||
72
src/services/jobportal/jobFairInstitution.ts
Normal file
72
src/services/jobportal/jobFairInstitution.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
export interface JobFairInstitutionItem {
|
||||
id: number;
|
||||
/** 机构名称 */
|
||||
institutionName: string;
|
||||
/** 机构简介 */
|
||||
institutionIntro?: string;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
|
||||
export interface JobFairInstitutionForm {
|
||||
id?: number;
|
||||
institutionName: string;
|
||||
institutionIntro?: string;
|
||||
}
|
||||
|
||||
export interface JobFairInstitutionListParams {
|
||||
institutionName?: string;
|
||||
current?: number;
|
||||
pageSize?: number;
|
||||
}
|
||||
|
||||
export interface JobFairInstitutionListResult {
|
||||
code: number;
|
||||
msg?: string;
|
||||
total: number;
|
||||
rows: JobFairInstitutionItem[];
|
||||
}
|
||||
|
||||
export interface JobFairInstitutionResult {
|
||||
code: number;
|
||||
msg?: string;
|
||||
data?: JobFairInstitutionItem;
|
||||
}
|
||||
|
||||
const BASE_URL = '/api/cms/job-fair-institution';
|
||||
|
||||
export async function getJobFairInstitutionList(params?: JobFairInstitutionListParams) {
|
||||
return request<JobFairInstitutionListResult>(`${BASE_URL}/list`, {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
export async function getJobFairInstitution(id: number) {
|
||||
return request<JobFairInstitutionResult>(`${BASE_URL}/${id}`, {
|
||||
method: 'GET',
|
||||
});
|
||||
}
|
||||
|
||||
export async function addJobFairInstitution(data: JobFairInstitutionForm) {
|
||||
return request<JobFairInstitutionResult>(BASE_URL, {
|
||||
method: 'POST',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export async function updateJobFairInstitution(data: JobFairInstitutionForm) {
|
||||
return request<JobFairInstitutionResult>(BASE_URL, {
|
||||
method: 'PUT',
|
||||
data,
|
||||
});
|
||||
}
|
||||
|
||||
export async function deleteJobFairInstitution(ids: number | number[]) {
|
||||
const idPath = Array.isArray(ids) ? ids.join(',') : ids;
|
||||
return request<JobFairInstitutionResult>(`${BASE_URL}/${idPath}`, {
|
||||
method: 'DELETE',
|
||||
});
|
||||
}
|
||||
@@ -1,5 +1,7 @@
|
||||
import { request } from '@umijs/max';
|
||||
import type { VenueBoothItem } from './venueInfo';
|
||||
import { downLoadXlsx } from '@/utils/downloadfile';
|
||||
import type { RecruitmentFairExportParams } from '@/services/jobfair/recruitmentFairExport';
|
||||
|
||||
/** 户外招聘会列表项 */
|
||||
export interface OutdoorFairItem {
|
||||
@@ -24,11 +26,11 @@ export interface OutdoorFairItem {
|
||||
reservedBoothCount?: number;
|
||||
/** 举办时间 */
|
||||
holdTime: string;
|
||||
/** 截止时间 */
|
||||
/** 招聘会结束时间 */
|
||||
endTime: string;
|
||||
/** 开放申请 */
|
||||
/** 报名开始时间 */
|
||||
applyStartTime: string;
|
||||
/** 截止申请 */
|
||||
/** 报名截止时间 */
|
||||
applyEndTime: string;
|
||||
/** 是否开启线上申请 */
|
||||
onlineApply: boolean;
|
||||
@@ -134,6 +136,20 @@ export interface OutdoorFairCompanyQrCodeInfo {
|
||||
qrCodeContent: string;
|
||||
}
|
||||
|
||||
/** 管理端查看的招聘会微信小程序码。 */
|
||||
export interface OutdoorFairMiniProgramQrCodeInfo {
|
||||
fairId: number;
|
||||
page: string;
|
||||
scene: string;
|
||||
/** 小程序目标版本:当前尚未正式发布,默认为体验版 trial。 */
|
||||
envVersion: 'trial' | 'release' | 'develop';
|
||||
imageData: string;
|
||||
/** getUnlimitedQRCode 生成的小程序码长期有效。 */
|
||||
permanent: boolean;
|
||||
/** 小程序码本身是否需要周期轮换。 */
|
||||
rotationRequired: boolean;
|
||||
}
|
||||
|
||||
/** 企业审核通过后可读取的只读展位图。 */
|
||||
export interface OutdoorFairCompanyBoothMap {
|
||||
currentCompanyId: number;
|
||||
@@ -174,6 +190,15 @@ export async function getOutdoorFairList(params?: OutdoorFairListParams) {
|
||||
});
|
||||
}
|
||||
|
||||
/** 导出户外招聘会参会企业/岗位。 */
|
||||
export async function exportOutdoorFair(params: RecruitmentFairExportParams) {
|
||||
return downLoadXlsx(
|
||||
`${CMS_OUTDOOR_FAIR_BASE}/export`,
|
||||
{ params },
|
||||
`outdoor_fair_participants_${new Date().getTime()}.xlsx`,
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取户外招聘会详情
|
||||
* GET /api/cms/outdoor-fair/{id}
|
||||
@@ -296,6 +321,17 @@ export async function signupOutdoorFair(fairId: number) {
|
||||
);
|
||||
}
|
||||
|
||||
/** 当前企业退订已审核通过的户外招聘会。 */
|
||||
export async function unsubscribeOutdoorFair(fairId: number, reason: string) {
|
||||
return request<{ code: number; msg?: string }>(
|
||||
`${CMS_OUTDOOR_FAIR_BASE}/${fairId}/company/unsubscribe`,
|
||||
{
|
||||
method: 'POST',
|
||||
data: { reason },
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前企业户外招聘会二维码
|
||||
* GET /api/cms/outdoor-fair/{fairId}/company/qrcode
|
||||
@@ -307,6 +343,17 @@ export async function getMyOutdoorFairQrCode(fairId: number) {
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 管理员获取招聘会微信小程序码
|
||||
* GET /api/cms/outdoor-fair/{fairId}/mini-program-qrcode
|
||||
*/
|
||||
export async function getOutdoorFairMiniProgramQrCode(fairId: number) {
|
||||
return request<{ code: number; msg?: string; data: OutdoorFairMiniProgramQrCodeInfo }>(
|
||||
`${CMS_OUTDOOR_FAIR_BASE}/${fairId}/mini-program-qrcode`,
|
||||
{ method: 'GET' },
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 上传户外招聘会照片
|
||||
* POST /api/common/upload
|
||||
|
||||
@@ -1027,6 +1027,26 @@ export async function getParticipatingCompanies(
|
||||
);
|
||||
}
|
||||
|
||||
/** 获取招聘会企业退订记录。 */
|
||||
export async function getCompanyUnsubscribes(
|
||||
fairId: number,
|
||||
params?: {
|
||||
current?: number;
|
||||
pageSize?: number;
|
||||
companyName?: string;
|
||||
},
|
||||
) {
|
||||
return request<{
|
||||
code: number;
|
||||
msg?: string;
|
||||
total: number;
|
||||
rows: API.OutdoorFairDetail.CompanyUnsubscribe[];
|
||||
}>(`/api/cms/outdoor-fair/${fairId}/company-unsubscribes`, {
|
||||
method: 'GET',
|
||||
params,
|
||||
});
|
||||
}
|
||||
|
||||
/** 分页获取招聘会参会岗位,可按企业懒加载。 */
|
||||
export async function getParticipatingJobs(
|
||||
fairId: number,
|
||||
|
||||
@@ -27,6 +27,10 @@ export interface VenueInfoItem {
|
||||
handler?: string;
|
||||
/** 备注 */
|
||||
remark?: string;
|
||||
/** 所属机构ID,支持多个 */
|
||||
institutionIds?: number[];
|
||||
/** 所属机构名称,多个用顿号分隔 */
|
||||
institutionNames?: string;
|
||||
createTime?: string;
|
||||
updateTime?: string;
|
||||
}
|
||||
@@ -63,6 +67,7 @@ export interface VenueInfoForm {
|
||||
handleOrg?: string;
|
||||
handler?: string;
|
||||
remark?: string;
|
||||
institutionIds?: number[];
|
||||
}
|
||||
|
||||
/** 通用响应 */
|
||||
@@ -103,6 +108,7 @@ const formatDate = (value: any) => {
|
||||
const toApiPayload = (data: VenueInfoForm) => ({
|
||||
...data,
|
||||
routeLineIds: Array.isArray(data.routeLineIds) ? data.routeLineIds.join(',') : data.routeLineIds,
|
||||
institutionIds: Array.isArray(data.institutionIds) ? data.institutionIds : [],
|
||||
handleDate: formatDate(data.handleDate),
|
||||
});
|
||||
|
||||
|
||||
12
src/types/jobfair/outdoorFairDetail.d.ts
vendored
12
src/types/jobfair/outdoorFairDetail.d.ts
vendored
@@ -34,6 +34,18 @@ declare namespace API.OutdoorFairDetail {
|
||||
jobList?: PostedJob[];
|
||||
}
|
||||
|
||||
/** 企业退订记录 */
|
||||
export interface CompanyUnsubscribe {
|
||||
id: number;
|
||||
fairId: number;
|
||||
companyId: number;
|
||||
companyName: string;
|
||||
contactPerson?: string;
|
||||
contactPhone?: string;
|
||||
reason: string;
|
||||
unsubscribeTime: string;
|
||||
}
|
||||
|
||||
/** 参会企业二维码信息 */
|
||||
export interface CompanyQrCodeInfo {
|
||||
fairId: number;
|
||||
|
||||
Reference in New Issue
Block a user