|
@@ -150,17 +150,18 @@
|
|
|
return params;
|
|
|
},
|
|
|
afterFetch: async (data) => {
|
|
|
- const newData = [...data];
|
|
|
- newData &&
|
|
|
- newData.forEach((item) => {
|
|
|
+ const newData: Recordable[] = [];
|
|
|
+ data &&
|
|
|
+ data.forEach((item) => {
|
|
|
const newItem = { ...item };
|
|
|
let total = 0;
|
|
|
item.scoreList &&
|
|
|
item.scoreList.forEach((score) => {
|
|
|
newItem[score.courseId] = score.score;
|
|
|
- total += score.score;
|
|
|
+ total += Number(score.score);
|
|
|
});
|
|
|
- newItem.total = total;
|
|
|
+ newItem.total = parseFloat(total.toFixed(2));
|
|
|
+ newData.push(newItem);
|
|
|
});
|
|
|
return newData;
|
|
|
},
|