feat(admin): 统一订单与支付枚举中文映射
This commit is contained in:
@@ -7,6 +7,12 @@ import { fetchAdminPayments } from '@/features/admin/api'
|
||||
import { AdminPageHeader } from '@/features/admin/components/AdminPageHeader'
|
||||
import { DataTable } from '@/features/admin/components/DataTable'
|
||||
import { FilterBar, FilterField } from '@/features/admin/components/FilterBar'
|
||||
import {
|
||||
paymentBizTypeMap,
|
||||
paymentMethodLabel,
|
||||
paymentProviderLabel,
|
||||
paymentProviderMap,
|
||||
} from '@/features/admin/enumLabels'
|
||||
import type { AdminPaymentQuery, AdminPaymentRow } from '@/features/admin/types'
|
||||
import { useAdminSessionStore } from '@/stores/adminSession'
|
||||
import { formatDateTime, formatMoney, formatText } from '@/shared/utils/format'
|
||||
@@ -27,16 +33,12 @@ const statusOptions = [
|
||||
{ value: 'closed', label: '已关闭' },
|
||||
]
|
||||
|
||||
const bizTypeOptions = [
|
||||
{ value: 'order_pay', label: '订单支付' },
|
||||
{ value: 'main_recharge', label: '充值' },
|
||||
]
|
||||
const bizTypeOptions = Object.entries(paymentBizTypeMap).map(([value, label]) => ({ value, label }))
|
||||
|
||||
const providerOptions = [
|
||||
{ value: 'leshua', label: '拉卡拉' },
|
||||
{ value: 'shuncheng', label: '顺诚' },
|
||||
{ value: 'mock', label: '模拟支付' },
|
||||
]
|
||||
const providerOptions = Object.entries(paymentProviderMap).map(([value, label]) => ({
|
||||
value,
|
||||
label,
|
||||
}))
|
||||
|
||||
const statusMeta: Record<string, { label: string; color: string }> = {
|
||||
pending: { label: '待支付', color: 'gold' },
|
||||
@@ -91,8 +93,8 @@ const columns: TableColumnsType<AdminPaymentRow> = [
|
||||
width: 170,
|
||||
render: (_, row) => (
|
||||
<div className="admin-stack">
|
||||
<span>{formatText(row.provider)}</span>
|
||||
<span className="admin-mono">{formatText(row.pay_way)}</span>
|
||||
<span>{paymentProviderLabel(row.provider)}</span>
|
||||
<span className="admin-mono">{paymentMethodLabel(row.pay_way)}</span>
|
||||
</div>
|
||||
),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user