Commit 395520b9 authored by 李文光's avatar 李文光

feat: 优化岗位编辑与简历初筛建议

- 岗位匹配条件改为多行文本域
- 候选人列表补充表头并优化台账式布局
- 统一初筛建议取值与评估来源优先级
- 未筛选阶段按初筛建议约束下一步,人工推进后以人工结论为准
parent 318341ef
......@@ -68,6 +68,7 @@
## 评估与匹配
- **初筛建议(Screening Recommendation)**:系统根据岗位要求与候选人简历证据生成的招聘建议,固定取值为「待绑定岗位 / 待补全简历 / 待评估 / 需重评 / 建议推进 / 建议复核 / 建议暂缓」,用于辅助 HR 决策;它不是人工初筛结论,也不表示候选人当前阶段。有效 AI 评估优先,其次为快速匹配;AI 评估已有决策时保留其原始决策含义,只有缺失或无法识别时才按 85 / 72 分档兜底;人工阶段变化不覆盖该建议。_Avoid_: 初筛结论、初筛状态。
- **自述优势(Self-Claimed Strengths / 自我评价)**:候选人在简历中对自己能力、性格、经历的主观自述(如「自我评价」「核心竞争力」「个人优势」段落)。规则:不作为 AI 匹配 / 亮点 / 证据依据,只能作为面试待验证线索。
- **简历事实(Resume Facts)**:可从简历客观内容核实或引用的匹配依据——工作 / 项目 / 实习经历的职责、产出与结果数据、教育背景、证书与明确列出的技能。AI 评估只以此类内容作为匹配与亮点证据。
- **风险固定维度(Fixed Risk Dimensions)**:候选人风险只按四个固定维度评估——跳槽频率(任职时间线推算)、竞业协议(岗位对内 `nonCompete` 是否命中,需人力确认上一家竞业)、职业空窗(任职间隔 gap ≥12/24 个月提示)、高层职业道德(总监/VP/首席等高层专属背调提示)。规则本地确定性计算(`risk_profile.py`),每项输出「提示 + 依据(简历时间线/岗位说明)」,由 HR 人工确认,不直接扣分。
......@@ -83,6 +84,7 @@
## 流程与联动
- **初筛建议约束(Screening Recommendation Gate)**:候选人仍处于「未筛选」时,下一步必须服从初筛建议:建议复核或建议暂缓时先复核评估,不直接推进面试;HR 人工推进到「初筛通过」后,以人工结论为准,下一步显示按人工结论推进。
- **事件日志(Event Log)**:每个关键动作留下的操作记录,用于时间线与追溯。
- **待办(Task)**:需要 HR 跟进的事项,随候选人 / 岗位 / Offer 状态自动增删。
- **下推联动**:候选人 / 岗位 / Offer 的状态变化与事件日志、待办自动保持一致。
......
......@@ -726,17 +726,37 @@ if (isNew.value && ['paste', 'template'].includes(String(route.query.import || '
<el-form-item label="任职要求" required class="jd-long-text">
<el-input v-model="form.requirements" type="textarea" :autosize="{ minRows: 9, maxRows: 40 }" />
</el-form-item>
<el-form-item label="硬性条件(逗号分隔)">
<el-input v-model="form.mustHave" placeholder="如 本科, 5年经验, 电气专业" />
<el-form-item label="硬性条件(逗号或换行分隔)">
<el-input
v-model="form.mustHave"
type="textarea"
:autosize="{ minRows: 3, maxRows: 8 }"
placeholder="如 本科, 5年经验, 电气专业"
/>
</el-form-item>
<el-form-item label="加分项(逗号分隔)">
<el-input v-model="form.niceToHave" />
<el-form-item label="加分项(逗号或换行分隔)">
<el-input
v-model="form.niceToHave"
type="textarea"
:autosize="{ minRows: 3, maxRows: 8 }"
placeholder="每行填写一项,也可用逗号分隔"
/>
</el-form-item>
<el-form-item label="淘汰项(逗号分隔)">
<el-input v-model="form.knockout" />
<el-form-item label="淘汰项(逗号或换行分隔)">
<el-input
v-model="form.knockout"
type="textarea"
:autosize="{ minRows: 3, maxRows: 8 }"
placeholder="每行填写一项,也可用逗号分隔"
/>
</el-form-item>
<el-form-item label="匹配关键词(逗号分隔)">
<el-input v-model="form.matchKeywords" />
<el-form-item label="匹配关键词(逗号或换行分隔)">
<el-input
v-model="form.matchKeywords"
type="textarea"
:autosize="{ minRows: 3, maxRows: 8 }"
placeholder="每行填写一项,也可用逗号分隔"
/>
</el-form-item>
<el-form-item label="胜任力框架" class="jd-span-full">
<el-input v-model="form.competency" type="textarea" :autosize="{ minRows: 4, maxRows: 18 }" />
......
......@@ -10,7 +10,8 @@ import ReportContentView from '@/components/reports/ReportContentView.vue'
import { useRecruitmentStore } from '@/stores/recruitment'
import { CANDIDATE_TAG_OPTIONS, candidateTagTone } from '@/utils/constants'
import { candidateWorkflow, workflowStageClass } from '@/utils/task'
import { candidateScreeningConclusion, quickScore } from '@/utils/resume'
import { candidateStageSummary, quickScore } from '@/utils/resume'
import { candidateScreeningRecommendation } from '@/utils/screening'
import { isAiEvaluationReport } from '@/utils/scoring'
import { analysisInputKey, analysisNeedsRefresh } from '@/utils/analysis'
import { resumeDisplayName, candidateAge, candidateYears } from '@/utils/candidate'
......@@ -28,6 +29,23 @@ const router = useRouter()
const selected = computed(() => store.selectedCandidate || store.candidates[0] || null)
const flow = computed(() => (selected.value ? candidateWorkflow(selected.value, store.state) : null))
const screeningRecommendation = computed(() =>
selected.value
? candidateScreeningRecommendation(selected.value, store.state)
: { value: '待绑定岗位', tone: 'info', note: '请先选择候选人。' }
)
const stageSummary = computed(() => (selected.value ? candidateStageSummary(selected.value) : ''))
const hasValidAiReport = computed(() =>
Boolean(selected.value && isAiEvaluationReport(selected.value.analysis) && !analysisNeedsRefresh(selected.value))
)
const screeningScore = computed(() => {
if (!selected.value) return 0
return hasValidAiReport.value ? Number(selected.value.analysis?.score || 0) : quickScore(selected.value)
})
const screeningScoreMode = computed(() => (hasValidAiReport.value ? 'AI 评估' : '本地快筛'))
const screeningScoreColor = computed(() =>
screeningScore.value >= 85 ? 'var(--green)' : screeningScore.value >= 72 ? 'var(--yellow)' : 'var(--rose)'
)
const detailScore = computed(() => {
if (!selected.value) return 0
......@@ -62,7 +80,7 @@ const riskTagMeta = (level) =>
})[level] || { type: 'info', text: level }
const scoreNumber = computed(() => {
const value = detailScore.value
const value = screeningScore.value
return value ? Math.round(value) : '--'
})
......@@ -169,7 +187,7 @@ const RING_RADIUS = 38
const ringCircumference = 2 * Math.PI * RING_RADIUS
const ringDrawn = ref(false)
const ringOffset = computed(() => {
const score = Math.max(0, Math.min(100, detailScore.value || 0))
const score = Math.max(0, Math.min(100, screeningScore.value || 0))
return ringDrawn.value ? ringCircumference * (1 - score / 100) : ringCircumference
})
......@@ -557,7 +575,39 @@ const footerActions = computed(() => {
const actions = []
if (['Offer 中', '待入职', '已入职'].includes(stage)) {
actions.push({ key: 'offer', label: '去录用入职处理', type: 'primary', handler: (candidate) => goOffer(candidate) })
} else if (['未筛选', '初筛通过'].includes(stage)) {
} else if (stage === '未筛选') {
actions.push({
key: 'match',
label: '快速匹配',
type: 'default',
handler: (candidate) => runLocalMatchAction(candidate),
})
if (!f?.hasAiReport)
actions.push({
key: 'eval',
label: '生成 AI 评估报告',
type: 'primary',
loading: evaluating.value,
handler: (candidate) => generateEval(candidate),
})
if (f?.hasAiReport && ['建议复核', '建议暂缓'].includes(screeningRecommendation.value.value)) {
actions.push({
key: 'review',
label: '查看评估建议',
type: 'primary',
handler: () => {
store.resumeDetailSection = 'assessment'
},
})
} else if (f?.hasAiReport) {
actions.push({
key: 'staging',
label: '推进面试',
type: 'primary',
handler: (candidate) => advanceStage(candidate, '面试中'),
})
}
} else if (stage === '初筛通过') {
actions.push({
key: 'match',
label: '快速匹配',
......@@ -574,7 +624,7 @@ const footerActions = computed(() => {
})
actions.push({
key: 'staging',
label: '推进面试',
label: '按人工结论推进面试',
type: 'primary',
handler: (candidate) => advanceStage(candidate, '面试中'),
})
......@@ -939,7 +989,7 @@ const saveInterview = (candidate) => {
<section class="dossier-content">
<div class="summary-strip" :class="`tone-${decisionInfo.tone}`">
<div class="score-block">
<svg class="score-ring" viewBox="0 0 88 88" :style="{ '--ring': decisionColor }" aria-hidden="true">
<svg class="score-ring" viewBox="0 0 88 88" :style="{ '--ring': screeningScoreColor }" aria-hidden="true">
<circle class="ring-track" cx="44" cy="44" r="38" />
<circle
class="ring-value"
......@@ -953,17 +1003,19 @@ const saveInterview = (candidate) => {
<div class="score-copy">
<span class="score-label">当前得分</span>
<strong class="score-value">{{ scoreNumber }}<small>/100</small></strong>
<span class="score-mode">{{ store.resumeDetailMode === 'ai' ? 'AI 评估' : '本地快筛' }}</span>
<span class="score-mode">{{ screeningScoreMode }}</span>
</div>
</div>
<div class="decision-block">
<span class="eyebrow">初筛建议</span>
<strong class="decision-text">{{ decisionInfo.text }}</strong>
<p class="note-text">{{ decisionInfo.note }}</p>
<strong class="decision-text" :class="`tone-${screeningRecommendation.tone}`">{{
screeningRecommendation.value
}}</strong>
<p class="note-text">{{ screeningRecommendation.note }}</p>
</div>
<div class="next-block">
<span class="eyebrow">当前节点</span>
<strong class="next-title">{{ candidateScreeningConclusion(selected, store.state) }}</strong>
<strong class="next-title">{{ stageSummary }}</strong>
<p class="note-text">{{ flow?.next?.desc || '查看候选人当前流程状态。' }}</p>
</div>
</div>
......@@ -1117,7 +1169,7 @@ const saveInterview = (candidate) => {
</div>
<div class="assessment-decision" :class="`tone-${decisionInfo.tone}`">
<div>
<span>初筛建议</span>
<span>当前评估建议</span>
<strong>{{ decisionInfo.text }}</strong>
<p>{{ decisionInfo.note }}</p>
</div>
......@@ -1802,6 +1854,24 @@ const saveInterview = (candidate) => {
line-height: 1.35;
}
.decision-text {
&.tone-success {
color: color-mix(in srgb, var(--green) 80%, var(--ink));
}
&.tone-warning {
color: color-mix(in srgb, var(--yellow) 58%, var(--ink));
}
&.tone-danger {
color: color-mix(in srgb, var(--rose) 82%, var(--ink));
}
&.tone-info {
color: var(--ink);
}
}
.note-text {
margin: 6px 0 0;
font-size: 12px;
......
......@@ -9,7 +9,8 @@ import { expectedSalaryText } from '@/utils/candidate'
import { CANDIDATE_TAG_OPTIONS, candidateTagTone } from '@/utils/constants'
import { jobCandidates } from '@/utils/links'
import { getFilteredCandidates, quickMatchNeedsRefresh } from '@/utils/matching'
import { aiScore, candidateScreeningConclusion, quickScore } from '@/utils/resume'
import { aiScore, quickScore } from '@/utils/resume'
import { candidateScreeningRecommendation } from '@/utils/screening'
import { candidateWorkflow } from '@/utils/task'
import { showToast } from '@/utils/toast'
......@@ -97,6 +98,20 @@ const filtered = computed(() => {
return scopeJob.value ? jobCandidates(scopeJob.value, base) : base
})
const filteredSelectedCount = computed(() => filtered.value.filter((candidate) => isSelected(candidate)).length)
const allFilteredSelected = computed(
() => filtered.value.length > 0 && filteredSelectedCount.value === filtered.value.length
)
const partlyFilteredSelected = computed(() => filteredSelectedCount.value > 0 && !allFilteredSelected.value)
const toggleSelectAll = () => {
const ids = filtered.value.map((candidate) => candidate.id)
if (allFilteredSelected.value) {
selectedIds.value = selectedIds.value.filter((id) => !ids.includes(id))
return
}
selectedIds.value = [...new Set([...selectedIds.value, ...ids])]
}
const clearScope = () => {
router.replace('/resumes')
}
......@@ -206,6 +221,7 @@ const profileSummary = (candidate) => {
}
const workflowFor = (candidate) => candidateWorkflow(candidate, store.state)
const screeningRecommendationFor = (candidate) => candidateScreeningRecommendation(candidate, store.state)
const openDetail = (candidate) => {
store.selectedCandidateId = candidate.id
......@@ -454,6 +470,22 @@ const openBatch = () => {
</div>
</transition>
<div v-if="filtered.length" class="candidate-list-head">
<el-checkbox
class="select-all-check"
:model-value="allFilteredSelected"
:indeterminate="partlyFilteredSelected"
aria-label="选择当前筛选结果中的全部候选人"
@change="toggleSelectAll"
/>
<span>候选人</span>
<span>求职岗位</span>
<span>快筛 / AI</span>
<span>来源 / 状态</span>
<span>初筛建议</span>
<span>下一步</span>
<span class="head-action">操作</span>
</div>
<div v-if="filtered.length" class="candidate-cards">
<article
v-for="candidate in filtered"
......@@ -481,9 +513,6 @@ const openBatch = () => {
<span v-if="parseStatusView(candidate)" class="parse-chip" :class="parseStatusView(candidate).type">
{{ parseStatusView(candidate).text }}
</span>
<span class="stage-chip" :class="stageToneClass(candidate.stage)">{{
candidate.stage || '未筛选'
}}</span>
<span v-if="quickMatchNeedsRefresh(candidate)" class="refresh-chip">快筛待更新</span>
</div>
<div class="candidate-contact">
......@@ -491,9 +520,6 @@ const openBatch = () => {
<span v-if="expectedSalaryText(candidate)" class="salary-chip">{{
expectedSalaryText(candidate)
}}</span>
<span v-if="candidate.source && candidate.source !== '其他'" class="source-chip">{{
candidate.source
}}</span>
</div>
<div class="candidate-profile" :class="{ 'is-empty': !profileSummary(candidate) }">
{{ profileSummary(candidate) || '档案字段待补全' }}
......@@ -512,6 +538,20 @@ const openBatch = () => {
</div>
</div>
<div class="candidate-job" @click.stop>
<span class="cell-label">求职岗位</span>
<el-select
:model-value="candidate.jobId"
size="small"
class="job-select"
placeholder="选择岗位"
@change="(jobId) => bindJob(candidate, jobId)"
>
<el-option value="">未绑定</el-option>
<el-option v-for="job in store.jobs" :key="job.id" :label="job.title" :value="job.id" />
</el-select>
</div>
<div class="score-cluster">
<div class="score-cell">
<span>快筛</span>
......@@ -531,32 +571,35 @@ const openBatch = () => {
</div>
</div>
<div class="candidate-flow" @click.stop>
<div class="flow-job">
<span class="cell-label">求职岗位</span>
<el-select
:model-value="candidate.jobId"
size="small"
class="job-select"
placeholder="选择岗位"
@change="(jobId) => bindJob(candidate, jobId)"
>
<el-option value="">未绑定</el-option>
<el-option v-for="job in store.jobs" :key="job.id" :label="job.title" :value="job.id" />
</el-select>
</div>
<div class="flow-next">
<span class="cell-label">下一步</span>
<b>{{ workflowFor(candidate).next.title }}</b>
<small>{{ candidateScreeningConclusion(candidate, store.state) }}</small>
</div>
<div class="candidate-source-status">
<span class="source-value">{{ candidate.source || '其他' }}</span>
<span class="stage-chip" :class="stageToneClass(candidate.stage)">{{ candidate.stage || '未筛选' }}</span>
</div>
<div class="candidate-conclusion">
<span class="cell-label">初筛建议</span>
<span
class="recommendation-value"
:class="`tone-${screeningRecommendationFor(candidate).tone}`"
:title="screeningRecommendationFor(candidate).note"
>
{{ screeningRecommendationFor(candidate).value }}
</span>
</div>
<div class="candidate-next">
<span class="cell-label">下一步</span>
<b>{{ workflowFor(candidate).next.title }}</b>
</div>
<div class="candidate-actions" @click.stop>
<el-button size="small" round type="primary" plain @click="openDetail(candidate)">查看档案</el-button>
<el-button size="small" round @click="runMatch(candidate)">快速匹配</el-button>
<el-dropdown trigger="click" @command="(command) => rowCommand(command, candidate)">
<el-button link class="more-btn">更多</el-button>
<el-button link class="more-btn">
更多
<el-icon><ArrowDown /></el-icon>
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item command="view">查看档案</el-dropdown-item>
......@@ -655,6 +698,8 @@ const openBatch = () => {
}
.candidate-list-card {
--candidate-grid: 24px minmax(180px, 1.35fr) minmax(126px, 0.9fr) minmax(132px, 0.78fr) minmax(88px, 0.65fr)
minmax(108px, 0.8fr) minmax(118px, 0.88fr) 200px;
padding: 0;
overflow: hidden;
}
......@@ -815,36 +860,90 @@ const openBatch = () => {
.candidate-cards {
display: flex;
flex-direction: column;
gap: 0;
padding: 0 20px 14px;
}
.candidate-list-head {
display: grid;
grid-template-columns: var(--candidate-grid);
align-items: center;
gap: 10px;
padding: 14px 20px 20px;
min-height: 40px;
margin: 0 20px;
padding: 0 14px;
background: color-mix(in srgb, var(--bg) 78%, #fff);
border-top: 1px solid var(--line);
border-bottom: 1px solid var(--line);
color: color-mix(in srgb, var(--ink) 58%, var(--muted));
font-size: 11px;
font-weight: 600;
letter-spacing: 0.5px;
.select-all-check {
display: flex;
align-items: center;
justify-content: center;
}
.head-action {
text-align: right;
}
}
.candidate-list-head > span:nth-child(n + 3) {
padding-left: 14px;
border-left: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}
.candidate-card {
position: relative;
display: grid;
grid-template-columns: 24px minmax(240px, 1.5fr) minmax(150px, 0.7fr) minmax(220px, 0.95fr) auto;
grid-template-columns: var(--candidate-grid);
align-items: center;
gap: 12px;
padding: 13px 14px;
border: 1px solid var(--line);
border-radius: 12px;
background: var(--panel);
gap: 10px;
min-height: 82px;
padding: 12px 14px;
border: 0;
border-bottom: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
background: transparent;
cursor: pointer;
transition:
border-color 0.18s ease,
box-shadow 0.18s ease,
transform 0.18s ease;
background 0.18s ease,
box-shadow 0.18s ease;
&:nth-child(even) {
background: color-mix(in srgb, var(--bg) 38%, transparent);
}
&:hover {
border-color: color-mix(in srgb, var(--blue) 40%, var(--line));
box-shadow: 0 10px 24px rgba(39, 49, 70, 0.08);
transform: translateY(-1px);
background: color-mix(in srgb, var(--blue) 6%, #fff);
box-shadow: inset 3px 0 0 color-mix(in srgb, var(--blue) 65%, transparent);
}
&:focus-visible {
outline: 2px solid var(--cyan);
outline-offset: 1px;
outline-offset: -2px;
}
&:last-child {
border-bottom: 0;
}
&.is-selected {
background: color-mix(in srgb, var(--blue) 9%, #fff);
box-shadow: inset 3px 0 0 var(--blue);
}
}
.candidate-card > .candidate-job,
.candidate-card > .score-cluster,
.candidate-card > .candidate-source-status,
.candidate-card > .candidate-conclusion,
.candidate-card > .candidate-next,
.candidate-card > .candidate-actions {
padding-left: 10px;
border-left: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
}
.candidate-person {
......@@ -989,18 +1088,6 @@ const openBatch = () => {
font-weight: 600;
}
.source-chip {
display: inline-flex;
align-items: center;
margin-left: 6px;
padding: 0 6px;
border: 1px solid var(--line);
border-radius: 6px;
background: var(--bg);
color: var(--muted);
font-size: 10px;
}
.candidate-contact {
margin-top: 4px;
color: var(--muted);
......@@ -1026,7 +1113,7 @@ const openBatch = () => {
.score-cluster {
display: flex;
align-items: center;
gap: 10px;
gap: 6px;
}
.score-cell {
......@@ -1034,61 +1121,102 @@ const openBatch = () => {
display: flex;
align-items: baseline;
gap: 6px;
min-width: 60px;
min-width: 58px;
padding: 6px 8px;
border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
border-radius: 8px;
background: color-mix(in srgb, var(--panel) 88%, transparent);
span {
color: var(--muted);
font-size: 11px;
font-weight: 500;
white-space: nowrap;
}
b {
font-size: 21px;
font-size: 19px;
line-height: 1;
font-variant-numeric: tabular-nums;
}
}
.candidate-flow {
display: grid;
grid-template-columns: minmax(120px, 0.9fr) minmax(130px, 1.1fr);
gap: 12px;
align-items: start;
}
.flow-job,
.flow-next {
.candidate-job,
.candidate-conclusion,
.candidate-next {
min-width: 0;
}
.candidate-job {
.job-select {
width: 100%;
}
}
.cell-label {
display: block;
display: none;
color: var(--muted);
font-size: 11px;
margin-bottom: 4px;
}
.flow-next {
b {
display: block;
font-size: 13px;
color: var(--ink);
.candidate-source-status {
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 6px;
min-width: 0;
.source-value {
max-width: 100%;
color: var(--muted);
font-size: 12px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
}
small {
display: block;
margin-top: 3px;
.candidate-conclusion {
> span:not(.cell-label) {
display: -webkit-box;
color: var(--muted);
font-size: 11px;
font-size: 12px;
font-weight: 600;
line-height: 1.45;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
.recommendation-value {
&.tone-success {
color: color-mix(in srgb, var(--green) 80%, var(--ink));
}
&.tone-warning {
color: color-mix(in srgb, var(--yellow) 58%, var(--ink));
}
&.tone-danger {
color: color-mix(in srgb, var(--rose) 82%, var(--ink));
}
&.tone-info {
color: var(--muted);
}
}
}
.candidate-next {
b {
display: -webkit-box;
font-size: 13px;
line-height: 1.4;
color: var(--ink);
overflow: hidden;
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
}
}
......@@ -1097,10 +1225,23 @@ const openBatch = () => {
align-items: center;
justify-content: flex-end;
gap: 6px;
flex-wrap: wrap;
flex-wrap: nowrap;
:deep(.el-button) {
white-space: nowrap;
}
:deep(.el-button + .el-button) {
margin-left: 0;
}
.more-btn {
color: var(--muted);
.el-icon {
margin-left: 2px;
font-size: 12px;
}
}
}
......@@ -1217,39 +1358,110 @@ const openBatch = () => {
font-size: 13px;
}
@media (max-width: 1280px) {
.candidate-card {
grid-template-columns: minmax(220px, 1.4fr) minmax(120px, 0.6fr) minmax(220px, 1fr) auto;
gap: 12px;
@media (max-width: 1400px) {
.candidate-list-head {
display: none;
}
}
@media (max-width: 1120px) {
.metric-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
.candidate-cards {
padding-top: 12px;
}
.candidate-card {
grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
grid-template-columns: 24px minmax(0, 1.4fr) minmax(0, 1fr);
row-gap: 12px;
min-height: 0;
.candidate-person {
grid-column: 2 / 4;
}
.candidate-job {
grid-column: 2;
}
.score-cluster {
grid-column: 3;
}
.candidate-source-status {
grid-column: 2;
}
.candidate-conclusion {
grid-column: 3;
}
.candidate-next {
grid-column: 2 / 4;
}
.score-cluster,
.candidate-actions {
justify-content: flex-start;
grid-column: 2 / 4;
justify-content: flex-end;
}
}
.candidate-card > .candidate-job,
.candidate-card > .score-cluster,
.candidate-card > .candidate-source-status,
.candidate-card > .candidate-conclusion,
.candidate-card > .candidate-next,
.candidate-card > .candidate-actions {
padding-left: 0;
border-left: 0;
}
.cell-label {
display: block;
}
}
@media (max-width: 1120px) {
.metric-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (max-width: 720px) {
.metric-grid {
grid-template-columns: 1fr;
grid-template-columns: repeat(2, minmax(0, 1fr));
gap: 10px;
}
.list-head {
flex-direction: column;
align-items: stretch;
.head-actions {
justify-content: flex-end;
}
}
.metric-card {
min-height: 78px;
padding: 13px 14px 13px 17px;
.metric-copy strong {
font-size: 22px;
}
}
.candidate-card {
grid-template-columns: 1fr;
grid-template-columns: 24px minmax(0, 1fr);
.candidate-check-cell {
grid-column: 1;
}
.candidate-flow {
grid-template-columns: 1fr;
.candidate-person,
.candidate-job,
.score-cluster,
.candidate-source-status,
.candidate-conclusion,
.candidate-next,
.candidate-actions {
grid-column: 2;
}
}
......@@ -1259,6 +1471,12 @@ const openBatch = () => {
}
}
@media (max-width: 520px) {
.metric-grid {
grid-template-columns: 1fr;
}
}
@media (prefers-reduced-motion: reduce) {
.candidate-card,
.fade-enter-active,
......@@ -1267,11 +1485,6 @@ const openBatch = () => {
}
}
.candidate-card.is-selected {
border-color: var(--blue);
box-shadow: 0 0 0 2px color-mix(in srgb, var(--blue) 30%, transparent);
}
.candidate-check-cell {
display: flex;
align-items: center;
......@@ -1281,7 +1494,7 @@ const openBatch = () => {
display: flex;
align-items: center;
gap: 10px;
margin: 10px 0;
margin: 0 20px 10px;
padding: 8px 12px;
background: color-mix(in srgb, var(--blue) 10%, #fff);
border: 1px solid color-mix(in srgb, var(--blue) 35%, var(--line));
......
import { describe, expect, it } from 'vitest'
import { candidateStageSummary } from '../resume'
import { candidateScreeningRecommendation } from '../screening'
import { candidateWorkflow } from '../task'
const job = {
id: 'job-1',
title: '测试工程师',
jd: '负责自动化测试和质量保障',
mustHave: '自动化测试',
}
const candidate = {
id: 'cand-1',
name: '张三',
jobId: 'job-1',
jobTitle: '测试工程师',
resumeText: '5 年自动化测试经验,负责测试框架建设。',
}
describe('candidateScreeningRecommendation', () => {
it('asks for a job before evaluating the candidate', () => {
expect(candidateScreeningRecommendation(candidate, { jobs: [] })).toMatchObject({
value: '待绑定岗位',
tone: 'info',
})
})
it('asks for resume text before evaluating the candidate', () => {
expect(candidateScreeningRecommendation({ ...candidate, resumeText: '' }, { jobs: [job] })).toMatchObject({
value: '待补全简历',
tone: 'warning',
})
})
it('shows pending when no assessment exists', () => {
expect(candidateScreeningRecommendation(candidate, { jobs: [job] })).toMatchObject({
value: '待评估',
tone: 'info',
})
})
it('prioritizes a valid AI decision over quick match', () => {
const result = candidateScreeningRecommendation(
{
...candidate,
matchReport: { jobId: job.id, jobTitle: job.title },
quickMatchScore: 45,
analysis: {
reportVersion: 'ai-evaluation-v2',
score: 86,
decision: '建议优先推进面试',
},
},
{ jobs: [job] }
)
expect(result).toMatchObject({ value: '建议推进', tone: 'success' })
})
it('marks an obsolete AI assessment as needing re-evaluation', () => {
const result = candidateScreeningRecommendation(
{
...candidate,
analysis: {
reportVersion: 'ai-evaluation-v2',
inputKey: 'outdated',
decision: '建议优先推进面试',
score: 90,
},
},
{ jobs: [job] }
)
expect(result).toMatchObject({ value: '需重评', tone: 'warning' })
})
it('falls back to score when an AI decision is not recognized', () => {
const result = candidateScreeningRecommendation(
{
...candidate,
analysis: {
reportVersion: 'ai-evaluation-v2',
score: 78,
decision: '待人工判断',
},
},
{ jobs: [job] }
)
expect(result).toMatchObject({ value: '建议复核', tone: 'warning' })
})
it('uses the quick match score when AI assessment is absent', () => {
expect(
candidateScreeningRecommendation(
{
...candidate,
matchReport: { jobId: job.id, jobTitle: job.title },
quickMatchScore: 91,
},
{ jobs: [job] }
)
).toMatchObject({ value: '建议推进', tone: 'success' })
expect(
candidateScreeningRecommendation(
{
...candidate,
matchReport: { jobId: job.id, jobTitle: job.title },
quickMatchScore: 60,
},
{ jobs: [job] }
)
).toMatchObject({ value: '建议暂缓', tone: 'danger' })
})
it('does not let manual stage changes rewrite the system recommendation', () => {
const result = candidateScreeningRecommendation(
{
...candidate,
stage: 'Offer 中',
analysis: {
reportVersion: 'ai-evaluation-v2',
score: 65,
decision: '建议进入人才池或暂缓',
},
},
{ jobs: [job] }
)
expect(result.value).toBe('建议暂缓')
})
})
describe('candidateStageSummary', () => {
it('keeps process wording for the current-stage display', () => {
expect(candidateStageSummary({ stage: '初筛通过' })).toBe('初筛通过,待推进面试')
expect(candidateStageSummary({ stage: 'Offer 中' })).toBe('待生成 / 审批 Offer')
})
})
describe('candidateWorkflow screening recommendation guard', () => {
const assessedCandidate = (decision, score = 80) => ({
...candidate,
matchReport: { jobId: job.id, jobTitle: job.title },
analysis: {
reportVersion: 'ai-evaluation-v2',
decision,
score,
},
})
it('routes unscreened hold and review recommendations to assessment review', () => {
expect(candidateWorkflow(assessedCandidate('建议进入人才池或暂缓', 60), { jobs: [job] }).next.title).toBe(
'复核评估后再决定'
)
expect(candidateWorkflow(assessedCandidate('建议 HR 复核后推进', 80), { jobs: [job] }).next.title).toBe(
'复核评估结论'
)
})
it('allows unscreened advance recommendations to continue to interview', () => {
expect(candidateWorkflow(assessedCandidate('建议优先推进面试', 90), { jobs: [job] }).next.title).toBe('推进面试')
})
it('lets a manual initial-screen pass override a hold recommendation', () => {
const result = candidateWorkflow(
{ ...assessedCandidate('建议进入人才池或暂缓', 60), stage: '初筛通过' },
{ jobs: [job] }
)
expect(result.next.title).toBe('按人工结论推进面试')
})
it('asks for a job before routing the candidate into screening', () => {
expect(candidateWorkflow(candidate, { jobs: [] }).next.title).toBe('绑定求职岗位')
})
it('asks for re-evaluation when the AI report is obsolete', () => {
const result = candidateWorkflow(
{
...assessedCandidate('建议优先推进面试', 90),
analysis: {
reportVersion: 'ai-evaluation-v2',
inputKey: 'outdated',
decision: '建议优先推进面试',
score: 90,
},
},
{ jobs: [job] }
)
expect(result.next.title).toBe('重新生成 AI 评估报告')
})
})
......@@ -2,7 +2,9 @@ import { quickMatchScore, isAiEvaluationReport, providerLabel, scoreColor } from
import { matchedJobForCandidate, findJobForCandidate, candidateJobTitle, jobCandidates } from './links.js'
import { candidateWorkflow, workflowStageClass } from './task.js'
import { resumeDisplayName, candidateYears, candidateAge } from './candidate.js'
import { analysisNeedsRefresh, quickMatchNeedsRefresh } from './analysis.js'
import { analysisNeedsRefresh } from './analysis.js'
export { candidateScreeningRecommendation } from './screening.js'
export function scoreColorFor(score) {
return scoreColor(score)
......@@ -18,7 +20,7 @@ export function aiScore(candidate) {
return Number(candidate.analysis.score || 0)
}
export function candidateScreeningConclusion(candidate = {}, state = {}) {
export function candidateStageSummary(candidate = {}) {
const stages = ['未筛选', '初筛通过', '面试中', 'Offer 中', '待入职', '已入职']
const currentIndex = stages.indexOf(candidate.stage || '未筛选')
if (candidate.stage === '已入职') return '流程已完成'
......
import { analysisNeedsRefresh } from './analysis.js'
import { matchedJobForCandidate } from './links.js'
import { isAiEvaluationReport, quickMatchScore } from './scoring.js'
const SCREENING_RECOMMENDATIONS = {
noJob: {
value: '待绑定岗位',
tone: 'info',
note: '请先为候选人绑定岗位,再生成快筛或 AI 评估建议。',
},
noResume: {
value: '待补全简历',
tone: 'warning',
note: '当前缺少可分析的简历正文,请补充或重新上传简历文件。',
},
stale: {
value: '需重评',
tone: 'warning',
note: '岗位要求或简历内容已变化,请重新生成快筛或 AI 评估。',
},
pending: {
value: '待评估',
tone: 'info',
note: '尚未生成快筛或 AI 评估,暂时没有可用的初筛建议。',
},
advance: {
value: '建议推进',
tone: 'success',
note: '匹配证据较充分,建议进入初筛或安排后续评估。',
},
review: {
value: '建议复核',
tone: 'warning',
note: '总体条件可接受,但存在待确认项,建议 HR 复核后再推进。',
},
hold: {
value: '建议暂缓',
tone: 'danger',
note: '当前匹配证据不足或存在硬性缺口,建议暂缓或转入人才池复评。',
},
}
function scoreScreeningRecommendation(score = 0) {
const value = Number(score || 0)
if (value >= 85) return SCREENING_RECOMMENDATIONS.advance
if (value >= 72) return SCREENING_RECOMMENDATIONS.review
return SCREENING_RECOMMENDATIONS.hold
}
function decisionScreeningRecommendation(decision = '', score = 0) {
const text = String(decision || '')
if (/人才池|暂缓|不建议/.test(text)) return SCREENING_RECOMMENDATIONS.hold
if (/复核/.test(text)) return SCREENING_RECOMMENDATIONS.review
if (/优先|推荐|推进|进入初筛/.test(text)) return SCREENING_RECOMMENDATIONS.advance
return scoreScreeningRecommendation(score)
}
export function candidateScreeningRecommendation(candidate = {}, state = {}) {
const job = matchedJobForCandidate(candidate, state.jobs || [])
if (!job) return SCREENING_RECOMMENDATIONS.noJob
if (!String(candidate.resumeText || '').trim()) return SCREENING_RECOMMENDATIONS.noResume
const hasAiReport = isAiEvaluationReport(candidate.analysis)
if (hasAiReport && analysisNeedsRefresh(candidate)) return SCREENING_RECOMMENDATIONS.stale
if (hasAiReport) {
return decisionScreeningRecommendation(candidate.analysis?.decision, candidate.analysis?.score)
}
const hasQuickAssessment =
Boolean(candidate.matchReport) || candidate.quickMatchScore != null || candidate.match != null
if (!hasQuickAssessment) return SCREENING_RECOMMENDATIONS.pending
return scoreScreeningRecommendation(quickMatchScore(candidate))
}
......@@ -2,6 +2,7 @@ import { STAGE_ORDER } from './constants.js'
import { candidateJobTitle } from './links.js'
import { analysisNeedsRefresh, quickMatchNeedsRefresh } from './analysis.js'
import { isAiEvaluationReport } from './scoring.js'
import { candidateScreeningRecommendation } from './screening.js'
export function taskTreatment(task = {}) {
const text = `${task.title} ${task.module} ${task.status} ${task.target}`.toLowerCase()
......@@ -63,9 +64,17 @@ export function candidateWorkflow(candidate = {}, state = {}) {
)
const offer = state.offers?.find((item) => item.candidateId === candidate.id) || null
const candidateTitle = candidateJobTitle(candidate, state.jobs || [])
const recommendation = candidateScreeningRecommendation(candidate, state)
const isUnscreened = (candidate.stage || '未筛选') === '未筛选'
const rules = [
{
when: !candidate.resumeText,
when: recommendation.value === '待绑定岗位',
title: '绑定求职岗位',
desc: '先为候选人选择目标岗位,才能按岗位要求生成可靠匹配和建议。',
action: '选择岗位',
},
{
when: recommendation.value === '待补全简历',
title: '补充简历文本',
desc: '当前缺少可分析正文,先补全简历文本或重新上传可解析文件。',
action: '补充简历文本',
......@@ -76,6 +85,12 @@ export function candidateWorkflow(candidate = {}, state = {}) {
desc: '岗位 JD 或匹配规则已变化,先刷新本地匹配依据。',
action: '快速匹配',
},
{
when: recommendation.value === '需重评',
title: '重新生成 AI 评估报告',
desc: '岗位要求或简历内容已经变化,当前评估建议不再适用。',
action: '重新评估',
},
{
when: !hasAiReport,
title: '生成 AI 评估报告',
......@@ -83,11 +98,29 @@ export function candidateWorkflow(candidate = {}, state = {}) {
action: '生成 AI 评估报告',
},
{
when: ['未筛选', '初筛通过'].includes(candidate.stage),
when: isUnscreened && recommendation.value === '建议复核',
title: '复核评估结论',
desc: '系统判断仍存在待确认项,建议查看评估证据后再决定是否推进。',
action: '查看评估建议',
},
{
when: isUnscreened && recommendation.value === '建议暂缓',
title: '复核评估后再决定',
desc: '系统建议暂缓推进,请先复核硬性缺口和风险证据。',
action: '查看评估详情',
},
{
when: isUnscreened && recommendation.value === '建议推进',
title: '推进面试',
desc: '候选人已具备进入面试池的条件,下一步安排面试官和时间。',
action: '推进面试',
},
{
when: candidate.stage === '初筛通过',
title: '按人工结论推进面试',
desc: 'HR 已人工确认初筛通过,按人工决定安排面试官和时间。',
action: '推进面试',
},
{
when: candidate.stage === '面试中' && !hasInterviewFeedback,
title: '录入面试评价',
......@@ -132,6 +165,7 @@ export function candidateWorkflow(candidate = {}, state = {}) {
hasAiReport,
hasInterviewFeedback,
candidateTitle,
recommendation,
next: rules.find((rule) => rule.when) || rules[rules.length - 1],
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment