feat: 优化代理后台页面布局
- 所有页面统一使用 BasicPage 组件 - 添加面包屑导航支持 - 统一页面标题和描述样式 - 移除控制台页面的应用管理快捷链接 - 优化卡密管理、用户管理、财务管理页面布局
This commit is contained in:
@@ -3,6 +3,7 @@ import { ArrowDownLeft, ArrowUpRight, Loader2, Receipt, RotateCcw } from 'lucide
|
||||
import { onMounted, ref } from 'vue'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
import { BasicPage } from '@/components/global-layout'
|
||||
import api from '@/services/api'
|
||||
|
||||
const { t } = useI18n()
|
||||
@@ -40,9 +41,9 @@ function formatDate(dateStr: string) {
|
||||
|
||||
function getTypeLabel(type: string) {
|
||||
const map: Record<string, string> = {
|
||||
recharge: t('agent.finance.recharge'),
|
||||
consume: t('agent.finance.consume'),
|
||||
refund: t('agent.finance.refund'),
|
||||
recharge: '充值',
|
||||
consume: '消费',
|
||||
refund: '退款',
|
||||
}
|
||||
return map[type] || type
|
||||
}
|
||||
@@ -58,21 +59,16 @@ function getTypeClass(type: string) {
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="space-y-6">
|
||||
<div>
|
||||
<h1 class="text-2xl font-bold">
|
||||
{{ t('agent.finance.title') }}
|
||||
</h1>
|
||||
<p class="text-muted-foreground">
|
||||
{{ t('agent.finance.description') }}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<BasicPage
|
||||
:title="t('nav.finance')"
|
||||
description="财务管理"
|
||||
sticky
|
||||
>
|
||||
<div class="grid gap-4 md:grid-cols-3">
|
||||
<UiCard>
|
||||
<UiCardHeader class="pb-2">
|
||||
<UiCardTitle class="text-sm font-medium">
|
||||
{{ t('agent.finance.accountBalance') }}
|
||||
账户余额
|
||||
</UiCardTitle>
|
||||
</UiCardHeader>
|
||||
<UiCardContent>
|
||||
@@ -83,9 +79,9 @@ function getTypeClass(type: string) {
|
||||
</UiCard>
|
||||
</div>
|
||||
|
||||
<UiCard>
|
||||
<UiCard class="mt-6">
|
||||
<UiCardHeader>
|
||||
<UiCardTitle>{{ t('agent.finance.transactionRecords') }}</UiCardTitle>
|
||||
<UiCardTitle>交易记录</UiCardTitle>
|
||||
</UiCardHeader>
|
||||
<UiCardContent class="p-0">
|
||||
<div v-if="loading" class="flex items-center justify-center py-12">
|
||||
@@ -94,7 +90,7 @@ function getTypeClass(type: string) {
|
||||
|
||||
<div v-else-if="transactions.length === 0" class="text-center py-12 text-muted-foreground">
|
||||
<Receipt class="size-16 mx-auto mb-4 opacity-30" />
|
||||
<p>{{ t('agent.finance.noTransactions') }}</p>
|
||||
<p>暂无交易记录</p>
|
||||
</div>
|
||||
|
||||
<div v-else class="divide-y">
|
||||
@@ -128,12 +124,12 @@ function getTypeClass(type: string) {
|
||||
{{ tx.type === 'recharge' || tx.type === 'refund' ? '+' : '-' }}¥{{ tx.amount.toFixed(2) }}
|
||||
</p>
|
||||
<p class="text-xs text-muted-foreground">
|
||||
{{ t('agent.finance.balance') }}: ¥{{ tx.balance.toFixed(2) }}
|
||||
余额: ¥{{ tx.balance.toFixed(2) }}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</UiCardContent>
|
||||
</UiCard>
|
||||
</div>
|
||||
</BasicPage>
|
||||
</template>
|
||||
|
||||
Reference in New Issue
Block a user