fix(mining-admin-web): 适配planting-ledger后端返回数据格式
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
bc191791e8
commit
4ca4fc9135
|
|
@ -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>
|
||||
))
|
||||
|
|
|
|||
Loading…
Reference in New Issue