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
 <template>
1
 <template>
2
   <div v-loading="loading">
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
     <div class="screenBox flex">
16
     <div class="screenBox flex">
4
       <div class="flex">
17
       <div class="flex">
5
         <date-picker title="选择日期" @changeTime="changeTime"></date-picker>
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
       </div>
21
       </div>
9
       <el-button type="primary" size="mini" @click="init(1,'export')">导出Excel</el-button>
22
       <el-button type="primary" size="mini" @click="init(1,'export')">导出Excel</el-button>
10
     </div>
23
     </div>
33
 <script>
46
 <script>
34
 import datePicker from '@/components/assembly/screen/datePicker.vue'
47
 import datePicker from '@/components/assembly/screen/datePicker.vue'
35
 import selfChannel from '@/components/assembly/screen/channel.vue'
48
 import selfChannel from '@/components/assembly/screen/channel.vue'
49
+
50
+const order_type_options = {
51
+  MP: '1',
52
+  ADQ: '2',
53
+}
54
+
36
 export default {
55
 export default {
37
   components: { datePicker, selfChannel },
56
   components: { datePicker, selfChannel },
38
   data () {
57
   data () {
46
       time: [],
65
       time: [],
47
       account_id: '',
66
       account_id: '',
48
       playlet_id: '',
67
       playlet_id: '',
68
+      order_type: order_type_options.MP,
69
+      order_type_options: Object.freeze(order_type_options),
49
       desCol: [
70
       desCol: [
50
         { prop: "date", label: "日期" },
71
         { prop: "date", label: "日期" },
51
         { prop: "cost", label: "投放消耗" },
72
         { prop: "cost", label: "投放消耗" },
59
       height: ''
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
   created () {
93
   created () {
63
     this.height = document.documentElement.clientHeight - 200 > 400 ? document.documentElement.clientHeight - 200 : 400
94
     this.height = document.documentElement.clientHeight - 200 > 400 ? document.documentElement.clientHeight - 200 : 400
64
     this.init(1)
95
     this.init(1)
89
         params: {
120
         params: {
90
           start: this.time[0],
121
           start: this.time[0],
91
           end: this.time[1],
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
           page: type == 'export' ? 1 : this.page,
126
           page: type == 'export' ? 1 : this.page,
95
           pagesize: type == 'export' ? this.$store.state.exportNumber : this.page_size,
127
           pagesize: type == 'export' ? this.$store.state.exportNumber : this.page_size,
96
         }
128
         }
104
             this.total = res.rst.pageInfo.total;
136
             this.total = res.rst.pageInfo.total;
105
             this.pages = res.rst.pageInfo.pages;
137
             this.pages = res.rst.pageInfo.pages;
106
             if (!res.rst.data || res.rst.data.length == 0) {
138
             if (!res.rst.data || res.rst.data.length == 0) {
139
+              this.datas = []
140
+              this.$refs.plxTable.reloadData(this.datas)
107
               return
141
               return
108
             }
142
             }
109
             if (!this.desColFlag) {
143
             if (!this.desColFlag) {
162
         }
196
         }
163
       ]
197
       ]
164
       this.$exportOrder({ excelDatas, name: `运营数据(导出时间:${this.$getDay(0)})` })
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
 </script>
207
 </script>