云设备录入

This commit is contained in:
sjl
2025-10-11 10:35:25 +08:00
parent 2e58e58c73
commit a3b6a5c0be
23 changed files with 9302 additions and 3827 deletions

View File

@@ -269,10 +269,21 @@ const childRefs: any = {}
const init = () => {
loading.value = true
//循环渲染图表
xAixsTimeList.value.push(mqttMessage.value.dataTime.split(" ")[1])
// 限制x轴数据点数量避免过多数据点导致性能问题和显示重复
if (xAixsTimeList.value.length > 50) {
xAixsTimeList.value.shift()
}
searchForm.value.index.map((item: any, index: any) => {
item?.children.map((vv: any, vvs: any) => {
if (mqttMessage.value[vv.name] != undefined) {
// 清空当前时间点的数据(如果存在),防止重复
const currentTime = mqttMessage.value.dataTime.split(" ")[1];
vv.yMethodList = vv.yMethodList.filter((point: any) => point[0] !== currentTime);
item.data.push({
// time: mqttMessage.value.dataTime,
value: mqttMessage.value[vv.name],
@@ -280,14 +291,16 @@ const init = () => {
})
allDataList.value.push(mqttMessage.value[vv.name])
vv.data.push(mqttMessage.value[vv.name])
vv.yMethodList.push([mqttMessage.value.dataTime.split(" ")[1], mqttMessage.value[vv.name] + '', vv.phase])
// 更新yMethodList数据确保与xAixsTimeList保持同步
vv.yMethodList.push([currentTime, mqttMessage.value[vv.name] + '', vv.phase])
// 限制数据点数量,避免过多数据点导致性能问题和显示重复
if (vv.yMethodList.length > 50) {
vv.yMethodList.shift()
}
}
})
})
//循环渲染图表
xAixsTimeList.value.push(mqttMessage.value.dataTime.split(" ")[1])
searchForm.value.index.map((item: any, index: any) => {
@@ -378,7 +391,7 @@ defineExpose({ resetData, setHarmonicSpectrumData })
.harmonic {
width: 100%;
// height: 100%;
display: flex;
display: 'flex';
flex-direction: column;
position: relative;
@@ -416,4 +429,4 @@ defineExpose({ resetData, setHarmonicSpectrumData })
}
}
}
</style>
</style>