修正错误数据

This commit is contained in:
Xiaoyu 2025-03-12 20:44:46 +08:00
parent 21773a046a
commit 5294c003fb

View File

@ -154,11 +154,11 @@ const getSensorTypeName = (type, name) => {
const getSensorDataItems = (sensor) => {
// 线"---"
if (sensor.status === 0) {
return [{ label: "PDS值", value: "---", unit: "" }];
return [{ label: "TDS值", value: "---", unit: "" }];
}
// 线
return [{ label: "PDS值", value: sensor.data?.pds, unit: "mg/L" }];
return [{ label: "TDS值", value: sensor.data?.tds, unit: "mg/L" }];
};
//
@ -180,7 +180,7 @@ const handleKeyPress = (event) => {
status: isOnline ? 0 : 1,
updated_at: new Date().toISOString(),
data: {
pds: null,
tds: null,
},
}));
@ -210,15 +210,15 @@ const handleKeyPress = (event) => {
const substanceData = {
h: {
// (1000-1370)
pds: 1185,
tds: 1185,
},
c: {
// (200-248)
pds: 224,
tds: 224,
},
f: {
// (450-490)
pds: 470,
tds: 470,
},
};
@ -231,7 +231,7 @@ const handleKeyPress = (event) => {
sensorList.value = sensorList.value.map((sensor) => ({
...sensor,
data: {
pds: null,
tds: null,
},
}));
return;
@ -271,7 +271,7 @@ const handleKeyPress = (event) => {
status: 1,
updated_at: new Date().toISOString(),
data: {
pds: randomValue,
tds: randomValue,
},
}));
}, 1000); //