소스 검색

更新设备在线状态显示,不会刷新整个表格,只刷新状态

wuyunfeng 3 년 전
부모
커밋
5c0b97f42c
2개의 변경된 파일11개의 추가작업 그리고 4개의 파일을 삭제
  1. 6 2
      src/views/ncs-device/components/deviceManager.vue
  2. 5 2
      src/views/ncs-device/nurse_watch.vue

+ 6 - 2
src/views/ncs-device/components/deviceManager.vue

@@ -1032,8 +1032,12 @@ export default {
             this.rowData[i]['online_state'] = (mac !== undefined && mac !== null) ? this.$t('deviceManage.connectTrue') : this.$t('deviceManage.connectFalse')
           }
         }
-        const rowData = [...this.rowData]
-        this.$set(this, 'rowData', rowData)
+       //只刷新在线状态列数据
+          var params = {
+              columns: ['online_state']
+          }
+          this.gridApi.refreshCells(params);
+
       }
     },
     websocketclose: function(e) {

+ 5 - 2
src/views/ncs-device/nurse_watch.vue

@@ -350,8 +350,11 @@ export default {
           const mac = this.onlineDevice.filter(p => p.toLowerCase() === item.eth_mac.toLowerCase())[0]
           item.online_state = (mac !== undefined && mac !== null) ? '在线' : '离线'
         })
-        const tableData = [...this.tableData]
-        this.$set(this, 'tableData', tableData)
+        //只刷新在线状态列数据
+        var params = {
+          columns: ['online_state']
+        }
+        this.gridApi.refreshCells(params);
       }
     },
     deviceOnlineWebsocketclose: function(e) {