Parcourir la source

修复在线设备为null时的页面设备报错不显示

wennn il y a 2 ans
Parent
commit
7166f6f3bd
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/views/ncs-device/components/deviceManager.vue

+ 1 - 1
src/views/ncs-device/components/deviceManager.vue

@@ -777,7 +777,7 @@
                         if (this.onlineDevice.length > 0) {
                             if (this.isCannotBeOnline(item.device_type)) {
                                 if (item.eth_mac) {
-                                    const mac = this.onlineDevice.filter(p => p.toLowerCase() === item.eth_mac.toLowerCase())[0]
+                                    const mac = this.onlineDevice.filter(p => p != null && (p.toLowerCase() === item.eth_mac.toLowerCase()))[0]
                                     // console.log('在线设备1', mac)
                                     if (mac !== undefined && mac !== null) {
                                         item['online_state'] = this.$t('deviceManage.connectTrue')