Przeglądaj źródła

feat: 报告展示

zhangjie 1 rok temu
rodzic
commit
145e0620ef

+ 15 - 19
src/modules/target/components/target-statistics/DetailTargetStatistics.vue

@@ -252,6 +252,7 @@
               v-for="(evaluation, eindex) in item.evaluationList"
               :key="`${item.targetId}-${eindex}`"
             >
+              <!-- 课程目标 -->
               <td
                 v-if="!eindex"
                 :rowspan="item.evaluationList.length"
@@ -259,32 +260,26 @@
               >
                 {{ item.targetName }}
               </td>
+              <!-- 评价依据 -->
               <td v-if="!eindex" :rowspan="item.evaluationList.length">
                 <p
-                  v-for="edesc in item.graduationRequirementPoint.split('\n')"
+                  v-for="edesc in item.graduationRequirementPoint.split(',')"
                   :key="edesc"
                 >
                   {{ edesc }}
                 </p>
               </td>
+              <!-- 评价环节 -->
               <td style="width: 140px">{{ evaluation.evaluation }}</td>
-
-              <td
-                v-if="!eindex"
-                style="width: 80px"
-                :rowspan="item.evaluationList.length - 1"
-              >
-                {{ item.normalTargetWeight }}
-              </td>
-              <td
-                v-else-if="eindex === item.evaluationList.length - 1"
-                style="width: 80px"
-              >
+              <!-- 权重 -->
+              <td style="width: 80px">
                 {{ evaluation.targetWeight }}
               </td>
-
+              <!-- 目标分值 -->
               <td style="width: 100px">{{ evaluation.targetScore }}</td>
+              <!-- 实际平均分 -->
               <td style="width: 100px">{{ evaluation.targetAvgScore }}</td>
+              <!-- 目标达成评价值 -->
               <td
                 v-if="!eindex"
                 :rowspan="item.evaluationList.length"
@@ -749,12 +744,12 @@ export default {
         const ntarget = {
           targetId: target.targetId,
           targetName: target.targetName,
-          finalWeight: target.finalScore.targetWeight,
-          usualWeight: target.usualScore.targetWeight,
+          finalWeight: target.finalScore?.targetWeight,
+          usualWeight: target.usualScore?.targetWeight,
           evaluationValue: targetVals[target.targetId],
         };
         ntarget.finalDimensions = ["期末成绩"];
-        ntarget.usualWorks = target.usualScore.scoreList.map(
+        ntarget.usualWorks = (target.usualScore?.scoreList || []).map(
           (item) => item.evaluation
         );
         tColumnCounts.push(
@@ -783,9 +778,10 @@ export default {
         const workScoreKey = lastIndex === sindex ? "matrixAvgScore" : "score";
 
         student.targetList.forEach((target, index) => {
-          nitem[`${target.targetId}-final`] = target.finalScore[finalScoreKey];
+          nitem[`${target.targetId}-final`] =
+            target.finalScore && target.finalScore[finalScoreKey];
 
-          target.usualScore.scoreList.forEach((work) => {
+          (target.usualScore?.scoreList || []).forEach((work) => {
             nitem[`${target.targetId}-usual-${work.evaluation}`] =
               work[workScoreKey];
           });