|
|
@@ -837,9 +837,15 @@ const calculateParticipantCounts = async () => {
|
|
|
(project as any).totalParticipants = uniqueParticipants.size;
|
|
|
|
|
|
// 计算完赛人数(有成绩记录的)
|
|
|
- const completedScores = scores.filter(score =>
|
|
|
- score.individualPerformance || score.teamPerformance
|
|
|
- );
|
|
|
+ const completedScores = scores.filter(score => {
|
|
|
+ const individualScore = parseFloat(score.individualPerformance);
|
|
|
+ const teamScore = parseFloat(score.teamPerformance);
|
|
|
+
|
|
|
+ // 成绩必须存在且大于0
|
|
|
+ return (!isNaN(individualScore) && individualScore > 0) ||
|
|
|
+ (!isNaN(teamScore) && teamScore > 0);
|
|
|
+ });
|
|
|
+ console.log('completedScores: ', completedScores);
|
|
|
(project as any).completedParticipants = completedScores.length;
|
|
|
|
|
|
// 计算未完赛人数
|