修改 电网一张图告警明细数据

This commit is contained in:
GGJ
2024-10-21 19:15:45 +08:00
parent 96ea25d0a6
commit 2e364d82ed
8 changed files with 274 additions and 116 deletions

View File

@@ -31,6 +31,7 @@
collapse-tags
placeholder="请选择区域"
/>
<!-- <el-tree
ref="tree"
v-model="formData.deptName"

View File

@@ -0,0 +1,184 @@
<template>
<div class="default-main">
<TableHeader area>
<template #select>
<el-form-item label="统计类型:">
<el-select v-model="tableStore.table.params.statisticalType" placeholder="请选择统计类型" value-key="id">
<el-option v-for="item in classificationData" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="电压等级:">
<el-select v-model="tableStore.table.params.scale" filterable multiple collapse-tags clearable
placeholder="请选择电压等级" value-key="id">
<el-option v-for="item in voltageleveloption" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="终端厂家:">
<el-select v-model="tableStore.table.params.manufacturer" filterable multiple collapse-tags
clearable placeholder="请选择终端厂家" value-key="id">
<el-option v-for="item in terminaloption" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="干扰源类型:">
<el-select v-model="tableStore.table.params.loadType" filterable multiple collapse-tags clearable
placeholder="请选择干扰源类型" value-key="id">
<el-option v-for="item in interfereoption" :key="item.id" :label="item.name" :value="item">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="通讯状态:">
<el-select v-model="tableStore.table.params.comFlag" filterable multiple collapse-tags clearable
placeholder="请选择通讯状态">
<el-option v-for="item in communicationstatus" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="终端状态:">
<el-select v-model="tableStore.table.params.runFlag" filterable multiple collapse-tags clearable
placeholder="请选择终端状态">
<el-option v-for="item in terminalstatus" :key="item.value" :label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="评价筛选">
<el-input v-model="tableStore.table.params.evaluate" clearable placeholder="输入关键字筛选" />
</el-form-item>
</template>
</TableHeader>
<Table ref="tableRef" />
</div>
</template>
<script setup lang="ts">
import { ref, onMounted, provide } from 'vue'
import TableStore from '@/utils/tableStore'
import Table from '@/components/table/index.vue'
import { useDictData } from '@/stores/dictData'
import TableHeader from '@/components/table/header/index.vue'
const dictData = useDictData()
defineOptions({
name: 'harmonic-boot/run/terminalmessage'
})
const view = ref(true)
const classificationData = dictData.getBasicData('Statistical_Type', ["Report_Type", "Voltage_Level", "Load_Type"])
const voltageleveloption = dictData.getBasicData('Dev_Voltage_Stand')
const terminaloption = dictData.getBasicData('Dev_Manufacturers')
const interfereoption = dictData.getBasicData('Interference_Source')
const communicationstatus = [
{ value: 0, label: "中断" },
{ value: 1, label: "正常" },
]
const terminalstatus = [
{ value: 0, label: "投运" },
{ value: 1, label: "热备用" },
{ value: 2, label: "停运" },
]
const tableStore = new TableStore({
url: '/device-boot/runManage/getRuntimeData',
method: 'POST',
isWebPaging: true,
column: [
{
field: 'index',
title: '序号',
width: '60',
formatter: (row: any) => {
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
}
},
{ field: 'areaName', title: '区域' },
{ field: 'gdName', title: '地级区' },
{
field: 'bdName',
title: '供电公司',
minWidth: 100
},
{ field: 'manufacturer', title: '厂家' , minWidth: 100},
{ field: 'devName', title: '终端名称', minWidth: 80 },
{ field: 'ip', title: '网络参数' , minWidth: 100},
{ field: 'loginTime', title: '投运时间', minWidth: 100 },
{ field: 'devType', title: '终端型号', minWidth: 100 },
{ field: 'port', title: '端口', minWidth: 100 },
{ field: 'updateTime', title: '最新数据', minWidth: 100 },
{
field: 'runFlag',
title: '终端状态',
effect: 'dark',
render: 'tag',
custom: {
'投运': 'success',
'热备用': 'warning',
'停运': 'danger',
},
},
{
field: 'comFlag',
title: '通讯状态',
render: 'tag',
effect: 'dark',
custom: {
'正常': 'success',
'中断': 'danger',
},
},
{
field: 'onlineEvaluate',
title: '在线率评价',
render: 'tag',
effect: 'dark',
custom: {
'/': 'info',
'优': 'success',
'良': 'warning',
'差': 'danger',
},
},
],
loadCallback: () => {
tableStore.table.data.map((item: any) => {
item.onlineEvaluate == 3.14159 ? item.onlineEvaluate = '/' : item.onlineEvaluate <= 0.6 ? item.onlineEvaluate = '差' : item.onlineEvaluate <= 0.9 ? item.onlineEvaluate = '良' : item.onlineEvaluate <= 1 ? item.onlineEvaluate = '优' : '/'
})
}
})
tableStore.table.params.statisticalType = classificationData[0]
tableStore.table.params.serverName = "harmonic-boot"
tableStore.table.params.comFlag = []
tableStore.table.params.runFlag = []
tableStore.table.params.evaluate = ''
tableStore.table.params.powerFlag = 2
tableStore.table.params.monitorFlag = 2
tableStore.table.params.scale = []
tableStore.table.params.manufacturer = []
tableStore.table.params.loadType = []
const wp = ref({})
provide('tableStore', tableStore)
onMounted(() => {
tableStore.index()
})
</script>

View File

@@ -38,18 +38,16 @@
</h3>
<el-descriptions title="" border :column="2" size="small">
<el-descriptions-item width="140px" label="告警原因">
<span
style="font-weight: 550"
:style="TargetData.info == 0 ? 'color: #0e8780;' : 'color: #ff0000;'"
>
<span style="font-weight: 550"
:style="TargetData.info == 0 ? 'color: #0e8780;' : TargetData.info == 3 ? 'color: #000' : 'color: #ff0000;'">
{{
TargetData.info == 1
? '超标告警'
: TargetData.info == 2
? '完整性告警'
: TargetData.info == 0
? '无告警'
: ''
? '完整性告警'
: TargetData.info == 0
? '无告警'
: '暂无数据'
}}
</span>
</el-descriptions-item>
@@ -75,11 +73,8 @@
</h3>
<div style="display: flex">
<MyEChart :style="`height: calc(${rowHeight} - 31px)`" :options="ComCharts" @click="Integrity" />
<MyEChart
:style="`height: calc(${rowHeight} - 31px)`"
:options="onLineCharts"
@click="OnlineRate"
/>
<MyEChart :style="`height: calc(${rowHeight} - 31px)`" :options="onLineCharts"
@click="OnlineRate" />
</div>
</el-col>
</el-row>
@@ -98,18 +93,14 @@
<el-col :span="12" style="display: flex">
<div>
综合评估得分:
<span
class="conclusion"
:class="
dropList.assessData == '特质'
? 'background1'
: dropList.assessData == '较差'
? 'background2'
: dropList.assessData == '极差'
<span class="conclusion" :class="dropList.assessData == '特质'
? 'background1'
: dropList.assessData == '较差'
? 'background2'
: dropList.assessData == '极差'
? 'background3'
: ''
"
>
">
{{ dropList.assessData }}
</span>
</div>
@@ -123,18 +114,14 @@
<el-col :span="10" style="display: flex; align-items: center">
<div style="width: 100%">
评估得分
<span
class="conclusion"
:class="
item.avg == '特质'
? 'background1'
: item.avg == '较差'
? 'background2'
: item.avg == '极差'
<span class="conclusion" :class="item.avg == '特质'
? 'background1'
: item.avg == '较差'
? 'background2'
: item.avg == '极差'
? 'background3'
: ''
"
>
">
{{ item.avg }}
</span>
</div>
@@ -529,13 +516,16 @@ const open = async (id: string) => {
TargetData.value = res.data
let num = 0
let flag = 0
let judgment=true
for (let k in res.data) {
if (k != 'lineId') {
flag += res.data[k]
if(res.data[k] != '/'){
judgment=false
}
flag += (res.data[k] == '/' ? 0 : res.data[k])
}
}
// console.log('🚀 ~ getGridDiagramTargetData ~ flag:', flag)
if (IntegrityNum.value == 0) {
num = 2 //完整性告警
} else {
@@ -544,6 +534,9 @@ const open = async (id: string) => {
} else {
num = 0 //无告警
}
if(judgment){
num = 3
}
}
TargetData.value.info = num
@@ -685,29 +678,36 @@ defineExpose({ open })
.lineInfo {
padding: 0 10px 10px 10px;
}
:deep(.el-page-header__header) {
height: 45px;
border-bottom: 1px solid #f1eded;
}
:deep(.el-descriptions__header) {
margin-bottom: 10px;
}
.evaluationData {
display: grid;
grid-template-rows: repeat(5, auto);
height: 87%;
.row {
margin: 4px 2% 0;
width: 100%;
box-shadow: 1px 1px 1px 1px #e8e3e3;
}
img {
width: 6%;
margin: 0px 15px;
}
}
.iconBox {
display: flex;
span {
display: inline-block;
width: 3px;
@@ -717,20 +717,24 @@ defineExpose({ open })
margin-left: 3px;
}
}
.conclusion {
display: inline-block;
padding: 2px 5px;
height: 20px;
border-radius: 4px;
}
.background1 {
background-color: #339966;
color: #fff;
}
.background2 {
background-color: #97017e;
color: #fff;
}
.background3 {
background-color: #cc0000;
color: #fff;

View File

@@ -47,11 +47,10 @@ const info = (res: any) => {
legend: {
type: 'scroll',
orient: 'vertical',
left: 10,
top: '5%',
tooltip: {
show: true
}
top:null,
left: 25,
bottom: 40,
},
xAxis: {
show: false
@@ -92,8 +91,9 @@ const info = (res: any) => {
legend: {
type: 'scroll',
orient: 'vertical',
left: 10,
top: '5%'
top:null,
left: 25,
bottom: 40,
},
tooltip: {
formatter: '{a} <br/>{b} : {c} (次)',

View File

@@ -13,6 +13,7 @@
</el-tabs>
</div>
</template>
<!-- "area": "",
"city": "",
"protocolCapacity": 0,