“选择报名项目”进入时默认选择第一个队伍

This commit is contained in:
马梓彭 2026-10-13 15:56:08 +08:00
parent aca1ec79fa
commit 063e7d2f65

View File

@ -1658,6 +1658,13 @@ const switchSourceTeam = async (teamId) => {
activeTeamKey.value = activeAssignGroupId.value ? `${activeAssignGroupId.value}_1` : null;
};
// 进入选择项目、分配队员步骤时,默认选中界面展示的第一个团队
const switchToFirstSourceTeam = async () => {
const firstTeamId = selectedTeams.value[0]?.id;
if (!firstTeamId) return;
await switchSourceTeam(firstTeamId);
};
// 选择多个来源团队并预加载各自的运动员
const onTeamSelectionChange = async (teamIds) => {
const selectedIds = Array.isArray(teamIds) ? teamIds : [];
@ -2286,17 +2293,21 @@ const fetchMembers = async () => {
}
};
const handlePrevious = () => {
const handlePrevious = async () => {
if (activeStep.value === 3) {
activeStep.value = 2;
previewData.value = null;
previewLoading.value = false;
draftRegistrationId.value = null;
await nextTick();
await switchToFirstSourceTeam();
return;
}
if (activeStep.value === 2) {
activeStep.value = 1;
resetAssignMembersAndBeyond();
await nextTick();
await switchToFirstSourceTeam();
return;
}
if (activeStep.value === 1) {
@ -2456,7 +2467,7 @@ const handleStep0Next = async () => {
ElMessage.warning('请至少选择一个团队');
return;
}
await switchSourceTeam(selectedTeamIds.value[0]);
await switchToFirstSourceTeam();
activeStep.value = 1;
};
@ -2485,7 +2496,7 @@ const handleStep1Next = async () => {
});
await nextTick();
await switchSourceTeam(selectedTeamIds.value[0]);
await switchToFirstSourceTeam();
};
const handleStep2Next = async () => {