Commit 49348141 by chenwq1

fix:报价

1 parent 0398f3fe
const target = ['ip', 'dev', 'uat', 'prod', 'beta']
const index = 3
const index = 1
/**
*
0本地
......
......@@ -841,17 +841,11 @@ export default {
// priceHistory 字段废弃:统一使用 priceHistoryByRound(按轮分组)
if (!Array.isArray(data.priceHistoryByRound)) data.priceHistoryByRound = []
// 规范化每轮数据:保证 priceHistoryList 为数组,且按 quoteTime 倒序(同一轮最新在前)
// 不再改变后端轮次顺序,保持后端返回的倒序(最新轮在最上方)
// 规范化每轮数据:保证 priceHistoryList 为数组,并保持接口返回的原始顺序
// 如需按时间排序,请在后端/调用方显式处理;这里不做二次排序,避免影响展示顺序
data.priceHistoryByRound = data.priceHistoryByRound.map(r => {
const list = Array.isArray(r?.priceHistoryList) ? r.priceHistoryList.filter(Boolean) : []
list.sort((a, b) => {
const ta = a?.quoteTime || ''
const tb = b?.quoteTime || ''
if (ta === tb) return 0
return ta < tb ? 1 : -1
})
const quoteTime = list[0]?.quoteTime || r?.quoteTime || ''
const quoteTime = r?.quoteTime || list[list.length - 1]?.quoteTime || ''
return {
...r,
roundNo: r?.roundNo,
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!