mirror of
https://gitee.com/js-yhsec/energy_storage.git
synced 2026-05-28 11:19:24 +08:00
系统总览图表加载销毁优化
This commit is contained in:
@@ -29,32 +29,32 @@ export default {
|
||||
curList: [
|
||||
{
|
||||
name: '日光伏设备告警',
|
||||
key: 'key1',
|
||||
key: 'solar_num_err',
|
||||
lineColor: '#22E4FF',
|
||||
value: 1111,
|
||||
d: ''
|
||||
},
|
||||
{
|
||||
name: '日储能设备告警',
|
||||
key: 'key2',
|
||||
key: 'storage_num_err',
|
||||
lineColor: '#0E68E4',
|
||||
value: 0,
|
||||
d: ''
|
||||
},
|
||||
{
|
||||
name: '日充电设备告警',
|
||||
key: 'key3',
|
||||
key: 'charge_num_err',
|
||||
lineColor: '#00BAAD',
|
||||
value: 0,
|
||||
d: ''
|
||||
},
|
||||
{
|
||||
name: '日负荷设备告警',
|
||||
key: 'key4',
|
||||
lineColor: '#FF8D1A',
|
||||
value: 0,
|
||||
d: ''
|
||||
}
|
||||
// {
|
||||
// name: '日负荷设备告警',
|
||||
// key: 'key4',
|
||||
// lineColor: '#FF8D1A',
|
||||
// value: 0,
|
||||
// d: ''
|
||||
// }
|
||||
],
|
||||
faultChart: null,
|
||||
lineChartData: {
|
||||
@@ -91,7 +91,7 @@ export default {
|
||||
}
|
||||
},
|
||||
mounted() {},
|
||||
onBeforeUnmount() {
|
||||
beforeUnmount() {
|
||||
this.faultChart = null
|
||||
window.removeEventListener('resize', this.handleResize)
|
||||
},
|
||||
@@ -102,9 +102,9 @@ export default {
|
||||
},
|
||||
processData(data, keys) {
|
||||
data.sort((a, b) => {
|
||||
return new Date(a.date) - new Date(b.date)
|
||||
return new Date(a.dt) - new Date(b.dt)
|
||||
})
|
||||
const dates = data.map((item) => item.date)
|
||||
const dates = data.map((item) => item.dt)
|
||||
const values = []
|
||||
keys.forEach((item, index) => {
|
||||
values[index] = data.map((dataValue) => dataValue[keys[index]])
|
||||
@@ -181,6 +181,7 @@ export default {
|
||||
lineStyle: { type: 'dashed', color: '#435463' }
|
||||
},
|
||||
axisLabel: {
|
||||
interval: 4,
|
||||
color: '#fff'
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user