告警事件添加设备选取功能
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<TableHeader datePicker ref="refheader" showCustomColumn showExport>
|
||||
<template v-slot:select>
|
||||
<!-- <el-form-item label="设备选取">
|
||||
<el-form-item label="设备选取">
|
||||
<el-tree-select
|
||||
v-model="tableStore.table.params.cascader"
|
||||
:data="deviceTreeOptions"
|
||||
:data="deviceTree"
|
||||
clearable
|
||||
:props="treeProps"
|
||||
filterable
|
||||
@@ -12,9 +12,11 @@
|
||||
check-strictly
|
||||
default-expand-all
|
||||
placeholder="请选择需要筛选的数据"
|
||||
@node-click="sourceChange"
|
||||
@clear="onTreeClear"
|
||||
style="width: 100%"
|
||||
></el-tree-select>
|
||||
</el-form-item> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="关键字筛选">
|
||||
<el-input
|
||||
maxlength="32"
|
||||
@@ -22,7 +24,7 @@
|
||||
style="width: 240px"
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
placeholder="请输入设备名称/告警代码"
|
||||
placeholder="请输入告警代码"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="级别">
|
||||
@@ -199,47 +201,35 @@ provide('tableStore', tableStore)
|
||||
// "type": "",
|
||||
// "userId": ""
|
||||
tableStore.table.params.searchValue = ''
|
||||
// tableStore.table.params.cascader = ''
|
||||
// tableStore.table.params.level = ''
|
||||
// tableStore.table.params.engineeringid = ''
|
||||
// tableStore.table.params.projectId = ''
|
||||
// tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.engineeringid = ''
|
||||
tableStore.table.params.projectId = ''
|
||||
tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.lineId = ''
|
||||
tableStore.table.params.cascader = ''
|
||||
tableStore.table.params.type = 3
|
||||
// tableStore.table.params.eventIds = []
|
||||
// tableStore.table.params.status = ''
|
||||
// tableStore.table.params.target = []
|
||||
// tableStore.table.params.userId = ''
|
||||
// tableStore.table.params.deviceTypeId = ''
|
||||
// tableStore.table.params.deviceTypeName = ''
|
||||
const deviceTreeOptions = ref<any>(props.deviceTree)
|
||||
deviceTreeOptions.value.map((item: any, index: any) => {
|
||||
if (item?.children.length == 0) {
|
||||
deviceTreeOptions.value.splice(index, 1)
|
||||
}
|
||||
})
|
||||
tableStore.table.params.level = ''
|
||||
|
||||
const filterNode = createTreeFilterNode()
|
||||
const sourceChange = (e: any) => {
|
||||
tableStore.table.params.deviceTypeId = ''
|
||||
|
||||
const onTreeClear = () => {
|
||||
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
|
||||
tableStore.table.params.deviceTypeName = 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] || ''
|
||||
tableStore.table.params.deviceId = e[3] || ''
|
||||
}
|
||||
}
|
||||
tableStore.table.params.lineId = ''
|
||||
}
|
||||
|
||||
const sourceChange = (e: any) => {
|
||||
onTreeClear()
|
||||
if (e.level == 0) {
|
||||
tableStore.table.params.engineeringid = e.id
|
||||
} else if (e.level == 1) {
|
||||
tableStore.table.params.projectId = e.id
|
||||
} else if (e.level == 2) {
|
||||
tableStore.table.params.deviceId = e.id
|
||||
} else if (e.level == 3) {
|
||||
tableStore.table.params.lineId = e.id
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
|
||||
@@ -1,26 +1,32 @@
|
||||
<template>
|
||||
<TableHeader datePicker ref="refheader" showCustomColumn showExport>
|
||||
<template v-slot:select>
|
||||
<!-- <el-form-item label="设备选取">
|
||||
<el-tree-select
|
||||
v-model="tableStore.table.params.cascader"
|
||||
:data="deviceTreeOptions"
|
||||
clearable
|
||||
:props="treeProps"
|
||||
filterable
|
||||
:filter-node-method="filterNode"
|
||||
check-strictly
|
||||
default-expand-all
|
||||
placeholder="请选择需要筛选的数据"
|
||||
style="width: 100%"
|
||||
>
|
||||
|
||||
</el-tree-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="关键字筛选">
|
||||
<el-input maxlength="32" show-word-limit style="width: 240px"
|
||||
v-model.trim="tableStore.table.params.searchValue" clearable placeholder="请输入监测点名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="设备选取">
|
||||
<el-tree-select
|
||||
v-model="tableStore.table.params.cascader"
|
||||
:data="deviceTree"
|
||||
clearable
|
||||
:props="treeProps"
|
||||
filterable
|
||||
:filter-node-method="filterNode"
|
||||
check-strictly
|
||||
default-expand-all
|
||||
placeholder="请选择需要筛选的数据"
|
||||
@node-click="sourceChange"
|
||||
@clear="onTreeClear"
|
||||
style="width: 100%"
|
||||
></el-tree-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="关键字筛选">
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
style="width: 240px"
|
||||
v-model.trim="tableStore.table.params.searchValue"
|
||||
clearable
|
||||
placeholder="请输入监测点名称"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item label="级别">
|
||||
<el-select v-model.trim="tableStore.table.params.level" placeholder="请选择级别" clearable>
|
||||
<el-option
|
||||
@@ -65,18 +71,23 @@ const tableStore = new TableStore({
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{ title: '发生时刻', field: 'startTime', align: 'center', sortable: true, minWidth: 180, },
|
||||
{ title: '监测点名称', field: 'lineName', align: 'center', minWidth: 150,formatter: (row: any) => {
|
||||
{ title: '发生时刻', field: 'startTime', align: 'center', sortable: true, minWidth: 180 },
|
||||
{
|
||||
title: '监测点名称',
|
||||
field: 'lineName',
|
||||
align: 'center',
|
||||
minWidth: 150,
|
||||
formatter: (row: any) => {
|
||||
return row.cellValue ? row.cellValue : '/'
|
||||
} },
|
||||
{ title: '设备名称', field: 'equipmentName', align: 'center', minWidth: 150, },
|
||||
{ title: '项目名称', field: 'projectName', align: 'center', minWidth: 150, },
|
||||
{ title: '工程名称', field: 'engineeringName', align: 'center', minWidth: 150, },
|
||||
}
|
||||
},
|
||||
{ title: '设备名称', field: 'equipmentName', align: 'center', minWidth: 150 },
|
||||
{ title: '项目名称', field: 'projectName', align: 'center', minWidth: 150 },
|
||||
{ title: '工程名称', field: 'engineeringName', align: 'center', minWidth: 150 },
|
||||
|
||||
|
||||
{ title: '事件描述', field: 'showName', align: 'center', minWidth: 250, }
|
||||
{ title: '事件描述', field: 'showName', align: 'center', minWidth: 250 }
|
||||
],
|
||||
beforeSearchFun: () => { }
|
||||
beforeSearchFun: () => {}
|
||||
})
|
||||
|
||||
provide('tableStore', tableStore)
|
||||
@@ -84,33 +95,40 @@ provide('tableStore', tableStore)
|
||||
// "type": "",
|
||||
// "userId": ""
|
||||
tableStore.table.params.searchValue = ''
|
||||
// tableStore.table.params.engineeringid = ''
|
||||
// tableStore.table.params.deviceTypeId = ''
|
||||
// tableStore.table.params.projectId = ''
|
||||
// tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.engineeringid = ''
|
||||
tableStore.table.params.projectId = ''
|
||||
tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.lineId = ''
|
||||
tableStore.table.params.cascader = ''
|
||||
tableStore.table.params.type = 1
|
||||
// tableStore.table.params.eventIds = []
|
||||
// tableStore.table.params.status = ''
|
||||
// tableStore.table.params.target = []
|
||||
// tableStore.table.params.userId = ''
|
||||
// tableStore.table.params.cascader = ''
|
||||
// tableStore.table.params.deviceTypeName = ''
|
||||
// tableStore.table.params.level=''
|
||||
|
||||
const deviceTreeOptions = ref<any>(props.deviceTree)
|
||||
deviceTreeOptions.value.map((item: any, index: any) => {
|
||||
if (item?.children.length == 0) {
|
||||
deviceTreeOptions.value.splice(index, 1)
|
||||
}
|
||||
})
|
||||
const filterNode = createTreeFilterNode()
|
||||
|
||||
const onTreeClear = () => {
|
||||
tableStore.table.params.engineeringid = ''
|
||||
tableStore.table.params.projectId = ''
|
||||
tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.lineId = ''
|
||||
}
|
||||
|
||||
const sourceChange = (e: any) => {
|
||||
onTreeClear()
|
||||
if (e.level == 0) {
|
||||
tableStore.table.params.engineeringid = e.id
|
||||
} else if (e.level == 1) {
|
||||
tableStore.table.params.projectId = e.id
|
||||
} else if (e.level == 2) {
|
||||
tableStore.table.params.deviceId = e.id
|
||||
} else if (e.level == 3) {
|
||||
tableStore.table.params.lineId = e.id
|
||||
}
|
||||
}
|
||||
onMounted(() => {
|
||||
tableStore.index()
|
||||
})
|
||||
setTimeout(() => {
|
||||
tableStore.table.height = mainHeight(200).height as any
|
||||
}, 0)
|
||||
const addMenu = () => { }
|
||||
const addMenu = () => {}
|
||||
</script>
|
||||
<style></style>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<div ref="refheader" v-show="!isWaveCharts" style="width: 100%">
|
||||
<TableHeader datePicker showExport showCustomColumn @onResetForm="onResetForm">
|
||||
<template v-slot:select>
|
||||
<!-- <el-form-item label="设备选取">
|
||||
<el-form-item label="设备选取">
|
||||
<el-tree-select
|
||||
v-model="tableStore.table.params.cascader"
|
||||
:data="deviceTreeOptions"
|
||||
:data="deviceTree"
|
||||
clearable
|
||||
:props="treeProps"
|
||||
filterable
|
||||
@@ -13,10 +13,12 @@
|
||||
check-strictly
|
||||
default-expand-all
|
||||
placeholder="请选择需要筛选的数据"
|
||||
@node-click="sourceChange"
|
||||
@clear="onTreeClear"
|
||||
style="width: 100%"
|
||||
></el-tree-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="关键字筛选">
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="关键字筛选">
|
||||
<el-input
|
||||
maxlength="32"
|
||||
show-word-limit
|
||||
@@ -25,7 +27,7 @@
|
||||
clearable
|
||||
placeholder="请输入监测点名称"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<!-- <el-form-item>
|
||||
<el-button type="primary" plain @click="openFilterDialog">事件筛选</el-button>
|
||||
</el-form-item> -->
|
||||
@@ -309,17 +311,14 @@ provide('tableStore', tableStore)
|
||||
// "type": "",
|
||||
// "userId": ""
|
||||
tableStore.table.params.searchValue = ''
|
||||
// tableStore.table.params.engineeringid = ''
|
||||
// tableStore.table.params.projectId = ''
|
||||
// tableStore.table.params.deviceTypeId = ''
|
||||
// tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.engineeringid = ''
|
||||
tableStore.table.params.projectId = ''
|
||||
tableStore.table.params.deviceId = ''
|
||||
tableStore.table.params.lineId = ''
|
||||
tableStore.table.params.cascader = ''
|
||||
|
||||
tableStore.table.params.type = 0
|
||||
// tableStore.table.params.eventIds = []
|
||||
// tableStore.table.params.status = ''
|
||||
// tableStore.table.params.target = []
|
||||
// tableStore.table.params.userId = ''
|
||||
// tableStore.table.params.cascader = ''
|
||||
// tableStore.table.params.deviceTypeName = ''
|
||||
|
||||
Object.assign(tableStore.table.params, {
|
||||
featureAmplitudeMin: undefined,
|
||||
featureAmplitudeMax: undefined,
|
||||
@@ -334,54 +333,26 @@ Object.assign(tableStore.table.params, {
|
||||
const openFilterDialog = () => {
|
||||
filterVisible.value = true
|
||||
}
|
||||
|
||||
const deviceTreeOptions: any = ref<any>(props.deviceTree)
|
||||
deviceTreeOptions.value.map((item: any, index: any) => {
|
||||
if (item?.children.length == 0) {
|
||||
deviceTreeOptions.value.splice(index, 1)
|
||||
}
|
||||
})
|
||||
const sourceChange = (e: any) => {
|
||||
tableStore.table.params.deviceTypeId = ''
|
||||
const onTreeClear = () => {
|
||||
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
|
||||
tableStore.table.params.deviceTypeName = 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] || ''
|
||||
tableStore.table.params.deviceId = e[3] || ''
|
||||
}
|
||||
}
|
||||
|
||||
// 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] || ''
|
||||
// }
|
||||
tableStore.table.params.lineId = ''
|
||||
}
|
||||
|
||||
const sourceChange = (e: any) => {
|
||||
onTreeClear()
|
||||
if (e.level == 0) {
|
||||
tableStore.table.params.engineeringid = e.id
|
||||
} else if (e.level == 1) {
|
||||
tableStore.table.params.projectId = e.id
|
||||
} else if (e.level == 2) {
|
||||
tableStore.table.params.deviceId = e.id
|
||||
} else if (e.level == 3) {
|
||||
tableStore.table.params.lineId = e.id
|
||||
}
|
||||
}
|
||||
|
||||
const filterNode = createTreeFilterNode()
|
||||
const onFilterConfirm = () => {
|
||||
tableStore.onTableAction('search', {})
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
<Transient
|
||||
v-if="!showEventStatistics"
|
||||
:deviceTree="deviceTree"
|
||||
:key="key"
|
||||
@statistics="showEventStatistics = true"
|
||||
/>
|
||||
<eventStatistics v-else @back="showEventStatistics = false" />
|
||||
@@ -14,13 +13,13 @@
|
||||
|
||||
</el-tab-pane> -->
|
||||
<el-tab-pane label="稳态越限告警" name="3">
|
||||
<Steady v-if="activeName == '3'" :deviceTree="deviceTree" :key="key" />
|
||||
<Steady :deviceTree="deviceTree" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="设备告警" name="1">
|
||||
<Device v-if="activeName == '1'" :deviceTree="deviceTree" :key="key" />
|
||||
<Device :deviceTree="deviceTree" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="前置告警" name="2">
|
||||
<Front v-if="activeName == '2'" :deviceTree="deviceTree" :key="key" />
|
||||
<Front />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
</div>
|
||||
@@ -48,9 +47,8 @@ watch(activeName, val => {
|
||||
}
|
||||
})
|
||||
getLineTree({ type: 'engineering' }).then(res => {
|
||||
|
||||
deviceTree.value = res.data
|
||||
key.value += 1
|
||||
|
||||
activeName.value = '4'
|
||||
})
|
||||
onMounted(() => {})
|
||||
|
||||
Reference in New Issue
Block a user