|
@@ -628,6 +628,9 @@ const pageInit = async () => {
|
|
data: its,
|
|
data: its,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
|
|
+ res.data.healths.forEach((item: any) => {
|
|
|
|
+ newHealthyMessage(item)
|
|
|
|
+ })
|
|
}
|
|
}
|
|
});
|
|
});
|
|
// 处理接收到的消息
|
|
// 处理接收到的消息
|
|
@@ -871,6 +874,9 @@ const mockStart = async (state: boolean = false) => {
|
|
data: its,
|
|
data: its,
|
|
};
|
|
};
|
|
});
|
|
});
|
|
|
|
+ resultCatch.data.healths.forEach((item: any) => {
|
|
|
|
+ newHealthyMessage(item)
|
|
|
|
+ })
|
|
}
|
|
}
|
|
} else {
|
|
} else {
|
|
lineParamsAllRef.value = [];
|
|
lineParamsAllRef.value = [];
|
|
@@ -1441,6 +1447,35 @@ const healthyStatusText = ref({
|
|
color: "",
|
|
color: "",
|
|
});
|
|
});
|
|
let flag = false;
|
|
let flag = false;
|
|
|
|
+
|
|
|
|
+const newHealthyMessage = (data: Object) => {
|
|
|
|
+ console.log('newHealthyMessage ===>', data)
|
|
|
|
+ if (data.health == 99) {
|
|
|
|
+ if (flag) {
|
|
|
|
+ data.health = 92;
|
|
|
|
+ flag = false;
|
|
|
|
+ } else {
|
|
|
|
+ data.health = 98;
|
|
|
|
+ flag = true;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 获取健康数据
|
|
|
|
+ // let obj=determineHealthStatus(data.avg_num)
|
|
|
|
+ let obj = determineHealthStatus(`${data.sha}(${data.health}%)`);
|
|
|
|
+ healthyStatusText.value = obj;
|
|
|
|
+ sessionStorage.setItem("healthyStatusText", JSON.stringify(data));
|
|
|
|
+ xAxisData.value.push(moment(data._ts).format("HH:mm:ss"));
|
|
|
|
+ seriesData.value[0].data.push(data.health);
|
|
|
|
+ let arr = seriesData.value[0].data;
|
|
|
|
+ seriesData.value = [
|
|
|
|
+ {
|
|
|
|
+ name: "趋势",
|
|
|
|
+ data: arr,
|
|
|
|
+ },
|
|
|
|
+ ];
|
|
|
|
+};
|
|
|
|
+
|
|
const healthyMessage = (data: Object) => {
|
|
const healthyMessage = (data: Object) => {
|
|
if (data.avg_num == 99) {
|
|
if (data.avg_num == 99) {
|
|
if (flag) {
|
|
if (flag) {
|