修改异常数据页面、修改有功功率趋势分析页面接口
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
<!--业务用户管理界面-->
|
||||
<template>
|
||||
<div>
|
||||
<TableHeader date-picker>
|
||||
<TableHeader date-picker ref="TableHeaderRef">
|
||||
<template v-slot:select>
|
||||
<el-form-item label="对象类型">
|
||||
<el-select
|
||||
@@ -22,7 +21,7 @@
|
||||
|
||||
<template v-slot:operation></template>
|
||||
</TableHeader>
|
||||
<div class="card-list pt10">
|
||||
<div class="card-list pt10" v-loading="loading">
|
||||
<div class="monitoringPoints">
|
||||
<el-card style="height: 200px">
|
||||
<template #header>
|
||||
@@ -38,9 +37,9 @@
|
||||
<span class="divBox_num" style="color: #57bc6e">{{ monitoringPoints.runNum }}</span>
|
||||
</div>
|
||||
<div class="divBox" style="width: 200px">
|
||||
<span class="iconfont icon-yichang" style="color: #ff0000"></span>
|
||||
<span class="iconfont icon-yichang" style="color: #FFBF00"></span>
|
||||
<span class="divBox_title">告警测点数</span>
|
||||
<span class="divBox_num" style="color: #ff0000">
|
||||
<span class="divBox_num" style="color: #FFBF00">
|
||||
{{ monitoringPoints.abnormalNum }}
|
||||
</span>
|
||||
</div>
|
||||
@@ -66,9 +65,7 @@
|
||||
<span>告警指标统计</span>
|
||||
</div>
|
||||
</template>
|
||||
<div class="mb5" style="height: 40px">
|
||||
<el-segmented style="height: 100%" v-model="segmented" :options="segmentedList" block />
|
||||
</div>
|
||||
|
||||
<div class="header">
|
||||
<span style="flex: 1; text-align: left">指标名称</span>
|
||||
|
||||
@@ -77,15 +74,16 @@
|
||||
<div :style="indicatorHeight" style="overflow-y: auto">
|
||||
<div v-for="o in abnormal" class="abnormal mb10">
|
||||
<span style="flex: 1; height: 24px" class="iconDiv">
|
||||
<div :style="{ backgroundColor: o.ids.length > 0 ? '#ff9800' : '' }"></div>
|
||||
<div :style="{ backgroundColor: o.ids.length > 0 ? '#FFBF00' : '' }"></div>
|
||||
{{ o.targetName }}
|
||||
</span>
|
||||
|
||||
<span style="width: 110px; text-align: center">
|
||||
<span
|
||||
style="color: #ff9800; cursor: pointer; text-decoration: underline"
|
||||
style="color: #388e3c"
|
||||
:class="` ${o.ids.length > 0 ? 'text-red' : ''}`"
|
||||
class="text"
|
||||
@click="quantityClick(o)"
|
||||
@click="quantityClick(o, 0)"
|
||||
>
|
||||
{{ o.ids.length }}
|
||||
</span>
|
||||
@@ -122,12 +120,64 @@
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item class="form_but">
|
||||
<el-button type="primary" icon="el-icon-Refresh">更新</el-button>
|
||||
<el-button type="primary" icon="el-icon-Download">导出</el-button>
|
||||
<el-button type="primary" @click="MonitorVerify" icon="el-icon-Refresh">更新</el-button>
|
||||
<el-button type="primary" @click="onExport" icon="el-icon-Download">导出</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<!--表格-->
|
||||
<Table ref="tableRef"></Table>
|
||||
<div :style="{ height: tableStore.table.height }" v-loading="tableStore.table.loading">
|
||||
<vxe-table height="auto" :data="tableStore.table.data" v-bind="defaultAttribute" ref="tableRef">
|
||||
<vxe-column type="seq" title="序号" width="80px">
|
||||
<template #default="{ rowIndex }">
|
||||
<span>
|
||||
{{
|
||||
(tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize +
|
||||
rowIndex +
|
||||
1
|
||||
}}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="monitorName" title="监测点名称">
|
||||
<template #default="{ row }">
|
||||
<span class="table_name">
|
||||
{{ row.monitorName }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="devName" title="所属终端名称">
|
||||
<template #default="{ row }">
|
||||
<span class="table_name">
|
||||
{{ row.devName }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="stationName" title="所属电站">
|
||||
<template #default="{ row }">
|
||||
<span class="table_name">
|
||||
{{ row.stationName }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="objType" title="监测对象类型" :formatter="formatter"></vxe-column>
|
||||
<vxe-column field="objName" title="监测对象名称" :formatter="formatter"></vxe-column>
|
||||
<vxe-column field="voltageLevel" title="电压等级"></vxe-column>
|
||||
<vxe-column field="abnormalDay" title="告警天数">
|
||||
<template #default="{ row }">
|
||||
<span class="table_name" @click="quantityClick(row, 1)">
|
||||
{{ row.abnormalDay }}
|
||||
</span>
|
||||
</template>
|
||||
</vxe-column>
|
||||
<vxe-column field="abnormalDay" title="严重度">
|
||||
<template #default="{ row }">
|
||||
<el-tag type="warning" v-if="row.severity == 0">预警</el-tag>
|
||||
<el-tag type="danger" v-if="row.severity == 1">告警</el-tag>
|
||||
</template>
|
||||
</vxe-column>
|
||||
</vxe-table>
|
||||
</div>
|
||||
<!-- <Table ref="tableRef"></Table> -->
|
||||
</el-card>
|
||||
</div>
|
||||
<alarmDetails ref="alarmDetailsRef" />
|
||||
@@ -139,178 +189,63 @@ import TableStore from '@/utils/tableStore'
|
||||
import Table from '@/components/table/index.vue'
|
||||
import TableHeader from '@/components/table/header/index.vue'
|
||||
import { onMounted, provide, ref } from 'vue'
|
||||
import { defaultAttribute } from '@/components/table/defaultAttribute'
|
||||
import { useDictData } from '@/stores/dictData'
|
||||
import { mainHeight } from '@/utils/layout'
|
||||
import MyEchart from '@/components/echarts/MyEchart.vue'
|
||||
import alarmDetails from './alarmDetails.vue'
|
||||
import { useConfig } from '@/stores/config'
|
||||
import { getMonitorLimitDataDay } from '@/api/device-boot/dataVerify'
|
||||
import { queryFirstNode } from '@/api/auth'
|
||||
|
||||
const alarmDetailsRef = ref()
|
||||
const dictData = useDictData()
|
||||
//字典获取监督对象类型
|
||||
const objTypeList: any = ref([])
|
||||
const pageHeight = mainHeight(155)
|
||||
const indicatorHeight = mainHeight(507)
|
||||
const tableRef = ref()
|
||||
const pageHeight = mainHeight(157)
|
||||
const indicatorHeight = mainHeight(462)
|
||||
|
||||
const monitoringPoints = ref({
|
||||
runNum: 0,
|
||||
abnormalNum: 0
|
||||
})
|
||||
|
||||
const tableRef = ref()
|
||||
const percentage = ref({})
|
||||
const loading = ref(false)
|
||||
const TableHeaderRef = ref()
|
||||
const abnormal: any = ref([])
|
||||
const mapList: any = ref([])
|
||||
const segmented = ref(1)
|
||||
const segmentedList = [
|
||||
{
|
||||
label: '基础数据',
|
||||
value: 1
|
||||
},
|
||||
{
|
||||
label: '稳态数据',
|
||||
value: 2
|
||||
},
|
||||
{
|
||||
label: '暂态数据',
|
||||
value: 3
|
||||
}
|
||||
]
|
||||
const time = ref(['', ''])
|
||||
|
||||
const tableStore = new TableStore({
|
||||
url: '/device-boot/dataVerify/getMonitorVerifyData',
|
||||
url: '/device-boot/dataVerify/getMonitorLimitData',
|
||||
method: 'POST',
|
||||
showPage: false,
|
||||
publicHeight: 480,
|
||||
column: [
|
||||
{
|
||||
title: '序号',
|
||||
width: 80,
|
||||
formatter: (row: any) => {
|
||||
return (tableStore.table.params.pageNum - 1) * tableStore.table.params.pageSize + row.rowIndex + 1
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '监测点名称',
|
||||
field: 'monitorName',
|
||||
type: 'html',
|
||||
formatter: (row, column) => {
|
||||
return `<div class="table_name">${row.cellValue}</div>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '所属终端名称',
|
||||
field: 'devName',
|
||||
type: 'html',
|
||||
formatter: (row, column) => {
|
||||
return `<div class="table_name">测试终端</div>`
|
||||
// `<div class="table_name">${row.cellValue}</div>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '所属电站',
|
||||
field: 'stationName',
|
||||
type: 'html',
|
||||
formatter: (row, column) => {
|
||||
return `<div class="table_name">${row.cellValue}</div>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '监测对象类型',
|
||||
field: 'objType',
|
||||
formatter: (row, column) => {
|
||||
return `测试光伏电站`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '监测对象名称',
|
||||
field: 'objName',
|
||||
formatter: (row, column) => {
|
||||
return `测试对象`
|
||||
}
|
||||
},
|
||||
{ title: '电压等级', field: 'voltageLevel' },
|
||||
{
|
||||
title: '告警天数',
|
||||
field: 'abnormalDay',
|
||||
type: 'html',
|
||||
formatter: (row, column) => {
|
||||
return `<div class="table_name">${row.cellValue}</div>`
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '严重度',
|
||||
field: 'severity',
|
||||
render: 'tag',
|
||||
custom: {
|
||||
0: 'warning',
|
||||
1: 'danger'
|
||||
},
|
||||
|
||||
replaceValue: {
|
||||
0: '预警',
|
||||
1: '告警'
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
width: '120',
|
||||
render: 'buttons',
|
||||
buttons: [
|
||||
{
|
||||
name: 'edit',
|
||||
title: '工单',
|
||||
type: 'primary',
|
||||
icon: 'el-icon-Plus',
|
||||
render: 'basicButton',
|
||||
click: row => {}
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
filename: '稳态告警统计',
|
||||
publicHeight: 530,
|
||||
column: [],
|
||||
beforeSearchFun: () => {
|
||||
loading.value = true
|
||||
time.value = [tableStore.table.params.startTime, tableStore.table.params.endTime]
|
||||
},
|
||||
loadCallback: () => {
|
||||
console.log('🚀 ~ abnormal.value:', tableStore.table.data)
|
||||
// console.log('🚀 ~ abnormal.value:', tableStore.table.data)
|
||||
monitoringPoints.value.runNum = tableStore.table.data.runNum //总数
|
||||
monitoringPoints.value.abnormalNum = tableStore.table.data.abnormalNum //告警测点数
|
||||
abnormal.value = tableStore.table.data.targetList
|
||||
mapList.value = tableStore.table.data.mapList
|
||||
tableStore.table.allData = tableStore.table.data.monitorAlarmInfo
|
||||
tableStore.table.data = tableStore.table.data.monitorAlarmInfo
|
||||
|
||||
echart()
|
||||
loading.value = false
|
||||
}
|
||||
})
|
||||
|
||||
const options = ref({
|
||||
title: {
|
||||
text: '监测点告警情况(2025-03-01~2025-03-10)'
|
||||
},
|
||||
legend: {
|
||||
show: false
|
||||
},
|
||||
xAxis: {
|
||||
name: '时间',
|
||||
|
||||
axisLine: {
|
||||
show: true
|
||||
},
|
||||
|
||||
data: ['03-01', '03-02', '03-03', '03-04', '03-05', '03-06', '03-07', '03-08', '03-09', '03-10']
|
||||
},
|
||||
yAxis: {
|
||||
name: '数量' // 给X轴加单位
|
||||
},
|
||||
grid: {},
|
||||
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
name: '告警监测点数量',
|
||||
type: 'bar',
|
||||
|
||||
data: [11, 11, 11, 11, 0, 0, 0, 0, 0, 0]
|
||||
}
|
||||
]
|
||||
}
|
||||
})
|
||||
const options = ref({})
|
||||
const echart = () => {
|
||||
percentage.value = {
|
||||
color: ['#ff9800'],
|
||||
color: ['#FFBF00'],
|
||||
options: {
|
||||
dataZoom: null,
|
||||
toolbox: {
|
||||
@@ -318,8 +253,8 @@ const echart = () => {
|
||||
},
|
||||
grid: {
|
||||
top: '0%',
|
||||
left: '2%',
|
||||
right: '2%',
|
||||
left: '0%',
|
||||
right: '0%',
|
||||
bottom: '0%'
|
||||
},
|
||||
tooltip: {
|
||||
@@ -340,11 +275,41 @@ const echart = () => {
|
||||
],
|
||||
|
||||
series: [
|
||||
{
|
||||
name: '告警总数',
|
||||
type: 'bar',
|
||||
barWidth: 12,
|
||||
data: [100],
|
||||
z: 0,
|
||||
zlevel: 0,
|
||||
itemStyle: {
|
||||
normal: {
|
||||
color: {
|
||||
type: 'linear',
|
||||
x: 0,
|
||||
y: 0,
|
||||
x2: 1,
|
||||
y2: 0,
|
||||
colorStops: [
|
||||
{
|
||||
offset: 1,
|
||||
color: '#57bc6e' // 100% 处的颜色
|
||||
}
|
||||
],
|
||||
global: false // 缺省为 false
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
name: '告警占比',
|
||||
type: 'bar',
|
||||
barWidth: 12,
|
||||
data: [((monitoringPoints.value.abnormalNum / monitoringPoints.value.runNum) * 100).toFixed(2)],
|
||||
data: [
|
||||
((monitoringPoints.value.abnormalNum / monitoringPoints.value.runNum) * 100) == 0
|
||||
? ''
|
||||
: ((monitoringPoints.value.abnormalNum / monitoringPoints.value.runNum) * 100).toFixed(2)
|
||||
],
|
||||
z: 0,
|
||||
zlevel: 0,
|
||||
|
||||
@@ -359,11 +324,11 @@ const echart = () => {
|
||||
colorStops: [
|
||||
{
|
||||
offset: 0,
|
||||
color: '#ff0007' // 0% 处的颜色
|
||||
color: '#FFBF00' // 0% 处的颜色
|
||||
},
|
||||
{
|
||||
offset: 1,
|
||||
color: '#E22331' // 100% 处的颜色
|
||||
color: '#FFBF00' // 100% 处的颜色
|
||||
}
|
||||
],
|
||||
global: false // 缺省为 false
|
||||
@@ -382,7 +347,7 @@ const echart = () => {
|
||||
// symbolMargin: 300,
|
||||
symbol: 'rect',
|
||||
symbolClip: true,
|
||||
symbolSize: [2, 15],
|
||||
symbolSize: [2, 20],
|
||||
symbolPosition: 'start',
|
||||
symbolOffset: [0, 0],
|
||||
data: [100],
|
||||
@@ -390,9 +355,9 @@ const echart = () => {
|
||||
zlevel: 0
|
||||
},
|
||||
{
|
||||
name: '机器故障率',
|
||||
name: '',
|
||||
type: 'bar',
|
||||
barGap: '-125%',
|
||||
barGap: '-110%',
|
||||
data: [100],
|
||||
barWidth: 18,
|
||||
|
||||
@@ -408,16 +373,92 @@ const echart = () => {
|
||||
]
|
||||
}
|
||||
}
|
||||
options.value = {
|
||||
title: {
|
||||
text: `监测点告警统计(${mapList.value[0].time} ~ ${mapList.value[mapList.value.length - 1].time})`
|
||||
},
|
||||
xAxis: {
|
||||
name: '时间',
|
||||
axisLine: {
|
||||
show: true
|
||||
},
|
||||
data: mapList.value.map(item => item.time),
|
||||
axisLabel: {
|
||||
formatter: function (value) {
|
||||
let time = ''
|
||||
if (value.slice(-2) == '01') {
|
||||
time = value
|
||||
} else {
|
||||
time = value.slice(5, 10)
|
||||
}
|
||||
return time
|
||||
}
|
||||
}
|
||||
},
|
||||
yAxis: {
|
||||
name: '数量' // 给X轴加单位
|
||||
},
|
||||
grid: {},
|
||||
color: ['#FFBF00'],
|
||||
options: {
|
||||
series: [
|
||||
{
|
||||
name: '告警监测点数量',
|
||||
type: 'bar',
|
||||
|
||||
data: mapList.value.map(item => item.val)
|
||||
// mapList.value.map(item => ({
|
||||
// value: [item.time, item.val]
|
||||
// }))
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
tableStore.table.params.deptId = dictData.state.area[0].id
|
||||
tableStore.table.params.objType = ''
|
||||
tableStore.table.params.alarmDayLimit = 5
|
||||
tableStore.table.params.warnDayLimit = 1
|
||||
|
||||
const quantityClick = (e: any) => {
|
||||
alarmDetailsRef.value.open(e)
|
||||
const quantityClick = (e: any, num: number) => {
|
||||
if (num == 0 && e.ids?.length == 0) return
|
||||
alarmDetailsRef.value.open(e, time.value, num)
|
||||
}
|
||||
// 更新
|
||||
const MonitorVerify = () => {
|
||||
tableStore.table.loading = true
|
||||
getMonitorLimitDataDay(tableStore.table.params).then(res => {
|
||||
tableStore.table.data = res.data
|
||||
tableStore.table.allData = res.data
|
||||
tableStore.table.loading = false
|
||||
})
|
||||
}
|
||||
const formatter = (row: any) => {
|
||||
return row.cellValue || '/'
|
||||
}
|
||||
// 导出
|
||||
const onExport = () => {
|
||||
tableRef.value?.exportData({
|
||||
filename: tableStore.table.filename, // 文件名字
|
||||
sheetName: 'Sheet1',
|
||||
type: 'xlsx', //导出文件类型 xlsx 和 csv
|
||||
useStyle: true,
|
||||
data: tableStore.table.data, // 数据源 // 过滤那个字段导出
|
||||
columnFilterMethod: function (column: any) {
|
||||
return !(
|
||||
column.column.title === undefined ||
|
||||
column.column.title === '序号' ||
|
||||
column.column.title === '操作'
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
onMounted(() => {
|
||||
TableHeaderRef.value.setDatePicker([
|
||||
{ label: '年份', value: 1 },
|
||||
{ label: '季度', value: 2 },
|
||||
{ label: '月份', value: 3 }
|
||||
])
|
||||
queryFirstNode({ type: 0 }).then(res => {
|
||||
objTypeList.value = res.data
|
||||
})
|
||||
@@ -437,8 +478,9 @@ provide('tableStore', tableStore)
|
||||
.statistics {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-between;
|
||||
margin-bottom: 10px;
|
||||
.divBox {
|
||||
margin: 0 10px 10px 0;
|
||||
width: 200px;
|
||||
height: 70px;
|
||||
padding: 10px;
|
||||
@@ -464,7 +506,7 @@ provide('tableStore', tableStore)
|
||||
background-color: #eef8f0;
|
||||
}
|
||||
&:nth-child(2) {
|
||||
background-color: #ffd7d7;
|
||||
background-color: #fff6ed;
|
||||
}
|
||||
&:nth-child(3) {
|
||||
background-color: #e5f8f6;
|
||||
@@ -546,7 +588,7 @@ provide('tableStore', tableStore)
|
||||
font-weight: 600;
|
||||
div:nth-child(2) {
|
||||
font-size: 16px;
|
||||
color: #ff0000;
|
||||
color: #FFBF00;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -559,4 +601,9 @@ provide('tableStore', tableStore)
|
||||
:deep(.el-segmented) {
|
||||
clip-path: polygon(4% 0, 100% 0, 96% 100%, 0 100%);
|
||||
}
|
||||
.text-red {
|
||||
color: #FFBF00 !important;
|
||||
cursor: pointer;
|
||||
text-decoration: underline;
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user