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

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

@@ -7,28 +7,19 @@
<Icon class="ba-icon-dark" v-if="field.render == 'icon'" :name="fieldValue ? fieldValue : field.default ?? ''" />
<!-- switch -->
<el-switch
v-if="field.render == 'switch'"
@change="onChangeField(field, $event)"
:model-value="fieldValue.toString()"
:loading="row.loading"
:active-value="field.activeValue"
:inactive-value="field.inactiveValue"
/>
<el-switch v-if="field.render == 'switch'" @change="onChangeField(field, $event)"
:model-value="fieldValue.toString()" :loading="row.loading" :active-value="field.activeValue"
:inactive-value="field.inactiveValue" />
<!-- image -->
<div v-if="field.render == 'image' && fieldValue" class="ba-render-image">
<el-image
:hide-on-click-modal="true"
:preview-teleported="true"
:preview-src-list="[fullUrl(fieldValue)]"
:src="fieldValue.length > 100 ? fieldValue : fullUrl(fieldValue)"
></el-image>
<el-image :hide-on-click-modal="true" :preview-teleported="true" :preview-src-list="[fullUrl(fieldValue)]"
:src="fieldValue.length > 100 ? fieldValue : fullUrl(fieldValue)"></el-image>
</div>
<!-- tag -->
<div v-if="field.render == 'tag' && fieldValue !== ''">
<el-tag :type="getTagType(fieldValue, field.custom) || 'primary'" size="small">
<el-tag :type="getTagType(fieldValue, field.custom) || 'primary'" :effect="field.effect ||'light'" size="small">
{{ field.replaceValue ? field.replaceValue[fieldValue] : fieldValue }}
</el-tag>
</div>
@@ -44,55 +35,28 @@
</div>
<!-- customTemplate 自定义模板 -->
<div
v-if="field.render == 'customTemplate'"
v-html="field.customTemplate ? field.customTemplate(row, field, fieldValue, column, index) : ''"
></div>
<div v-if="field.render == 'customTemplate'"
v-html="field.customTemplate ? field.customTemplate(row, field, fieldValue, column, index) : ''"></div>
<!-- 自定义组件/函数渲染 -->
<component
v-if="field.render == 'customRender'"
:is="field.customRender"
:renderRow="row"
:renderField="field"
:renderValue="fieldValue"
:renderColumn="column"
:renderIndex="index"
/>
<component v-if="field.render == 'customRender'" :is="field.customRender" :renderRow="row" :renderField="field"
:renderValue="fieldValue" :renderColumn="column" :renderIndex="index" />
<!-- 按钮组 -->
<div v-if="field.render == 'buttons' && buttons" class="cn-render-buttons">
<template v-for="(btn, idx) in buttons" :key="idx">
<!-- 常规按钮 -->
<el-button
link
v-if="btn.render == 'basicButton'"
@click="onButtonClick(btn)"
:class="btn.class"
class="table-operate"
:type="btn.type"
:disabled="btn.showDisabled && btn.showDisabled(row, field)"
:loading="props.row.loading || false"
v-bind="btn.attr"
>
<el-button link v-if="btn.render == 'basicButton'" @click="onButtonClick(btn)" :class="btn.class"
class="table-operate" :type="btn.type" :disabled="btn.showDisabled && btn.showDisabled(row, field)"
:loading="props.row.loading || false" v-bind="btn.attr">
<div v-if="btn.text || btn.title" class="table-operate-text">{{ btn.text || btn.title }}</div>
</el-button>
<!-- 带提示信息的按钮 -->
<el-tooltip
v-if="btn.render == 'tipButton'"
:disabled="btn.title && !btn.disabledTip ? false : true"
:content="btn.title"
placement="top"
>
<el-button
link
@click="onButtonClick(btn)"
:class="btn.class"
class="table-operate"
:type="btn.type"
v-bind="btn.attr"
>
<el-tooltip v-if="btn.render == 'tipButton'" :disabled="btn.title && !btn.disabledTip ? false : true"
:content="btn.title" placement="top">
<el-button link @click="onButtonClick(btn)" :class="btn.class" class="table-operate" :type="btn.type"
v-bind="btn.attr">
<div v-if="btn.text || btn.title" class="table-operate-text">
{{ btn.text || btn.title }}
</div>
@@ -100,12 +64,8 @@
</el-tooltip>
<!-- 带确认框的按钮 -->
<el-popconfirm
v-if="btn.render == 'confirmButton'"
:disabled="btn.disabled && btn.disabled(row, field)"
v-bind="btn.popconfirm"
@confirm="onButtonClick(btn)"
>
<el-popconfirm v-if="btn.render == 'confirmButton'" :disabled="btn.disabled && btn.disabled(row, field)"
v-bind="btn.popconfirm" @confirm="onButtonClick(btn)">
<template #reference>
<div style="display: inline-block">
<el-button link :class="btn.class" class="table-operate" :type="btn.type" v-bind="btn.attr">
@@ -123,15 +83,10 @@
</el-button>
<template #dropdown>
<el-dropdown-menu>
<el-dropdown-item
v-for="item in btn.buttons"
:key="item.text"
:command="item"
:disabled="item.showDisabled && item.showDisabled(row, field)"
:style="{
<el-dropdown-item v-for="item in btn.buttons" :key="item.text" :command="item"
:disabled="item.showDisabled && item.showDisabled(row, field)" :style="{
color: item.type === 'primary' ? 'var(--el-color-primary)' : 'var(--el-color-danger)'
}"
>
}">
{{ item.text }}
</el-dropdown-item>
</el-dropdown-menu>
@@ -233,29 +188,36 @@ const handlerCommand = (item: OptButton) => {
.m-10 {
margin: 4px;
}
.ba-render-image {
text-align: center;
}
.images-item {
width: 50px;
margin: 0 5px;
}
.el-image {
height: 36px;
// width: 36px;
}
.table-operate-text {
padding-left: 5px;
font-size: 12px;
}
.table-operate {
padding: 4px 5px;
height: auto;
}
.cn-render-buttons {
display: flex;
align-items: center;
justify-content: center;
.icon {
font-size: 12px !important;
// color: var(--ba-bg-color-overlay) !important;
@@ -265,18 +227,22 @@ const handlerCommand = (item: OptButton) => {
.move-button {
cursor: move;
}
.ml-6 {
display: inline-flex;
vertical-align: middle;
margin-left: 6px;
}
.ml-6 + .el-button {
.ml-6+.el-button {
margin-left: 6px;
}
.ba-render-color {
height: 25px;
width: 100%;
}
.cn-render-buttons {
:deep(.el-button) {
margin-left: 0;

View File

@@ -53,8 +53,7 @@ const editorConfig = {
meta: { path: '/supervision/' },
timeout: 0,
customInsert(res: any, insertFn: InsertFnType) {
console.log('🚀 ~ customInsert ~ res:', res)
insertFn(res.data.url, 'image', res.data.url)
insertFn(res.data.url.split('?')[0], 'image', res.data.url.split('?')[0])
}
}
}

View File

@@ -1,5 +1,7 @@
<template>
<component :is="config.layout.layoutMode"></component>
<div>
<component :is="config.layout.layoutMode"></component>
</div>
</template>
<script setup lang="ts">
@@ -51,10 +53,10 @@ onBeforeMount(() => {
})
const init = async () => {
await Promise.all([getAreaList(), dictDataCache(), getUserById(), areaSelect(),getAllUserSimpleList()]).then(res => {
await Promise.all([getAreaList(), dictDataCache(), getUserById(), areaSelect(), getAllUserSimpleList()]).then(res => {
dictData.state.area = res[0].data
dictData.state.basic = res[1].data
dictData.state.userList=res[4].data
dictData.state.userList = res[4].data
adminInfo.dataFill(res[2].data)
dictData.state.areaTree = res[3].data
})
@@ -79,6 +81,7 @@ const init = async () => {
if (item.children) {
handlerMenu(item.children)
}
})
}
handlerMenu(res.data)

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,12 +516,15 @@ 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 //完整性告警
@@ -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,