[Snow Team] frontend-fixer-2: auto-commit work
This commit is contained in:
@@ -3,7 +3,7 @@ import { Search } from '@element-plus/icons-vue'
|
||||
import { computed, onMounted, reactive, ref } from 'vue'
|
||||
|
||||
import { fetchAdminWalletLedger, type AdminWalletLedger } from '@/features/admin/api/adminWallet'
|
||||
import { formatMoneyWithSymbol } from '@/shared/utils/money'
|
||||
import { formatCentWithSymbol } from '@/shared/utils/money'
|
||||
import { balanceTypeLabel, ledgerDirectionLabel } from '@/utils/statusLabels'
|
||||
import { formatDateTime } from '@/utils/time'
|
||||
import AdminTablePagination from '../components/AdminTablePagination.vue'
|
||||
@@ -22,12 +22,12 @@ const filters = reactive({
|
||||
const inAmount = computed(() =>
|
||||
ledger.value
|
||||
.filter(item => item.direction === 'in')
|
||||
.reduce((sum, item) => sum + Number(item.amount || 0), 0)
|
||||
.reduce((sum, item) => sum + Number(item.amount_cent || 0), 0)
|
||||
)
|
||||
const outAmount = computed(() =>
|
||||
ledger.value
|
||||
.filter(item => item.direction === 'out')
|
||||
.reduce((sum, item) => sum + Number(item.amount || 0), 0)
|
||||
.reduce((sum, item) => sum + Number(item.amount_cent || 0), 0)
|
||||
)
|
||||
|
||||
onMounted(loadLedger)
|
||||
@@ -65,7 +65,7 @@ async function handlePageChange() {
|
||||
}
|
||||
|
||||
function money(value: number) {
|
||||
return formatMoneyWithSymbol(value)
|
||||
return formatCentWithSymbol(value)
|
||||
}
|
||||
|
||||
function directionType(direction: string) {
|
||||
@@ -149,13 +149,13 @@ function directionLabel(direction: string) {
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="金额" width="110">
|
||||
<template #default="{ row }">{{ money(Number(row.amount)) }}</template>
|
||||
<template #default="{ row }">{{ money(Number(row.amount_cent)) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="余额类型" width="110">
|
||||
<template #default="{ row }">{{ balanceTypeLabel(row.balance_type) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="变化后余额" width="130">
|
||||
<template #default="{ row }">{{ money(Number(row.balance_after)) }}</template>
|
||||
<template #default="{ row }">{{ money(Number(row.balance_after_cent)) }}</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" min-width="180">
|
||||
<template #default="{ row }">{{ formatDateTime(row.created_at) }}</template>
|
||||
|
||||
Reference in New Issue
Block a user