fix:对接接口
This commit is contained in:
@@ -33,7 +33,7 @@
|
||||
}}</a-descriptions-item>
|
||||
<a-descriptions-item label="错误码">{{ infoObject.errorCode }}</a-descriptions-item>
|
||||
<a-descriptions-item label="告警描述">
|
||||
<div style="color: #2778ff">{{ infoObject.alarmTitle }}</div>
|
||||
<div style="color: rgba(255, 118, 54, 1)">{{ infoObject.alarmTitle }}</div>
|
||||
{{ infoObject.abnormalDescription }}</a-descriptions-item
|
||||
>
|
||||
<a-descriptions-item label="监测点位">
|
||||
@@ -56,6 +56,9 @@
|
||||
});
|
||||
import { ref } from 'vue';
|
||||
import * as echarts from 'echarts';
|
||||
import { energyAlarmApi } from '/@/api/alarmManagement/energyAlarm';
|
||||
import { http } from '/nerv-lib/util';
|
||||
import { message } from 'ant-design-vue';
|
||||
|
||||
let chartInstance: echarts.ECharts | null = null;
|
||||
const graphChart = ref(null);
|
||||
@@ -94,19 +97,21 @@
|
||||
const toggle = (data: any) => {
|
||||
infoObject.value = data;
|
||||
visible.value = true;
|
||||
setTimeout(() => {
|
||||
getChatr();
|
||||
}, 500);
|
||||
// setTimeout(() => {
|
||||
// getChatr();
|
||||
// }, 500);
|
||||
http.get(energyAlarmApi.getEnergyGraph, { logId: infoObject.value.id }).then((res: any) => {
|
||||
if (res.msg === 'success') {
|
||||
const data = res.data;
|
||||
if (data.length > 0) {
|
||||
getChatr(data[0]);
|
||||
}
|
||||
} else {
|
||||
message.error(res.msg);
|
||||
}
|
||||
});
|
||||
};
|
||||
const getChatr = () => {
|
||||
let dayData = [];
|
||||
let energyAlarm: any = [];
|
||||
|
||||
// Extend data for 30 days
|
||||
for (let i = 1; i < 30; i++) {
|
||||
dayData.push(`3/${i}`);
|
||||
energyAlarm.push(Math.floor(Math.random() * 250));
|
||||
}
|
||||
const getChatr = (data) => {
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose();
|
||||
}
|
||||
@@ -182,7 +187,7 @@
|
||||
return value;
|
||||
},
|
||||
},
|
||||
data: dayData,
|
||||
data: data.dateList,
|
||||
},
|
||||
],
|
||||
yAxis: [
|
||||
@@ -342,7 +347,7 @@
|
||||
shadowBlur: 20,
|
||||
},
|
||||
},
|
||||
data: energyAlarm,
|
||||
data: data.data,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
Reference in New Issue
Block a user