提交: 测试 设备详情页 设备状态更新 ws

This commit is contained in:
23688nl 2022-09-29 09:07:46 +08:00
parent 7edd17714d
commit f7f6839e27
2 changed files with 4 additions and 4 deletions

View File

@ -338,7 +338,7 @@ export default {
handleDeviceInfo(param) { handleDeviceInfo(param) {
if (this.tableList && this.tableList.length > 0) { if (this.tableList && this.tableList.length > 0) {
this.tableList = this.tableList.map((v) => { this.tableList = this.tableList.map((v) => {
if (v["deviceId"] === param["deviceId"]) { if (v["deviceKey"] === param["deviceKey"]) {
return Object.assign(v, param); return Object.assign(v, param);
} else { } else {
return v; return v;
@ -357,7 +357,7 @@ export default {
if (!this.tableList || this.length <= 0) { if (!this.tableList || this.length <= 0) {
return; return;
} }
let deviceIds = this.tableList.map((v) => v["deviceId"]); let deviceIds = this.tableList.map((v) => v["deviceKey"]);
this.stompClient = new WebSocket( this.stompClient = new WebSocket(
`${webSocketProjectGatewayUrl}/${this.getGuid()}/${deviceIds.toString()}` `${webSocketProjectGatewayUrl}/${this.getGuid()}/${deviceIds.toString()}`
); );

View File

@ -349,12 +349,12 @@ export default {
}, },
// socket // socket
handleDeviceInfo(param) { handleDeviceInfo(param) {
if (param.deviceId === this.deviceInfo.deviceId) { if (param.deviceKey === this.deviceInfo.deviceKey) {
this.deviceInfo = Object.assign(this.deviceInfo, param); this.deviceInfo = Object.assign(this.deviceInfo, param);
} else { } else {
if (this.childDeviceList && this.childDeviceList.length > 0) { if (this.childDeviceList && this.childDeviceList.length > 0) {
this.childDeviceList = this.childDeviceList.map((v) => { this.childDeviceList = this.childDeviceList.map((v) => {
if (v["deviceId"] === param["deviceId"]) { if (v["deviceKey"] === param["deviceKey"]) {
return Object.assign(v, param); return Object.assign(v, param);
} else { } else {
return v; return v;