Browse Source

feat: 企微数据 - 账号数据趋势 - 更新时间逻辑

zhengxy 2 years ago
parent
commit
b92cb8f979
1 changed files with 33 additions and 0 deletions
  1. 33 0
      project/src/components/dataBoard/accountTrends.vue

+ 33 - 0
project/src/components/dataBoard/accountTrends.vue

236
     this.handleGetChart()
236
     this.handleGetChart()
237
     this.handleGetSummaryList()
237
     this.handleGetSummaryList()
238
     this.handleGetList()
238
     this.handleGetList()
239
+    this.handleGetUpdateTime()
239
   },
240
   },
240
   beforeDestroy () {
241
   beforeDestroy () {
241
     this.myChart && this.myChart.clear()
242
     this.myChart && this.myChart.clear()
244
     initTableHeight() {
245
     initTableHeight() {
245
       this.height = document.documentElement.clientHeight - 200 > 400 ? document.documentElement.clientHeight - 200 : 400
246
       this.height = document.documentElement.clientHeight - 200 > 400 ? document.documentElement.clientHeight - 200 : 400
246
     },
247
     },
248
+    // 获取"数据更新时间"
249
+    async handleGetUpdateTime() {
250
+      console.log('handleGetUpdateTime => ')
251
+      try {
252
+        // const { data: res = {} } = await this.$axios.get(this.URL.xxx, {
253
+        //   params: {}
254
+        // })
255
+        // if (res && res.errno == 0) {
256
+        //   this.updateTime = res.rst.updateTime
257
+        // } else if (res.errno != 4002) {
258
+        //   this.$message.warning(res.err)
259
+        //   this.updateTime = ''
260
+        // }
261
+      } catch (error) {
262
+        this.updateTime = ''
263
+      }
264
+    },
247
     // 获取汇总表数据
265
     // 获取汇总表数据
248
     async handleGetSummaryList() {
266
     async handleGetSummaryList() {
249
       console.log('handleGetSummaryList => ',)
267
       console.log('handleGetSummaryList => ',)
560
       this.filter.sort_type = 'desc'
578
       this.filter.sort_type = 'desc'
561
       this.pagination.page = 1
579
       this.pagination.page = 1
562
       this.handleGetList()
580
       this.handleGetList()
581
+      this.handleGetUpdateTime()
563
     },
582
     },
564
     // 监听时间筛选变化
583
     // 监听时间筛选变化
565
     onChangeTime(time) {
584
     onChangeTime(time) {
568
       this.handleGetSummaryList()
587
       this.handleGetSummaryList()
569
       this.pagination.page = 1
588
       this.pagination.page = 1
570
       this.handleGetList()
589
       this.handleGetList()
590
+      this.handleGetUpdateTime()
571
     },
591
     },
572
     // 监听“MP账号”筛选变化
592
     // 监听“MP账号”筛选变化
573
     onChangeAccountId(val) {
593
     onChangeAccountId(val) {
578
       this.filter.sort_type = 'desc'
598
       this.filter.sort_type = 'desc'
579
       this.pagination.page = 1
599
       this.pagination.page = 1
580
       this.handleGetList()
600
       this.handleGetList()
601
+      this.handleGetUpdateTime()
581
     },
602
     },
582
     // 监听“ADQ账号”筛选变化
603
     // 监听“ADQ账号”筛选变化
583
     onChangeAccountIdAdq(val) {
604
     onChangeAccountIdAdq(val) {
588
       this.filter.sort_type = 'desc'
609
       this.filter.sort_type = 'desc'
589
       this.pagination.page = 1
610
       this.pagination.page = 1
590
       this.handleGetList()
611
       this.handleGetList()
612
+      this.handleGetUpdateTime()
591
     },
613
     },
592
     // 监听“收益截止日期”筛选变化
614
     // 监听“收益截止日期”筛选变化
593
     onChangeClosingDate(val) {
615
     onChangeClosingDate(val) {
596
       this.handleGetSummaryList()
618
       this.handleGetSummaryList()
597
       this.pagination.page = 1
619
       this.pagination.page = 1
598
       this.handleGetList()
620
       this.handleGetList()
621
+      this.handleGetUpdateTime()
599
     },
622
     },
600
     // 监听“推广类型”筛选变化
623
     // 监听“推广类型”筛选变化
601
     onChangePromotionType(val) {
624
     onChangePromotionType(val) {
604
       this.handleGetSummaryList()
627
       this.handleGetSummaryList()
605
       this.pagination.page = 1
628
       this.pagination.page = 1
606
       this.handleGetList()
629
       this.handleGetList()
630
+      this.handleGetUpdateTime()
607
     },
631
     },
608
     // 监听当前页变化
632
     // 监听当前页变化
609
     handleCurrentChange(currentPage) {
633
     handleCurrentChange(currentPage) {
634
+      this.handleGetChart()
635
+      this.handleGetSummaryList()
610
       this.pagination.page = currentPage
636
       this.pagination.page = currentPage
611
       this.handleGetList()
637
       this.handleGetList()
638
+      this.handleGetUpdateTime()
612
     },
639
     },
613
     // 监听点击"确定(搜索)"按钮
640
     // 监听点击"确定(搜索)"按钮
614
     onClickSearch() {
641
     onClickSearch() {
616
       this.handleGetSummaryList()
643
       this.handleGetSummaryList()
617
       this.pagination.page = 1
644
       this.pagination.page = 1
618
       this.handleGetList()
645
       this.handleGetList()
646
+      this.handleGetUpdateTime()
619
     },
647
     },
620
     // 监听排序变化
648
     // 监听排序变化
621
     onClickSort(sort_field, sort_type) {
649
     onClickSort(sort_field, sort_type) {
637
       // 后端排序 => 获取最新数据
665
       // 后端排序 => 获取最新数据
638
       this.pagination.page = 1
666
       this.pagination.page = 1
639
       this.handleGetList()
667
       this.handleGetList()
668
+      // 获取其他表数据 & 同步更新时间
669
+      this.handleGetChart()
670
+      this.handleGetSummaryList()
671
+      this.handleGetUpdateTime()
640
     },
672
     },
641
     // 监听点击"重置"按钮
673
     // 监听点击"重置"按钮
642
     onClickReset() {
674
     onClickReset() {
654
       this.handleGetChart()
686
       this.handleGetChart()
655
       this.handleGetSummaryList()
687
       this.handleGetSummaryList()
656
       this.handleGetList()
688
       this.handleGetList()
689
+      this.handleGetUpdateTime()
657
     },
690
     },
658
     // 监听点击"导出"按钮
691
     // 监听点击"导出"按钮
659
     async onClickExport() {
692
     async onClickExport() {