diff --git a/src/components/cockpit/listOfMainMonitoringPoints/index.vue b/src/components/cockpit/listOfMainMonitoringPoints/index.vue
index f266274..9b0b820 100644
--- a/src/components/cockpit/listOfMainMonitoringPoints/index.vue
+++ b/src/components/cockpit/listOfMainMonitoringPoints/index.vue
@@ -20,7 +20,12 @@
-
+
@@ -38,7 +43,12 @@
-
+
@@ -158,6 +168,30 @@ const setEchart = () => {
title: {
text: `${indicatorName}与${powerName}负荷曲线拟合图`
},
+ tooltip: {
+ trigger: 'axis',
+ formatter: function (params: any) {
+ let result = params[0].name
+ params.forEach((item: any) => {
+ if (item.seriesName === indicatorName) {
+ // 对于电能质量指标,格式化Y轴值显示
+ let valueText = ''
+ if (item.value[1] == 0) {
+ valueText = '不越限'
+ } else if (item.value[1] == 1) {
+ valueText = '越限'
+ } else {
+ valueText = item.value[1]
+ }
+ result += `
${item.marker}${item.seriesName}: ${valueText}`
+ } else {
+ // 对于功率数据,正常显示数值
+ result += `
${item.marker}${item.seriesName}: ${item.value[1]}`
+ }
+ })
+ return result
+ }
+ },
xAxis: {
type: 'time',
axisLabel: {
@@ -170,20 +204,22 @@ const setEchart = () => {
},
yAxis: [
{},
- indicatorName ? {
- min: 0,
- max: 1,
- axisLabel: {
- formatter: function(value: number) {
- if (value === 0) {
- return '不越限'
- } else if (value === 1) {
- return '越限'
- }
- return value
- }
- }
- } : {}
+ indicatorName
+ ? {
+ min: 0,
+ max: 1,
+ axisLabel: {
+ formatter: function (value: number) {
+ if (value === 0) {
+ return '不越限'
+ } else if (value === 1) {
+ return '越限'
+ }
+ return value
+ }
+ }
+ }
+ : {}
],
grid: {
left: '10px',
@@ -211,7 +247,7 @@ const setEchart = () => {
{
name: indicatorName, // 动态设置指标名称
type: 'line',
- step:'end',
+ step: 'end',
showSymbol: false,
// smooth: true,
data: [],