diff --git a/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js b/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js index f28c2697..66e06a03 100644 --- a/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js +++ b/public/react/src/modules/ec/graduatesRequirement/GraduatesRequirement.js @@ -228,17 +228,22 @@ function getTableData(data_args) { let nameRowData = {}; let targetValueRowData = {}; let realValueRowData = {}; + let target_value_total = 0; + let real_value_total = 0; // 一个course数组的数据组合成三行table数据 innerItem.course_data.forEach((course, courseIndex) => { nameRowData[`c${courseIndex + 1}`] = course.course_name; - if (course.status) { - nameRowData.status = course.status - } + targetValueRowData[`c${courseIndex + 1}`] = course.target_value && course.target_value.toFixed ? course.target_value.toFixed(3) : course.target_value ; + target_value_total = target_value_total + targetValueRowData[`c${courseIndex + 1}`] realValueRowData[`c${courseIndex + 1}`] = course.real_value && course.real_value.toFixed ? course.real_value.toFixed(3) : course.real_value ; + real_value_total = real_value_total + realValueRowData[`c${courseIndex + 1}`] }) + if (real_value_total >= target_value_total) { + nameRowData.status = true + } maxCouseCount = Math.max(maxCouseCount, innerItem.course_data.length) tableData.push(nameRowData) tableData.push(targetValueRowData)