{{ module.moduleName }}
@@ -106,9 +106,7 @@ const MODULE_COLORS = ["#6958e7", "#3698ee", "#ffb83e", "#ff6f4a", "#45b982", "#
let scoreChart;
let progressChart;
-const participatingModules = computed(() =>
- (report.value.modules || []).filter((module) => module && module.participating !== false)
-);
+const displayModules = computed(() => report.value.modules || []);
const totalStudyMinutes = computed(() =>
Object.values(studyTime.value || {}).reduce((total, value) => total + (Number(value) || 0), 0)
@@ -139,7 +137,7 @@ const renderScoreChart = () => {
center: ["34%", "50%"],
avoidLabelOverlap: true,
label: { formatter: "{b}" },
- data: participatingModules.value.map((module, index) => ({
+ data: displayModules.value.map((module, index) => ({
name: module.moduleName,
value: Number(module.score) || 0,
itemStyle: { color: moduleColor(index) }
@@ -151,7 +149,7 @@ const renderScoreChart = () => {
const renderProgressChart = () => {
if (!progressChartRef.value) return;
progressChart = progressChart || echarts.init(progressChartRef.value);
- const modules = participatingModules.value;
+ const modules = displayModules.value;
progressChart.setOption({
tooltip: { trigger: "axis", axisPointer: { type: "shadow" } },
legend: { top: 0, data: ["已完成", "待完成"] },
diff --git a/tests/student-home-new-modules.static.test.cjs b/tests/student-home-new-modules.static.test.cjs
index 553c3c1..2a9cdbf 100644
--- a/tests/student-home-new-modules.static.test.cjs
+++ b/tests/student-home-new-modules.static.test.cjs
@@ -6,7 +6,11 @@ const root = path.resolve(__dirname, '..');
const page = fs.readFileSync(path.join(root, 'src/views/student/index.vue'), 'utf8');
assert(/getCurrentExperimentReport/.test(page));
-assert(/participatingModules/.test(page));
+assert(/const displayModules = computed\(\(\) => report\.value\.modules \|\| \[\]\);/.test(page));
+assert(/:data="displayModules"/.test(page));
+assert(/v-for="\(module, index\) in displayModules"/.test(page));
+assert((page.match(/displayModules\.value/g) || []).length >= 2);
+assert(!/participatingModules/.test(page));
assert(/completedTaskCount/.test(page));
assert(/totalTaskCount/.test(page));
assert(/moduleName/.test(page));