This commit is contained in:
@@ -53,21 +53,28 @@
|
||||
}
|
||||
|
||||
// 获取状态标签类型
|
||||
const getStatusType = (status: AgentRechargeStatus): 'warning' | 'success' | 'info' => {
|
||||
const statusMap: Record<AgentRechargeStatus, 'warning' | 'success' | 'info'> = {
|
||||
const getStatusType = (
|
||||
status: AgentRechargeStatus
|
||||
): 'warning' | 'success' | 'info' | 'danger' => {
|
||||
const statusMap: Record<AgentRechargeStatus, 'warning' | 'success' | 'info' | 'danger'> = {
|
||||
1: 'warning', // 待支付
|
||||
2: 'success', // 已完成
|
||||
3: 'info' // 已取消
|
||||
2: 'success', // 已支付
|
||||
3: 'success', // 已完成
|
||||
4: 'info', // 已关闭
|
||||
5: 'danger' // 已退款
|
||||
}
|
||||
return statusMap[status] || 'info'
|
||||
}
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status: AgentRechargeStatus): string => {
|
||||
// 获取状态文本(优先使用 status_name,否则使用本地映射)
|
||||
const getStatusText = (status: AgentRechargeStatus, statusName?: string): string => {
|
||||
if (statusName) return statusName
|
||||
const statusMap: Record<AgentRechargeStatus, string> = {
|
||||
1: '待支付',
|
||||
2: '已完成',
|
||||
3: '已取消'
|
||||
2: '已支付',
|
||||
3: '已完成',
|
||||
4: '已关闭',
|
||||
5: '已退款'
|
||||
}
|
||||
return statusMap[status] || '-'
|
||||
}
|
||||
@@ -97,7 +104,9 @@
|
||||
{
|
||||
label: '状态',
|
||||
render: (data) =>
|
||||
h(ElTag, { type: getStatusType(data.status) }, () => getStatusText(data.status))
|
||||
h(ElTag, { type: getStatusType(data.status) }, () =>
|
||||
getStatusText(data.status, data.status_name)
|
||||
)
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
@@ -327,21 +327,28 @@
|
||||
}
|
||||
|
||||
// 获取状态标签类型
|
||||
const getStatusType = (status: AgentRechargeStatus): 'warning' | 'success' | 'info' => {
|
||||
const statusMap: Record<AgentRechargeStatus, 'warning' | 'success' | 'info'> = {
|
||||
const getStatusType = (
|
||||
status: AgentRechargeStatus
|
||||
): 'warning' | 'success' | 'info' | 'danger' => {
|
||||
const statusMap: Record<AgentRechargeStatus, 'warning' | 'success' | 'info' | 'danger'> = {
|
||||
1: 'warning', // 待支付
|
||||
2: 'success', // 已完成
|
||||
3: 'info' // 已取消
|
||||
2: 'success', // 已支付
|
||||
3: 'success', // 已完成
|
||||
4: 'info', // 已关闭
|
||||
5: 'danger' // 已退款
|
||||
}
|
||||
return statusMap[status] || 'info'
|
||||
}
|
||||
|
||||
// 获取状态文本
|
||||
const getStatusText = (status: AgentRechargeStatus): string => {
|
||||
// 获取状态文本(优先使用 status_name,否则使用本地映射)
|
||||
const getStatusText = (status: AgentRechargeStatus, statusName?: string): string => {
|
||||
if (statusName) return statusName
|
||||
const statusMap: Record<AgentRechargeStatus, string> = {
|
||||
1: '待支付',
|
||||
2: '已完成',
|
||||
3: '已取消'
|
||||
2: '已支付',
|
||||
3: '已完成',
|
||||
4: '已关闭',
|
||||
5: '已退款'
|
||||
}
|
||||
return statusMap[status] || '-'
|
||||
}
|
||||
@@ -391,7 +398,9 @@
|
||||
label: '状态',
|
||||
width: 100,
|
||||
formatter: (row: AgentRecharge) => {
|
||||
return h(ElTag, { type: getStatusType(row.status) }, () => getStatusText(row.status))
|
||||
return h(ElTag, { type: getStatusType(row.status) }, () =>
|
||||
getStatusText(row.status, row.status_name)
|
||||
)
|
||||
}
|
||||
},
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user