diff --git a/src/views/iot/project/profileV2/DeviceManage/EDeviceChildren.vue b/src/views/iot/project/profileV2/DeviceManage/EDeviceChildren.vue index 2e7ee01d..86bda6ab 100644 --- a/src/views/iot/project/profileV2/DeviceManage/EDeviceChildren.vue +++ b/src/views/iot/project/profileV2/DeviceManage/EDeviceChildren.vue @@ -261,10 +261,10 @@ export default { ).then((res) => { this.tableList = res.rows; this.deviceTotal = res.total; - if (this.stompClient) { - this.closeSocket(); - } - this.connection(); + // if (this.stompClient) { + // this.closeSocket(); + // } + // this.connection(); }); }, // 动态表格 返回的 勾选数据 @@ -364,9 +364,9 @@ export default { this.stompClient.onmessage = this.socket_message; this.stompClient.onclose = this.socket_onclose; }, - socket_message(evt) { - console.log("wsljcg:=", evt); - const data = JSON.parse(evt.data); + socket_message(data) { + console.log("wsljcg:=", data); + // const data = JSON.parse(evt.data); // this.actualEnergyCensus = data.params || {}; console.log("socket-message:", data); this.handleDeviceInfo(data); diff --git a/src/views/iot/project/profileV2/DeviceManage/EDeviceTable.vue b/src/views/iot/project/profileV2/DeviceManage/EDeviceTable.vue index 5388336f..d147c431 100644 --- a/src/views/iot/project/profileV2/DeviceManage/EDeviceTable.vue +++ b/src/views/iot/project/profileV2/DeviceManage/EDeviceTable.vue @@ -181,6 +181,7 @@
0) { + // let result = this.list.filter(v => { if (v['deviceKey'] === param['deviceKey']) { return v }}); this.list = this.list.map((v) => { if (v["deviceKey"] === param["deviceKey"]) { return Object.assign(v, param); @@ -426,6 +375,7 @@ export default { return v; } }); + this.$refs.eDeviceChildren.socket_message(param); } }, socket_onclose(e) { diff --git a/src/views/profile/DeviceDetailsView/deviceSelectNav.vue b/src/views/profile/DeviceDetailsView/deviceSelectNav.vue index 9620146f..0bf3de4b 100644 --- a/src/views/profile/DeviceDetailsView/deviceSelectNav.vue +++ b/src/views/profile/DeviceDetailsView/deviceSelectNav.vue @@ -21,6 +21,9 @@ 一键分闸 + {{ childDeviceList.length > tSelectList.length ? '全选' : '取消' }} 已选择设备: 当前未选择设备 0) { + if (this.tSelectList.length >= this.childDeviceList.length) { + this.tSelectList = []; + this.tSelectLabelList = []; + } else { + this.childDeviceList.forEach((v) => { + if (this.tSelectList.indexOf(v.deviceId) < 0) { + this.tSelectList.push(v.deviceId); + this.tSelectLabelList.push(v.deviceName); + } + }); + } + } + }, + // 点击子设备 线路开关 handleChildStatus(type) { this.$prompt("请输入登录密码", "提示", {