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

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

View File

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

View File

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

View File

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

View File

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

View File

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