fix(mining-admin-web): 适配planting-ledger后端返回数据格式

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
hailin 2026-01-12 04:12:22 -08:00
parent bc191791e8
commit 4ca4fc9135
1 changed files with 11 additions and 17 deletions

View File

@ -138,41 +138,35 @@ export function PlantingLedger({ accountSequence }: PlantingLedgerProps) {
<Table>
<TableHeader>
<TableRow>
<TableHead></TableHead>
<TableHead>ID</TableHead>
<TableHead className="text-right"></TableHead>
<TableHead className="text-right"></TableHead>
<TableHead></TableHead>
<TableHead className="text-right"></TableHead>
<TableHead className="text-right"></TableHead>
<TableHead></TableHead>
<TableHead></TableHead>
<TableHead></TableHead>
<TableHead></TableHead>
</TableRow>
</TableHeader>
<TableBody>
{data.items.length === 0 ? (
<TableRow>
<TableCell colSpan={7} className="text-center py-8 text-muted-foreground">
<TableCell colSpan={6} className="text-center py-8 text-muted-foreground">
</TableCell>
</TableRow>
) : (
data.items.map((item) => (
<TableRow key={item.orderId}>
<TableCell className="font-mono text-sm">{item.orderNo}</TableCell>
data.items.map((item: any) => (
<TableRow key={item.id || item.orderId}>
<TableCell className="font-mono text-sm">{item.originalAdoptionId || item.orderNo}</TableCell>
<TableCell className="text-right font-mono">{formatNumber(item.treeCount)}</TableCell>
<TableCell className="text-right font-mono">{formatDecimal(item.totalAmount, 2)}</TableCell>
<TableCell className="text-sm">
{item.selectedProvince || '-'} / {item.selectedCity || '-'}
</TableCell>
<TableCell className="text-right font-mono">{formatDecimal(item.contributionPerTree || '0', 4)}</TableCell>
<TableCell className="text-right font-mono">{formatDecimal(item.totalContribution || item.totalAmount || '0', 4)}</TableCell>
<TableCell>
<Badge variant={getStatusVariant(item.status)}>
{plantingStatusLabels[item.status] || item.status}
</Badge>
</TableCell>
<TableCell className="text-sm text-muted-foreground">
{formatDateTime(item.createdAt)}
</TableCell>
<TableCell className="text-sm text-muted-foreground">
{item.paidAt ? formatDateTime(item.paidAt) : '-'}
{item.adoptionDate ? formatDateTime(item.adoptionDate) : (item.createdAt ? formatDateTime(item.createdAt) : '-')}
</TableCell>
</TableRow>
))