소스 검색

收入分析

ith5 5 달 전
부모
커밋
4c3a5c20b9
2개의 변경된 파일163개의 추가작업 그리고 0개의 파일을 삭제
  1. 10 0
      src/views/v1/api/gameLog/analyse.js
  2. 153 0
      src/views/v1/gameLog/pay/index.vue

+ 10 - 0
src/views/v1/api/gameLog/analyse.js

@@ -53,5 +53,15 @@ export default {
       method: 'get',
       params
     })
+  },
+  /**
+   * 收入分析
+   */
+  getIncomeAnalysis(params = {}) {
+    return request({
+      url: '/v1/gameLog/analyse/getIncomeAnalysis',
+      method: 'get',
+      params
+    })
   }
 }

+ 153 - 0
src/views/v1/gameLog/pay/index.vue

@@ -0,0 +1,153 @@
+<template>
+  <div class="ma-content-block">
+    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm">
+      <!-- 搜索区 tableSearch -->
+      <template #tableSearch>
+        <a-col :sm="8" :xs="24">
+          <a-form-item label="游戏" field="game_id">
+            <game-select v-model="searchForm.game_id" multiple />
+          </a-form-item>
+        </a-col>
+        <a-col :sm="8" :xs="24">
+          <a-form-item label="注册日期" field="reg_date">
+            <a-date-picker class="w-full" v-model="searchForm.reg_date" :show-time="false" mode="date" />
+          </a-form-item>
+        </a-col>
+      </template>
+
+      <!-- Table 自定义渲染 -->
+    </sa-table>
+  </div>
+</template>
+
+<script setup>
+import { onMounted, ref, reactive } from 'vue'
+import api from '../../api/gameLog/analyse'
+import dayjs from 'dayjs'
+import GameSelect from '@/components/game-select/index.vue'
+import MediaSelect from '@/components/media-select/index.vue'
+import AuthSelect from '@/components/auth-select/index.vue'
+
+// 引用定义
+const crudRef = ref()
+const gameList = ref([])
+
+// 搜索表单
+const searchForm = ref({
+  game_id: '',
+  reg_date: '',
+})
+
+// SaTable 基础配置
+const options = reactive({
+  api: api.getIncomeAnalysis,
+  pk: 'date',
+  showSort: false,
+  showSummary: true,
+  operationColumn: false,
+  summary: [
+    {
+      action: 'totalRow',
+      dataIndex: 'tdate',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'game_id',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'login_total',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'pay_total',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'pay_num',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'pay_arpu',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'pay_ratio',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'yestoday_pay_total',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'pay_increase_yestoday',
+    },
+    {
+      action: 'totalRow',
+      dataIndex: 'pay_increase_week',
+    },
+  ],
+})
+
+// SaTable 列配置
+const columns = reactive([
+  { title: '游戏ID', dataIndex: 'game_id', width: 70, fixed: 'left' },
+  { title: '游戏名', dataIndex: 'game_name', width: 140, fixed: 'left' },
+  {
+    title: 'DAU',
+    dataIndex: 'login_total',
+    width: 90,
+  },
+  {
+    title: '付费人数',
+    dataIndex: 'pay_num',
+    width: 90,
+  },
+  {
+    title: '付费金额',
+    dataIndex: 'pay_total',
+    width: 90,
+  },
+  {
+    title: 'ARPU',
+    dataIndex: 'pay_arpu',
+    width: 90,
+  },
+  {
+    title: '收入比例',
+    dataIndex: 'pay_ratio',
+    width: 90,
+  },
+  {
+    title: '昨日充值',
+    dataIndex: 'yestoday_pay_total',
+    width: 90,
+  },
+  {
+    title: '昨日增长',
+    dataIndex: 'pay_increase_yestoday',
+    width: 90,
+  },
+  {
+    title: '上周增长',
+    dataIndex: 'pay_increase_week',
+    width: 90,
+  },
+])
+
+// 页面数据初始化
+const initPage = async () => {
+  searchForm.value.reg_date = dayjs().subtract(1, 'day').format('YYYY-MM-DD')
+}
+
+// SaTable 数据请求
+const refresh = async () => {
+  crudRef.value?.refresh()
+}
+
+// 页面加载完成执行
+onMounted(async () => {
+  initPage()
+  refresh()
+})
+</script>