fix: 自选Tab两行布局(策略全显)+新增RR列
This commit is contained in:
+15
-9
@@ -301,7 +301,7 @@ function renderWatchlist() {
|
||||
<thead><tr class="text-slate-500 border-b border-slate-800/50">
|
||||
<th class="text-left p-3">股票</th><th class="text-right p-3">现价</th>
|
||||
<th class="text-right p-3">涨跌%</th><th class="text-right p-3">买入区间</th>
|
||||
<th class="text-right p-3">信号</th><th class="text-left p-3">策略</th>
|
||||
<th class="text-right p-3">RR</th><th class="text-right p-3">信号</th>
|
||||
</tr></thead>
|
||||
<tbody>${stocks.map(s => {
|
||||
const buyZone = (s.entry_low||0) + '~' + (s.entry_high||0);
|
||||
@@ -309,15 +309,21 @@ function renderWatchlist() {
|
||||
const sl = s.stop_loss || 0;
|
||||
const tp = s.take_profit || 0;
|
||||
const signal = s.timing_signal || '';
|
||||
const action = (s.action||'').slice(0,60);
|
||||
const action = (s.action||'');
|
||||
const price = s.price || 0;
|
||||
const chg = s.change_pct || 0;
|
||||
const priceDisplay = price ? price.toFixed(2) : '—';
|
||||
return `
|
||||
<tr class="stock-row border-b border-slate-800/30" onclick="openStock('${s.code}')">
|
||||
<td class="p-3"><div class="font-medium text-white">${s.name}</div><div class="text-slate-500">${s.code}</div></td>
|
||||
<td class="p-3 text-right font-mono">${(s.price||'—')}</td>
|
||||
<td class="p-3 text-right font-mono">${(s.change_pct||0)>=0?'+':''}${(s.change_pct||0).toFixed(2)}</td>
|
||||
<td class="p-3 text-right font-mono" title="损${sl} 盈${tp} RR${rr}">${buyZone}</td>
|
||||
<td class="p-3 text-right font-mono"><span class="${signal.includes('买入')?'text-green-400':signal.includes('关注')?'text-yellow-400':'text-slate-400'}">${signal||'—'}</span></td>
|
||||
<td class="p-3 text-slate-400 text-xs max-w-[200px] truncate" title="${action}">${action||'—'}</td>
|
||||
<tr class="border-b border-slate-800/30 hover:bg-slate-800/20 cursor-pointer" onclick="openStock('${s.code}')">
|
||||
<td class="p-3"><div class="font-medium text-white">${s.name}</div><div class="text-slate-500 text-[10px]">${s.code}</div></td>
|
||||
<td class="p-3 text-right font-mono text-sm">${priceDisplay}</td>
|
||||
<td class="p-3 text-right font-mono text-sm ${chg>=0?'text-green-400':'text-red-400'}">${chg>=0?'+':''}${chg.toFixed(2)}</td>
|
||||
<td class="p-3 text-right font-mono text-xs text-slate-300">${buyZone}<br><span class="text-slate-500">损${sl} 盈${tp}</span></td>
|
||||
<td class="p-3 text-right font-mono text-sm ${rr>=1.5?'text-green-400':rr>0?'text-yellow-400':'text-slate-500'}">${rr>0?rr.toFixed(2):'—'}</td>
|
||||
<td class="p-3 text-right"><span class="text-xs px-2 py-1 rounded ${signal.includes('买入')?'bg-green-900/50 text-green-300':signal.includes('关注')?'bg-yellow-900/50 text-yellow-300':'bg-slate-800 text-slate-400'}">${signal||'—'}</span></td>
|
||||
</tr>
|
||||
<tr class="border-b border-slate-800/20 hover:bg-slate-800/10 cursor-pointer" onclick="openStock('${s.code}')">
|
||||
<td colspan="6" class="p-2 pl-3 text-xs text-slate-400 leading-relaxed">${action || '—'}</td>
|
||||
</tr>`;
|
||||
}).join('')}</tbody>
|
||||
</table>
|
||||
|
||||
Reference in New Issue
Block a user