From 43ca358cb825a16b8ec5fff6108e62d209b8bd2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=B2=E4=B9=88=E4=BA=86?= Date: Tue, 2 Jan 2024 13:45:20 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=88=E7=AB=AF=E8=BF=90=E8=A1=8C=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/echarts/MyEchart.vue | 13 +- src/layouts/admin/index.vue | 15 + .../sags/operationsManagement/statistics.vue | 442 ++++++++++++++++++ 3 files changed, 464 insertions(+), 6 deletions(-) create mode 100644 src/views/voltage/sags/operationsManagement/statistics.vue diff --git a/src/components/echarts/MyEchart.vue b/src/components/echarts/MyEchart.vue index fd0094f..ddeb331 100644 --- a/src/components/echarts/MyEchart.vue +++ b/src/components/echarts/MyEchart.vue @@ -9,9 +9,13 @@ import 'echarts/lib/component/dataZoom' const chartRef = ref() const props = defineProps(['options']) -let chart: echarts.ECharts | null = null +let chart: echarts.ECharts | any = null const resizeHandler = () => { - chart?.resize() + chart.getZr().painter.getViewportRoot().style.display = "none"; + requestAnimationFrame(() => { + chart.resize() + chart.getZr().painter.getViewportRoot().style.display = ""; + }) } const initChart = () => { chart?.dispose() @@ -88,7 +92,6 @@ const initChart = () => { ], yAxis: [ { - type: 'value', nameTextStyle: { @@ -148,9 +151,7 @@ const initChart = () => { }) } onMounted(() => { - setTimeout(() => { - // initChart() - }, 20) + initChart() window.addEventListener('resize', resizeHandler) }) defineExpose({ initChart }) diff --git a/src/layouts/admin/index.vue b/src/layouts/admin/index.vue index 3ab2266..8ec1feb 100644 --- a/src/layouts/admin/index.vue +++ b/src/layouts/admin/index.vue @@ -147,6 +147,21 @@ const init = async () => { extend: 'none', children: [] }, + { + id: 1, + pid: 3, + type: 'menu', + title: '终端运行统计', + name: 'voltage/sags/operationsManagement/statistics', + path: 'voltage/sags/operationsManagement/statistics', + icon: 'fa-solid fa-chart-column', + menu_type: 'tab', + url: '', + component: '/src/views/voltage/sags/operationsManagement/statistics.vue', + keepalive: 'voltage/sags/operationsManagement/statistics', + extend: 'none', + children: [] + }, { id: 1, pid: 3, diff --git a/src/views/voltage/sags/operationsManagement/statistics.vue b/src/views/voltage/sags/operationsManagement/statistics.vue new file mode 100644 index 0000000..6e627cf --- /dev/null +++ b/src/views/voltage/sags/operationsManagement/statistics.vue @@ -0,0 +1,442 @@ + + + +