fix(CloudSchoolReport): 修正课程完成率计算公式显示
refactor(OnlineLearningMonitorPage): 重构知识点数据生成逻辑 - 当状态为"进行中"或"成功"时停止生成有效数据 - 调整"进行中"状态的数据约束规则 chore: 更新部署配置信息
This commit is contained in:
parent
2580f447a4
commit
c3b0df2e28
|
|
@ -2,9 +2,9 @@
|
|||
"projectName": "aixuediebian-kanban",
|
||||
"projectId": "pages-eip23arpzoar",
|
||||
"deployUrl": "https://aixuediebian-kanban-3fzkam9s.edgeone.cool",
|
||||
"previewUrl": "https://aixuediebian-kanban-3fzkam9s.edgeone.cool?eo_token=576e664b0c4a84b8248571e5462c243d&eo_time=1776677133",
|
||||
"previewUrl": "https://aixuediebian-kanban-3fzkam9s.edgeone.cool?eo_token=cb14dd055e9800e60bec15a6d7609f0a&eo_time=1776851825",
|
||||
"consoleUrl": "https://console.cloud.tencent.com/edgeone/pages/project/pages-eip23arpzoar/index",
|
||||
"deploymentUrl": "https://console.cloud.tencent.com/edgeone/pages/project/pages-eip23arpzoar/deployment/e2mce5a5te",
|
||||
"deployId": "e2mce5a5te",
|
||||
"lastDeployTime": 1776677133
|
||||
"deploymentUrl": "https://console.cloud.tencent.com/edgeone/pages/project/pages-eip23arpzoar/deployment/qmtywlqsh0",
|
||||
"deployId": "qmtywlqsh0",
|
||||
"lastDeployTime": 1776851825
|
||||
}
|
||||
|
|
@ -301,7 +301,7 @@
|
|||
</template>
|
||||
<template v-else-if="column.key === 'courseCompletionRate'">
|
||||
<a-tooltip placement="top" :overlay-style="{ maxWidth: '320px' }">
|
||||
<template #title>课程完成率 = (当日打卡的课程数 / 当日总课程数 × 学员人数)</template>
|
||||
<template #title>课程完成率 = 当日打卡的课程数 / (当日总课程数 × 学员人数)</template>
|
||||
<span style="cursor:help;border-bottom:1px dashed #aaa;">课程完成率</span>
|
||||
</a-tooltip>
|
||||
</template>
|
||||
|
|
|
|||
|
|
@ -1138,7 +1138,7 @@ const studentColumns = computed(() => [
|
|||
align: 'center'
|
||||
},
|
||||
{
|
||||
title: '学无交',
|
||||
title: '仅学无交',
|
||||
dataIndex: 'hasStudyNoSubmit',
|
||||
key: 'hasStudyNoSubmit',
|
||||
width: 80,
|
||||
|
|
@ -1459,6 +1459,8 @@ const knowledgeColumns = [
|
|||
|
||||
// 生成知识点数据 - 一对多关系:每个知识点对应多条攻坚记录
|
||||
// 逻辑:正确率>=达标正确率时状态为"成功",成功后后续攻坚不再记录数据
|
||||
// 当状态为"进行中"或"成功"时,该知识点后续所有学习次数的数据显示为'-'值
|
||||
// 仅当状态为"进行中"时:本次正确率必须为'-',学习时长必须有值,答题时长可随机为'-'或有值
|
||||
const generateKnowledgeData = (student) => {
|
||||
const knowledges = [
|
||||
{ name: '函数的概念与性质', id: 1 },
|
||||
|
|
@ -1472,16 +1474,16 @@ const generateKnowledgeData = (student) => {
|
|||
const attemptCount = Math.floor(Math.random() * 2) + 3; // 3-4次攻坚
|
||||
const targetRateNum = Math.floor(Math.random() * 20 + 70); // 70-90%达标率
|
||||
const targetRate = `${targetRateNum}%`;
|
||||
let hasSuccess = false; // 标记是否已成功
|
||||
let stopGenerate = false; // 标记是否停止生成有效数据
|
||||
|
||||
for (let i = 0; i < attemptCount; i++) {
|
||||
// 如果已经成功,后续所有数据为空
|
||||
if (hasSuccess) {
|
||||
if (stopGenerate) {
|
||||
// 已停止生成,添加空值数据
|
||||
data.push({
|
||||
key: `${knowledgeIndex}-${i}`,
|
||||
knowledgeName: knowledge.name,
|
||||
knowledgeId: knowledge.id,
|
||||
knowledgeRowSpan: i === 0 ? attemptCount : null,
|
||||
knowledgeRowSpan: i === 0 ? attemptCount : 0,
|
||||
targetRate: targetRate,
|
||||
attemptNumber: i + 1,
|
||||
studyDuration: '-',
|
||||
|
|
@ -1500,23 +1502,38 @@ const generateKnowledgeData = (student) => {
|
|||
const isSuccess = correctRateNum >= targetRateNum;
|
||||
const status = isSuccess ? '成功' : (Math.random() > 0.3 ? '失败' : '进行中');
|
||||
|
||||
// 如果成功,标记并记录数据
|
||||
if (isSuccess) {
|
||||
hasSuccess = true;
|
||||
// 根据状态设置字段值
|
||||
let finalCorrectRate = correctRate;
|
||||
let finalStudyDuration = `${Math.floor(Math.random() * 10 + 5)}分钟${String(Math.floor(Math.random() * 60)).padStart(2, '0')}秒`;
|
||||
let finalAnswerDuration = `${Math.floor(Math.random() * 8 + 3)}分钟${String(Math.floor(Math.random() * 60)).padStart(2, '0')}秒`;
|
||||
|
||||
// 仅当状态为"进行中"时,执行特定数据约束规则
|
||||
if (status === '进行中') {
|
||||
// 1. 本次正确率必须为'-'空值
|
||||
finalCorrectRate = '-';
|
||||
// 2. 学习时长必须有值(已在上面生成)
|
||||
// 3. 答题时长可随机为'-'或有值
|
||||
finalAnswerDuration = Math.random() > 0.5 ? '-' : `${Math.floor(Math.random() * 8 + 3)}分钟${String(Math.floor(Math.random() * 60)).padStart(2, '0')}秒`;
|
||||
}
|
||||
|
||||
// 添加当前次数的数据
|
||||
data.push({
|
||||
key: `${knowledgeIndex}-${i}`,
|
||||
knowledgeName: knowledge.name,
|
||||
knowledgeId: knowledge.id,
|
||||
knowledgeRowSpan: i === 0 ? attemptCount : null,
|
||||
knowledgeRowSpan: i === 0 ? attemptCount : 0,
|
||||
targetRate: targetRate,
|
||||
attemptNumber: i + 1,
|
||||
studyDuration: `${Math.floor(Math.random() * 10 + 5)}分钟${String(Math.floor(Math.random() * 60)).padStart(2, '0')}秒`,
|
||||
answerDuration: `${Math.floor(Math.random() * 8 + 3)}分钟${String(Math.floor(Math.random() * 60)).padStart(2, '0')}秒`,
|
||||
correctRate: correctRate,
|
||||
studyDuration: finalStudyDuration,
|
||||
answerDuration: finalAnswerDuration,
|
||||
correctRate: finalCorrectRate,
|
||||
status: status
|
||||
});
|
||||
|
||||
// 如果状态为"进行中"或"成功",停止生成后续有效数据
|
||||
if (status === '进行中' || status === '成功') {
|
||||
stopGenerate = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue