mirror of
https://gh-proxy.org/https://github.com/klinsmaya/SQLBot.git
synced 2026-11-10 02:07:12 +08:00
fix: Fix the issue of incorrect number of charts displayed in the session when adding charts (#107)
This commit is contained in:
@@ -145,19 +145,21 @@ function adaptorChartInfoList(chatInfo: ChatInfo) {
|
|||||||
(record?.sql || record?.chart)) ||
|
(record?.sql || record?.chart)) ||
|
||||||
(record?.predict_record_id !== undefined &&
|
(record?.predict_record_id !== undefined &&
|
||||||
record?.predict_record_id !== null &&
|
record?.predict_record_id !== null &&
|
||||||
data.data.length > 0)
|
data?.data?.length > 0)
|
||||||
) {
|
) {
|
||||||
const recordeInfo = { id: chatInfo.id + '_' + record.id, data: data, chart: {} }
|
const recordeInfo = { id: chatInfo.id + '_' + record.id, data: data, chart: {} }
|
||||||
const chartBaseInfo = JSON.parse(record.chart)
|
const chartBaseInfo = JSON.parse(record.chart)
|
||||||
recordeInfo['chart'] = {
|
if (chartBaseInfo) {
|
||||||
type: chartBaseInfo.type,
|
recordeInfo['chart'] = {
|
||||||
title: chartBaseInfo.title,
|
type: chartBaseInfo?.type,
|
||||||
columns: chartBaseInfo.columns,
|
title: chartBaseInfo?.title,
|
||||||
xAxis: chartBaseInfo.axis?.x ? [chartBaseInfo.axis.x] : [],
|
columns: chartBaseInfo?.columns,
|
||||||
yAxis: chartBaseInfo.axis?.y ? [chartBaseInfo.axis.y] : [],
|
xAxis: chartBaseInfo?.axis?.x ? [chartBaseInfo?.axis?.x] : [],
|
||||||
series: chartBaseInfo.axis?.series ? [chartBaseInfo.axis.series] : [],
|
yAxis: chartBaseInfo?.axis?.y ? [chartBaseInfo?.axis.y] : [],
|
||||||
|
series: chartBaseInfo?.axis?.series ? [chartBaseInfo?.axis?.series] : [],
|
||||||
|
}
|
||||||
|
chartInfoList.value.push(recordeInfo)
|
||||||
}
|
}
|
||||||
chartInfoList.value.push(recordeInfo)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user