|
|
@ -136,21 +136,21 @@ |
|
|
|
const echartPieOne = ref(null); |
|
|
|
const echartPieTow = ref(null); |
|
|
|
const getGraphChart = async () => { |
|
|
|
let dayData = []; |
|
|
|
let dayData: any = []; |
|
|
|
// 能源告警 |
|
|
|
let energyAlarm = []; |
|
|
|
let energyAlarm: any = []; |
|
|
|
// 网关告警 |
|
|
|
let wgAlarm = []; |
|
|
|
let wgAlarm: any = []; |
|
|
|
// 设备告警 |
|
|
|
let equipmentAlarm = []; |
|
|
|
let total = []; |
|
|
|
let equipmentAlarm: any = []; |
|
|
|
let total: any = []; |
|
|
|
await http |
|
|
|
.post(alarmOverviewApi.getAlarmTrend, { |
|
|
|
orgId: orgId.value, |
|
|
|
}) |
|
|
|
.then((res) => { |
|
|
|
if (res.msg === 'success') { |
|
|
|
res.data.forEach((item: any, index) => { |
|
|
|
res.data.forEach((item: any) => { |
|
|
|
energyAlarm.push(item.alarmEnergyConsumptionNum); |
|
|
|
wgAlarm.push(item.alarmGatewayNum); |
|
|
|
equipmentAlarm.push(item.alarmEquipmentNum); |
|
|
@ -180,7 +180,7 @@ |
|
|
|
axisPointer: { |
|
|
|
type: 'shadow', |
|
|
|
}, |
|
|
|
formatter: function (params) { |
|
|
|
formatter: function (params: any) { |
|
|
|
let res = |
|
|
|
params[0].axisValue + |
|
|
|
'<br/>' + |
|
|
@ -238,6 +238,11 @@ |
|
|
|
show: false, |
|
|
|
}, |
|
|
|
data: dayData, |
|
|
|
axisLabel: { |
|
|
|
show: true, // 显示所有刻度值 |
|
|
|
interval: 1, // 显示所有刻度,不跳过 |
|
|
|
// rotate: 45, // 可选:如果标签过长,可以旋转标签以避免重叠 |
|
|
|
}, |
|
|
|
}, |
|
|
|
], |
|
|
|
yAxis: [ |
|
|
@ -330,7 +335,7 @@ |
|
|
|
color: '#000000', |
|
|
|
position: 'top', |
|
|
|
top: '10', |
|
|
|
formatter: function (value) { |
|
|
|
formatter: function (value: any) { |
|
|
|
return ( |
|
|
|
Number(energyAlarm[value.dataIndex]) + |
|
|
|
Number(wgAlarm[value.dataIndex]) + |
|
|
@ -426,7 +431,7 @@ |
|
|
|
fontSize: 14, |
|
|
|
fontWeight: 'bold', |
|
|
|
}, |
|
|
|
formatter: function (parms) { |
|
|
|
formatter: function (parms: any) { |
|
|
|
return '[ ' + parms.data.name + ' ] : ' + parms.data.value; |
|
|
|
}, |
|
|
|
}, |
|
|
@ -538,7 +543,7 @@ |
|
|
|
fontSize: 14, |
|
|
|
fontWeight: 'bold', |
|
|
|
}, |
|
|
|
formatter: function (parms) { |
|
|
|
formatter: function (parms: any) { |
|
|
|
return '[ ' + parms.data.name + ' ] : ' + parms.data.value; |
|
|
|
}, |
|
|
|
}, |
|
|
|