Files
ALL-teach_sys/frontend_智能制造/test_interview_page.html

60 lines
2.2 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>测试面试题页面</title>
</head>
<body>
<h1>测试面试题页面数据</h1>
<div id="output"></div>
<script type="module">
import { getMockPageData } from './src/mocks/resumeInterviewMock.js';
const data = getMockPageData();
const output = document.getElementById('output');
let html = '<h2>数据结构检查</h2>';
html += `<p>Industries数量: ${data.industries?.length || 0}</p>`;
html += `<p>ResumeTemplates键数量: ${Object.keys(data.resumeTemplates || {}).length}</p>`;
html += '<h2>Industries列表</h2><ul>';
data.industries?.forEach(ind => {
html += `<li>${ind.name} - ${ind.positions?.length || 0}个岗位</li>`;
});
html += '</ul>';
html += '<h2>ResumeTemplates列表</h2><ul>';
Object.keys(data.resumeTemplates || {}).forEach(key => {
html += `<li>${key} - ${data.resumeTemplates[key]?.length || 0}个模板</li>`;
});
html += '</ul>';
html += '<h2>匹配检查</h2><ul>';
data.industries?.forEach(ind => {
const hasTemplate = data.resumeTemplates?.hasOwnProperty(ind.name);
const status = hasTemplate ? '✓' : '❌';
html += `<li>${status} ${ind.name}</li>`;
});
html += '</ul>';
output.innerHTML = html;
// 测试点击岗位
console.log('测试岗位点击数据:');
const testIndustry = data.industries?.[0];
const testPosition = testIndustry?.positions?.[0];
if (testIndustry && testPosition) {
const templates = data.resumeTemplates?.[testIndustry.name] || [];
const selectedTemplate = templates.find(t => t.position === testPosition.title) || templates[0];
console.log('Industry:', testIndustry.name);
console.log('Position:', testPosition.title);
console.log('Templates found:', templates.length);
console.log('Selected template:', selectedTemplate);
console.log('Template content:', selectedTemplate?.content);
}
</script>
</body>
</html>