按批补齐全量信号证券名称
This commit is contained in:
parent
bee6fc8502
commit
f7ce1a17bb
|
|
@ -3528,11 +3528,13 @@ createApp({
|
|||
((up.sell_actions && up.sell_actions.items) || []).forEach(x => push(x.ts_code));
|
||||
((up.mr && up.mr.watch) || []).forEach(x => push(x.ts_code));
|
||||
((up.mr && up.mr.avoid) || []).forEach(x => push(x.ts_code));
|
||||
const codes = [...set].filter(Boolean);
|
||||
if (!codes.length) return;
|
||||
const d = await call('get', '/api/names?codes=' + encodeURIComponent(codes.join(',')));
|
||||
const names = (d && (d.names || (d.data && d.data.names))) || null;
|
||||
if (names) nameMap.value = { ...nameMap.value, ...names };
|
||||
const codes = [...set].filter(c=>c && (!nameMap.value[c]?.name || nameMap.value[c].name===c));
|
||||
// 全天信号可覆盖数千证券,名称分批读取,避免长网址导致整批失败。
|
||||
for(let i=0;i<codes.length;i+=120){
|
||||
const d = await call('get', '/api/names?codes=' + encodeURIComponent(codes.slice(i,i+120).join(',')));
|
||||
const names = (d && (d.names || (d.data && d.data.names))) || null;
|
||||
if (names) nameMap.value = { ...nameMap.value, ...names };
|
||||
}
|
||||
}
|
||||
|
||||
const heldPositions = computed(() => (positions.value || []).filter(p => (p.total_qty || 0) > 0));
|
||||
|
|
|
|||
Loading…
Reference in New Issue