Przeglądaj źródła

窗口刷新问题

learshaw 1 tydzień temu
rodzic
commit
a8d4b87616
1 zmienionych plików z 16 dodań i 0 usunięć
  1. 16 0
      ems-ui-cloud/src/views/devmgr/attr/index.vue

+ 16 - 0
ems-ui-cloud/src/views/devmgr/attr/index.vue

@@ -543,6 +543,19 @@ export default {
 
     }
   },
+  watch: {
+    // 监听 activeTab 的变化
+    activeTab(newVal) {
+      if (newVal === 'callLog') {
+        // 当切换到“调用日志”时,调用查询接口
+        this.handleCallLogQuery()
+      } else if(newVal ==='reportLog'){
+        this.handleLogQuery()
+      } else if (newVal === 'eventLog') {
+        this.handleEventLogQuery()
+      }
+    }
+  },
   created() {
     this.getList()
     this.getAreaTree('0', 2)
@@ -841,6 +854,9 @@ export default {
       this.reset()
       this.curRow = row
       console.log('设备this.curRow', this.curRow)
+      // 重置调用日志数据
+      this.callLogData = []
+      this.callLogQueryTotal = 0
       getModelByCode(this.curRow.deviceModel).then(response => {
         this.open = true
         this.abilityData = response.data?.abilityList.filter(item => item.hiddenFlag === 1) || []