Browse Source

解决图表报错问题。

milestone-20250820-金币兑换Token
宋杰 1 day ago
parent
commit
52ae7f3255
  1. 29
      src/views/AiEmotion.vue
  2. 6
      src/views/components/emotionDecod.vue

29
src/views/AiEmotion.vue

@ -2757,22 +2757,23 @@ async function renderChartsSequentially(clonedData, stockIndex = 0) {
console.log(`${config.name}Ref方法:`, typeof config.ref[config.method]); console.log(`${config.name}Ref方法:`, typeof config.ref[config.method]);
if (typeof config.ref[config.method] === "function") { if (typeof config.ref[config.method] === "function") {
try {
// DOM
await new Promise((resolve) => setTimeout(resolve, 100));
try {
// 2
const delay = stockIndex === 0 ? 100 : 300 + (stockIndex * 100);
await new Promise((resolve) => setTimeout(resolve, delay));
config.ref[config.method](...config.params);
console.log(`${stockIndex}个股票的${config.name}图表渲染成功`);
config.ref[config.method](...config.params);
console.log(`${stockIndex}个股票的${config.name}图表渲染成功`);
//
await new Promise((resolve) => setTimeout(resolve, 800));
} catch (error) {
console.error(
`${stockIndex}个股票的${config.name}图表渲染失败:`,
error
);
}
} else {
//
await new Promise((resolve) => setTimeout(resolve, 800));
} catch (error) {
console.error(
`${stockIndex}个股票的${config.name}图表渲染失败:`,
error
);
}
} else {
console.error( console.error(
`${stockIndex}个股票的${config.name}Ref.${config.method} 方法不存在` `${stockIndex}个股票的${config.name}Ref.${config.method} 方法不存在`
); );

6
src/views/components/emotionDecod.vue

@ -406,6 +406,12 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
], ],
}; };
// DOM
if (!KlineCanvs.value) {
console.error('DOM元素未准备好,无法初始化ECharts');
return;
}
// echarts // echarts
if (KlineCanvsChart) { if (KlineCanvsChart) {
KlineCanvsChart.dispose(); KlineCanvsChart.dispose();

Loading…
Cancel
Save