From 8f95150f17890903196c32d1c52638923f37ccad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=A9=AC=E6=A2=93=E5=BD=AD?= Date: Wed, 23 Sep 2026 10:35:50 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=AA=E4=BA=BA=E9=A1=B9=E7=9B=AE=E5=8F=AA?= =?UTF-8?q?=E5=B1=95=E7=A4=BA=E5=BD=93=E5=89=8D=E5=87=BA=E5=9C=BA=E4=BA=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/network/remote_scoring_adapter.dart | 16 +++++++++++----- .../scoring/widgets/competition_header.dart | 10 +++++++++- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/lib/core/network/remote_scoring_adapter.dart b/lib/core/network/remote_scoring_adapter.dart index 8da1246..12fc0bb 100644 --- a/lib/core/network/remote_scoring_adapter.dart +++ b/lib/core/network/remote_scoring_adapter.dart @@ -125,6 +125,14 @@ abstract final class RemoteScoringAdapter { JudgeScoreSheet sheet, ) { final memberNames = sheet.header.memberNames; + final isPersonal = sheet.header.scope.toLowerCase() == 'personal'; + final participantName = sheet.header.participantName.trim().isNotEmpty + ? sheet.header.participantName.trim() + : entry.participantName.trim(); + // 单位报名的个人项目可能与其他运动员共享报名项,个人评分页只展示当前出场人。 + final athleteLabel = isPersonal + ? (memberNames.length == 1 ? memberNames.single : participantName) + : (memberNames.isEmpty ? entry.participantName : memberNames.join('、')); return ScoringTask( taskId: entry.sessionEntryId, eventId: session.eventId, @@ -143,13 +151,11 @@ abstract final class RemoteScoringAdapter { ? entry.groupName : sheet.header.groupName, teamId: entry.sessionEntryId, - teamName: entry.participantName, - athleteLabel: memberNames.isEmpty - ? entry.participantName - : memberNames.join('、'), + teamName: isPersonal ? '' : entry.participantName, + athleteLabel: athleteLabel, ruleVersion: session.ruleName, scheduledAt: session.startTime ?? DateTime.now(), - prescribedEntryType: sheet.header.scope.toLowerCase() == 'personal' + prescribedEntryType: isPersonal ? PrescribedEntryType.individual : PrescribedEntryType.collective, ); diff --git a/lib/modules/scoring/widgets/competition_header.dart b/lib/modules/scoring/widgets/competition_header.dart index 3ddce89..04fe731 100644 --- a/lib/modules/scoring/widgets/competition_header.dart +++ b/lib/modules/scoring/widgets/competition_header.dart @@ -44,6 +44,14 @@ class CompetitionHeader extends StatelessWidget { @override Widget build(BuildContext context) { + final normalizedTeamLabel = teamLabel.trim(); + final normalizedAthleteLabel = athleteLabel.trim(); + final participantText = + normalizedTeamLabel.isEmpty || + normalizedTeamLabel == normalizedAthleteLabel + ? normalizedAthleteLabel + : '$normalizedTeamLabel:$normalizedAthleteLabel'; + return Column( children: [ Container( @@ -224,7 +232,7 @@ class CompetitionHeader extends StatelessWidget { ), Flexible( child: Text( - '$teamLabel:$athleteLabel', + participantText, maxLines: 1, overflow: TextOverflow.ellipsis, ),