消除红色图表未找到的警告和删除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

@@ -8,7 +8,8 @@ export default {
components: {},
data() {
return {
myChart: null // 存储图表实例,避免重复创建
myChart: null, // 存储图表实例,避免重复创建
isMounted: false // 图表挂载标志,避免过早执行
};
},
props: {
@@ -24,6 +25,7 @@ export default {
}
},
mounted() {
this.isMounted = true;
this.$nextTick(() => {
this.updateChart();
});
@@ -34,18 +36,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;
}