From 7670da7f9ff74e675e5bd8aa3d090c3b01614c7d Mon Sep 17 00:00:00 2001
From: zhujiyan <17812234322@163.com>
Date: Fri, 18 Oct 2024 16:24:44 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E8=B6=8B=E5=8A=BF=E6=8A=98?=
=?UTF-8?q?=E7=BA=BF=E5=9B=BE=E9=97=AA=E5=8A=A8=E9=97=AE=E9=A2=98=E4=BF=AE?=
=?UTF-8?q?=E6=94=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/components/echarts/MyEchart.vue | 10 ++++++----
.../control/tabs/components/harmonicSpectrum.vue | 3 ++-
.../device/control/tabs/components/realtrend.vue | 2 +-
src/views/govern/device/control/tabs/realtime.vue | 8 ++++++--
4 files changed, 15 insertions(+), 8 deletions(-)
diff --git a/src/components/echarts/MyEchart.vue b/src/components/echarts/MyEchart.vue
index 0690305..b2bdf98 100644
--- a/src/components/echarts/MyEchart.vue
+++ b/src/components/echarts/MyEchart.vue
@@ -20,7 +20,7 @@ const config = useConfig()
color[0] = config.layout.elementUiPrimary[0]
const chartRef = ref()
-const props = defineProps(['options'])
+const props = defineProps(['options','isInterVal'])
let chart: echarts.ECharts | any = null
const resizeHandler = () => {
// 不在视野中的时候不进行resize
@@ -33,8 +33,10 @@ const resizeHandler = () => {
})
}
const initChart = () => {
- chart?.dispose()
-
+ if(!props.isInterVal){
+ chart?.dispose()
+ }
+ // chart?.dispose()
chart = echarts.init(chartRef.value as HTMLDivElement)
const options = {
title: {
@@ -242,7 +244,7 @@ onBeforeUnmount(() => {
watch(
() => props.options,
(newVal, oldVal) => {
- initChart()
+ initChart()
}
)
diff --git a/src/views/govern/device/control/tabs/components/harmonicSpectrum.vue b/src/views/govern/device/control/tabs/components/harmonicSpectrum.vue
index 17735b6..6d1f54a 100644
--- a/src/views/govern/device/control/tabs/components/harmonicSpectrum.vue
+++ b/src/views/govern/device/control/tabs/components/harmonicSpectrum.vue
@@ -38,7 +38,7 @@
})?.name
}}
-->
-
+
@@ -389,6 +389,7 @@ const init = () => {
item.echartsData.options.series.push({
name: zz.phase,
type: 'line',
+ increment: true,
barMaxWidth: 24, //使用的 y 轴的 index,在单个图表实例中存在多个 y轴的时候有用
itemStyle: {
// normal: {
diff --git a/src/views/govern/device/control/tabs/components/realtrend.vue b/src/views/govern/device/control/tabs/components/realtrend.vue
index 697e399..577e785 100644
--- a/src/views/govern/device/control/tabs/components/realtrend.vue
+++ b/src/views/govern/device/control/tabs/components/realtrend.vue
@@ -48,7 +48,7 @@
diff --git a/src/views/govern/device/control/tabs/realtime.vue b/src/views/govern/device/control/tabs/realtime.vue
index 3d5c226..2aa291e 100644
--- a/src/views/govern/device/control/tabs/realtime.vue
+++ b/src/views/govern/device/control/tabs/realtime.vue
@@ -169,7 +169,7 @@ const initRadioCharts = () => {
echartsData1.value = {
options: {
grid: {
- top: 230
+ top: 0
},
title: {
text: '',
@@ -624,9 +624,13 @@ onMounted(() => {
border: 1px solid #eee;
margin: 0 10px;
padding: 10px;
+ position: relative;
.mid_charts {
width: 100%;
- height: 100%;
+ height: 80%;
+ position: absolute;
+ top: 20%;
+ bottom:10px;
}
}