歷史資料過濾NaN和0

This commit is contained in:
huliang 2025-05-13 10:31:26 +08:00
parent c4f175d379
commit c3ceba4433
3 changed files with 4 additions and 4 deletions

View File

@ -56,10 +56,8 @@ const useElecStore = defineStore("elecDist", () => {
.format("YYYY-MM-DDTHH:mm:ss.000+08:00"); // 現在時間前2個小時
const endTime = dayjs().format("YYYY-MM-DDTHH:mm:ss.000+08:00"); // 現在的時間
const id = item.id;
console.log(
`local:|foxs:4918|history:${id}?period=timerange;start=${startTime};end=${endTime}|bql:history:HistoryRollup.rollup(baja:RelTime '3600000')`
);
const ordString = `local:|foxs:4918|history:${id}?period=timerange;start=${startTime};end=${endTime}|bql:history:HistoryRollup.rollup(baja:RelTime '3600000')`;
console.log(ordString);
// @ts-ignore
window.require &&
// @ts-ignore

View File

@ -123,6 +123,7 @@ const useElecReportStore = defineStore("elecReportData", () => {
const timestamp = record.get("timestamp").$cEncStr;
if (
currentValue !== null &&
!isNaN(currentValue) &&
currentValue !== 0 &&
timestamp !== null
) {

View File

@ -40,7 +40,7 @@ const useElecStore = defineStore("elecData", () => {
eleclist.push({
slotPath: record.get("slotPath"),
displayName: record.get("parent$2edisplayName"),
id: record.get("NumericInterval$2ehistoryConfig$2eid").$cEncStr,
id: record.get("NumericInterval$2ehistoryConfig$2eid"),
out: record.get("out")?.get("value") ?? null,
});
},
@ -85,6 +85,7 @@ const useElecStore = defineStore("elecData", () => {
const timestamp = record.get("timestamp").$cEncStr;
if (
currentValue !== null &&
!isNaN(currentValue) &&
currentValue !== 0 &&
timestamp !== null
) {