fix: 调整卡片预览

master
Lxy 3 months ago
parent 83a136092a
commit d4155bb9a8

@ -152,6 +152,11 @@
margin-bottom: 16px;
}
.future-overview {
margin-bottom: 12px;
text-align: center;
}
.future-metrics {
display: flex;
justify-content: space-between;
@ -160,6 +165,53 @@
border-bottom: 1px solid #f0f0f0;
}
.future-levels {
display: flex;
justify-content: space-between;
margin-bottom: 12px;
padding: 12px;
background: #fafafa;
border-radius: 4px;
}
.level-item {
display: flex;
flex-direction: column;
align-items: center;
flex: 1;
}
.level-label {
font-size: 12px;
color: #8c8c8c;
margin-bottom: 4px;
}
.level-value {
font-size: 14px;
font-weight: 500;
color: #262626;
}
.future-ai-analysis {
margin-bottom: 16px;
padding: 12px;
background: #f0f8ff;
border-radius: 4px;
font-size: 12px;
line-height: 1.4;
}
.ai-label {
font-weight: 500;
color: #1890ff;
margin-right: 8px;
}
.ai-content {
color: #262626;
}
.metric-item {
display: flex;
flex-direction: column;

@ -235,6 +235,13 @@ const Dashboard = () => {
¥{item.currentPrice.toFixed(2)}
</div>
{/* 整体预判 */}
<div className="future-overview">
<Tag color={item.overallView === '多头排列' ? 'green' : item.overallView === '空头排列' ? 'red' : 'blue'}>
{item.overallView}
</Tag>
</div>
<div className="future-metrics">
<div className="metric-item">
<span className="metric-label">胜率</span>
@ -250,6 +257,24 @@ const Dashboard = () => {
</div>
</div>
{/* 压力支撑位 */}
<div className="future-levels">
<div className="level-item">
<span className="level-label">压力</span>
<span className="level-value">¥{item.tradingAdvice?.resistance?.toFixed(2) || '-'}</span>
</div>
<div className="level-item">
<span className="level-label">支撑</span>
<span className="level-value">¥{item.tradingAdvice?.support?.toFixed(2) || '-'}</span>
</div>
</div>
{/* AI分析 */}
<div className="future-ai-analysis">
<span className="ai-label">AI分析:</span>
<span className="ai-content">{item.aiAnalysis || '-'}</span>
</div>
<div className="future-trends">
<div className="trend-item">
<span className="trend-period">5MIN</span>

@ -126,6 +126,11 @@ export const generateFutureData = (code, name) => {
const entry = currentPrice;
const stopLoss = entry * (1 - 0.02 * (Math.random() + 0.5));
const target = entry * (1 + 0.03 * (Math.random() + 0.5));
const resistance = entry * (1 + 0.05 * (Math.random() + 0.5));
const support = entry * (1 - 0.05 * (Math.random() + 0.5));
const overallViews = ['观望', '中线', '多头排列', '空头排列', '震荡'];
const overallView = overallViews[Math.floor(Math.random() * overallViews.length)];
return {
code,
@ -142,10 +147,14 @@ export const generateFutureData = (code, name) => {
tradingAdvice: {
entry: +entry.toFixed(2),
stopLoss: +stopLoss.toFixed(2),
target: +target.toFixed(2)
target: +target.toFixed(2),
resistance: +resistance.toFixed(2),
support: +support.toFixed(2)
},
riskLevel: ['低', '中等', '高'][Math.floor(Math.random() * 3)],
volatility: ['低', '中等', '高'][Math.floor(Math.random() * 3)]
volatility: ['低', '中等', '高'][Math.floor(Math.random() * 3)],
overallView,
aiAnalysis: `MACD:${indicators.macd} | RSI:${indicators.rsi} | 布林带:${indicators.bollinger}`
};
};
@ -162,7 +171,10 @@ export const generateFuturesOverview = () => {
atr: data.atr,
adx: data.adx,
adxStatus: data.adxStatus,
trends: data.trends
trends: data.trends,
tradingAdvice: data.tradingAdvice,
overallView: data.overallView,
aiAnalysis: data.aiAnalysis
};
});
};

Loading…
Cancel
Save