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