消除红色图表未找到的警告和删除views下多余的vue文件

This commit is contained in:
2026-04-23 10:00:01 +08:00
parent a6eaf41099
commit f1116245fc
92 changed files with 446 additions and 5404 deletions

View File

@@ -9,7 +9,8 @@ export default {
data() {
return {
myChart: null, // 存储图表实例,避免重复创建
resizeHandler: null // 窗口resize事件处理器
resizeHandler: null, // 窗口resize事件处理器
isMounted: false
};
},
props: {
@@ -29,6 +30,7 @@ export default {
},
},
mounted() {
this.isMounted = true;
this.$nextTick(() => {
this.updateChart();
});
@@ -58,18 +60,18 @@ export default {
// 深度监听数据变化,仅更新图表配置(不销毁实例)
chartData: {
handler() {
if (!this.isMounted) return;
console.log(this.chartData, 'chartData');
this.updateChart();
},
deep: true,
immediate: true // 初始化时立即执行
deep: true
}
},
methods: {
updateChart() {
const chartDom = this.$refs.cockpitEffChip;
if (!chartDom) {
console.error('图表容器未找到!');
if (process.env.NODE_ENV === 'development') console.warn('图表容器未找到!');
return;
}