From 37e4e88d68d12974bd63472710b7414bd5bf3e46 Mon Sep 17 00:00:00 2001 From: duanxiaohai <1812246227@qq.com> Date: Thu, 20 Jun 2024 09:55:26 +0800 Subject: [PATCH] gx --- src/view/echart_analyze/FlipClock.vue | 54 ++++++++++-- src/view/echarts_yl/eP2_2.vue | 11 +-- src/view/echarts_yl/eP3_2.vue | 11 +-- src/view/echarts_yl/pie.vue | 1 - src/view/echarts_yl/pie2.vue | 16 ++-- src/view/echarts_yl/ylSMFW.vue | 4 +- src/view/education.vue | 24 +++++- src/view/hygiene.vue | 113 ++++++-------------------- src/view/work.vue | 13 ++- 9 files changed, 128 insertions(+), 119 deletions(-) diff --git a/src/view/echart_analyze/FlipClock.vue b/src/view/echart_analyze/FlipClock.vue index 84e344f..31c7520 100644 --- a/src/view/echart_analyze/FlipClock.vue +++ b/src/view/echart_analyze/FlipClock.vue @@ -1,7 +1,7 @@ diff --git a/src/view/echarts_yl/eP2_2.vue b/src/view/echarts_yl/eP2_2.vue index b346ad0..b3ef77f 100644 --- a/src/view/echarts_yl/eP2_2.vue +++ b/src/view/echarts_yl/eP2_2.vue @@ -214,11 +214,12 @@ const getOption = () => { }; const setChart = () => { - // Vue3中: 需要引入 - var myChart = echarts.init(chart.value); - - // 使用刚指定的配置项和数据显示图表。 - myChart.setOption(data.option); + if (chart.value) { + const myChart = echarts.init(chart.value); + myChart.setOption(data.option); + } else { + // console.error('chart is not defined'); + } }; // 使用生命钩子 diff --git a/src/view/echarts_yl/eP3_2.vue b/src/view/echarts_yl/eP3_2.vue index b3da1a6..23aed97 100644 --- a/src/view/echarts_yl/eP3_2.vue +++ b/src/view/echarts_yl/eP3_2.vue @@ -365,11 +365,12 @@ const getOption = () => { }; }; const setChart = () => { - // Vue3中: 需要引入 - var myChart = echarts.init(chart.value); - - // 使用刚指定的配置项和数据显示图表。 - myChart.setOption(data.option); + if (chart.value) { + const myChart = echarts.init(chart.value); + myChart.setOption(data.option); + } else { + // console.error('chart is not defined'); + } }; // 使用生命钩子 diff --git a/src/view/echarts_yl/pie.vue b/src/view/echarts_yl/pie.vue index 024c6d6..493f462 100644 --- a/src/view/echarts_yl/pie.vue +++ b/src/view/echarts_yl/pie.vue @@ -253,7 +253,6 @@ const getOption = () => { const setChart = () => { // Vue3中: 需要引入 var myChart = echarts.init(chart.value); - // 使用刚指定的配置项和数据显示图表。 myChart.setOption(data.option); }; diff --git a/src/view/echarts_yl/pie2.vue b/src/view/echarts_yl/pie2.vue index e298927..9eef877 100644 --- a/src/view/echarts_yl/pie2.vue +++ b/src/view/echarts_yl/pie2.vue @@ -2,7 +2,7 @@
- - \ No newline at end of file + diff --git a/src/view/echarts_yl/ylSMFW.vue b/src/view/echarts_yl/ylSMFW.vue index 4a8253f..07b04f7 100644 --- a/src/view/echarts_yl/ylSMFW.vue +++ b/src/view/echarts_yl/ylSMFW.vue @@ -1,5 +1,5 @@