fix(ledger): 修复 portfolio 接口组装时 avgCost 变量未定义的 ReferenceError
This commit is contained in:
@@ -24,6 +24,8 @@ interface Position {
|
||||
realizedPnlCny: string;
|
||||
avgCost: string;
|
||||
dilutedCost: string;
|
||||
floatingPnl: string;
|
||||
accumulatedPnl: string;
|
||||
holdingDays: number;
|
||||
exchange: string;
|
||||
accumulatedDividendsCny: string;
|
||||
@@ -366,8 +368,10 @@ export async function getPortfolioPositions(): Promise<Position[]> {
|
||||
totalBuyCost: holding.totalBuyCostCny.toString(),
|
||||
totalBuyQuantity: holding.totalBuyQuantity.toString(),
|
||||
realizedPnlCny: holding.realizedPnlCny.toString(),
|
||||
avgCost: avgCost.toString(),
|
||||
dilutedCost: dilutedCost.toString(),
|
||||
avgCost: metrics.averageCost,
|
||||
dilutedCost: metrics.dilutedCost,
|
||||
floatingPnl: metrics.floatingPnl,
|
||||
accumulatedPnl: metrics.accumulatedPnl,
|
||||
holdingDays,
|
||||
exchange: holding.exchange,
|
||||
accumulatedDividendsCny: holding.accumulatedDividendsCny.toString(),
|
||||
|
||||
Reference in New Issue
Block a user