Browse Source

feat: 运营数据 - 新增"ADQ运营数据"表

zhengxy 2 years ago
parent
commit
b3154c6523
1 changed files with 44 additions and 5 deletions
  1. 44 5
      project/src/components/dataBoard/operateDayRetrieve.vue

+ 44 - 5
project/src/components/dataBoard/operateDayRetrieve.vue

@@ -1,10 +1,23 @@
1 1
 <template>
2 2
   <div v-loading="loading">
3
+    <div class="topTagBox flex">
4
+      <div class="left flex-align-center">
5
+        <div
6
+          :class="['tagItem', isMP ? 'tagItem_active' : '']"
7
+          @click="onClickTab(order_type_options.MP)"
8
+        >MP运营数据</div>
9
+        <div
10
+          :class="['tagItem', isADQ ? 'tagItem_active' : '']"
11
+          @click="onClickTab(order_type_options.ADQ)"
12
+        >ADQ运营数据</div>
13
+      </div>
14
+    </div>
15
+
3 16
     <div class="screenBox flex">
4 17
       <div class="flex">
5 18
         <date-picker title="选择日期" @changeTime="changeTime"></date-picker>
6
-        <self-channel title="公众号" type='thePublic' @channelDefine="(val)=>{account_id = val;init(1)}"></self-channel>
7
-        <self-channel title="剧集" type='dramaList' @channelDefine="(val)=>{playlet_id = val;init(1)}"></self-channel>
19
+        <self-channel v-show="isMP" title="公众号" type='thePublic' @channelDefine="(val)=>{account_id = val;init(1)}"></self-channel>
20
+        <self-channel v-show="isMP" title="剧集" type='dramaList' @channelDefine="(val)=>{playlet_id = val;init(1)}"></self-channel>
8 21
       </div>
9 22
       <el-button type="primary" size="mini" @click="init(1,'export')">导出Excel</el-button>
10 23
     </div>
@@ -33,6 +46,12 @@
33 46
 <script>
34 47
 import datePicker from '@/components/assembly/screen/datePicker.vue'
35 48
 import selfChannel from '@/components/assembly/screen/channel.vue'
49
+
50
+const order_type_options = {
51
+  MP: '1',
52
+  ADQ: '2',
53
+}
54
+
36 55
 export default {
37 56
   components: { datePicker, selfChannel },
38 57
   data () {
@@ -46,6 +65,8 @@ export default {
46 65
       time: [],
47 66
       account_id: '',
48 67
       playlet_id: '',
68
+      order_type: order_type_options.MP,
69
+      order_type_options: Object.freeze(order_type_options),
49 70
       desCol: [
50 71
         { prop: "date", label: "日期" },
51 72
         { prop: "cost", label: "投放消耗" },
@@ -59,6 +80,16 @@ export default {
59 80
       height: ''
60 81
     }
61 82
   },
83
+  computed: {
84
+    // 当前列表是否为"MP运营数据"
85
+    isMP() {
86
+      return this.order_type === order_type_options.MP
87
+    },
88
+    // 当前列表是否为"ADQ运营数据"
89
+    isADQ() {
90
+      return this.order_type === order_type_options.ADQ
91
+    },
92
+  },
62 93
   created () {
63 94
     this.height = document.documentElement.clientHeight - 200 > 400 ? document.documentElement.clientHeight - 200 : 400
64 95
     this.init(1)
@@ -89,8 +120,9 @@ export default {
89 120
         params: {
90 121
           start: this.time[0],
91 122
           end: this.time[1],
92
-          drama_id: this.playlet_id,
93
-          app_id: this.account_id,
123
+          order_type: this.order_type,
124
+          drama_id: this.isMP ? this.playlet_id : '',
125
+          app_id: this.isMP ? this.account_id: '',
94 126
           page: type == 'export' ? 1 : this.page,
95 127
           pagesize: type == 'export' ? this.$store.state.exportNumber : this.page_size,
96 128
         }
@@ -104,6 +136,8 @@ export default {
104 136
             this.total = res.rst.pageInfo.total;
105 137
             this.pages = res.rst.pageInfo.pages;
106 138
             if (!res.rst.data || res.rst.data.length == 0) {
139
+              this.datas = []
140
+              this.$refs.plxTable.reloadData(this.datas)
107 141
               return
108 142
             }
109 143
             if (!this.desColFlag) {
@@ -162,7 +196,12 @@ export default {
162 196
         }
163 197
       ]
164 198
       this.$exportOrder({ excelDatas, name: `运营数据(导出时间:${this.$getDay(0)})` })
165
-    }
199
+    },
200
+    // 切换数据类型
201
+    onClickTab(order_type) {
202
+      this.order_type = order_type
203
+      this.init(1)
204
+    },
166 205
   }
167 206
 }
168 207
 </script>