fix: 评估页字段名错误(evaluations→advice_evaluation)
This commit is contained in:
+4
-4
@@ -814,14 +814,14 @@ function renderEvaluation() {
|
|||||||
<th class="text-left p-3">状态</th>
|
<th class="text-left p-3">状态</th>
|
||||||
</tr></thead>
|
</tr></thead>
|
||||||
<tbody>${evals.map(x => {
|
<tbody>${evals.map(x => {
|
||||||
const e = x.evaluations[0] || {};
|
const adv = (x.advice_evaluation && x.advice_evaluation[0]) || {};
|
||||||
const t = e.theoretical || {};
|
const t = x.theoretical || {};
|
||||||
const a = e.actual || {};
|
const a = x.actual || {};
|
||||||
const status = t.status || 'safe';
|
const status = t.status || 'safe';
|
||||||
const icon = status === 'take_profit_hit' ? '🟢' : status === 'stop_loss_hit' ? '🔴' : status === 'in_entry_zone' ? '📥' : '💤';
|
const icon = status === 'take_profit_hit' ? '🟢' : status === 'stop_loss_hit' ? '🔴' : status === 'in_entry_zone' ? '📥' : '💤';
|
||||||
return `<tr class="stock-row border-b border-slate-800/30">
|
return `<tr class="stock-row border-b border-slate-800/30">
|
||||||
<td class="p-3"><div class="font-medium text-white">${x.name}</div><div class="text-slate-500">${x.code}</div></td>
|
<td class="p-3"><div class="font-medium text-white">${x.name}</div><div class="text-slate-500">${x.code}</div></td>
|
||||||
<td class="p-3 text-slate-300">${x.current?.slice(0,40)||'—'}</td>
|
<td class="p-3 text-slate-300">${x.current || (x.advice_evaluation && x.advice_evaluation[0] && x.advice_evaluation[0].current_advice || '') || '—'}</td>
|
||||||
<td class="p-3"><span class="${(t.theoretical_pnl_pct||0)>=0?'badge-up':'badge-down'}">${(t.theoretical_pnl_pct||0).toFixed(1)}%</span></td>
|
<td class="p-3"><span class="${(t.theoretical_pnl_pct||0)>=0?'badge-up':'badge-down'}">${(t.theoretical_pnl_pct||0).toFixed(1)}%</span></td>
|
||||||
<td class="p-3"><span class="${(a.actual_pnl_pct||0)>=0?'badge-up':'badge-down'}">${(a.actual_pnl_pct||0).toFixed(1)}%</span></td>
|
<td class="p-3"><span class="${(a.actual_pnl_pct||0)>=0?'badge-up':'badge-down'}">${(a.actual_pnl_pct||0).toFixed(1)}%</span></td>
|
||||||
<td class="p-3">${icon} ${status.replace(/_/g,' ')}</td>
|
<td class="p-3">${icon} ${status.replace(/_/g,' ')}</td>
|
||||||
|
|||||||
Reference in New Issue
Block a user