Browse Source

feat: 企微数据 - 短剧数据趋势 - 默认排序逻辑

zhengxy 2 years ago
parent
commit
2d48ad2277
1 changed files with 11 additions and 4 deletions
  1. 11 4
      project/src/components/dataBoard/shortDramaTrends.vue

+ 11 - 4
project/src/components/dataBoard/shortDramaTrends.vue

197
         closing_date: '', // 收益截止日期
197
         closing_date: '', // 收益截止日期
198
         plat_order_type: '', // 推广类型
198
         plat_order_type: '', // 推广类型
199
         costCover: ['', ''], // 回本率(范围)
199
         costCover: ['', ''], // 回本率(范围)
200
-        sort_field: 'expense_date', // 排序字段 - 默认值
200
+        sort_field: 'paid', // 排序字段 - 默认值
201
         sort_type: 'desc', // 升序/降序
201
         sort_type: 'desc', // 升序/降序
202
       },
202
       },
203
     }
203
     }
211
     isADQ() {
211
     isADQ() {
212
       return this.filter.order_type === orderTypeOptions.ADQ
212
       return this.filter.order_type === orderTypeOptions.ADQ
213
     },
213
     },
214
+    // 当前"时间"列是否展示的为"时间段" => 是时间段 默认排序"消耗"、非时间段 默认排序时间
215
+    isShowTimes() {
216
+      // 没选"短剧" => 展示的为时间段
217
+      return !this.filter.playlet_id
218
+    },
214
   },
219
   },
215
   created () {
220
   created () {
216
     this.initTableHeight()
221
     this.initTableHeight()
534
     onChangeOrderType() {
539
     onChangeOrderType() {
535
       this.handleGetChart()
540
       this.handleGetChart()
536
       this.handleGetSummaryList()
541
       this.handleGetSummaryList()
537
-      this.filter.sort_field = 'expense_date'
542
+      this.filter.sort_field = this.isShowTimes ? 'paid' : 'expense_date'
538
       this.filter.sort_type = 'desc'
543
       this.filter.sort_type = 'desc'
539
       this.pagination.page = 1
544
       this.pagination.page = 1
540
       this.handleGetList()
545
       this.handleGetList()
552
       this.filter.playlet_id = val
557
       this.filter.playlet_id = val
553
       this.handleGetChart()
558
       this.handleGetChart()
554
       this.handleGetSummaryList()
559
       this.handleGetSummaryList()
560
+      this.filter.sort_field = this.isShowTimes ? 'paid' : 'expense_date'
561
+      this.filter.sort_type = 'desc'
555
       this.pagination.page = 1
562
       this.pagination.page = 1
556
       this.handleGetList()
563
       this.handleGetList()
557
     },
564
     },
589
       if (this.filter.sort_field === sort_field) {
596
       if (this.filter.sort_field === sort_field) {
590
         if (this.filter.sort_type === sort_type) {
597
         if (this.filter.sort_type === sort_type) {
591
           // 点击的是当前排序字段 && 是当前排序类型 => 重置 取消排序
598
           // 点击的是当前排序字段 && 是当前排序类型 => 重置 取消排序
592
-          this.filter.sort_field = 'expense_date'
599
+          this.filter.sort_field = this.isShowTimes ? 'paid' : 'expense_date'
593
           this.filter.sort_type = 'desc'
600
           this.filter.sort_type = 'desc'
594
         } else {
601
         } else {
595
           // 点击的是当前排序字段 && 非当前排序类型 => 设置排序类型
602
           // 点击的是当前排序字段 && 非当前排序类型 => 设置排序类型
613
       this.filter.closing_date = '',
620
       this.filter.closing_date = '',
614
       this.filter.plat_order_type = ''
621
       this.filter.plat_order_type = ''
615
       this.filter.costCover = ['', '']
622
       this.filter.costCover = ['', '']
616
-      this.filter.sort_field = 'expense_date'
623
+      this.filter.sort_field = 'paid'
617
       this.filter.sort_type = 'desc'
624
       this.filter.sort_type = 'desc'
618
       this.pagination.page = 1
625
       this.pagination.page = 1
619
       this.handleGetChart()
626
       this.handleGetChart()