Merge branch 'main' of http://47.107.152.87:3000/dyf/APP
This commit is contained in:
@ -574,12 +574,21 @@
|
|||||||
if (!json) {
|
if (!json) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
console.log("收到设备数据:", json);
|
||||||
let keys = Object.keys(json);
|
let keys = Object.keys(json);
|
||||||
keys.forEach((key) => {
|
keys.forEach((key) => {
|
||||||
if (key in these.formData) {
|
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) {
|
if (this.formData.battary <= 20) {
|
||||||
this.showPop({
|
this.showPop({
|
||||||
|
|||||||
@ -476,8 +476,7 @@ class BleReceive {
|
|||||||
|
|
||||||
let recCnt = recArr.find(v => {
|
let recCnt = recArr.find(v => {
|
||||||
|
|
||||||
return v.key.replace(/\//g, "").toLowerCase() === f.device.detailPageUrl.replaceAll(
|
return v.key.replace(/\//g, "").toLowerCase() === f.device.detailPageUrl.replace(/\//g, '').toLowerCase();
|
||||||
'/', '').toLowerCase();
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user