From 8e1e6dfa30c623f85cccb8933e447b10446d77f1 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Mon, 13 Jul 2026 11:04:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E6=96=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/ApplyFormView.vue | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/src/views/ApplyFormView.vue b/src/views/ApplyFormView.vue index 664250f..26fe910 100644 --- a/src/views/ApplyFormView.vue +++ b/src/views/ApplyFormView.vue @@ -1163,28 +1163,25 @@ function applyServerPayload(d: { location_city?: string oversea_country?: string intro?: string + recommend?: string | null promise_signed_at?: string | null promise_signature?: string | null submitted_at?: string | null files?: { id: number; kind: string; original_name: string; size: number; url: string }[] -}) { +} & Record) { applicationStatus.value = (d.status as 'draft' | 'submitted') || 'draft' submittedAt.value = typeof d.submitted_at === 'string' ? d.submitted_at : '' participantMayEdit.value = d.participant_may_edit !== false - formModel.player_name = d.player_name || '' - formModel.school = d.school || '' - formModel.degree = d.degree || '' - formModel.contact_email = d.contact_email || '' - formModel.contact_mobile = d.contact_mobile || '' - formModel.entry_group = d.entry_group || '' - formModel.company_name = d.company_name || '' - formModel.project_name = d.project_name || '' - formModel.track = d.track || '' - formModel.location_country = d.location_country || '' - formModel.location_province = d.location_province || '' - formModel.location_city = d.location_city || '' - formModel.oversea_country = d.oversea_country || '' - formModel.intro = d.intro || '' + for (const f of schemaFields.value) { + if (f.type === 'file') continue + if (f.key === 'commitment_accepted' || f.key === 'promise_signature') continue + const raw = Object.prototype.hasOwnProperty.call(d, f.key) ? d[f.key] : undefined + if (f.type === 'checkbox') { + formModel[f.key] = raw ? '1' : '' + } else { + formModel[f.key] = raw != null ? String(raw) : '' + } + } const hasSignaturePayload = Object.prototype.hasOwnProperty.call(d, 'promise_signature') const sig = hasSignaturePayload ? typeof d.promise_signature === 'string'