Browse Source

feat: 平台推广数据

zhengxy 10 months ago
parent
commit
2f47bb57cb

+ 1 - 1
project/src/components/assembly/screen/channel.vue

223
       this.placeholderVal = '请选择'
223
       this.placeholderVal = '请选择'
224
     } else if (this.type == 'promotionData') {
224
     } else if (this.type == 'promotionData') {
225
       this.options = [...promotionData]
225
       this.options = [...promotionData]
226
-      this.placeholderVal = '请选择'
226
+      this.placeholderVal = '请选择平台'
227
     } else {
227
     } else {
228
       this.init()
228
       this.init()
229
     }
229
     }

+ 1 - 1
project/src/components/assembly/screen/channelMultiple.vue

220
       this.placeholderVal = '请选择'
220
       this.placeholderVal = '请选择'
221
     } else if (this.type == 'promotionData') { // 平台推广数据
221
     } else if (this.type == 'promotionData') { // 平台推广数据
222
       this.options = [...promotionData]
222
       this.options = [...promotionData]
223
-      this.placeholderVal = '请选择'
223
+      this.placeholderVal = '请选择平台'
224
     } else {
224
     } else {
225
       this.init()
225
       this.init()
226
     }
226
     }

+ 1 - 1
project/src/components/assembly/screen/channelV2.vue

497
         this.placeholderVal = '请选择'
497
         this.placeholderVal = '请选择'
498
       } else if (this.type == 'promotionData') { // 平台推广数据
498
       } else if (this.type == 'promotionData') { // 平台推广数据
499
         this.options = [...promotionData]
499
         this.options = [...promotionData]
500
-        this.placeholderVal = '请选择'
500
+        this.placeholderVal = '请选择平台'
501
       } else {
501
       } else {
502
         this.init()
502
         this.init()
503
       }
503
       }

+ 21 - 91
project/src/components/dataBoard/promotionData.vue

3
     <div class="screenBox flex-align-center">
3
     <div class="screenBox flex-align-center">
4
       <div class="flex-align-center" style="flex: 1">
4
       <div class="flex-align-center" style="flex: 1">
5
         <datePicker title="自定义" :is_include_today="false" :pickerOptions="pickerOptions" :quickFlag="true" :afferent_time="default_time" :clearFlag="false" @changeTime="changeTime" />
5
         <datePicker title="自定义" :is_include_today="false" :pickerOptions="pickerOptions" :quickFlag="true" :afferent_time="default_time" :clearFlag="false" @changeTime="changeTime" />
6
-        <selfInputV2 v-model="keyword" label_name="标题" placeholder="请输入关键字" labelWidth @change="onChangeKeyword" />
7
-        <selfChannelV2 v-model="plat_type" type='promotionData' title="平台" @change="onChangePlatType" />
6
+        <selfInputV2 v-model="keyword" label_name="推广标题" placeholder="请输入关键字" labelWidth @change="onChangeKeyword" />
7
+        <selfChannelV2 v-model="plat_type" type="promotionData" title="平台" labelWidth @change="onChangePlatType" />
8
       </div>
8
       </div>
9
       <div class="right">
9
       <div class="right">
10
-        <el-button v-if="isCanExport" type="primary" size="mini" @click="init(1, 'export')">导出Excel</el-button>
10
+        <el-button v-if="isCanExport" type="primary" size="mini" @click="init(1, 'export')" >导出Excel</el-button>
11
       </div>
11
       </div>
12
     </div>
12
     </div>
13
     <div class="dataInfoBox">
13
     <div class="dataInfoBox">
14
-      <div
15
-        class="dataInfoItem"
16
-        v-for="(item, index) in dataInfoArrs"
17
-        :key="index"
18
-      >
14
+      <div class="dataInfoItem" v-for="(item, index) in dataInfoArrs" :key="index">
19
         <div class="dataItemTitle">
15
         <div class="dataItemTitle">
20
           <img :src="item.icon" style="height: 14px" class="titleIcon" />
16
           <img :src="item.icon" style="height: 14px" class="titleIcon" />
21
           <span>{{ item.label }}</span>
17
           <span>{{ item.label }}</span>
22
         </div>
18
         </div>
23
         <div class="dataItem-data">
19
         <div class="dataItem-data">
24
-          {{
25
-            dataInfo && (dataInfo[item.prop] || dataInfo[item.prop] == 0)
26
-              ? $formatNum(dataInfo[item.prop])
27
-              : "-"
28
-          }}
29
-          <span class="f15">{{
30
-            item.brackets_prop
31
-              ? `(${
32
-                  dataInfo &&
33
-                  (dataInfo[item.brackets_prop] ||
34
-                    dataInfo[item.brackets_prop] == 0)
35
-                    ? $formatNum(dataInfo[item.brackets_prop])
36
-                    : "-"
37
-                })`
38
-              : ""
39
-          }}</span>
20
+          {{ dataInfo && (dataInfo[item.prop] || dataInfo[item.prop] == 0) ? $formatNum(dataInfo[item.prop])   : "-" }}
21
+          <span class="f15">{{ item.brackets_prop ? `(${dataInfo && (dataInfo[item.brackets_prop] || dataInfo[item.brackets_prop] == 0) ? $formatNum(dataInfo[item.brackets_prop]) : "-" })` : "" }}</span>
40
         </div>
22
         </div>
41
       </div>
23
       </div>
42
     </div>
24
     </div>
43
     <div>
25
     <div>
44
-      <ux-grid
45
-        ref="plxTable"
46
-        :border="false"
47
-        @row-click="
48
-          () => {
49
-            return;
50
-          }
51
-        "
52
-        :header-cell-style="
53
-          () => {
54
-            return {
55
-              backgroundColor: '#FFFFFF !important',
56
-              border: 'none!important',
57
-            };
58
-          }
59
-        "
60
-        :height="height"
61
-        show-footer-overflow="tooltip"
62
-        show-overflow="tooltip"
63
-        size="mini"
64
-      >
65
-        <ux-table-column
66
-          v-for="item in desCol"
67
-          v-if="!item.excelShow"
68
-          :key="item.prop"
69
-          :resizable="true"
70
-          :field="item.prop"
71
-          :title="item.label"
72
-          :min-width="item.min_width ? item.min_width : 120"
73
-          :fixed="item.fixed ? item.fixed : ''"
74
-          align="center"
75
-        >
26
+      <ux-grid ref="plxTable" :border="false" @row-click="() => { return; }" :header-cell-style="() => { return { backgroundColor: '#FFFFFF !important', border: 'none!important', }; } " :height="height" show-footer-overflow="tooltip" show-overflow="tooltip" size="mini">
27
+        <ux-table-column v-for="item in desCol" v-if="!item.excelShow" :key="item.prop" :resizable="true" :field="item.prop" :title="item.label" :min-width="item.min_width ? item.min_width : 120" :fixed="item.fixed ? item.fixed : ''" align="center">
76
           <template #header>
28
           <template #header>
77
-            <div :class="['flex-align-jus-center']">
78
-              {{ item.label
79
-              }}{{ item.brackets_label ? `(${item.brackets_label})` : "" }}
80
-              <el-tooltip
81
-                v-if="item.notes"
82
-                :content="item.notes"
83
-                placement="top"
84
-              >
85
-                <div><i class="el-icon-question"></i></div>
29
+            <div :class="['flex-align-jus-center']">{{ item.label }}{{ item.brackets_label ? `(${item.brackets_label})` : "" }}
30
+              <el-tooltip v-if="item.notes" :content="item.notes" placement="top">
31
+                <div><i class="el-icon-question" /></div>
86
               </el-tooltip>
32
               </el-tooltip>
87
             </div>
33
             </div>
88
           </template>
34
           </template>
89
           <template v-slot="{ row }">
35
           <template v-slot="{ row }">
90
             <span v-if="item.prop === 'pid' || item.prop === 'adq_account_id'">{{ row[item.prop] }}</span>
36
             <span v-if="item.prop === 'pid' || item.prop === 'adq_account_id'">{{ row[item.prop] }}</span>
91
-            <span v-else-if="item.prop === 'plat_type'">{{ row[item.prop] == 10 ? '番茄' : (row[item.prop] == 8 ? '映客' : '') }}</span>
92
-            <span v-else>{{ row[item.prop] !== "" && (row[item.prop] || row[item.prop] === 0 || row[item.prop] === "0")   ? $formatNum(row[item.prop])   : "-" }}</span>
93
-            <span v-if="item.brackets_label" >({{   row[item.brackets_prop] != "" && (row[item.brackets_prop] || row[item.brackets_prop] == 0) ? $formatNum(row[item.brackets_prop]) : "-" }})</span>
37
+            <span v-else-if="item.prop === 'plat_type'">{{ row[item.prop] == 10 ? "番茄" : row[item.prop] == 8 ? "映客" : "" }}</span>
38
+            <span v-else>{{ row[item.prop] !== "" && (row[item.prop] || row[item.prop] === 0 || row[item.prop] === "0") ? $formatNum(row[item.prop]) : "-" }}</span>
39
+            <span v-if="item.brackets_label">({{ row[item.brackets_prop] != "" && (row[item.brackets_prop] || row[item.brackets_prop] == 0) ? $formatNum(row[item.brackets_prop]) : "-" }})</span>
94
           </template>
40
           </template>
95
         </ux-table-column>
41
         </ux-table-column>
96
       </ux-grid>
42
       </ux-grid>
97
       <div class="pagination" v-show="total > 0">
43
       <div class="pagination" v-show="total > 0">
98
-        <el-pagination
99
-          background
100
-          :current-page="page"
101
-          @current-change="handleCurrentChange"
102
-          layout="prev, pager, next, sizes, jumper"
103
-          :page-sizes="[20, 50, 100]"
104
-          @size-change="handleSizeChange"
105
-          :page-count="Number(pages)"
106
-        />
44
+        <el-pagination background :current-page="page" @current-change="handleCurrentChange" layout="prev, pager, next, sizes, jumper" :page-sizes="[20, 50, 100]" @size-change="handleSizeChange" :page-count="Number(pages)" />
107
       </div>
45
       </div>
108
     </div>
46
     </div>
109
   </div>
47
   </div>
143
           prop: "first_roi",
81
           prop: "first_roi",
144
           label: "首日roi",
82
           label: "首日roi",
145
           icon: require("@/assets/img/icon/roi@2x.png"),
83
           icon: require("@/assets/img/icon/roi@2x.png"),
146
-        }
84
+        },
147
       ],
85
       ],
148
       dataInfo: {},
86
       dataInfo: {},
149
       desCol: [
87
       desCol: [
150
-        { prop: "populariz_title", label: "推广标题", fixed: "left", min_width: "160" },
88
+        { prop: "populariz_title", label: "推广标题", fixed: "left", min_width: "160", },
151
         { prop: "pid", label: "推广ID", min_width: "160" },
89
         { prop: "pid", label: "推广ID", min_width: "160" },
152
         { prop: "ref_date", label: "日期", min_width: "160" },
90
         { prop: "ref_date", label: "日期", min_width: "160" },
153
         { prop: "plat_type", label: "平台" },
91
         { prop: "plat_type", label: "平台" },
170
   },
108
   },
171
   created() {
109
   created() {
172
     this.time = this.default_time;
110
     this.time = this.default_time;
173
-    this.height =
174
-      document.documentElement.clientHeight - 400 > 400
175
-        ? document.documentElement.clientHeight - 400
176
-        : 400;
111
+    this.height = document.documentElement.clientHeight - 330 > 330 ? document.documentElement.clientHeight - 330 : 330;
177
     this.init(1);
112
     this.init(1);
178
   },
113
   },
179
   methods: {
114
   methods: {
199
         }
134
         }
200
       }
135
       }
201
       this.loading = true;
136
       this.loading = true;
202
-      this.$axios
203
-        .get(this.URL.BASEURL + this.URL.dataBoard_promotionData, {
137
+      this.$axios.get(this.URL.BASEURL + this.URL.dataBoard_promotionData, {
204
           params: {
138
           params: {
205
             send_time_start: this.time[0],
139
             send_time_start: this.time[0],
206
             send_time_end: this.time[1],
140
             send_time_end: this.time[1],
207
             keyword: this.keyword,
141
             keyword: this.keyword,
208
             plat_type: this.plat_type,
142
             plat_type: this.plat_type,
209
             page: type == "export" ? 1 : this.page,
143
             page: type == "export" ? 1 : this.page,
210
-            page_size:
211
-              type == "export"
212
-                ? this.$store.state.exportNumber
213
-                : this.page_size,
144
+            page_size: type == "export" ? this.$store.state.exportNumber : this.page_size,
214
           },
145
           },
215
         })
146
         })
216
         .then((res) => {
147
         .then((res) => {
217
           var res = res.data;
148
           var res = res.data;
218
           this.loading = false;
149
           this.loading = false;
219
           if (res && res.errno == 0) {
150
           if (res && res.errno == 0) {
220
-            console.log("res => ", res);
221
             if (res.rst.extra) {
151
             if (res.rst.extra) {
222
               // 汇总数据
152
               // 汇总数据
223
               this.dataInfo = res.rst.extra;
153
               this.dataInfo = res.rst.extra;
276
       this.init(1);
206
       this.init(1);
277
     },
207
     },
278
     onChangePlatType(val) {
208
     onChangePlatType(val) {
279
-      this.plat_type = val || ''
209
+      this.plat_type = val || "";
280
       this.init(1);
210
       this.init(1);
281
     },
211
     },
282
   },
212
   },