From 8f3f904e6d64095b8b8cf73ef7d43abeb2436f3b Mon Sep 17 00:00:00 2001 From: GGJ <357021191@qq.com> Date: Tue, 29 Oct 2024 14:49:34 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/echarts/MyEchart.vue | 1 + src/utils/echartMethod.ts | 3 ++ .../tabs/components/harmonicSpectrum.vue | 30 +++++++++---------- .../govern/device/control/tabs/trend.vue | 4 +-- src/views/govern/device/planData/index.vue | 4 +-- 5 files changed, 23 insertions(+), 19 deletions(-) diff --git a/src/components/echarts/MyEchart.vue b/src/components/echarts/MyEchart.vue index 1fc2cc3..888b2cd 100644 --- a/src/components/echarts/MyEchart.vue +++ b/src/components/echarts/MyEchart.vue @@ -65,6 +65,7 @@ const initChart = () => { }, backgroundColor: 'rgba(0,0,0,0.35)', borderWidth: 0, + confine:true, ...(props.options?.tooltip || null) }, toolbox: { diff --git a/src/utils/echartMethod.ts b/src/utils/echartMethod.ts index abbdf1a..fe190e2 100644 --- a/src/utils/echartMethod.ts +++ b/src/utils/echartMethod.ts @@ -13,6 +13,9 @@ export const yMethod = (arr: any) => { } else { min = Math.floor(minValue / 100) * 100 } + } else if (maxValue == minValue && maxValue < 10 && minValue > 0) { + max = Math.ceil(maxValue / 10) * 10 + min = Math.floor(minValue / 10) * 10 } else if (maxValue == minValue && maxValue != 0 && minValue != 0) { max = Math.ceil(maxValue / 10 + 1) * 10 min = Math.floor(minValue / 10 - 1) * 10 diff --git a/src/views/govern/device/control/tabs/components/harmonicSpectrum.vue b/src/views/govern/device/control/tabs/components/harmonicSpectrum.vue index 4b4a286..72ca33d 100644 --- a/src/views/govern/device/control/tabs/components/harmonicSpectrum.vue +++ b/src/views/govern/device/control/tabs/components/harmonicSpectrum.vue @@ -309,21 +309,21 @@ const init = () => { // right: '4%' // }, tooltip: { - axisPointer: { - type: 'cross', - label: { - color: '#fff', - fontSize: 16 - } - }, - textStyle: { - color: '#fff', - fontStyle: 'normal', - opacity: 0.35, - fontSize: 14 - }, - backgroundColor: 'rgba(0,0,0,0.35)', - borderWidth: 0 + // axisPointer: { + // type: 'cross', + // label: { + // color: '#fff', + // fontSize: 16 + // } + // }, + // textStyle: { + // color: '#fff', + // fontStyle: 'normal', + // opacity: 0.35, + // fontSize: 14 + // }, + // backgroundColor: 'rgba(0,0,0,0.35)', + // borderWidth: 0 }, xAxis: { name: '时间', diff --git a/src/views/govern/device/control/tabs/trend.vue b/src/views/govern/device/control/tabs/trend.vue index 6d38559..2e7316f 100644 --- a/src/views/govern/device/control/tabs/trend.vue +++ b/src/views/govern/device/control/tabs/trend.vue @@ -241,7 +241,7 @@ const init = async () => { itemGap: 15, type: 'scroll', // 开启滚动分页 // orient: 'vertical', // 垂直排列 - top: 5, + top: 10, bottom: 30, width: 400, height: 50 @@ -353,7 +353,7 @@ const init = async () => { ABCList.forEach((kk: any) => { let seriesList: any = [] kk.forEach((cc: any) => { - if (cc.statisticalData) { + if (cc.statisticalData !== null) { yMethodList.push(cc.statisticalData?.toFixed(2) - 0) } diff --git a/src/views/govern/device/planData/index.vue b/src/views/govern/device/planData/index.vue index b30c2ac..8f0ec08 100644 --- a/src/views/govern/device/planData/index.vue +++ b/src/views/govern/device/planData/index.vue @@ -475,7 +475,7 @@ const init = (flag: boolean) => { itemGap: 15, type: 'scroll', // 开启滚动分页 // orient: 'vertical', // 垂直排列 - top: 5, + top: 10, bottom: 30, width: 400, height: 50 @@ -559,7 +559,7 @@ const init = (flag: boolean) => { ABCList.forEach((kk: any) => { let seriesList: any = [] kk.forEach((cc: any) => { - if (cc.statisticalData) { + if (cc.statisticalData !== null) { yMethodList.push(cc.statisticalData?.toFixed(2) - 0) }