From 1ca8e536dd61ad62cdc4c547f720cda9721c6cc5 Mon Sep 17 00:00:00 2001 From: guanj Date: Mon, 6 Jul 2026 10:41:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=99=90=E5=80=BC=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../online/wentaishujufenxi/index.vue | 172 +++++++++--------- 1 file changed, 89 insertions(+), 83 deletions(-) diff --git a/src/views/pqs/harmonicMonitoring/monitoringPoint/online/wentaishujufenxi/index.vue b/src/views/pqs/harmonicMonitoring/monitoringPoint/online/wentaishujufenxi/index.vue index c981ddcd..761c1548 100644 --- a/src/views/pqs/harmonicMonitoring/monitoringPoint/online/wentaishujufenxi/index.vue +++ b/src/views/pqs/harmonicMonitoring/monitoringPoint/online/wentaishujufenxi/index.vue @@ -10,30 +10,53 @@ - + - + - + - + - + @@ -44,10 +67,21 @@ -
- +
+
@@ -72,7 +106,7 @@ import html2canvas from 'html2canvas' import { ElMessage } from 'element-plus' import { yMethod, completeTimeSeries } from '@/utils/echartMethod' import * as echarts from 'echarts' // 全引入 -import { min } from 'xe-utils' + const datePickerRef = ref() const monitoringPoint = useMonitoringPoint() const checked = ref(monitoringPoint.state.showCheckBox) @@ -198,8 +232,8 @@ const shujuchuli = (res: any) => { let cvalue = [] let topLimit = [] let lowerLimit = [] - item.maxValue = (item.topLimit > item.maxValue ? item.topLimit : item.maxValue) - item.minValue = (item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue) + item.maxValue = item.topLimit > item.maxValue ? item.topLimit : item.maxValue + item.minValue = item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue //判断数据是否存在 if (item.value !== null) { for (let j = 0; j < item.value.length; j++) { @@ -234,12 +268,7 @@ const shujuchuli = (res: any) => { //不存在一个暂降点或1个 //处理暂降点 if (item.eventDetail.length > 0) { for (let k = 0; k < item.eventDetail.length; k++) { - chufa.push([ - item.eventDetail[k].time, - (0).toFixed(3), - item.eventDetail[k].id, - 99 - ]) + chufa.push([item.eventDetail[k].time, (0).toFixed(3), item.eventDetail[k].id, 99]) } } let shuju = { @@ -267,8 +296,8 @@ const shujuchuli = (res: any) => { let gvalue = [] let topLimit = [] let lowerLimit = [] - item.maxValue = (item.topLimit > item.maxValue ? item.topLimit : item.maxValue) - item.minValue = (item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue) + item.maxValue = item.topLimit > item.maxValue ? item.topLimit : item.maxValue + item.minValue = item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue //判断数据是否存在 if (item.value !== null) { for (let j = 0; j < item.value.length; j++) { @@ -289,12 +318,7 @@ const shujuchuli = (res: any) => { //不存在一个暂降点或1个 //处理暂降点 if (item.eventDetail.length > 0) { for (let k = 0; k < item.eventDetail.length; k++) { - chufa.push([ - item.eventDetail[k].time, - (0).toFixed(3), - item.eventDetail[k].id, - 99 - ]) + chufa.push([item.eventDetail[k].time, (0).toFixed(3), item.eventDetail[k].id, 99]) } } let shuju = { @@ -345,7 +369,7 @@ const shujuchuli = (res: any) => { let bvalue = [] let cvalue = [] let topLimit = [] - item.maxValue = (item.topLimit > item.maxValue ? item.topLimit : item.maxValue) + item.maxValue = item.topLimit > item.maxValue ? item.topLimit : item.maxValue //判断数据是否存在 if (item.value !== null) { for (let j = 0; j < item.value.length; j++) { @@ -379,12 +403,7 @@ const shujuchuli = (res: any) => { //不存在一个暂降点或1个 //处理暂降点 if (item.eventDetail.length > 0) { for (let k = 0; k < item.eventDetail.length; k++) { - chufa.push([ - item.eventDetail[k].time, - (0).toFixed(3), - item.eventDetail[k].id, - 99 - ]) + chufa.push([item.eventDetail[k].time, (0).toFixed(3), item.eventDetail[k].id, 99]) } } let shuju = { @@ -409,7 +428,7 @@ const shujuchuli = (res: any) => { if (item.phaiscType.length == 3) { let gvalue = [] let topLimit = [] - item.maxValue = (item.topLimit > item.maxValue ? item.topLimit : item.maxValue) + item.maxValue = item.topLimit > item.maxValue ? item.topLimit : item.maxValue //判断数据是否存在 if (item.value !== null) { for (let j = 0; j < item.value.length; j++) { @@ -479,7 +498,7 @@ const shujuchuli = (res: any) => { let bvalue = [] let cvalue = [] let lowerLimit = [] - item.minValue = (item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue) + item.minValue = item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue //判断数据是否存在 if (item.value !== null) { for (let j = 0; j < item.value.length; j++) { @@ -538,7 +557,7 @@ const shujuchuli = (res: any) => { if (item.phaiscType.length == 3) { let gvalue = [] let lowerLimit = [] - item.minValue = (item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue) + item.minValue = item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue //判断数据是否存在 if (item.value !== null) { for (let j = 0; j < item.value.length; j++) { @@ -599,7 +618,6 @@ const shujuchuli = (res: any) => { } //无限值 if (item.topLimit == 0 && item.lowerLimit == 0) { - if (item.minValue !== null && item.maxValue !== null) { //最小值等于下限值 //图列为A,B,C,暂降 @@ -638,12 +656,7 @@ const shujuchuli = (res: any) => { //不存在一个暂降点或1个 //处理暂降点 if (item.eventDetail.length > 0) { for (let k = 0; k < item.eventDetail.length; k++) { - chufa.push([ - item.eventDetail[k].time, - (0).toFixed(3), - item.eventDetail[k].id, - 99 - ]) + chufa.push([item.eventDetail[k].time, (0).toFixed(3), item.eventDetail[k].id, 99]) } } let shuju = { @@ -683,12 +696,7 @@ const shujuchuli = (res: any) => { //不存在一个暂降点或1个 //处理暂降点 if (item.eventDetail.length > 0) { for (let k = 0; k < item.eventDetail.length; k++) { - chufa.push([ - item.eventDetail[k].time, - (0).toFixed(3), - item.eventDetail[k].id, - 99 - ]) + chufa.push([item.eventDetail[k].time, (0).toFixed(3), item.eventDetail[k].id, 99]) } } let shuju = { @@ -740,8 +748,8 @@ const shujuchuli = (res: any) => { let cvalue = [] let topLimit = [] let lowerLimit = [] - item.maxValue = (item.topLimit > item.maxValue ? item.topLimit : item.maxValue) - item.minValue = (item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue) + item.maxValue = item.topLimit > item.maxValue ? item.topLimit : item.maxValue + item.minValue = item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue //判断数据是否存在 if (item.value !== null) { for (let j = 0; j < item.value.length; j++) { @@ -796,8 +804,8 @@ const shujuchuli = (res: any) => { let gvalue = [] let topLimit = [] let lowerLimit = [] - item.maxValue = (item.topLimit > item.maxValue ? item.topLimit : item.maxValue) - item.minValue = (item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue) + item.maxValue = item.topLimit > item.maxValue ? item.topLimit : item.maxValue + item.minValue = item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue //判断数据是否存在 if (item.value !== null) { for (let j = 0; j < item.value.length; j++) { @@ -863,7 +871,7 @@ const shujuchuli = (res: any) => { let bvalue = [] let cvalue = [] let topLimit = [] - item.maxValue = (item.topLimit > item.maxValue ? item.topLimit : item.maxValue) + item.maxValue = item.topLimit > item.maxValue ? item.topLimit : item.maxValue // item.minValue=item.lowerLimit //判断数据是否存在 if (item.value !== null) { @@ -916,7 +924,7 @@ const shujuchuli = (res: any) => { if (item.phaiscType.length == 2) { let gvalue = [] let topLimit = [] - item.maxValue = (item.topLimit > item.maxValue ? item.topLimit : item.maxValue) + item.maxValue = item.topLimit > item.maxValue ? item.topLimit : item.maxValue // item.minValue=item.lowerLimit //判断数据是否存在 if (item.value !== null) { @@ -981,7 +989,7 @@ const shujuchuli = (res: any) => { let cvalue = [] let lowerLimit = [] // item.maxValue=item.topLimit - item.minValue = (item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue) + item.minValue = item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue //判断数据是否存在 if (item.value !== null) { for (let j = 0; j < item.value.length; j++) { @@ -1034,7 +1042,7 @@ const shujuchuli = (res: any) => { let gvalue = [] let lowerLimit = [] // item.maxValue=item.topLimit - item.minValue = (item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue) + item.minValue = item.lowerLimit < item.minValue ? item.lowerLimit : item.minValue //判断数据是否存在 if (item.value !== null) { for (let j = 0; j < item.value.length; j++) { @@ -1202,6 +1210,7 @@ const getSeriesDataValues = (data: any[]) => { .filter((v): v is number => v != null && !Number.isNaN(v)) } const buildItemYAxis = (item: any) => { + console.log('🚀 ~ buildItemYAxis ~ item:', item) if (item.useDualAxis && item.serise?.length) { const uniqueUnits = [...new Set(item.units.filter((u: string) => u != null && u !== ''))] as string[] const valuesByUnit: Record = {} @@ -1214,8 +1223,8 @@ const buildItemYAxis = (item: any) => { if (unit) valuesByUnit[unit].push(...getSeriesDataValues(s.data)) }) return uniqueUnits.map((unit, index) => { - const [min, max] = yMethod(valuesByUnit[unit].length ? valuesByUnit[unit] : [0]) + return { type: 'value', min, @@ -1232,7 +1241,14 @@ const buildItemYAxis = (item: any) => { }) } const values = item.value?.length ? item.value.map((k: any) => k[1]) : [0] - const [min, max] = yMethod([item.maxValue, item.minValue, ...values]) + + const [min, max] = yMethod([ + item.maxValue, + item.minValue, + ...values, + item.topLimit?.[0]?.[1] || null, + item.lowerLimit?.[0]?.[1] || null + ]) return [ { type: 'value', @@ -1281,10 +1297,7 @@ const rendering = () => { let opitonserise: any[] = [] item.legend.forEach((item2: any) => { - if ( - item.avalue !== undefined && - (item2 == 'A相' || item2 == 'AB相' || item2.startsWith('零序电压')) - ) { + if (item.avalue !== undefined && (item2 == 'A相' || item2 == 'AB相' || item2.startsWith('零序电压'))) { let data = { name: item2, symbol: 'none', @@ -1592,10 +1605,7 @@ const getEcharts = () => { let tips = '' tips += '时刻:' + params[0].data[0] + '
' for (let i = 0; i < params.length; i++) { - - if (params[i].seriesName == '暂态触发点') { - tips += '' return tips @@ -1605,29 +1615,29 @@ const getEcharts = () => { params[i].marker + params[i].value[1] > 0 ? 'A相谐波电流方向:流入
' : params[i].value[1] == 0 - ? 'A相谐波电流方向:无
' - : 'A相谐波电流方向:流出
' + ? 'A相谐波电流方向:无
' + : 'A相谐波电流方向:流出
' } else if (params[i].seriesName == 'B相谐波电流方向') { tips += params[i].marker + params[i].value[1] > 0 ? 'B相谐波电流方向:流入
' : params[i].value[1] == 0 - ? 'B相谐波电流方向:无
' - : 'B相谐波电流方向:流出
' + ? 'B相谐波电流方向:无
' + : 'B相谐波电流方向:流出
' } else if (params[i].seriesName == 'C相谐波电流方向') { tips += params[i].marker + params[i].value[1] > 0 ? 'C相谐波电流方向:流入
' : params[i].value[1] == 0 - ? 'C相谐波电流方向:无
' - : 'C相谐波电流方向:流出
' + ? 'C相谐波电流方向:无
' + : 'C相谐波电流方向:流出
' } else if (params[i].seriesName == '总谐波电流方向') { tips += params[i].marker + params[i].value[1] > 0 ? '总谐波电流方向:流入
' : params[i].value[1] == 0 - ? '总谐波电流方向:无
' - : '总谐波电流方向:流出
' + ? '总谐波电流方向:无
' + : '总谐波电流方向:流出
' } else if (params[i].seriesName.includes('正序电压')) { let str = (params[i].value[1] * 1).toString() let reg = str.indexOf('.') > -1 ? /(\d)(?=(\d{3})+\.)/g : /(\d)(?=(?:\d{3})+$)/g @@ -1699,8 +1709,6 @@ const getEcharts = () => { ':' + (Number.isNaN(Number(str2)) ? '/' : str2) + '
' - - } } @@ -1908,7 +1916,6 @@ const getEcharts = () => { echarts.connect('group') } const conditionChange = () => { - //判断一个指标时 if (formData.condition.length == 1) { if ( @@ -2045,7 +2052,6 @@ const conditionChange = () => { } setTimeout(() => { //console.log('🚀 ~ setTimeout ~ tableHeaderRef.value:', tableHeaderRef.value) - //tableHeaderRef.value && tableHeaderRef.value?.computedSearchRow() }, 100) }