优化admin-gui

This commit is contained in:
yml2213
2026-05-27 01:14:03 +08:00
parent 89f4dabfb3
commit 6fe3c75674
10 changed files with 1497 additions and 245 deletions
+6 -14
View File
@@ -1,29 +1,21 @@
<script setup lang="ts">
import { computed, onMounted, ref } from 'vue'
import { computed, ref } from 'vue'
import { fetchAdminOrders, type Order } from '@/api/orders'
import { useAdminTable } from '@/composables/useAdminTable'
import { handoffStatusLabel, orderStatusLabel, settlementStatusLabel } from '@/utils/statusLabels'
import { formatDateTime } from '@/utils/time'
const loading = ref(false)
const orders = ref<Order[]>([])
const status = ref('')
const { loading, data: orders, load: loadOrders } = useAdminTable<Order>({
fetchFn: fetchAdminOrders,
})
const filteredOrders = computed(() => {
if (!status.value) return orders.value
return orders.value.filter((item) => item.status === status.value)
})
onMounted(loadOrders)
async function loadOrders() {
loading.value = true
try {
orders.value = await fetchAdminOrders()
} finally {
loading.value = false
}
}
</script>
<template>