Prechádzať zdrojové kódy

fix(去掉console.log + watch 切换时间)

liujing 8 mesiacov pred
rodič
commit
df467ce2aa

+ 18 - 4
src/layout/components/Navbar.vue

@@ -189,8 +189,6 @@ export default {
       queryNums: {
         start_time: Math.round((new Date().getTime()) / 1000 - (5 * 60)),
         end_time: Math.round(new Date().getTime() / 1000),
-        // start_time:0,
-        // end_time:0,
         pageSize: 10,
         pageIndex: 1,
         app_ids: 0
@@ -202,13 +200,25 @@ export default {
       times: {
         start_time: Math.round((new Date().getTime()) / 1000 - (1 * 60)),
         end_time: Math.round(new Date().getTime() / 1000),
-        // start_time:0,
-        // end_time:0,
         live: false
       },
       currentRoute: ''
     }
   },
+  watch: {
+    '$store.state.time.globalTimes': {
+      handler(newValue, oldValue) {
+        if (newValue) {
+          this.queryNums.start_time = newValue.startTime
+          this.queryNums.end_time = newValue.endTime
+          this.times.start_time = newValue.startTime
+          this.times.end_time = newValue.endTime
+        }
+
+      },
+      deep: true
+    },
+  },
   computed: {
     ...mapGetters([
       'sidebar',
@@ -245,6 +255,8 @@ export default {
       this.queryNums.start_time = start_time
       this.queryNums.end_time = end_time
       this.queryNums.app_ids = this.appItem.id
+      this.times.start_time = start_time
+      this.times.end_time = end_time
       this.getList()
       this.getEventNums()
     }
@@ -320,6 +332,8 @@ export default {
         this.getEventNums()
         const start_time = this.times.start_time
         const end_time = this.times.end_time
+        console.log('start_time---', start_time, end_time)
+
         const obj = val
         obj.live = this.times.live
         obj.start_time = this.times.start_time

+ 4 - 1
src/views/business-analysis/topology/index.vue

@@ -343,11 +343,15 @@ export default {
           }
 
           this.topoUrl = ''
+          console.log('watch----if000-----this.changeQuery-', newValue.startTime, newValue.endTime)
+
           this.changeQuery('/business-analysis/topology/index', newValue.startTime, newValue.endTime, live)
           this.topoUrl = '/ui/index.html'
         } else {
           live = false
           this.topoUrl = ''
+          console.log('watch----else-----this.changeQuery-', newValue.startTime, newValue.endTime)
+
           this.changeQuery('/business-analysis/topology/index', newValue.startTime, newValue.endTime, live)
           this.topoUrl = '/ui/index.html'
         }
@@ -692,7 +696,6 @@ export default {
     },
     getslowTopUrlMapping() { // 慢接口TOP5
       this.loading3 = true
-      console.log('慢接口TOP5f---方法')
       slowTopUrlMapping(this.slowTopQuery).then(res => {
         if (res.code == 200) {
           this.slowTopList = res.data

+ 0 - 1
src/views/index/index.vue

@@ -398,7 +398,6 @@ export default {
         obj.live = this.times.live
         obj.start_time = this.times.start_time
         obj.end_time = this.times.end_time
-        console.log('obj-----',obj)
         storage.set('appsItem', obj)
         this.$router.push({
           path: '/business-analysis/topology/index',

+ 0 - 1
src/views/service/service/index.vue

@@ -457,7 +457,6 @@ export default {
       })
     },
     handleCellClick(row, column, cell, event){
-      console.log(123,row,column.label)
     },
     // 加载更多
     loadMore() {