提交: 测试 设备详情页 设备状态更新 ws
This commit is contained in:
parent
7edd17714d
commit
f7f6839e27
|
@ -338,7 +338,7 @@ export default {
|
|||
handleDeviceInfo(param) {
|
||||
if (this.tableList && this.tableList.length > 0) {
|
||||
this.tableList = this.tableList.map((v) => {
|
||||
if (v["deviceId"] === param["deviceId"]) {
|
||||
if (v["deviceKey"] === param["deviceKey"]) {
|
||||
return Object.assign(v, param);
|
||||
} else {
|
||||
return v;
|
||||
|
@ -357,7 +357,7 @@ export default {
|
|||
if (!this.tableList || this.length <= 0) {
|
||||
return;
|
||||
}
|
||||
let deviceIds = this.tableList.map((v) => v["deviceId"]);
|
||||
let deviceIds = this.tableList.map((v) => v["deviceKey"]);
|
||||
this.stompClient = new WebSocket(
|
||||
`${webSocketProjectGatewayUrl}/${this.getGuid()}/${deviceIds.toString()}`
|
||||
);
|
||||
|
|
|
@ -349,12 +349,12 @@ export default {
|
|||
},
|
||||
// 处理 socket 数据返回 赋值问题
|
||||
handleDeviceInfo(param) {
|
||||
if (param.deviceId === this.deviceInfo.deviceId) {
|
||||
if (param.deviceKey === this.deviceInfo.deviceKey) {
|
||||
this.deviceInfo = Object.assign(this.deviceInfo, param);
|
||||
} else {
|
||||
if (this.childDeviceList && this.childDeviceList.length > 0) {
|
||||
this.childDeviceList = this.childDeviceList.map((v) => {
|
||||
if (v["deviceId"] === param["deviceId"]) {
|
||||
if (v["deviceKey"] === param["deviceKey"]) {
|
||||
return Object.assign(v, param);
|
||||
} else {
|
||||
return v;
|
||||
|
|
Loading…
Reference in New Issue