区域概览未关联暂降次数和已关联处理事件合并

This commit is contained in:
sjl
2026-01-28 10:33:59 +08:00
parent 87af11288d
commit a9fc77eb8b
2 changed files with 47 additions and 50 deletions

View File

@@ -35,8 +35,7 @@
<div class="default-main">
<vxe-table :data="shareData" v-bind="defaultAttribute" height="auto" auto-resize>
<vxe-column field="month" title="月份" min-width="120px" sortable></vxe-column>
<vxe-column field="notAssociated" title="未关联暂降次数" sortable></vxe-column>
<vxe-column field="linked" title="已关联处理事件" sortable></vxe-column>
<vxe-column field="notAssociated" title="电压暂降次数" sortable></vxe-column>
</vxe-table>
</div>
</el-tab-pane>
@@ -102,28 +101,21 @@ const info = (list: any, searchBeginTime: any, searchEndTime: any,selectedAreaNa
]
// let all = 0
let all = 0
// list.monthlyStatistics.monthCalculation.forEach((item: any) => {
// all += item.linked + item.notAssociated
// })
let allNotAssociated = 0
let allLinked= 0
list.monthlyStatistics.monthCalculation.forEach((item: any) => {
allNotAssociated += item.notAssociated
all += item.linked + item.notAssociated
})
list.monthlyStatistics.monthCalculation.forEach((item: any) => {
allLinked += item.linked
})
shareData.value = [
{
month: '总计',
notAssociated: allNotAssociated.toFixed(2),
linked: allLinked.toFixed(2)
notAssociated: all,
},
...list.monthlyStatistics.monthCalculation
...list.monthlyStatistics.monthCalculation.map((item: any) => ({
month: item.month,
notAssociated: item.notAssociated + item.linked
}))
]
}

View File

@@ -48,7 +48,7 @@ const Processing = (list: any) => {
return html
}
},
color: ['#07CCCA'],
legend: {
data: ['暂降次数']
},
@@ -117,7 +117,7 @@ const Grade = (list: any) => {
return html
}
},
color: ['#07CCCA'],
legend: {
data: ['暂降次数']
},
@@ -185,7 +185,10 @@ const Relation = (list: any, interval: number) => {
// } else if (item.notAssociated == 1) {
// item.notAssociated = 1.3
// }
echartswArr.push(item.notAssociated)
//echartswArr.push(item.notAssociated)
const total = item.notAssociated + item.linked
echartswArr.push(total)
})
monthlyStatistics.value = {
title: {
@@ -208,9 +211,11 @@ const Relation = (list: any, interval: number) => {
},
legend: {
data: ['未关联暂降次数', '已关联处理事件']
data: ['暂降次数']
//data: ['未关联暂降次数', '已关联处理事件']
},
color: ['#07CCCA', '#Ff6600'],
color: ['#07CCCA'],
//color: ['#07CCCA', '#Ff6600'],
xAxis: {
name: '月份', // 给X轴加单位
data: echartsndArr
@@ -221,11 +226,11 @@ const Relation = (list: any, interval: number) => {
options: {
series: [
{
name: '未关联暂降次数',
name: '暂降次数',
type: 'bar',
barMaxWidth: 30,
barMinHeight: 5,
data: echartswArr,
data: echartswArr,
itemStyle: {
normal: {
label: {
@@ -247,32 +252,32 @@ const Relation = (list: any, interval: number) => {
}
}
},
{
name: '已关联处理事件',
type: 'bar',
barMaxWidth: 30,
data: echartsArr,
itemStyle: {
normal: {
label: {
// show: true, //数字开启显示
textStyle: {
//数值样式
color: '#fff',
fontSize: 14,
fontWeight: 600
}
},
color: function (params: any) {
if (params.data == 0) {
return '#B3B3B3'
} else {
return '#Ff6600'
}
}
}
}
}
// {
// name: '已关联处理事件',
// type: 'bar',
// barMaxWidth: 30,
// data: echartsArr,
// itemStyle: {
// normal: {
// label: {
// // show: true, //数字开启显示
// textStyle: {
// //数值样式
// color: '#fff',
// fontSize: 14,
// fontWeight: 600
// }
// },
// color: function (params: any) {
// if (params.data == 0) {
// return '#B3B3B3'
// } else {
// return '#Ff6600'
// }
// }
// }
// }
// }
]
}
}