From cfcd905a2b4ce223d409e6c2bb202db1d0902006 Mon Sep 17 00:00:00 2001 From: MSuMshk <2039814060@qq.com> Date: Mon, 16 Feb 2026 11:35:33 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=AF=B9=E9=BD=90=E8=90=A5=E4=B8=9A?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E6=8A=BD=E5=B1=89=E4=B8=8E=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E9=80=89=E6=8B=A9=E4=BA=A4=E4=BA=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../store/hours/components/AddSlotDrawer.vue | 59 +- .../store/hours/components/CopyStoreModal.vue | 96 +-- .../store/hours/components/DayEditDrawer.vue | 127 ++-- .../store/hours/components/HolidayDrawer.vue | 128 +++- apps/web-antd/src/views/store/hours/index.vue | 40 +- .../views/store/hours/styles/copy-modal.less | 219 ++++-- .../src/views/store/hours/styles/drawer.less | 646 ++++++++++++++++++ .../src/views/store/hours/styles/holiday.less | 22 +- 8 files changed, 1140 insertions(+), 197 deletions(-) diff --git a/apps/web-antd/src/views/store/hours/components/AddSlotDrawer.vue b/apps/web-antd/src/views/store/hours/components/AddSlotDrawer.vue index 580267f..585ea77 100644 --- a/apps/web-antd/src/views/store/hours/components/AddSlotDrawer.vue +++ b/apps/web-antd/src/views/store/hours/components/AddSlotDrawer.vue @@ -8,7 +8,7 @@ import type { import type { SlotType } from '#/api/store-hours'; -import { Button, Drawer, Textarea } from 'ant-design-vue'; +import { Button, Drawer, TimePicker } from 'ant-design-vue'; interface Props { addSlotForm: AddSlotFormState; @@ -36,18 +36,35 @@ const emit = defineEmits<{ }>(); function getInputValue(event: Event) { - const target = event.target as HTMLInputElement | null; + const target = event.target as HTMLInputElement | HTMLTextAreaElement | null; return target?.value ?? ''; } + +function hasFormatMethod( + value: unknown, +): value is { format: (pattern: string) => string } { + return Boolean( + value && + typeof value === 'object' && + 'format' in value && + typeof (value as { format?: unknown }).format === 'function', + ); +} + +function readTimeValue(value: unknown) { + if (typeof value === 'string') return value; + if (hasFormatMethod(value)) return value.format('HH:mm'); + return ''; +}