Files
admin-govern/src/views/govern/alarm/Transient.vue

366 lines
14 KiB
Vue
Raw Normal View History

2024-01-11 16:40:44 +08:00
<template>
2024-12-19 10:16:08 +08:00
<div ref="refheader" v-if="!isWaveCharts">
2024-12-26 15:56:32 +08:00
<TableHeader datePicker showExport>
2024-01-15 16:14:14 +08:00
<template v-slot:select>
<el-form-item label="数据来源">
2025-07-10 16:33:41 +08:00
<el-cascader
placeholder="请选择数据来源"
@change="sourceChange"
filterable
v-model.trim="tableStore.table.params.cascader"
:options="deviceTreeOptions"
:show-all-levels="false"
:props="{ checkStrictly: true }"
clearable
></el-cascader>
2024-12-25 10:53:07 +08:00
<!-- <el-input maxlength="32" show-word-limit v-model.trim="tableStore.table.params.searchValue" placeholder="请输入设备名称" /> -->
2024-01-15 16:14:14 +08:00
</el-form-item>
2024-10-09 16:01:49 +08:00
<!-- <el-form-item label="级别">
2024-12-25 10:53:07 +08:00
<el-select v-model.trim="tableStore.table.params.level" placeholder="请选择级别" clearable>
2024-09-25 16:36:53 +08:00
<el-option v-for="item in rankOptions" :key="item.value" :label="item.label"
:value="item.value"></el-option>
2024-01-15 16:14:14 +08:00
</el-select>
2024-10-09 16:01:49 +08:00
</el-form-item> -->
2024-01-15 16:14:14 +08:00
</template>
</TableHeader>
2024-12-19 10:16:08 +08:00
2024-01-18 15:50:17 +08:00
<Table></Table>
2024-01-15 16:14:14 +08:00
</div>
2025-07-10 16:33:41 +08:00
<waveFormAnalysis
v-loading="loading"
v-if="isWaveCharts"
ref="waveFormAnalysisRef"
@handleHideCharts="isWaveCharts = false"
:wp="wp"
/>
2024-12-19 10:16:08 +08:00
<!-- <div style="height: 300px;"> -->
<!-- <div style="padding: 10px" v-if="!view" v-loading="loading">
2024-01-15 16:14:14 +08:00
<el-row>
<el-col :span="12">
2024-09-25 16:36:53 +08:00
<div v-if="view2" style="display: flex">
2024-12-25 10:53:07 +08:00
<el-radio-group v-model.trim="value" @change="changeView">
2024-12-17 20:57:07 +08:00
<el-radio-button label="一次值" :value="1" />
<el-radio-button label="二次值" :value="2" />
</el-radio-group>
2024-09-25 16:36:53 +08:00
</div>
2024-01-15 16:14:14 +08:00
</el-col>
<el-col :span="12">
2024-12-13 14:36:23 +08:00
<el-button v-if="view2" @click="backbxlb" class="el-icon-refresh-right" icon="el-icon-Back"
style="float: right">
2024-01-15 16:14:14 +08:00
返回
</el-button>
</el-col>
</el-row>
2024-12-25 10:53:07 +08:00
<el-tabs v-if="view2" v-model.trim="bxactiveName" @tab-click="bxhandleClick">
2024-12-13 14:36:23 +08:00
<el-tab-pane label="瞬时波形" name="ssbx" class="boxbx pt10 pb10"
:style="'height:' + bxecharts + ';overflow-y: scroll;'">
<shushiboxi v-if="bxactiveName == 'ssbx' && showBoxi" :value="value" :boxoList="boxoList" :wp="wp">
</shushiboxi>
2024-01-15 16:14:14 +08:00
</el-tab-pane>
2024-12-13 14:36:23 +08:00
<el-tab-pane label="RMS波形" class="boxbx pt10 pb10" name="rmsbx"
:style="'height:' + bxecharts + ';overflow-y: scroll;'">
<rmsboxi v-if="bxactiveName == 'rmsbx' && showBoxi" :value="value" :boxoList="boxoList" :wp="wp">
</rmsboxi>
2024-01-15 16:14:14 +08:00
</el-tab-pane>
</el-tabs>
2024-12-19 10:16:08 +08:00
</div> -->
2024-01-11 16:40:44 +08:00
</template>
<script setup lang="ts">
2024-12-19 10:16:08 +08:00
import { ref, onMounted, provide, nextTick } from 'vue'
2024-01-11 16:40:44 +08:00
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import TableHeader from '@/components/table/header/index.vue'
2024-01-15 16:14:14 +08:00
import shushiboxi from '@/components/echarts/shushiboxi.vue'
2025-07-10 16:33:41 +08:00
import waveFormAnalysis from '@/views/govern/device/control/tabs/components/waveFormAnalysis.vue'
2024-01-15 16:14:14 +08:00
import rmsboxi from '@/components/echarts/rmsboxi.vue'
2024-01-18 15:50:17 +08:00
import { analyseWave } from '@/api/common'
2024-01-11 16:40:44 +08:00
import { mainHeight } from '@/utils/layout'
import { ElMessage } from 'element-plus'
2025-01-03 12:45:54 +08:00
import { getFileZip } from '@/api/cs-harmonic-boot/datatrend'
2024-01-11 16:40:44 +08:00
const props = defineProps(['deviceTree'])
const refheader = ref()
2024-12-19 10:16:08 +08:00
const waveFormAnalysisRef = ref()
2024-01-15 16:14:14 +08:00
const view = ref(true)
2024-12-19 10:16:08 +08:00
const isWaveCharts = ref(false)
2024-01-15 16:14:14 +08:00
const view2 = ref(false)
const showBoxi = ref(true)
2024-12-19 10:16:08 +08:00
const loading = ref(false)
2024-01-15 16:14:14 +08:00
const bxactiveName = ref('ssbx')
2024-10-16 20:31:54 +08:00
const boxoList: any = ref({})
2024-01-15 16:14:14 +08:00
const wp = ref({})
const value = ref(1)
const options = ref([
2024-01-11 16:40:44 +08:00
{
2024-01-15 16:14:14 +08:00
value: 1,
label: '一次值'
2024-01-11 16:40:44 +08:00
},
{
2024-01-15 16:14:14 +08:00
value: 2,
label: '二次值'
2024-01-11 16:40:44 +08:00
}
])
const rankOptions = ref([
{
value: '1',
label: '1级'
},
{
value: '2',
label: '2级'
},
{
value: '3',
label: '3级'
}
])
const tableStore = new TableStore({
2024-10-10 15:57:12 +08:00
url: '/cs-harmonic-boot/eventUser/queryEventpageWeb',
2024-01-11 16:40:44 +08:00
method: 'POST',
2024-09-25 16:36:53 +08:00
publicHeight: 65,
2025-01-03 16:11:31 +08:00
exportName: '暂态事件',
2025-07-15 16:31:06 +08:00
column: [ {
title: '序号',
width: 80,
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
2024-10-09 16:01:49 +08:00
{ title: '设备名称', field: 'equipmentName', align: 'center' },
2024-01-11 16:40:44 +08:00
{ title: '工程名称', field: 'engineeringName', align: 'center' },
{ title: '项目名称', field: 'projectName', align: 'center' },
2025-07-15 16:31:06 +08:00
{ title: '发生时刻', field: 'startTime', align: 'center', width: '240',sortable: true },
2024-11-06 13:25:42 +08:00
{ title: '监测点名称', field: 'lineName', align: 'center' },
2024-01-15 16:14:14 +08:00
{ title: '事件描述', field: 'showName', align: 'center' },
{ title: '事件发生位置', field: 'evtParamPosition', align: 'center' },
{ title: '相别', field: 'evtParamPhase', align: 'center' },
2025-07-15 16:31:06 +08:00
{ title: '持续时间(s)', field: 'evtParamTm', align: 'center',sortable: true },
{ title: '暂降(聚升)幅值(%)', minWidth: 100, field: 'evtParamVVaDepth', align: 'center',sortable: true },
2025-07-10 16:33:41 +08:00
2024-01-18 15:50:17 +08:00
{
title: '操作',
align: 'center',
2024-01-30 14:11:29 +08:00
width: '180',
2024-01-18 15:50:17 +08:00
render: 'buttons',
buttons: [
{
name: 'edit',
2024-01-26 09:35:33 +08:00
title: '波形分析',
2024-01-18 15:50:17 +08:00
type: 'primary',
icon: 'el-icon-DataLine',
2024-01-30 14:11:29 +08:00
render: 'basicButton',
2024-10-31 14:36:09 +08:00
loading: 'loading1',
2024-01-18 15:50:17 +08:00
disabled: row => {
return !row.wavePath && row.evtParamTm < 20
},
click: async row => {
2024-10-31 14:36:09 +08:00
row.loading1 = true
2024-12-19 10:16:08 +08:00
loading.value = true
isWaveCharts.value = true
2024-01-18 15:50:17 +08:00
await analyseWave(row.id)
.then(res => {
2024-10-31 14:36:09 +08:00
row.loading1 = false
2024-01-18 15:50:17 +08:00
if (res != undefined) {
2024-12-19 10:16:08 +08:00
boxoList.value = row
2025-07-10 16:33:41 +08:00
boxoList.value.featureAmplitude =
row.evtParamVVaDepth != '-' ? row.evtParamVVaDepth - 0 : null
2024-12-19 10:16:08 +08:00
boxoList.value.systemType = 'WX'
2024-01-18 15:50:17 +08:00
wp.value = res.data
}
2024-12-19 10:16:08 +08:00
loading.value = false
2024-01-18 15:50:17 +08:00
})
.catch(() => {
2024-10-31 14:36:09 +08:00
row.loading1 = false
2024-12-19 10:16:08 +08:00
loading.value = false
2024-01-18 15:50:17 +08:00
})
2024-12-19 10:16:08 +08:00
nextTick(() => {
2025-07-10 16:33:41 +08:00
waveFormAnalysisRef.value &&
waveFormAnalysisRef.value.getWpData(wp.value, boxoList.value, true)
2024-12-19 10:16:08 +08:00
// waveFormAnalysisRef.value && waveFormAnalysisRef.value.setHeight(200, 190)
})
// row.loading1 = true
// view.value = false
// view2.value = true
// loading.value = true
// boxoList.value = row
// boxoList.value.systemType = 'WX'
// boxoList.value.persistTime = row.evtParamTm != '-' ? row.evtParamTm - 0 : null
// await analyseWave(row.id)
// .then(res => {
// row.loading1 = false
// if (res != undefined) {
// wp.value = res.data
// }
// loading.value = false
// })
// .catch(() => {
// row.loading1 = false
// loading.value = false
// })
2024-01-18 15:50:17 +08:00
}
2024-09-25 16:36:53 +08:00
},
{
name: 'edit',
title: '波形下载',
type: 'primary',
icon: 'el-icon-Check',
2024-10-31 14:36:09 +08:00
loading: 'loading2',
render: 'basicButton',
disabled: row => {
// && row.evtParamTm < 20
return !row.wavePath
},
click: row => {
2025-01-03 12:45:54 +08:00
getFileZip({ eventId: row.id }).then(res => {
let blob = new Blob([res], { type: 'application/zip' }) // console.log(blob) // var href = window.URL.createObjectURL(blob); //创建下载的链接
const url = window.URL.createObjectURL(blob)
const link = document.createElement('a') // 创建a标签
link.href = url
link.download = row.wavePath.split('/')[2] || '波形文件' // 设置下载的文件名
document.body.appendChild(link)
link.click() //执行下载
document.body.removeChild(link) //释放标签
})
}
},
2024-09-25 16:36:53 +08:00
{
name: 'edit',
text: '暂无波形',
type: 'info',
icon: 'el-icon-DataLine',
render: 'basicButton',
disabled: row => {
return !(!row.wavePath && row.evtParamTm < 20)
2024-10-09 16:01:49 +08:00
}
2024-01-18 15:50:17 +08:00
}
]
}
2024-01-15 16:14:14 +08:00
],
beforeSearchFun: () => {
2024-10-10 09:56:34 +08:00
// if (!tableStore.table.params.deviceId) {
// delete tableStore.table.params.deviceId
// }
},
2024-01-15 16:14:14 +08:00
loadCallback: () => {
tableStore.table.data.forEach((item: any) => {
2024-01-18 15:50:17 +08:00
item.loading = false
2024-11-01 11:21:12 +08:00
item.evtParamTm =
item.evtParamTm.split('s')[0] != '-' ? (item.evtParamTm.split('s')[0] - 0).toFixed(2) : '-'
item.evtParamVVaDepth =
item.evtParamVVaDepth.split('%')[0] != '-' ? (item.evtParamVVaDepth.split('%')[0] - 0).toFixed(2) : '-'
2024-01-15 16:14:14 +08:00
})
}
2024-01-11 16:40:44 +08:00
})
provide('tableStore', tableStore)
// "target": [],
// "type": "",
// "userId": ""
tableStore.table.params.engineeringid = ''
tableStore.table.params.projectId = ''
2024-10-10 09:56:34 +08:00
tableStore.table.params.deviceTypeId = ''
2024-01-11 16:40:44 +08:00
tableStore.table.params.deviceId = ''
2024-01-15 16:14:14 +08:00
tableStore.table.params.type = 0
2024-01-11 16:40:44 +08:00
tableStore.table.params.eventIds = []
tableStore.table.params.status = ''
tableStore.table.params.target = []
tableStore.table.params.userId = ''
2024-09-25 16:36:53 +08:00
tableStore.table.params.cascader = ''
2024-10-10 10:29:38 +08:00
tableStore.table.params.deviceTypeName = ''
2024-10-09 16:01:49 +08:00
// tableStore.table.params.level=''
2024-01-18 15:50:17 +08:00
2024-10-10 09:56:34 +08:00
const deviceTreeOptions: any = ref<any>(props.deviceTree)
deviceTreeOptions.value.map((item: any, index: any) => {
if (item.children.length == 0) {
deviceTreeOptions.value.splice(index, 1)
}
})
2024-01-11 16:40:44 +08:00
const sourceChange = (e: any) => {
2024-10-10 09:56:34 +08:00
tableStore.table.params.deviceTypeId = ''
2024-10-16 20:31:54 +08:00
tableStore.table.params.engineeringid = ''
tableStore.table.params.projectId = ''
tableStore.table.params.deviceId = ''
2024-10-10 09:56:34 +08:00
if (e) {
let name = deviceTreeOptions.value.filter((item: any) => {
return item.id == e[0]
})[0].name
2024-10-16 20:31:54 +08:00
tableStore.table.params.deviceTypeName = name
2024-10-10 09:56:34 +08:00
if (name == '便携式设备') {
tableStore.table.params.deviceTypeId = e[0] || ''
tableStore.table.params.deviceId = e[1] || ''
} else {
tableStore.table.params.deviceTypeId = e[0] || ''
tableStore.table.params.engineeringid = e[1] || ''
tableStore.table.params.projectId = e[2] || ''
}
2024-10-09 16:01:49 +08:00
}
2024-10-10 09:56:34 +08:00
// tableStore.table.params.engineeringid = e[1] || ''
// tableStore.table.params.projectId = e[2] || ''
// const zlIndex = deviceTreeOptions.value.findIndex((item: any) => {
// return item.name == '治理设备'
// })
// const bxsIndex = deviceTreeOptions.value.findIndex((item: any) => {
// return item.name == '便携式设备'
// })
// console.log("🚀 ~ zlIndex ~ zlIndex:", zlIndex,bxsIndex)
// //便携式设备特殊处理
// if (bxsIndex != -1 && deviceTreeOptions.value[bxsIndex].id == e[0] && e.length == 2) {
// tableStore.table.params.deviceId = e[1]
// }
// //治理设备
// if (zlIndex != -1 && deviceTreeOptions.value[zlIndex].id == e[0]) {
// tableStore.table.params.deviceId = e[2] || ''
// }
2024-01-11 16:40:44 +08:00
}
2024-01-15 16:14:14 +08:00
const getboxin = async (row: any) => {
2024-01-18 15:50:17 +08:00
console.log('🚀 ~ getboxin ~ row:', row)
// boxoList.value = row
// await analyseWave(row.id).then(res => {
// if (res != undefined) {
// wp.value = res.data
// view.value = false
// view2.value = true
// }
// })
2024-01-15 16:14:14 +08:00
}
const changeView = () => {
showBoxi.value = false
setTimeout(() => {
showBoxi.value = true
}, 0)
}
const bxhandleClick = (tab: any) => {
if (tab.name == 'ssbx') {
bxactiveName.value = 'ssbx'
} else if (tab.name == 'rmsbx') {
bxactiveName.value = 'rmsbx'
}
// console.log(tab, event);
}
const backbxlb = () => {
view.value = true
view2.value = false
setTimeout(() => {
2024-01-18 15:50:17 +08:00
tableStore.table.height = mainHeight(180).height as any
}, 0)
2024-01-15 16:14:14 +08:00
}
2024-01-11 16:40:44 +08:00
onMounted(() => {
tableStore.index()
})
2024-10-16 20:31:54 +08:00
const bxecharts = mainHeight(175).height as any
2024-01-15 16:14:14 +08:00
setTimeout(() => {
2024-01-29 16:30:24 +08:00
tableStore.table.height = mainHeight(200).height as any
2024-01-15 16:14:14 +08:00
}, 0)
2024-01-11 16:40:44 +08:00
2025-07-10 16:33:41 +08:00
const addMenu = () => {}
2024-01-11 16:40:44 +08:00
</script>
2024-01-15 16:14:14 +08:00
<style scoped lang="scss"></style>