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

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"> <div class="default-main">
<vxe-table :data="shareData" v-bind="defaultAttribute" height="auto" auto-resize> <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="month" title="月份" min-width="120px" sortable></vxe-column>
<vxe-column field="notAssociated" title="未关联暂降次数" sortable></vxe-column> <vxe-column field="notAssociated" title="电压暂降次数" sortable></vxe-column>
<vxe-column field="linked" title="已关联处理事件" sortable></vxe-column>
</vxe-table> </vxe-table>
</div> </div>
</el-tab-pane> </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) => { 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 = [ shareData.value = [
{ {
month: '总计', month: '总计',
notAssociated: allNotAssociated.toFixed(2), notAssociated: all,
linked: allLinked.toFixed(2)
}, },
...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 return html
} }
}, },
color: ['#07CCCA'],
legend: { legend: {
data: ['暂降次数'] data: ['暂降次数']
}, },
@@ -117,7 +117,7 @@ const Grade = (list: any) => {
return html return html
} }
}, },
color: ['#07CCCA'],
legend: { legend: {
data: ['暂降次数'] data: ['暂降次数']
}, },
@@ -185,7 +185,10 @@ const Relation = (list: any, interval: number) => {
// } else if (item.notAssociated == 1) { // } else if (item.notAssociated == 1) {
// item.notAssociated = 1.3 // item.notAssociated = 1.3
// } // }
echartswArr.push(item.notAssociated) //echartswArr.push(item.notAssociated)
const total = item.notAssociated + item.linked
echartswArr.push(total)
}) })
monthlyStatistics.value = { monthlyStatistics.value = {
title: { title: {
@@ -208,9 +211,11 @@ const Relation = (list: any, interval: number) => {
}, },
legend: { legend: {
data: ['未关联暂降次数', '已关联处理事件'] data: ['暂降次数']
//data: ['未关联暂降次数', '已关联处理事件']
}, },
color: ['#07CCCA', '#Ff6600'], color: ['#07CCCA'],
//color: ['#07CCCA', '#Ff6600'],
xAxis: { xAxis: {
name: '月份', // 给X轴加单位 name: '月份', // 给X轴加单位
data: echartsndArr data: echartsndArr
@@ -221,11 +226,11 @@ const Relation = (list: any, interval: number) => {
options: { options: {
series: [ series: [
{ {
name: '未关联暂降次数', name: '暂降次数',
type: 'bar', type: 'bar',
barMaxWidth: 30, barMaxWidth: 30,
barMinHeight: 5, barMinHeight: 5,
data: echartswArr, data: echartswArr,
itemStyle: { itemStyle: {
normal: { normal: {
label: { label: {
@@ -247,32 +252,32 @@ const Relation = (list: any, interval: number) => {
} }
} }
}, },
{ // {
name: '已关联处理事件', // name: '已关联处理事件',
type: 'bar', // type: 'bar',
barMaxWidth: 30, // barMaxWidth: 30,
data: echartsArr, // data: echartsArr,
itemStyle: { // itemStyle: {
normal: { // normal: {
label: { // label: {
// show: true, //数字开启显示 // // show: true, //数字开启显示
textStyle: { // textStyle: {
//数值样式 // //数值样式
color: '#fff', // color: '#fff',
fontSize: 14, // fontSize: 14,
fontWeight: 600 // fontWeight: 600
} // }
}, // },
color: function (params: any) { // color: function (params: any) {
if (params.data == 0) { // if (params.data == 0) {
return '#B3B3B3' // return '#B3B3B3'
} else { // } else {
return '#Ff6600' // return '#Ff6600'
} // }
} // }
} // }
} // }
} // }
] ]
} }
} }