Files
admin-govern/src/components/cockpit/transientStatistics/components/transientStatisticsDetail.vue
2025-11-26 15:37:56 +08:00

245 lines
8.2 KiB
Vue

<template>
<div>
<!-- 暂态事件详情 -->
<el-dialog draggable title="暂态事件详情 " v-model="dialogVisible" append-to-body width="70%">
<TableHeader datePicker showExport :showReset="false" ref="tableHeaderRef" @selectChange="selectChange">
<template v-slot:select>
<el-form-item label="监测点">
<el-select v-model="tableStore.table.params.lineId" placeholder="请选择监测点名称">
<el-option
v-for="item in options"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</template>
</TableHeader>
<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%"
@close="handleHideCharts"
>
<waveFormAnalysis
v-loading="loading"
v-if="isWaveCharts"
ref="waveFormAnalysisRef"
@handleHideCharts="handleHideCharts"
:wp="wp"
/>
</el-dialog>
</div>
</template>
<script setup lang="ts">
import { ref, provide } from 'vue'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
import TableStore from '@/utils/tableStore'
import { mainHeight } from '@/utils/layout'
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue'
import { analyseWave } from '@/api/common'
const dialogVisible: any = ref(false)
const waveFormAnalysisRef: any = ref(null)
// 波形
const isWaveCharts = ref(false)
const loading = ref(false)
const wp = ref({})
const boxoList: any = ref({})
const tableHeaderRef = ref()
const options = [
{
value: '35kV进线',
label: '35kV进线'
}
]
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: '/cs-harmonic-boot/event/pageEvent',
method: 'POST',
showPage: true,
exportName: '主要监测点列表',
column: [
{
field: 'index',
title: '序号',
width: '80',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{
title: '暂态时间',
field: 'startTime'
},
{
title: '测点名称',
field: 'lineName',
width: '150'
},
{
title: '暂态类型',
field: 'tag',
width: '100'
},
{
title: '特征幅值(%)',
field: 'amplitude',
width: '100'
},
{
title: '暂降深度(%)',
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: 'persistTime',
width: '100'
},
{
title: '严重度',
field: 'severity',
width: '80'
},
{
title: '波形',
width: '100',
render: 'buttons',
buttons: [
{
name: 'edit',
text: '波形分析',
type: 'primary',
icon: 'el-icon-DataLine',
render: 'basicButton',
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 = 'YPT'
wp.value = res.data
}
loading.value = false
})
.catch(() => {
row.loading1 = false
loading.value = false
})
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'
// }
// ]
}
})
provide('tableStore', tableStore)
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
}
// 点击行
const cellClickEvent = ({ row, column }: any) => {
if (column.field != 'name') {
isWaveCharts.value = true
}
}
defineExpose({ open })
</script>
<style lang="scss" scoped></style>