From 25720b21e1e2f9bdac93506b29fb64942d87fec7 Mon Sep 17 00:00:00 2001 From: xiaomai Date: Fri, 8 May 2026 16:52:30 +0800 Subject: [PATCH] refactor(ui): streamline booking form layout and table actions Consolidate booking table row actions into a dropdown menu Update booking page layout to use a sidebar card for event details --- app/pages/bookings/index.vue | 146 +++++++++++++++++++++-------------- app/pages/index.vue | 83 ++++++++++---------- 2 files changed, 132 insertions(+), 97 deletions(-) diff --git a/app/pages/bookings/index.vue b/app/pages/bookings/index.vue index 8b69ac0..f6426bf 100644 --- a/app/pages/bookings/index.vue +++ b/app/pages/bookings/index.vue @@ -285,62 +285,43 @@ @@ -798,6 +779,59 @@ function receiptPath(booking: PublicBooking) { return `/receipt/${booking.receiptToken}` } +function isBookingRowActionBusy(booking: PublicBooking) { + return Boolean( + (deletingBookingId.value && deletingBookingId.value !== booking.id) + || (cancellingBookingId.value && cancellingBookingId.value !== booking.id) + || deletingBookingId.value === booking.id + || cancellingBookingId.value === booking.id + ) +} + +function bookingActionMenuItems(booking: PublicBooking) { + const busy = isBookingRowActionBusy(booking) + const items = [ + [ + { + label: 'Edit booking', + icon: 'i-lucide-pencil-line', + disabled: busy || !bookingConfig.value, + onSelect: () => openBookingEditor(booking) + }, + { + label: 'Transfer booking', + icon: 'i-lucide-send', + disabled: busy || !hasTransferTargets(booking), + onSelect: () => openTransferEditor(booking) + } + ] + ] + + if (booking.status === 'confirmed') { + items.push([ + { + label: 'Unconfirm booking', + icon: 'i-lucide-x-circle', + color: 'error', + disabled: busy, + onSelect: () => cancelBookingConfirmation(booking) + } + ]) + } + + items.push([ + { + label: 'Delete booking', + icon: 'i-lucide-trash-2', + color: 'error', + disabled: busy, + onSelect: () => deleteBooking(booking) + } + ]) + + return items +} + function openBookingEditor(booking: PublicBooking) { detailsBooking.value = booking detailsForm.customerName = booking.customerName diff --git a/app/pages/index.vue b/app/pages/index.vue index bb0d3b1..0c7108e 100644 --- a/app/pages/index.vue +++ b/app/pages/index.vue @@ -235,23 +235,28 @@ async function bookTicket(event: FormSubmitEvent) {