[fix]修改数据错误

This commit is contained in:
2026-06-08 15:16:32 +08:00
parent cf9870651f
commit 4e0f3c5a85

View File

@@ -419,6 +419,10 @@ const customerSummary = reactive({
unclaimAmount: 0, unclaimAmount: 0,
unclaimReceipt: 0, unclaimReceipt: 0,
}) })
const transactionTotals = reactive({
totalDeposit: 0,
totalWithdraw: 0,
})
const filters = reactive({ const filters = reactive({
startDate: today(), startDate: today(),
@@ -432,8 +436,8 @@ const transactionPage = reactive({
}) })
const showAllBanks = ref(false) const showAllBanks = ref(false)
const visibleBanks = computed(() => (showAllBanks.value ? banks.value : banks.value.slice(0, 4))) const visibleBanks = computed(() => (showAllBanks.value ? banks.value : banks.value.slice(0, 4)))
const totalDeposit = computed(() => customerSummary.totalDeposit) const totalDeposit = computed(() => transactionTotals.totalDeposit)
const totalWithdraw = computed(() => customerSummary.totalWithdraw) const totalWithdraw = computed(() => transactionTotals.totalWithdraw)
const dateRangeText = computed(() => { const dateRangeText = computed(() => {
const start = new Date(`${filters.startDate}T00:00:00`) const start = new Date(`${filters.startDate}T00:00:00`)
const end = new Date(`${filters.endDate}T00:00:00`) const end = new Date(`${filters.endDate}T00:00:00`)
@@ -446,8 +450,8 @@ const dateRangeText = computed(() => {
}) })
}) })
const summary = computed(() => [ const summary = computed(() => [
{ label: t('dashboard.Total Deposit / IN'), value: `AUD ${money(totalDeposit.value)}` }, { label: t('dashboard.Total Deposit / IN'), value: `AUD ${money(customerSummary.totalDeposit)}` },
{ label: t('dashboard.Total Withdraw / OUT'), value: `AUD ${money(totalWithdraw.value)}` }, { label: t('dashboard.Total Withdraw / OUT'), value: `AUD ${money(customerSummary.totalWithdraw)}` },
{ label: t('dashboard.Deposit Count'), value: customerSummary.countDeposit }, { label: t('dashboard.Deposit Count'), value: customerSummary.countDeposit },
{ label: t('dashboard.Withdraw Count'), value: customerSummary.countWithdraw }, { label: t('dashboard.Withdraw Count'), value: customerSummary.countWithdraw },
{ label: t('dashboard.Active Player'), value: customerSummary.activePlayer }, { label: t('dashboard.Active Player'), value: customerSummary.activePlayer },
@@ -566,6 +570,8 @@ const loadDashboard = (page = transactionPage.currentPage) => {
transactionPage.currentPage = toNumber(transactionData?.current_page) || page transactionPage.currentPage = toNumber(transactionData?.current_page) || page
transactionPage.lastPage = toNumber(transactionData?.last_page) || 1 transactionPage.lastPage = toNumber(transactionData?.last_page) || 1
transactionPage.pageSize = transactionPage.lastPage > 0 ? Math.max(1, Math.ceil(transactionPage.count / transactionPage.lastPage)) : 10 transactionPage.pageSize = transactionPage.lastPage > 0 ? Math.max(1, Math.ceil(transactionPage.count / transactionPage.lastPage)) : 10
transactionTotals.totalDeposit = toNumber(transactionData?.total_deposit)
transactionTotals.totalWithdraw = toNumber(transactionData?.total_withdraw)
const customerData = res.data.customer as DashboardCustomerSummary | undefined const customerData = res.data.customer as DashboardCustomerSummary | undefined
customerSummary.totalDeposit = toNumber(customerData?.total_deposit) customerSummary.totalDeposit = toNumber(customerData?.total_deposit)