Browse Source

解决图表报错问题。

milestone-20250710-上线前优化
宋杰 20 hours ago
parent
commit
52ae7f3255
  1. 33
      src/views/AiEmotion.vue
  2. 6
      src/views/components/emotionDecod.vue

33
src/views/AiEmotion.vue

@ -2757,22 +2757,23 @@ async function renderChartsSequentially(clonedData, stockIndex = 0) {
console.log(`${config.name}Ref方法:`, typeof config.ref[config.method]);
if (typeof config.ref[config.method] === "function") {
try {
// DOM
await new Promise((resolve) => setTimeout(resolve, 100));
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 {
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}图表渲染成功`);
//
await new Promise((resolve) => setTimeout(resolve, 800));
} catch (error) {
console.error(
`${stockIndex}个股票的${config.name}图表渲染失败:`,
error
);
}
} else {
console.error(
`${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
if (KlineCanvsChart) {
KlineCanvsChart.dispose();

Loading…
Cancel
Save