diff --git a/pages/config/config.vue b/pages/config/config.vue index 44507d6..be18f36 100644 --- a/pages/config/config.vue +++ b/pages/config/config.vue @@ -95,33 +95,26 @@ diff --git a/pages/detail/detail.vue b/pages/detail/detail.vue index a24f9dc..74a3558 100644 --- a/pages/detail/detail.vue +++ b/pages/detail/detail.vue @@ -17,17 +17,17 @@ ¥ - 156,240.00 + {{ (portfolioData.portfolioValue || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }} 历史变化 - +42.82% + {{ (portfolioData.historicalChange || 0) >= 0 ? '+' : '' }}{{ (portfolioData.historicalChange || 0).toFixed(2) }}% 日内波动 - +¥1,240.50 + {{ (portfolioData.dailyVolatility || 0) >= 0 ? '+' : '' }}¥{{ (portfolioData.dailyVolatility || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }} @@ -42,16 +42,15 @@ - + - H + {{ portfolioData.logicModel?.charAt(0) || 'S' }} - HFEA 风险平价逻辑 + {{ portfolioData.logicModel || '未设置策略' }} - 目标权重 - 季度调仓 + {{ portfolioData.logicModelDescription }} @@ -59,7 +58,7 @@ - 监控中 + {{ portfolioData.logicModelStatus || '监控中' }} @@ -67,25 +66,25 @@ - 当前记录项 (3) - 占比 100% + 当前记录项 ({{ portfolioData.totalItems || positions.length }}) + 占比 {{ portfolioData.totalRatio || 100 }}% - + - - {{ item.name.charAt(0) }} + + {{ item.stockName?.charAt(0) || item.stockCode?.charAt(0) || 'S' }} - {{ item.name }} - {{ item.code }} · {{ item.shares }}份 + {{ item.stockName || item.stockCode }} + {{ item.stockCode }} · {{ item.amount }}份 - ¥{{ item.marketValue }} - 比例 {{ item.weight }}% + ¥{{ (item.totalValue || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }} + 比例 {{ (item.ratio || 0).toFixed(1) }}% @@ -94,14 +93,14 @@ 变动额 - - {{ item.pnl > 0 ? '+' : '' }}{{ item.pnl }} + + {{ (item.changeAmount || 0) >= 0 ? '+' : '' }}¥{{ (item.changeAmount || 0).toLocaleString('zh-CN', { minimumFractionDigits: 2, maximumFractionDigits: 2 }) }} 偏离比例 - - {{ item.pnlPercent > 0 ? '+' : '' }}{{ item.pnlPercent }}% + + {{ (item.deviationRatio || 0) >= 0 ? '+' : '' }}{{ (item.deviationRatio || 0).toFixed(2) }}% @@ -117,18 +116,18 @@ - {{ log.date }} - {{ log.time }} + {{ log.Date }} + {{ log.Time }} - + - {{ log.title }} - {{ log.type === 'buy' ? '录入增加' : '结出减少' }} {{ log.amount }} + {{ log.Title }} + {{ log.Type === 'buy' ? '录入增加' : '结出减少' }} {{ log.Amount }} @@ -145,29 +144,233 @@ + + + + + {{ transactionType === 'buy' ? '录入增加' : '结出减少' }} + + + + + + + + 股票代码 + + + + + 数量 + + + + + 价格 + + + + + 货币 + + {{ transactionForm.currency }} + + + + + + 备注 + + + + + + + + + + + \ No newline at end of file diff --git a/pages/index/index.vue b/pages/index/index.vue index 4e148a2..8266200 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -110,7 +110,15 @@ const fetchAssetData = async () => { console.log('开始获取资产数据...'); const response = await api.assets.getAssetData(); if (response.code === 200) { - assetData.value = response.data; + // 映射资产数据字段 + const data = response.data; + assetData.value = { + totalValue: data.TotalValue, + currency: data.Currency, + todayProfit: data.TodayProfit, + todayProfitCurrency: data.TodayProfitCurrency, + totalReturnRate: data.TotalReturnRate + }; console.log('资产数据获取成功'); } } catch (error) { @@ -124,8 +132,22 @@ const fetchHoldingsData = async () => { console.log('开始获取持仓数据...'); const response = await api.assets.getHoldings(); if (response.code === 200) { - // 处理响应数据结构,获取 items 数组 - holdings.value = response.data.items || []; + // 处理响应数据结构,获取 items 数组并映射字段 + const items = response.data.items || []; + holdings.value = items.map(item => ({ + id: item.Id, + name: item.Name, + tags: item.Tags, + status: item.Status, + statusType: item.StatusType, + iconChar: item.IconChar, + iconBgClass: item.IconBgClass, + iconTextClass: item.IconTextClass, + value: item.Value, + currency: item.Currency, + returnRate: item.ReturnRate, + returnType: item.ReturnType + })); console.log('持仓数据获取成功,items数量:', holdings.value.length); console.log('持仓数据:', holdings.value); } diff --git a/pages/strategies/edit/edit.vue b/pages/strategies/edit/edit.vue index 2fb29b8..f122447 100644 --- a/pages/strategies/edit/edit.vue +++ b/pages/strategies/edit/edit.vue @@ -1,6 +1,13 @@