This commit is contained in:
2026-08-07 18:15:56 +08:00
parent 217768fb0b
commit 3c69e67e75
2 changed files with 29 additions and 0 deletions
@@ -53,6 +53,7 @@ const orderPage = ref(1)
const orderPageSize = ref(10)
const customerOrdersLoading = ref(false)
const customerOrdersError = ref<ApiErrorDetails | null>(null)
let skipNextOrderPageLoad = false
const previews = ref<Record<string, PreviewState>>({})
const previewOpen = ref(false)
const previewName = ref('')
@@ -195,6 +196,7 @@ async function loadDetail() {
const optional: Promise<void>[] = []
if (access.can('platform:order:list')) {
if (orderPage.value !== 1) skipNextOrderPageLoad = true
orderPage.value = 1
customerOrders.value = []
customerOrderTotal.value = 0
@@ -254,6 +256,10 @@ function handleTabKeydown(event: KeyboardEvent, key: DetailTab) {
onMounted(loadDetail)
onBeforeUnmount(clearPreviews)
watch(orderPage, (page, previousPage) => {
if (skipNextOrderPageLoad) {
skipNextOrderPageLoad = false
return
}
if (page !== previousPage) void loadCustomerOrders(page)
})
</script>