- 包含4个产业方向的前端项目:智能开发、智能制造、大健康、财经商贸 - 已清理node_modules、.yoyo等大文件,项目大小从2.6GB优化至631MB - 配置完善的.gitignore文件 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
40 lines
1.7 KiB
JavaScript
40 lines
1.7 KiB
JavaScript
import mockData from './src/data/mockData.js';
|
|
|
|
console.log('=== 检查班级排名数据流 ===\n');
|
|
|
|
// 1. 检查基础ranking数据
|
|
console.log('1. mockData.ranking 存在:', !!mockData.ranking);
|
|
console.log(' - ranking.topStudents 存在:', !!mockData.ranking?.topStudents);
|
|
console.log(' - topStudents 数量:', mockData.ranking?.topStudents?.length || 0);
|
|
|
|
// 2. 检查dashboardStatistics引用
|
|
console.log('\n2. mockData.dashboardStatistics 存在:', !!mockData.dashboardStatistics);
|
|
console.log(' - dashboardStatistics.ranking 存在:', !!mockData.dashboardStatistics?.ranking);
|
|
|
|
// 3. 检查数据是否正确传递
|
|
if (mockData.dashboardStatistics?.ranking === mockData.ranking) {
|
|
console.log('\n3. ✅ dashboardStatistics.ranking 正确引用了 mockData.ranking');
|
|
} else {
|
|
console.log('\n3. ❌ dashboardStatistics.ranking 没有正确引用 mockData.ranking');
|
|
}
|
|
|
|
// 4. 检查topStudents数据内容
|
|
if (mockData.ranking?.topStudents?.length > 0) {
|
|
console.log('\n4. 前3名学生数据:');
|
|
mockData.ranking.topStudents.slice(0, 3).forEach(student => {
|
|
console.log(` ${student.rank}. ${student.name || student.studentName} - ${student.score}分`);
|
|
console.log(` 学校: ${student.school}`);
|
|
console.log(` 专业: ${student.major}`);
|
|
console.log(` 头像: ${student.avatar ? '✓' : '✗'}`);
|
|
console.log(` studentName字段: ${student.studentName ? '✓' : '✗'}`);
|
|
});
|
|
}
|
|
|
|
// 5. 检查当前用户(罗浩宇)
|
|
const luoHaoyu = mockData.ranking?.topStudents?.find(s => s.isCurrentUser || s.name === "罗浩宇");
|
|
if (luoHaoyu) {
|
|
console.log(`\n5. 罗浩宇数据:
|
|
- 排名: ${luoHaoyu.rank}
|
|
- 学分: ${luoHaoyu.score}
|
|
- 是否标记为当前用户: ${luoHaoyu.isCurrentUser ? '✓' : '✗'}`);
|
|
} |