Files
ALL-teach_sys/frontend_大健康/test_interview_data.js
KQL cd2e307402 初始化12个产业教务系统项目
主要内容:
- 包含12个产业的完整教务系统前端代码
- 智能启动脚本 (start-industry.sh)
- 可视化产业导航页面 (index.html)
- 项目文档 (README.md)

优化内容:
- 删除所有node_modules和.yoyo文件夹,从7.5GB减少到2.7GB
- 添加.gitignore文件避免上传不必要的文件
- 自动依赖管理和智能启动系统

产业列表:
1. 文旅产业 (5150)
2. 智能制造 (5151)
3. 智能开发 (5152)
4. 财经商贸 (5153)
5. 视觉设计 (5154)
6. 交通物流 (5155)
7. 大健康 (5156)
8. 土木水利 (5157)
9. 食品产业 (5158)
10. 化工产业 (5159)
11. 能源产业 (5160)
12. 环保产业 (5161)

🤖 Generated with Claude Code
Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-24 14:14:14 +08:00

95 lines
3.3 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/env node
// 测试面试题数据是否正确加载
import fs from 'fs';
import path from 'path';
import { fileURLToPath } from 'url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
// 读取mock数据文件
const mockFilePath = path.join(__dirname, 'src/mocks/resumeInterviewMock.js');
const mockContent = fs.readFileSync(mockFilePath, 'utf-8');
// 提取industries数据
const industriesMatch = mockContent.match(/const industries = (\[[\s\S]*?\]);/);
if (!industriesMatch) {
console.error('❌ 无法找到industries数据');
process.exit(1);
}
// 尝试解析数据将JavaScript对象转换为JSON
const industriesDataStr = industriesMatch[1];
// 简单替换JavaScript对象语法为JSON格式
const jsonStr = industriesDataStr
.replace(/(\w+):/g, '"$1":') // 给属性名加引号
.replace(/'/g, '"') // 单引号改双引号
.replace(/,(\s*[\]}])/g, '$1'); // 移除尾随逗号
try {
const industries = JSON.parse(jsonStr);
console.log('✅ 成功解析industries数据');
console.log(`📊 共找到 ${industries.length} 个产业群`);
let totalPositions = 0;
let positionsWithQuestions = 0;
let questionsFromHealthData = 0;
industries.forEach(industry => {
console.log(`\n🏢 产业: ${industry.name} (${industry.positions.length} 个岗位)`);
industry.positions.forEach(position => {
totalPositions++;
if (position.questions && position.questions.length > 0) {
positionsWithQuestions++;
// 检查问题内容是否包含大健康特定问题
const questionTexts = position.questions.flatMap(q =>
q.subQuestions ? q.subQuestions.map(sq => sq.question) : [q.question]
);
const hasHealthQuestions = questionTexts.some(q =>
q.includes('健康管理') ||
q.includes('康复') ||
q.includes('药品') ||
q.includes('医疗') ||
q.includes('生产流程') ||
q.includes('质量控制') ||
q.includes('GMP') ||
q.includes('患者')
);
if (hasHealthQuestions) {
questionsFromHealthData++;
console.log(`${position.title}: 包含大健康相关问题 (${position.questions.length} 组)`);
} else {
console.log(`${position.title}: 可能仍是原始问题`);
console.log(` 示例问题: ${questionTexts[0]?.substring(0, 50)}...`);
}
} else {
console.log(` ⚠️ ${position.title}: 无面试题`);
}
});
});
console.log('\n📈 统计总结:');
console.log(`总岗位数: ${totalPositions}`);
console.log(`有面试题的岗位: ${positionsWithQuestions}`);
console.log(`包含大健康相关问题的岗位: ${questionsFromHealthData}`);
console.log(`更新完成率: ${((questionsFromHealthData / totalPositions) * 100).toFixed(1)}%`);
if (questionsFromHealthData < totalPositions * 0.8) {
console.log('\n⚠ 警告: 大部分岗位可能仍在使用原始问题,需要检查数据更新是否成功');
} else {
console.log('\n🎉 成功: 大部分岗位已更新为大健康相关问题');
}
} catch (error) {
console.error('❌ JSON解析失败:', error.message);
console.log('尝试的JSON字符串前100字符:', jsonStr.substring(0, 100));
}