提交: 测试 设备详情页 设备状态更新 ws
This commit is contained in:
parent
7edd17714d
commit
f7f6839e27
|
@ -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()}`
|
||||||
);
|
);
|
||||||
|
|
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue