This commit is contained in:
2026-08-25 19:51:00 +08:00
parent b412a7efeb
commit e4f846c2cb
6 changed files with 39 additions and 7 deletions
+9 -1
View File
@@ -354,7 +354,7 @@ async function loadHistory() {
`;
$('historyBody').innerHTML = history.map(h => `
<tr>
<td>${escapeHtml(h.job_title || '-')}</td>
<td title="${escapeHtml(recordDetail(h))}">${escapeHtml(h.job_title || '-')}</td>
<td>${escapeHtml(h.company || '-')}</td>
<td>${escapeHtml(h.salary || '-')}</td>
<td><span class="tag ${safeType(h.apply_type)}">${typeLabel(h.apply_type)}</span></td>
@@ -368,6 +368,14 @@ async function loadHistory() {
function typeLabel(t) {
return { chat: '沟通', deliver: '投递', skipped: '跳过' }[t] || t;
}
// 悬停详情:JD 摘要 + 打招呼语(用于 title 属性)
function recordDetail(h) {
const parts = [];
if (h.greeting) parts.push(`【打招呼语】${h.greeting}`);
if (h.jd_text) parts.push(`【JD】${h.jd_text.substring(0, 300)}${h.jd_text.length > 300 ? '...' : ''}`);
if (h.skip_reason) parts.push(`【跳过原因】${h.skip_reason}`);
return parts.join('\n\n') || '暂无详情';
}
// apply_type 仅允许白名单值用作 CSS class,防止注入
function safeType(t) {
return ['chat', 'deliver', 'skipped'].includes(t) ? t : 'skipped';