|
|
@ -156,19 +156,22 @@ |
|
|
if (Array.isArray(list)) list = sortByPctDesc(list) |
|
|
if (Array.isArray(list)) list = sortByPctDesc(list) |
|
|
if (Array.isArray(list) && list.length) { |
|
|
if (Array.isArray(list) && list.length) { |
|
|
strategyData.value = list.map(item => ({ |
|
|
strategyData.value = list.map(item => ({ |
|
|
name: item.tsCode ?? item.tscode ?? '', |
|
|
|
|
|
stockCode: item.tsCode ?? item.tscode ?? '', |
|
|
|
|
|
latest: item.close ?? '', |
|
|
|
|
|
|
|
|
name: item.stockName ?? item.name ?? item.tsName ?? item.tsname ?? item.secName ?? '', |
|
|
|
|
|
stockCode: item.tsCode ?? item.tscode ?? item.code ?? item.symbol ?? '', |
|
|
|
|
|
latest: item.close ?? item.lastClose ?? '', |
|
|
increase: formatPctChg(item.pctChg), |
|
|
increase: formatPctChg(item.pctChg), |
|
|
decrease: item.change ?? '', |
|
|
|
|
|
previousClose: item.preClose ?? item.preclose ?? '', |
|
|
|
|
|
volume: item.vol ?? '', |
|
|
|
|
|
turnover: item.amount ?? '', |
|
|
|
|
|
openingPrice: item.open ?? '', |
|
|
|
|
|
highestPrice: item.high ?? '', |
|
|
|
|
|
lowestPrice: item.low ?? '' |
|
|
|
|
|
|
|
|
decrease: item.change ?? item.chg ?? '', |
|
|
|
|
|
previousClose: item.preClose ?? item.preclose ?? item.prevClose ?? '', |
|
|
|
|
|
volume: item.vol ?? item.volume ?? '', |
|
|
|
|
|
turnover: item.amount ?? item.turnover ?? '', |
|
|
|
|
|
openingPrice: item.open ?? item.openPrice ?? '', |
|
|
|
|
|
highestPrice: item.high ?? item.highPrice ?? '', |
|
|
|
|
|
lowestPrice: item.low ?? item.lowPrice ?? '' |
|
|
})) |
|
|
})) |
|
|
console.log(`按名称(${apiName})加载成功,条数:`, strategyData.value.length, '首项:', strategyData.value[0]) |
|
|
console.log(`按名称(${apiName})加载成功,条数:`, strategyData.value.length, '首项:', strategyData.value[0]) |
|
|
|
|
|
if (!strategyData.value[0]?.name) { |
|
|
|
|
|
console.warn('名称字段未命中,原始keys示例:', Object.keys(list[0] || {})) |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
console.warn('getStrategyByName 返回空列表或结构不匹配', raw) |
|
|
console.warn('getStrategyByName 返回空列表或结构不匹配', raw) |
|
|
} |
|
|
} |
|
|
@ -203,19 +206,22 @@ |
|
|
if (Array.isArray(list)) list = sortByPctDesc(list) |
|
|
if (Array.isArray(list)) list = sortByPctDesc(list) |
|
|
if (Array.isArray(list) && list.length) { |
|
|
if (Array.isArray(list) && list.length) { |
|
|
strategyData.value = list.map(item => ({ |
|
|
strategyData.value = list.map(item => ({ |
|
|
name: item.tsCode ?? item.tscode ?? '', |
|
|
|
|
|
stockCode: item.tsCode ?? item.tscode ?? '', |
|
|
|
|
|
latest: item.close ?? '', |
|
|
|
|
|
|
|
|
name: item.stockName ?? item.name ?? item.tsName ?? item.tsname ?? item.secName ?? '', |
|
|
|
|
|
stockCode: item.tsCode ?? item.tscode ?? item.code ?? item.symbol ?? '', |
|
|
|
|
|
latest: item.close ?? item.lastClose ?? '', |
|
|
increase: formatPctChg(item.pctChg), |
|
|
increase: formatPctChg(item.pctChg), |
|
|
decrease: item.change ?? '', |
|
|
|
|
|
previousClose: item.preClose ?? item.preclose ?? '', |
|
|
|
|
|
volume: item.vol ?? '', |
|
|
|
|
|
turnover: item.amount ?? '', |
|
|
|
|
|
openingPrice: item.open ?? '', |
|
|
|
|
|
highestPrice: item.high ?? '', |
|
|
|
|
|
lowestPrice: item.low ?? '' |
|
|
|
|
|
|
|
|
decrease: item.change ?? item.chg ?? '', |
|
|
|
|
|
previousClose: item.preClose ?? item.preclose ?? item.prevClose ?? '', |
|
|
|
|
|
volume: item.vol ?? item.volume ?? '', |
|
|
|
|
|
turnover: item.amount ?? item.turnover ?? '', |
|
|
|
|
|
openingPrice: item.open ?? item.openPrice ?? '', |
|
|
|
|
|
highestPrice: item.high ?? item.highPrice ?? '', |
|
|
|
|
|
lowestPrice: item.low ?? item.lowPrice ?? '' |
|
|
})) |
|
|
})) |
|
|
console.log('stockSelectDetail 加载成功(已按涨幅降序),条数:', strategyData.value.length, '首项:', strategyData.value[0]) |
|
|
console.log('stockSelectDetail 加载成功(已按涨幅降序),条数:', strategyData.value.length, '首项:', strategyData.value[0]) |
|
|
|
|
|
if (!strategyData.value[0]?.name) { |
|
|
|
|
|
console.warn('名称字段未命中,原始keys示例:', Object.keys(list[0] || {})) |
|
|
|
|
|
} |
|
|
} else { |
|
|
} else { |
|
|
console.warn('stockSelectDetail 接口返回空列表或结构不匹配', raw) |
|
|
console.warn('stockSelectDetail 接口返回空列表或结构不匹配', raw) |
|
|
} |
|
|
} |
|
|
|