From 814e9917d66052026b565ac6ead41bbd9f16f2d3 Mon Sep 17 00:00:00 2001 From: stt Date: Mon, 8 Dec 2025 10:55:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=B9=E6=A1=86=E6=98=BE=E7=A4=BA=E8=B6=8A?= =?UTF-8?q?=E9=99=90=E5=92=8C=E4=B8=8D=E8=B6=8A=E9=99=90=EF=BC=8C=E4=B8=8D?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=95=B0=E5=80=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../listOfMainMonitoringPoints/index.vue | 70 ++++++++++++++----- 1 file changed, 53 insertions(+), 17 deletions(-) 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: [],