Merge branch 'main' of http://47.107.152.87:3000/dyf/APP
This commit is contained in:
@ -574,13 +574,22 @@
|
||||
if (!json) {
|
||||
return;
|
||||
}
|
||||
console.log("收到设备数据:", json);
|
||||
let keys = Object.keys(json);
|
||||
keys.forEach((key) => {
|
||||
if (key in these.formData) {
|
||||
these.formData[key] = json[key];
|
||||
// 确保响应式更新
|
||||
console.log(`更新字段 ${key}: ${these.formData[key]} -> ${json[key]}`);
|
||||
these.$set(these.formData, key, json[key]);
|
||||
} else {
|
||||
console.log(`字段 ${key} 不在 formData 中,跳过更新`);
|
||||
}
|
||||
});
|
||||
|
||||
// 强制触发视图更新,确保电量显示同步
|
||||
these.$forceUpdate();
|
||||
console.log("更新后的电量:", these.formData.battary);
|
||||
|
||||
if (this.formData.battary <= 20) {
|
||||
this.showPop({
|
||||
message: "设备电量低",
|
||||
|
||||
@ -476,8 +476,7 @@ class BleReceive {
|
||||
|
||||
let recCnt = recArr.find(v => {
|
||||
|
||||
return v.key.replace(/\//g, "").toLowerCase() === f.device.detailPageUrl.replaceAll(
|
||||
'/', '').toLowerCase();
|
||||
return v.key.replace(/\//g, "").toLowerCase() === f.device.detailPageUrl.replace(/\//g, '').toLowerCase();
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user