From 5a15159ff3e86704e2946152811209aa09c4e718 Mon Sep 17 00:00:00 2001 From: Mars <3361409208a@gmail.com> Date: Fri, 12 Jun 2026 09:24:25 +0800 Subject: [PATCH] =?UTF-8?q?fix(admin):=20=E4=BF=AE=E5=A4=8D=E5=85=AC?= =?UTF-8?q?=E5=85=B1=E5=86=85=E5=AE=B9=E5=B1=95=E7=A4=BA=E6=97=B6=E6=AE=B5?= =?UTF-8?q?=E4=B8=8E=E7=BC=96=E8=BE=91=E8=A1=A8=E5=8D=95=E6=97=B6=E5=8C=BA?= =?UTF-8?q?=E4=B8=8D=E4=B8=80=E8=87=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Cursor --- apps/admin/src/views/Contents.vue | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/admin/src/views/Contents.vue b/apps/admin/src/views/Contents.vue index 4d1f979..2b8d266 100644 --- a/apps/admin/src/views/Contents.vue +++ b/apps/admin/src/views/Contents.vue @@ -5,6 +5,10 @@ import type { TableInstance } from 'element-plus'; import { useAdminLocale } from '../composables/useAdminLocale'; import api from '../api'; import AdminTableEmpty from '../components/AdminTableEmpty.vue'; +import { + normalizeStartTimeForApi, + normalizeStartTimeForPicker, +} from './match-form'; const { t, localeTag } = useAdminLocale(); @@ -311,8 +315,8 @@ function openEdit(row: ContentItem) { status: row.status, linkType: (row.linkType as '' | 'ROUTE' | 'URL') || '', linkTarget: row.linkTarget ?? '', - startTime: row.startTime ? row.startTime.slice(0, 19) : '', - endTime: row.endTime ? row.endTime.slice(0, 19) : '', + startTime: normalizeStartTimeForPicker(row.startTime ?? undefined), + endTime: normalizeStartTimeForPicker(row.endTime ?? undefined), translations: LOCALES.map((locale) => { const tr = byLocale.get(locale); return { @@ -340,8 +344,8 @@ function buildPayload() { linkType: isBanner.value && form.value.linkType ? form.value.linkType : null, linkTarget: isBanner.value && form.value.linkType ? form.value.linkTarget.trim() : null, - startTime: form.value.startTime || null, - endTime: form.value.endTime || null, + startTime: form.value.startTime ? normalizeStartTimeForApi(form.value.startTime) : null, + endTime: form.value.endTime ? normalizeStartTimeForApi(form.value.endTime) : null, translations: form.value.translations.map((tr) => ({ locale: tr.locale, title: tr.title.trim() || undefined,