fix(CloudSchoolReport): 修正课程完成率计算公式显示

refactor(OnlineLearningMonitorPage): 重构知识点数据生成逻辑
- 当状态为"进行中"或"成功"时停止生成有效数据
- 调整"进行中"状态的数据约束规则

chore: 更新部署配置信息
This commit is contained in:
YangQiang 2026-04-23 09:27:27 +08:00
parent 2580f447a4
commit c3b0df2e28
3 changed files with 34 additions and 17 deletions

View File

@ -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
}

View File

@ -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>

View File

@ -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;
}
}
});