|
|
|
@ -12,7 +12,8 @@
|
|
|
|
<h3>此处为AI根据学情数据进行的智能分析,从个人成绩和实训时长角度给出分析结果,仅供参考</h3>
|
|
|
|
<h3>此处为AI根据学情数据进行的智能分析,从个人成绩和实训时长角度给出分析结果,仅供参考</h3>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="content">
|
|
|
|
<div class="content">
|
|
|
|
<div class="analysis">
|
|
|
|
<el-empty v-if="scoreLoaded && !hasScoreData" class="empty-score" description="暂无成绩数据,暂时无法进行AI学情分析" />
|
|
|
|
|
|
|
|
<div v-else class="analysis">
|
|
|
|
<template v-for="item in dialogue" :key="item.role">
|
|
|
|
<template v-for="item in dialogue" :key="item.role">
|
|
|
|
<template v-for="chid in item.child" :key="chid" v-if="item.role == roleId">
|
|
|
|
<template v-for="chid in item.child" :key="chid" v-if="item.role == roleId">
|
|
|
|
<div class="analysis-item" @click="analysis(chid)">{{ chid.name }}</div>
|
|
|
|
<div class="analysis-item" @click="analysis(chid)">{{ chid.name }}</div>
|
|
|
|
@ -57,39 +58,62 @@ const dialogue = ref([
|
|
|
|
},
|
|
|
|
},
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
const scoreList = ref([]);
|
|
|
|
const scoreList = ref([]);
|
|
|
|
const getScoreList = () => {
|
|
|
|
const scoreLoaded = ref(false);
|
|
|
|
if (roleId.value == 4) {
|
|
|
|
const hasScoreData = ref(false);
|
|
|
|
indexApi.getStuModuleDetail({ userId: userStore.userInfo.userId }).then((res) => {
|
|
|
|
const hasTeacherScoreData = (row) => {
|
|
|
|
scoreList.value = res.data;
|
|
|
|
return Number(row.completedTaskCount || 0) > 0 || moduleMap.some(({ key }) => row[`${key}Score`] !== null && row[`${key}Score`] !== undefined);
|
|
|
|
proxy.$cache.session.setJSON("scoreList", scoreList.value);
|
|
|
|
};
|
|
|
|
});
|
|
|
|
const getScoreList = async () => {
|
|
|
|
} else {
|
|
|
|
scoreLoaded.value = false;
|
|
|
|
scoreApi
|
|
|
|
scoreList.value = [];
|
|
|
|
.getScoreList({
|
|
|
|
hasScoreData.value = false;
|
|
|
|
|
|
|
|
proxy.$cache.session.remove("scoreList");
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
if (roleId.value == 4) {
|
|
|
|
|
|
|
|
const res = await indexApi.getStuModuleDetail({ userId: userStore.userInfo.userId });
|
|
|
|
|
|
|
|
scoreList.value = Array.isArray(res?.data) ? res.data : [];
|
|
|
|
|
|
|
|
hasScoreData.value = scoreList.value.length > 0;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
const res = await scoreApi.getScoreList({
|
|
|
|
index: 1,
|
|
|
|
index: 1,
|
|
|
|
size: 1000,
|
|
|
|
size: 1000,
|
|
|
|
schoolId: userStore.userInfo.schoolId,
|
|
|
|
schoolId: userStore.userInfo.schoolId,
|
|
|
|
})
|
|
|
|
|
|
|
|
.then((res) => {
|
|
|
|
|
|
|
|
const transformedData = res.data.list.map((item) => ({
|
|
|
|
|
|
|
|
name: item.name,
|
|
|
|
|
|
|
|
className: item.className,
|
|
|
|
|
|
|
|
schoolId: item.schoolId,
|
|
|
|
|
|
|
|
scores: moduleMap.map(({ key, name }) => ({
|
|
|
|
|
|
|
|
moduleName: name,
|
|
|
|
|
|
|
|
score: item[`${key}Score`] || 0,
|
|
|
|
|
|
|
|
// 总成绩
|
|
|
|
|
|
|
|
totalScore: item.score || 0,
|
|
|
|
|
|
|
|
// 总排名
|
|
|
|
|
|
|
|
totalRank: item.stuRank || null,
|
|
|
|
|
|
|
|
})),
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
proxy.$cache.session.setJSON("scoreList", transformedData);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
const rows = Array.isArray(res?.data?.list) ? res.data.list : [];
|
|
|
|
|
|
|
|
hasScoreData.value = rows.some(hasTeacherScoreData);
|
|
|
|
|
|
|
|
scoreList.value = rows.map((item) => ({
|
|
|
|
|
|
|
|
name: item.name,
|
|
|
|
|
|
|
|
className: item.className,
|
|
|
|
|
|
|
|
schoolId: item.schoolId,
|
|
|
|
|
|
|
|
scores: moduleMap.map(({ key, name }) => ({
|
|
|
|
|
|
|
|
moduleName: name,
|
|
|
|
|
|
|
|
score: item[`${key}Score`] || 0,
|
|
|
|
|
|
|
|
// 总成绩
|
|
|
|
|
|
|
|
totalScore: item.score || 0,
|
|
|
|
|
|
|
|
// 总排名
|
|
|
|
|
|
|
|
totalRank: item.stuRank || null,
|
|
|
|
|
|
|
|
})),
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (hasScoreData.value) {
|
|
|
|
|
|
|
|
proxy.$cache.session.setJSON("scoreList", scoreList.value);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
proxy.$message.warning("暂无成绩数据,暂时无法进行AI学情分析");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (error) {
|
|
|
|
|
|
|
|
proxy.$message.error("成绩数据加载失败,请稍后重试");
|
|
|
|
|
|
|
|
} finally {
|
|
|
|
|
|
|
|
scoreLoaded.value = true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
};
|
|
|
|
};
|
|
|
|
// 分析
|
|
|
|
// 分析
|
|
|
|
const analysis = (val) => {
|
|
|
|
const analysis = (val) => {
|
|
|
|
|
|
|
|
if (!scoreLoaded.value) {
|
|
|
|
|
|
|
|
return proxy.$message.warning("成绩数据正在加载,请稍候");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!hasScoreData.value) {
|
|
|
|
|
|
|
|
return proxy.$message.warning("暂无成绩数据,暂时无法进行AI学情分析");
|
|
|
|
|
|
|
|
}
|
|
|
|
proxy.$cache.session.setJSON("msg", val.msg);
|
|
|
|
proxy.$cache.session.setJSON("msg", val.msg);
|
|
|
|
router.push("/ai/learning-situation-dialogue");
|
|
|
|
router.push("/ai/learning-situation-dialogue");
|
|
|
|
};
|
|
|
|
};
|
|
|
|
@ -165,6 +189,13 @@ onMounted(() => {
|
|
|
|
background: linear-gradient(-90deg, #1160ff 0%, #1994ff 100%);
|
|
|
|
background: linear-gradient(-90deg, #1160ff 0%, #1994ff 100%);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
.empty-score {
|
|
|
|
|
|
|
|
height: 100%;
|
|
|
|
|
|
|
|
--el-empty-description-margin-top: 16px;
|
|
|
|
|
|
|
|
:deep(.el-empty__description p) {
|
|
|
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
.brief-introduction {
|
|
|
|
.brief-introduction {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
justify-content: center;
|
|
|
|
justify-content: center;
|
|
|
|
@ -176,4 +207,4 @@ onMounted(() => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</style>
|
|
|
|
|