4949 </v-radio-group >
5050 </v-col >
5151
52+ <v-col cols =" 12" md =" 6" >
53+ <v-text-field
54+ v-model.number =" participantLimit"
55+ :label =" submitterType === 'TEAM' ? '队伍数量限制' : '参与者人数限制'"
56+ type =" number"
57+ min =" 1"
58+ v-bind =" participantLimitProps"
59+ :hint =" t('tasks.form.participantLimitHint')"
60+ >
61+ <template #append-inner >
62+ <v-icon size =" small" color =" primary" >mdi-account-group</v-icon >
63+ </template >
64+ </v-text-field >
65+ </v-col >
66+
5267 <!-- 小队人数限制 -->
5368 <template v-if =" submitterType === ' TEAM' " >
5469 <v-col cols =" 12" md =" 6" >
@@ -483,6 +498,7 @@ const { handleSubmit, defineField, isSubmitting } = useForm({
483498 minTeamSize: z .number ().int ().min (1 ).optional (),
484499 maxTeamSize: z .number ().int ().min (1 ).optional (),
485500 requireRealName: z .boolean ().optional ().default (false ),
501+ participantLimit: z .number ().int ().min (1 ).optional ().nullable (),
486502 })
487503 .refine ((arg ) => ! arg .maxTeamSize || ! arg .minTeamSize || arg .maxTeamSize >= arg .minTeamSize , {
488504 message: ' 最大人数不能小于最小人数' ,
@@ -498,6 +514,7 @@ const { handleSubmit, defineField, isSubmitting } = useForm({
498514 minTeamSize: props .initialData ?.minTeamSize ?? 1 ,
499515 maxTeamSize: props .initialData ?.maxTeamSize ?? 10 ,
500516 defaultDeadline: props .initialData ?.defaultDeadline ?? 30 ,
517+ participantLimit: props .initialData ?.participantLimit ?? null ,
501518 },
502519})
503520
@@ -511,6 +528,7 @@ const [minTeamSize, minTeamSizeProps] = defineField('minTeamSize', vuetifyConfig
511528const [maxTeamSize, maxTeamSizeProps] = defineField (' maxTeamSize' , vuetifyConfig )
512529const [categoryId, categoryIdProps] = defineField (' categoryId' , vuetifyConfig )
513530const [requireRealName, requireRealNameProps] = defineField (' requireRealName' , vuetifyConfig )
531+ const [participantLimit, participantLimitProps] = defineField (' participantLimit' , vuetifyConfig )
514532
515533const description = ref (props .initialData ?.description || [])
516534
@@ -543,6 +561,7 @@ const submitFormData = (values: any) => {
543561 categoryId: categoryId .value || undefined ,
544562 minTeamSize: submitterType .value === ' TEAM' ? minTeamSize .value : undefined ,
545563 maxTeamSize: submitterType .value === ' TEAM' ? maxTeamSize .value : undefined ,
564+ participantLimit: participantLimit .value || undefined ,
546565 }
547566 emit (' submit' , submissionData )
548567}
0 commit comments