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

277 lines
9.8 KiB
Vue
Raw Normal View History

2024-01-11 16:40:44 +08:00
<template>
2024-01-15 16:14:14 +08:00
<div ref="refheader" v-show="view">
<TableHeader datePicker>
<template v-slot:select>
<el-form-item label="数据来源">
2024-10-10 09:56:34 +08:00
<el-cascader placeholder="请选择数据来源" @change="sourceChange" v-model="tableStore.table.params.cascader"
:options="deviceTreeOptions" :show-all-levels="false" :props="{ checkStrictly: true }"
clearable></el-cascader>
2024-01-15 16:14:14 +08:00
<!-- <el-input v-model="tableStore.table.params.searchValue" placeholder="请输入设备名称" /> -->
</el-form-item>
2024-10-09 16:01:49 +08:00
<!-- <el-form-item label="级别">
2024-01-15 16:14:14 +08:00
<el-select v-model="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>
<!-- <div style="height: 300px;"> -->
2024-01-18 15:50:17 +08:00
<Table></Table>
2024-01-15 16:14:14 +08:00
</div>
<div style="padding: 10px" v-if="!view">
<el-row>
<el-col :span="12">
2024-09-25 16:36:53 +08:00
<div v-if="view2" style="display: flex">
2024-10-09 16:01:49 +08:00
<span style="font-size: 14px; line-height: 30px">值类型选择:</span>
2024-09-25 16:36:53 +08:00
<el-select @change="changeView" style="width: 240px" v-model="value" placeholder="请选择值类型">
2024-10-10 09:56:34 +08:00
<el-option v-for="item in options" :key="item.value" :label="item.label"
:value="item.value"></el-option>
2024-09-25 16:36:53 +08:00
</el-select>
</div>
2024-01-15 16:14:14 +08:00
</el-col>
<el-col :span="12">
2024-10-10 09:56:34 +08:00
<el-button v-if="view2" @click="backbxlb" type="primary" 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>
<el-tabs v-if="view2" v-model="bxactiveName" @tab-click="bxhandleClick">
2024-10-10 09:56:34 +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-10-10 09:56:34 +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>
<!-- <xiebofenxi ref="child" :bxshuju="bxshuju" @backfh="back"></xiebofenxi> -->
</div>
2024-01-11 16:40:44 +08:00
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
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'
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'
const props = defineProps(['deviceTree'])
const refheader = ref()
2024-01-15 16:14:14 +08:00
const view = ref(true)
const view2 = ref(false)
const showBoxi = ref(true)
const bxactiveName = ref('ssbx')
const boxoList = ref({})
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({
url: '/cs-harmonic-boot/eventUser/queryEventpage',
method: 'POST',
2024-09-25 16:36:53 +08:00
publicHeight: 65,
2024-01-11 16:40:44 +08:00
column: [
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' },
2024-01-15 16:14:14 +08:00
{ title: '事件描述', field: 'showName', align: 'center' },
{ title: '事件发生位置', field: 'evtParamPosition', align: 'center' },
{ title: '相别', field: 'evtParamPhase', align: 'center' },
{ title: '持续时间(s)', field: 'evtParamTm', align: 'center' },
{ title: '暂降深度', field: 'evtParamVVaDepth', align: 'center' },
2024-01-18 15:50:17 +08:00
{ title: '发生时刻', field: 'startTime', align: 'center' },
{
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-01-18 15:50:17 +08:00
disabled: row => {
return !row.wavePath && row.evtParamTm < 20
},
click: async row => {
row.loading = true
boxoList.value = row
await analyseWave(row.id)
.then(res => {
row.loading = false
if (res != undefined) {
wp.value = res.data
view.value = false
view2.value = true
}
})
.catch(() => {
row.loading = false
})
}
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-01-15 16:14:14 +08:00
item.evtParamTm = item.evtParamTm.split('s')[0]
})
}
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-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 = ''
tableStore.table.params.engineeringid = ''
tableStore.table.params.projectId = ''
tableStore.table.params.deviceId = ''
if (e) {
let name = deviceTreeOptions.value.filter((item: any) => {
return item.id == e[0]
})[0].name
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-01-18 15:50:17 +08:00
const bxecharts = mainHeight(155).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
2024-10-10 09:56:34 +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>