Ver Código Fonte

feat: 数据看板 - 投手投放数据 - 新增"账户余额"&数据更新时间

zhengxy 1 ano atrás
pai
commit
6227e7f405

+ 45 - 0
project/src/components/dataBoard/throwPerson/throwPersonPuton.vue

@@ -20,6 +20,10 @@
20 20
     </div>
21 21
     <!-- E 筛选区 -->
22 22
 
23
+    <!-- S 数据更新时间 -->
24
+    <div class="update-time"><i class="el-icon-warning-outline" />数据更新时间:{{ updateTime || '-' }}</div>
25
+    <!-- E 数据更新时间 -->
26
+
23 27
     <div class="dataInfoBox" v-loading="dataLoading">
24 28
       <div class="dataInfoItem" v-for="(item, index) in dataInfoArrs" :key="index">
25 29
         <div class="dataItemTitle">
@@ -235,6 +239,7 @@ export default {
235 239
         { prop: "scan_follow_total", label: "企微粉丝人数" },
236 240
         { prop: "qw_cost", label: "企微成本" },
237 241
         { prop: "new_cost", label: "用户首日下单成本", min_width: 160 },
242
+        { prop: "balance", label: "账户余额", },
238 243
         { prop: "first_day_roi", label: "首日ROI", notes: '首日ROI=当日新用户充值之和/累计消耗' },
239 244
         { prop: "first_roi", label: "首日首单ROI", },
240 245
         { prop: "profile", label: "总毛利额", notes: '总毛利额=累计充值-累计消耗' },
@@ -254,6 +259,7 @@ export default {
254 259
         data: {}
255 260
       },//去重数据
256 261
       reset: false,
262
+      updateTime: '', // 数据更新时间
257 263
     }
258 264
   },
259 265
   computed: {
@@ -267,8 +273,24 @@ export default {
267 273
     this.time = this.default_time
268 274
     this.stat_throwPersonData()
269 275
     this.init(1)
276
+    this.handleGetUpdateTime()
270 277
   },
271 278
   methods: {
279
+    // 获取"数据更新时间"
280
+    async handleGetUpdateTime() {
281
+      try {
282
+        const params = { type: 'account_funds' }
283
+        const { data: res = {} } = await this.$axios.get(`${this.URL.BASEURL}${this.URL.dataBoard_uptime}`, { params })
284
+        if (res && res.errno == 0) {
285
+          this.updateTime = res.rst.uptime
286
+        } else if (res.errno != 4002) {
287
+          this.$message.warning(res.err)
288
+          this.updateTime = ''
289
+        }
290
+      } catch (error) {
291
+        this.updateTime = ''
292
+      }
293
+    },
272 294
     lookDuplicateRemovalData () {//点击查看去重数据
273 295
       this.duplicateRemovalData.loading = true;
274 296
       this.$axios.get(this.URL.BASEURL + this.URL.statistics_pitcherDataUniqueUser, {
@@ -313,6 +335,7 @@ export default {
313 335
       this.duplicateRemovalData.flag = false;
314 336
       this.stat_throwPersonData()
315 337
       this.init(1)
338
+      this.handleGetUpdateTime()
316 339
     },
317 340
     stat_throwPersonData () {//概览
318 341
       this.gl_loading = true
@@ -400,10 +423,12 @@ export default {
400 423
     },
401 424
     handleCurrentChange (val) {
402 425
       this.init(val)
426
+      this.handleGetUpdateTime()
403 427
     },
404 428
     handleSizeChange (page_size) {
405 429
       this.page_size = page_size
406 430
       this.init(1)
431
+      this.handleGetUpdateTime()
407 432
     },
408 433
     sortFieldEvent (type) {
409 434
       if (type === this.sort_field) { // 重复点击当前排序字段 => 重置排序字段
@@ -412,6 +437,7 @@ export default {
412 437
         this.sort_field = type;
413 438
       }
414 439
       this.init(1)
440
+      this.handleGetUpdateTime()
415 441
     },
416 442
     exportEvent (data) {
417 443
 
@@ -446,30 +472,35 @@ export default {
446 472
       this.user_id = val;
447 473
       this.stat_throwPersonData();
448 474
       this.init(1)
475
+      this.handleGetUpdateTime()
449 476
     },
450 477
     onChangeDramaId(val) {
451 478
       this.duplicateRemovalData.flag = false;
452 479
       this.drama_id = val;
453 480
       this.stat_throwPersonData();
454 481
       this.init(1)
482
+      this.handleGetUpdateTime()
455 483
     },
456 484
     onChangeAppId(val) {
457 485
       this.duplicateRemovalData.flag = false;
458 486
       this.app_id = val;
459 487
       this.stat_throwPersonData();
460 488
       this.init(1)
489
+      this.handleGetUpdateTime()
461 490
     },
462 491
     onChangeLaunchAccountId(val) {
463 492
       this.duplicateRemovalData.flag = false;
464 493
       this.launch_account_id = val;
465 494
       this.stat_throwPersonData();
466 495
       this.init(1)
496
+      this.handleGetUpdateTime()
467 497
     },
468 498
     onChangeClosingDate(val) {
469 499
       this.duplicateRemovalData.flag = false;
470 500
       this.closing_date = val || ''
471 501
       this.stat_throwPersonData();
472 502
       this.init(1)
503
+      this.handleGetUpdateTime()
473 504
     },
474 505
     // 监听点击"重置"按钮
475 506
     onClickReset() {
@@ -484,6 +515,7 @@ export default {
484 515
       this.duplicateRemovalData.flag = false;
485 516
       this.stat_throwPersonData();
486 517
       this.init(1)
518
+      this.handleGetUpdateTime()
487 519
     },
488 520
 
489 521
     onClickAccountName(account) {
@@ -508,6 +540,19 @@ export default {
508 540
 </style>
509 541
 
510 542
 <style lang="scss" scoped>
543
+.update-time {
544
+  margin-top: 10px;
545
+  padding-left: 20px;
546
+  display: flex;
547
+  align-items: center;
548
+  font-size: 12px;
549
+  color: #999;
550
+  i {
551
+    font-size: 14px;
552
+    font-weight: 600;
553
+    margin-right: 4px;
554
+  }
555
+}
511 556
 /deep/ .common-screen-label {
512 557
   flex-shrink: 0;
513 558
 }