fix: correct affiliate audit record sources

This commit is contained in:
shaw
2026-05-03 22:12:57 +08:00
parent 76e2503d5e
commit 0b84d12dbb
11 changed files with 334 additions and 98 deletions

View File

@@ -69,10 +69,11 @@ export interface AffiliateTransferRecord {
user_email: string
username: string
amount: number
current_balance: number
remaining_quota: number
frozen_quota: number
history_quota: number
balance_after?: number | null
available_quota_after?: number | null
frozen_quota_after?: number | null
history_quota_after?: number | null
snapshot_available: boolean
created_at: string
}

View File

@@ -1664,10 +1664,10 @@ export default {
paymentType: 'Payment Method',
orderStatus: 'Order Status',
transferAmount: 'Transfer Amount',
currentBalance: 'Current Balance',
remainingQuota: 'Remaining Quota',
frozenQuota: 'Frozen Rebate',
historyQuota: 'Historical Rebate',
balanceAfter: 'Balance After',
availableQuotaAfter: 'Available After',
frozenQuotaAfter: 'Frozen After',
historyQuotaAfter: 'Historical Rebate After',
invitedAt: 'Invited At',
rebatedAt: 'Rebated At',
transferredAt: 'Transferred At'

View File

@@ -1685,10 +1685,10 @@ export default {
paymentType: '支付方式',
orderStatus: '订单状态',
transferAmount: '提取金额',
currentBalance: '当前余额',
remainingQuota: '剩余可提取',
frozenQuota: '冻结返利',
historyQuota: '历史返利',
balanceAfter: '提取后余额',
availableQuotaAfter: '提取后可提',
frozenQuotaAfter: '提取后冻结',
historyQuotaAfter: '提取后历史返利',
invitedAt: '邀请时间',
rebatedAt: '返利时间',
transferredAt: '提取时间'

View File

@@ -83,17 +83,17 @@
<template #cell-amount="{ row }">
<AmountText :value="row.amount" strong />
</template>
<template #cell-current_balance="{ row }">
<AmountText :value="row.current_balance" />
<template #cell-balance_after="{ row }">
<NullableAmountText :value="row.balance_after" />
</template>
<template #cell-remaining_quota="{ row }">
<AmountText :value="row.remaining_quota" />
<template #cell-available_quota_after="{ row }">
<NullableAmountText :value="row.available_quota_after" />
</template>
<template #cell-frozen_quota="{ row }">
<AmountText :value="row.frozen_quota" />
<template #cell-frozen_quota_after="{ row }">
<NullableAmountText :value="row.frozen_quota_after" />
</template>
<template #cell-history_quota="{ row }">
<AmountText :value="row.history_quota" />
<template #cell-history_quota_after="{ row }">
<NullableAmountText :value="row.history_quota_after" />
</template>
<template #cell-created_at="{ row }">
<span class="text-sm text-gray-700 dark:text-gray-300">{{ formatDateTime(row.created_at) }}</span>
@@ -142,7 +142,7 @@
</template>
<script setup lang="ts">
import { computed, defineComponent, h, onMounted, reactive, ref } from 'vue'
import { computed, defineComponent, h, onMounted, reactive, ref, type PropType } from 'vue'
import { useI18n } from 'vue-i18n'
import AppLayout from '@/components/layout/AppLayout.vue'
import TablePageLayout from '@/components/layout/TablePageLayout.vue'
@@ -202,10 +202,10 @@ const columns = computed<Column[]>(() => {
return [
{ key: 'user', label: t('admin.affiliates.records.user'), sortable: true },
{ key: 'amount', label: t('admin.affiliates.records.transferAmount'), sortable: true },
{ key: 'current_balance', label: t('admin.affiliates.records.currentBalance'), sortable: true },
{ key: 'remaining_quota', label: t('admin.affiliates.records.remainingQuota'), sortable: true },
{ key: 'frozen_quota', label: t('admin.affiliates.records.frozenQuota'), sortable: true },
{ key: 'history_quota', label: t('admin.affiliates.records.historyQuota'), sortable: true },
{ key: 'balance_after', label: t('admin.affiliates.records.balanceAfter'), sortable: true },
{ key: 'available_quota_after', label: t('admin.affiliates.records.availableQuotaAfter'), sortable: true },
{ key: 'frozen_quota_after', label: t('admin.affiliates.records.frozenQuotaAfter'), sortable: true },
{ key: 'history_quota_after', label: t('admin.affiliates.records.historyQuotaAfter'), sortable: true },
{ key: 'created_at', label: t('admin.affiliates.records.transferredAt'), sortable: true },
]
})
@@ -368,6 +368,21 @@ const AmountText = defineComponent({
},
})
const NullableAmountText = defineComponent({
props: {
value: { type: Number as PropType<number | null | undefined>, default: null },
},
setup(amountProps) {
return () => {
const value = amountProps.value
if (value === null || value === undefined) {
return h('span', { class: 'text-sm text-gray-400 dark:text-dark-500' }, '-')
}
return h(AmountText, { value })
}
},
})
const OverviewStat = defineComponent({
props: {
label: { type: String, required: true },