查看波形图联调修改

This commit is contained in:
stt
2025-11-26 15:37:56 +08:00
parent af3f9fe607
commit e759f443d3
3 changed files with 301 additions and 221 deletions

View File

@@ -2,14 +2,10 @@
<div>
<!-- 暂态事件详情 -->
<el-dialog draggable title="暂态事件详情 " v-model="dialogVisible" append-to-body width="70%">
<TableHeader datePicker showExport :showReset="false">
<TableHeader datePicker showExport :showReset="false" ref="tableHeaderRef" @selectChange="selectChange">
<template v-slot:select>
<el-form-item label="监测点名称">
<el-select
v-model="tableStore.table.params.searchValue"
placeholder="请选择监测点名称"
style="width: 240px"
>
<el-form-item label="监测点">
<el-select v-model="tableStore.table.params.lineId" placeholder="请选择监测点名称">
<el-option
v-for="item in options"
:key="item.value"
@@ -20,15 +16,22 @@
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" @cell-click="cellClickEvent" isGroup :height="height"></Table>
<Table ref="tableRef" @cell-click="cellClickEvent" isGroup :height="heightRef"></Table>
</el-dialog>
<!-- 查看波形 -->
<el-dialog v-model="isWaveCharts" draggable title="瞬时/RMS波形" append-to-body width="70%">
<el-dialog
v-model="isWaveCharts"
draggable
title="瞬时/RMS波形"
append-to-body
width="70%"
@close="handleHideCharts"
>
<waveFormAnalysis
v-loading="loading"
v-if="isWaveCharts"
ref="waveFormAnalysisRef"
@handleHideCharts="isWaveCharts = false"
@handleHideCharts="handleHideCharts"
:wp="wp"
/>
</el-dialog>
@@ -50,18 +53,22 @@ const loading = ref(false)
const wp = ref({})
const boxoList: any = ref({})
const tableHeaderRef = ref()
const options = [
{
value: '35kV进线',
label: '35kV进线'
}
]
const height = mainHeight(0, 2).height as any
const heightRef = ref(mainHeight(57, 2.3).height)
const selectChange = (flag: boolean, h: any) => {
heightRef.value = mainHeight(h, 2.3).height
}
const tableStore: any = new TableStore({
url: '/user-boot/role/selectRoleDetail?id=0',
url: '/cs-harmonic-boot/event/pageEvent',
method: 'POST',
publicHeight: 30,
showPage: false,
showPage: true,
exportName: '主要监测点列表',
column: [
{
@@ -74,36 +81,49 @@ const tableStore: any = new TableStore({
},
{
title: '暂态时间',
field: 'time'
field: 'startTime'
},
{
title: '测点名称',
field: 'name',
field: 'lineName',
width: '150'
},
{
title: '暂态类型',
field: 'flicker',
field: 'tag',
width: '100'
},
{
title: '特征幅值(%)',
field: 'flicker',
field: 'amplitude',
width: '100'
},
{
title: '暂降深度(%)',
field: 'flicker',
width: '100'
field: 'depth',
width: '100',
formatter: (row: any) => {
// 当暂态类型不是电压暂升时,计算暂降深度 = 100 - 特征幅值
if (row.tag !== '电压暂升') {
const amplitude = parseFloat(row.row.amplitude)
if (!isNaN(amplitude)) {
return 100 - amplitude
}
return '-'
} else {
// 电压暂升时不显示暂降深度
return '/'
}
}
},
{
title: '持续时间(S)',
field: 'flicker',
field: 'persistTime',
width: '100'
},
{
title: '严重度',
field: 'flicker',
field: 'severity',
width: '80'
},
{
@@ -112,27 +132,38 @@ const tableStore: any = new TableStore({
render: 'buttons',
buttons: [
{
name: 'check',
title: '查看波形',
name: 'edit',
text: '波形分析',
type: 'primary',
icon: 'el-icon-EditPen',
icon: 'el-icon-DataLine',
render: 'basicButton',
loading: 'loading1',
// disabled: row => {
// return !row.wavePath
// },
disabled: row => {
return !row.wavePath
},
click: async row => {
row.loading1 = true
loading.value = true
isWaveCharts.value = true
dialogVisible.value = false
// 在打开弹窗时立即设置高度
nextTick(() => {
if (waveFormAnalysisRef.value) {
waveFormAnalysisRef.value.setHeight(false, 360)
}
})
await analyseWave(row.id)
.then(res => {
row.loading1 = false
if (res != undefined) {
boxoList.value = row
// boxoList.value = {
// ...row,
// duration: row.persistTime // 将 persistTime 值赋给 duration
// }
boxoList.value.featureAmplitude =
row.evtParamVVaDepth != '-' ? row.evtParamVVaDepth - 0 : null
boxoList.value.systemType = 'WX'
boxoList.value.systemType = 'YPT'
wp.value = res.data
}
loading.value = false
@@ -145,39 +176,60 @@ const tableStore: any = new TableStore({
nextTick(() => {
waveFormAnalysisRef.value &&
waveFormAnalysisRef.value.getWpData(wp.value, boxoList.value, true)
// waveFormAnalysisRef.value && waveFormAnalysisRef.value.setHeight(false, 360)
})
}
},
{
name: 'edit',
text: '暂无波形',
type: 'info',
icon: 'el-icon-DataLine',
render: 'basicButton',
disabled: row => {
return !(!row.wavePath && row.evtParamTm < 20)
}
}
]
}
],
beforeSearchFun: () => {},
loadCallback: () => {
tableStore.table.data = [
{
time: '2024-01-01 00:00:00',
name: '35kV进线',
flicker: '0'
},
{
time: '2024-01-01 00:00:00',
name: '35kV进线',
flicker: '0'
},
{
time: '2024-01-01 00:00:00',
name: '35kV进线',
flicker: '0'
}
]
// tableStore.table.data = [
// {
// time: '2024-01-01 00:00:00',
// name: '35kV进线',
// flicker: '0'
// },
// {
// time: '2024-01-01 00:00:00',
// name: '35kV进线',
// flicker: '0'
// },
// {
// time: '2024-01-01 00:00:00',
// name: '35kV进线',
// flicker: '0'
// }
// ]
}
})
tableStore.table.params.searchValue = ''
provide('tableStore', tableStore)
const open = async (row: any) => {
const open = async (row: any, searchBeginTime: any, searchEndTime: any) => {
dialogVisible.value = true
tableStore.table.params.lineId = row.id
nextTick(() => {
tableHeaderRef.value.setTimeInterval([searchBeginTime, searchEndTime])
tableStore.table.params.searchBeginTime = searchBeginTime
tableStore.table.params.searchEndTime = searchEndTime
tableStore.index()
})
}
const handleHideCharts = () => {
isWaveCharts.value = false
dialogVisible.value = true
}
// 点击行

View File

@@ -24,12 +24,9 @@ import { ref, onMounted, provide, reactive, watch, h } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import MyEchart from '@/components/echarts/MyEchart.vue'
import { getTimeOfTheMonth } from '@/utils/formatTime'
import { useConfig } from '@/stores/config'
import TransientStatisticsDetail from '@/components/cockpit/transientStatistics/components/transientStatisticsDetail.vue'
import TableHeader from '@/components/table/header/index.vue'
import { useRoute } from 'vue-router'
import { useTimeCacheStore } from '@/stores/timeCache'
import { netEventEcharts } from '@/api/harmonic-boot/cockpit/cockpit'
const prop = defineProps({
@@ -76,7 +73,7 @@ const eventEcharts = () => {
searchEndTime: tableStore.table.params.searchEndTime || prop.timeValue?.[1]
}).then(res => {
// 整理接口数据为图表所需格式
const rawData = res.data || {};
const rawData = res.data || {}
data.value = [
{
name: '电压中断',
@@ -90,7 +87,7 @@ const eventEcharts = () => {
name: '电压暂升',
value: rawData.eventUp || 0
}
];
]
echartList.value = {
title: {},
@@ -124,7 +121,7 @@ const eventEcharts = () => {
left: 'center'
},
{
text: (rawData.eventOff + rawData.eventDown + rawData.eventUp) + '次',
text: rawData.eventOff + rawData.eventDown + rawData.eventUp + '次',
left: 'center',
top: 'center'
}
@@ -174,6 +171,7 @@ const tableStore: any = new TableStore({
title: '电压中断(次)',
field: 'eventOff',
minWidth: '70',
sortable: true,
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row.eventOff}</span>`
@@ -183,6 +181,7 @@ const tableStore: any = new TableStore({
title: '电压暂降(次)',
field: 'eventDown',
minWidth: '80',
sortable: true,
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row.eventDown}</span>`
@@ -192,6 +191,7 @@ const tableStore: any = new TableStore({
title: '电压暂升(次)',
field: 'eventUp',
minWidth: '80',
sortable: true,
render: 'customTemplate',
customTemplate: (row: any) => {
return `<span style='cursor: pointer;text-decoration: underline;'>${row.eventUp}</span>`
@@ -215,7 +215,11 @@ provide('tableStore', tableStore)
// 点击行
const cellClickEvent = ({ row, column }: any) => {
if (column.field != 'name') {
transientStatisticsDetailRef.value.open(row)
transientStatisticsDetailRef.value.open(
row,
tableStore.table.params.searchBeginTime || prop.timeValue?.[0],
tableStore.table.params.searchEndTime || prop.timeValue?.[1]
)
}
}

View File

@@ -1,120 +1,131 @@
// waveData.worker.js
self.addEventListener('message', function(e) {
const { wp, value, iphasic, isOpen, boxoList } = JSON.parse(e.data);
self.addEventListener('message', function (e) {
const { wp, value, iphasic, isOpen, boxoList } = JSON.parse(e.data)
// 处理波形数据的函数
const fliteWaveData = (wp, step) => {
// 将原有的fliteWaveData函数实现复制到这里
const shunData = wp.listWaveData;
const pt = Number(wp.pt) / 1000;
const ct = Number(wp.ct);
const titleList = wp.waveTitle;
let xishu = pt;
let aTitle = '', bTitle = '', cTitle = '', unit = '电压';
let ifmax = 0, ifmin = 0, ismax = 0, ismin = 0;
const shunData = wp.listWaveData
const pt = Number(wp.pt) / 1000
const ct = Number(wp.ct)
const titleList = wp.waveTitle
let xishu = pt
let aTitle = '',
bTitle = '',
cTitle = '',
unit = '电压'
let ifmax = 0,
ifmin = 0,
ismax = 0,
ismin = 0
const shunshiFA = [];
const shunshiFB = [];
const shunshiFC = [];
const shunshiSA = [];
const shunshiSB = [];
const shunshiSC = [];
const shunshiFA = []
const shunshiFB = []
const shunshiFC = []
const shunshiSA = []
const shunshiSB = []
const shunshiSC = []
if (shunData.length > 0) {
if (titleList[iphasic * step + 1]?.substring(0, 1) !== 'U') {
xishu = ct;
unit = '电流';
xishu = ct
unit = '电流'
}
for (let i = 1; i <= iphasic; i++) {
switch (i) {
case 1:
aTitle = titleList[iphasic * step + i]?.substring(1) || '';
break;
aTitle = titleList[iphasic * step + i]?.substring(1) || ''
break
case 2:
bTitle = titleList[iphasic * step + i]?.substring(1) || '';
break;
bTitle = titleList[iphasic * step + i]?.substring(1) || ''
break
case 3:
cTitle = titleList[iphasic * step + i]?.substring(1) || '';
break;
cTitle = titleList[iphasic * step + i]?.substring(1) || ''
break
}
}
if (shunData[0][iphasic * step + 1] !== undefined) {
ifmax = shunData[0][iphasic * step + 1] * xishu;
ifmin = shunData[0][iphasic * step + 1] * xishu;
ismax = shunData[0][iphasic * step + 1];
ismin = shunData[0][iphasic * step + 1];
ifmax = shunData[0][iphasic * step + 1] * xishu
ifmin = shunData[0][iphasic * step + 1] * xishu
ismax = shunData[0][iphasic * step + 1]
ismin = shunData[0][iphasic * step + 1]
}
for (let shun = 0; shun < shunData.length; shun++) {
if (shunData[shun][iphasic * step + 1] === undefined) {
break;
break
}
switch (iphasic) {
case 1:
const shunFirstA = shunData[shun][iphasic * step + 1] * xishu;
shunshiFA.push([shunData[shun][0], shunFirstA]);
ifmax = Math.max(ifmax, shunFirstA);
ifmin = Math.min(ifmin, shunFirstA);
const shunFirstA = shunData[shun][iphasic * step + 1] * xishu
shunshiFA.push([shunData[shun][0], shunFirstA])
ifmax = Math.max(ifmax, shunFirstA)
ifmin = Math.min(ifmin, shunFirstA)
const shunSecondA = shunData[shun][iphasic * step + 1];
shunshiSA.push([shunData[shun][0], shunSecondA]);
ismax = Math.max(ismax, shunSecondA);
ismin = Math.min(ismin, shunSecondA);
break;
const shunSecondA = shunData[shun][iphasic * step + 1]
shunshiSA.push([shunData[shun][0], shunSecondA])
ismax = Math.max(ismax, shunSecondA)
ismin = Math.min(ismin, shunSecondA)
break
case 2:
const shunFirstA2 = shunData[shun][iphasic * step + 1] * xishu;
const shunFirstB2 = shunData[shun][iphasic * step + 2] * xishu;
shunshiFA.push([shunData[shun][0], shunFirstA2]);
shunshiFB.push([shunData[shun][0], shunFirstB2]);
ifmax = Math.max(ifmax, shunFirstA2, shunFirstB2);
ifmin = Math.min(ifmin, shunFirstA2, shunFirstB2);
const shunFirstA2 = shunData[shun][iphasic * step + 1] * xishu
const shunFirstB2 = shunData[shun][iphasic * step + 2] * xishu
shunshiFA.push([shunData[shun][0], shunFirstA2])
shunshiFB.push([shunData[shun][0], shunFirstB2])
ifmax = Math.max(ifmax, shunFirstA2, shunFirstB2)
ifmin = Math.min(ifmin, shunFirstA2, shunFirstB2)
const shunSecondA2 = shunData[shun][iphasic * step + 1];
const shunSecondB2 = shunData[shun][iphasic * step + 2];
shunshiSA.push([shunData[shun][0], shunSecondA2]);
shunshiSB.push([shunData[shun][0], shunSecondB2]);
ismax = Math.max(ismax, shunSecondA2, shunSecondB2);
ismin = Math.min(ismin, shunSecondA2, shunSecondB2);
break;
const shunSecondA2 = shunData[shun][iphasic * step + 1]
const shunSecondB2 = shunData[shun][iphasic * step + 2]
shunshiSA.push([shunData[shun][0], shunSecondA2])
shunshiSB.push([shunData[shun][0], shunSecondB2])
ismax = Math.max(ismax, shunSecondA2, shunSecondB2)
ismin = Math.min(ismin, shunSecondA2, shunSecondB2)
break
case 3:
const shunFirstA3 = shunData[shun][iphasic * step + 1] * xishu;
const shunFirstB3 = shunData[shun][iphasic * step + 2] * xishu;
const shunFirstC3 = shunData[shun][iphasic * step + 3] * xishu;
shunshiFA.push([shunData[shun][0], shunFirstA3]);
shunshiFB.push([shunData[shun][0], shunFirstB3]);
shunshiFC.push([shunData[shun][0], shunFirstC3]);
ifmax = Math.max(ifmax, shunFirstA3, shunFirstB3, shunFirstC3);
ifmin = isOpen ? Math.min(ifmin, shunFirstA3, shunFirstC3) : Math.min(ifmin, shunFirstA3, shunFirstB3, shunFirstC3);
const shunFirstA3 = shunData[shun][iphasic * step + 1] * xishu
const shunFirstB3 = shunData[shun][iphasic * step + 2] * xishu
const shunFirstC3 = shunData[shun][iphasic * step + 3] * xishu
shunshiFA.push([shunData[shun][0], shunFirstA3])
shunshiFB.push([shunData[shun][0], shunFirstB3])
shunshiFC.push([shunData[shun][0], shunFirstC3])
ifmax = Math.max(ifmax, shunFirstA3, shunFirstB3, shunFirstC3)
ifmin = isOpen
? Math.min(ifmin, shunFirstA3, shunFirstC3)
: Math.min(ifmin, shunFirstA3, shunFirstB3, shunFirstC3)
const shunSecondA3 = shunData[shun][iphasic * step + 1];
const shunSecondB3 = shunData[shun][iphasic * step + 2];
const shunSecondC3 = shunData[shun][iphasic * step + 3];
shunshiSA.push([shunData[shun][0], shunSecondA3]);
shunshiSB.push([shunData[shun][0], shunSecondB3]);
shunshiSC.push([shunData[shun][0], shunSecondC3]);
ismax = Math.max(ismax, shunSecondA3, shunSecondB3, shunSecondC3);
ismin = isOpen ? Math.min(ismin, shunSecondA3, shunSecondC3) : Math.min(ismin, shunSecondA3, shunSecondB3, shunSecondC3);
break;
const shunSecondA3 = shunData[shun][iphasic * step + 1]
const shunSecondB3 = shunData[shun][iphasic * step + 2]
const shunSecondC3 = shunData[shun][iphasic * step + 3]
shunshiSA.push([shunData[shun][0], shunSecondA3])
shunshiSB.push([shunData[shun][0], shunSecondB3])
shunshiSC.push([shunData[shun][0], shunSecondC3])
ismax = Math.max(ismax, shunSecondA3, shunSecondB3, shunSecondC3)
ismin = isOpen
? Math.min(ismin, shunSecondA3, shunSecondC3)
: Math.min(ismin, shunSecondA3, shunSecondB3, shunSecondC3)
break
}
}
}
const instantF = { max: ifmax, min: ifmin };
const instantS = { max: ismax, min: ismin };
const shunshiF = { shunshiFA, shunshiFB, shunshiFC };
const shunshiS = { shunshiSA, shunshiSB, shunshiSC };
const title = { aTitle, bTitle, cTitle, unit };
const instantF = { max: ifmax, min: ifmin }
const instantS = { max: ismax, min: ismin }
const shunshiF = { shunshiFA, shunshiFB, shunshiFC }
const shunshiS = { shunshiSA, shunshiSB, shunshiSC }
const title = { aTitle, bTitle, cTitle, unit }
return { instantF, instantS, shunshiF, shunshiS, title, unit };
};
return { instantF, instantS, shunshiF, shunshiS, title, unit }
}
// 处理标题
let titles = '';
let titles = ''
if (boxoList.systemType == 'pms') {
titles = '变电站名称:' +
titles =
'变电站名称:' +
boxoList.powerStationName +
' 监测点名称:' +
boxoList.measurementPointName +
@@ -124,9 +135,10 @@ self.addEventListener('message', function(e) {
(boxoList.featureAmplitude * 100).toFixed(2) +
'% 持续时间:' +
boxoList.duration +
's';
's'
} else if (boxoList.systemType == 'ZL') {
titles = ' 监测点名称:' +
titles =
' 监测点名称:' +
boxoList.equipmentName +
' 发生时刻:' +
boxoList.startTime +
@@ -134,9 +146,21 @@ self.addEventListener('message', function(e) {
boxoList.evtParamVVaDepth +
' 持续时间:' +
boxoList.evtParamTm +
's';
's'
} else if (boxoList.systemType == 'YPT') {
titles =
' 监测点名称:' +
boxoList.lineName +
' 发生时刻:' +
boxoList.startTime +
' 残余电压:' +
(boxoList.featureAmplitude * 100).toFixed(2) +
'% 持续时间:' +
boxoList.persistTime +
's'
} else {
titles = '变电站名称:' +
titles =
'变电站名称:' +
boxoList.subName +
' 监测点名称:' +
boxoList.lineName +
@@ -146,25 +170,25 @@ self.addEventListener('message', function(e) {
(boxoList.featureAmplitude * 100).toFixed(2) +
'% 持续时间:' +
boxoList.duration +
's';
's'
}
const iphasicValue = wp.iphasic || 1;
const picCounts = (wp.waveTitle.length - 1) / iphasicValue;
const waveDatas = [];
const iphasicValue = wp.iphasic || 1
const picCounts = (wp.waveTitle.length - 1) / iphasicValue
const waveDatas = []
for (let i = 0; i < picCounts; i++) {
const data = fliteWaveData(wp, i);
waveDatas.push(data);
const data = fliteWaveData(wp, i)
waveDatas.push(data)
}
const time = wp.time;
const type = wp.waveType;
let severity = wp.yzd;
const time = wp.time
const type = wp.waveType
let severity = wp.yzd
if (severity < 0) {
severity = '/';
type = '/';
severity = '/'
type = '/'
}
// 将处理结果发送回主线程
@@ -175,5 +199,5 @@ self.addEventListener('message', function(e) {
severity,
titles,
iphasic: iphasicValue
});
});
})
})