ith5 hai 3 meses
pai
achega
e2a14b5641

+ 23 - 23
src/components/sa-table/defaultOptions.js

@@ -2,7 +2,7 @@ export default {
   // 当前crud组件的 id,全局唯一,不指定则随机生成一个
   id: undefined,
   // 主键名称
-  pk: 'id',
+  pk: "id",
   // 请求api方法
   api: () => {},
   // 设置分页组件每页记录数
@@ -20,18 +20,18 @@ export default {
   // 斑马线
   stripe: true,
   // 表格大小
-  size: 'small',
+  size: "small",
   // 是否显示展开/折叠按钮
   isExpand: false,
   // 是否显示工具栏
   showTools: true,
   // 页面布局方式,支持 normal(标准)和 fixed(固定)两种
-  pageLayout: 'fixed',
+  pageLayout: "fixed",
   height: 0,
   // 简洁模式
   pageSimple: false,
   // 显示排序
-  showSort: true,
+  showSort: false,
   // 是否需要服务端排序
   serverSort: false,
   // 显示隐藏列
@@ -39,9 +39,9 @@ export default {
   // 显示搜索
   showSearch: true,
   // 搜索提交按钮文案
-  searchText: '搜索',
+  searchText: "搜索",
   // 搜索重置按钮文案
-  resetText: '重置',
+  resetText: "重置",
   // 强制搜索一行显示
   singleLine: false,
 
@@ -51,9 +51,9 @@ export default {
     // 显示新增按钮的权限
     auth: [],
     // 按钮文案
-    text: '查看',
+    text: "查看",
     // 是否显示
-    show: false
+    show: false,
   },
 
   add: {
@@ -62,9 +62,9 @@ export default {
     // 显示新增按钮的权限
     auth: [],
     // 按钮文案
-    text: '新增',
+    text: "新增",
     // 是否显示
-    show: false
+    show: false,
   },
   edit: {
     // 编辑api
@@ -72,9 +72,9 @@ export default {
     // 显示编辑按钮的权限
     auth: [],
     // 按钮文案
-    text: '编辑',
+    text: "编辑",
     // 是否显示
-    show: false
+    show: false,
   },
   delete: {
     // 删除api
@@ -82,11 +82,11 @@ export default {
     // 显示删除按钮的权限
     auth: [],
     // 按钮文案
-    text: '删除',
+    text: "删除",
     // 是否显示
     show: false,
     // 是否显示批量处理按钮
-    batch: true
+    batch: true,
   },
   import: {
     // 导入url
@@ -98,9 +98,9 @@ export default {
     // 显示导入按钮的权限
     auth: [],
     // 按钮文案
-    text: '导入',
+    text: "导入",
     // 是否显示
-    show: false
+    show: false,
   },
   export: {
     // 导出url
@@ -108,27 +108,27 @@ export default {
     // 显示导出按钮的权限
     auth: [],
     // 按钮文案
-    text: '导出',
+    text: "导出",
     // 是否显示
-    show: false
+    show: false,
   },
 
   // 列对齐方式
-  columnAlign: 'center',
+  columnAlign: "center",
 
   // 是否显示索引列
   showIndex: false,
   // 索引列名称
-  indexLabel: '序号',
+  indexLabel: "序号",
   // 索引列宽度
   indexColumnWidth: 70,
   // 索引列固定方向,false 为不固定
-  indexColumnFixed: 'left',
+  indexColumnFixed: "left",
 
   // 是否显示操作列
   operationColumn: true,
   // 操作列宽度
   operationColumnWidth: 190,
   // 操作列名称
-  operationColumnText: '操作'
-}
+  operationColumnText: "操作",
+};

+ 69 - 48
src/views/v1/gameLog/activeDay/index.vue

@@ -1,6 +1,12 @@
 <template>
   <div class="ma-content-block">
-    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm" @search="handleRequestData">
+    <sa-table
+      ref="crudRef"
+      :options="options"
+      :columns="columns"
+      :searchForm="searchForm"
+      @search="handleRequestData"
+    >
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="6" :xs="24">
@@ -10,7 +16,12 @@
         </a-col>
         <a-col :sm="6" :xs="24">
           <a-form-item label="注册日期" field="tdate">
-            <a-range-picker class="w-full" v-model="searchForm.tdate" :show-time="false" mode="date" />
+            <a-range-picker
+              class="w-full"
+              v-model="searchForm.tdate"
+              :show-time="false"
+              mode="date"
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="6" :xs="24">
@@ -26,103 +37,113 @@
 </template>
 
 <script setup>
-import { onMounted, ref, reactive, nextTick } from 'vue'
-import api from '../../api/gameLog/analyse'
-import dayjs from 'dayjs'
-import commonApi from '../../api/common'
-import GameSelect from '@/components/game-select/index.vue'
+import { onMounted, ref, reactive, nextTick } from "vue";
+import api from "../../api/gameLog/analyse";
+import dayjs from "dayjs";
+import commonApi from "../../api/common";
+import GameSelect from "@/components/game-select/index.vue";
 
 // 引用定义
-const crudRef = ref()
-const gameList = ref([])
+const crudRef = ref();
+const gameList = ref([]);
 
 // 搜索表单
 const searchForm = ref({
-  game_id: '',
+  game_id: "",
   tdate: [],
-  days: '1',
-})
+  days: "1",
+});
 
 const days_options = ref([
-  { label: '次留', value: '1' },
-  { label: '3留', value: '3' },
-  { label: '5留', value: '5' },
-  { label: '7留', value: '7' },
-  { label: '15留', value: '15' },
-  { label: '30留', value: '30' },
-])
+  { label: "次留", value: "1" },
+  { label: "3留", value: "3" },
+  { label: "5留", value: "5" },
+  { label: "7留", value: "7" },
+  { label: "15留", value: "15" },
+  { label: "30留", value: "30" },
+]);
 
 // SaTable 基础配置
 const options = reactive({
   api: api.getRetentionDayDataList,
-  pk: 'id',
+  pk: "id",
   showSummary: true,
   operationColumn: false,
   showSort: false,
   summary: [],
-})
+});
 
 // SaTable 列配置
-const columns = ref([])
+const columns = ref([]);
 
 // 页面数据初始化
 const initPage = async () => {
-  searchForm.value.tdate = [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]
-}
+  searchForm.value.tdate[0] = dayjs().subtract(8, "day").format("YYYY-MM-DD");
+  searchForm.value.tdate[1] = dayjs().subtract(1, "day").format("YYYY-MM-DD");
+};
 
 // SaTable 数据请求
 const refresh = async () => {
-  crudRef.value?.refresh()
-}
+  crudRef.value?.refresh();
+};
 
 const handleRequestData = () => {
   // 使用 nextTick 确保在 DOM 更新后再获取数据
   nextTick(() => {
-    const res = crudRef.value.getResponseData()
-    console.log('完整的响应数据:', res)
-    console.log('totalRow 数据:', res?.totalRow)
+    const res = crudRef.value.getResponseData();
+    console.log("完整的响应数据:", res);
+    console.log("totalRow 数据:", res?.totalRow);
 
     // 重新添加动态列,并为每一列添加合计配置
     if (res && res.columns && Array.isArray(res.columns)) {
-      columns.value = res.columns
-      console.log('columns updated:', columns.value)
+      columns.value = res.columns;
+      console.log("columns updated:", columns.value);
 
       // 动态生成 summary 配置,dataIndex 与 columns 保持一致
       if (Array.isArray(res.columns)) {
         // 只对数值类型的列添加合计
         const numericColumns = res.columns.filter((col) => {
           // 排除日期、文本等非数值列
-          const excludeFields = ['reg_date', 'date', 'time', 'name', 'title', 'description', 'game_id', 'game_name']
-          return !excludeFields.includes(col.dataIndex)
-        })
+          const excludeFields = [
+            "reg_date",
+            "date",
+            "time",
+            "name",
+            "title",
+            "description",
+            "game_id",
+            "game_name",
+          ];
+          return !excludeFields.includes(col.dataIndex);
+        });
 
         // 清空并重新设置 summary 配置
-        options.summary.length = 0
+        options.summary.length = 0;
         numericColumns.forEach((col) => {
           options.summary.push({
-            action: 'totalRow',
+            action: "totalRow",
             dataIndex: col.dataIndex,
-          })
-        })
+          });
+        });
 
-        console.log('summary config:', options.summary)
+        console.log("summary config:", options.summary);
         console.log(
-          'numeric columns:',
+          "numeric columns:",
           numericColumns.map((col) => col.dataIndex)
-        )
-        console.log('options.summary length:', options.summary.length)
+        );
+        console.log("options.summary length:", options.summary.length);
       }
     }
-  })
-}
+  });
+};
 
 // 页面加载完成执行
 onMounted(async () => {
-  initPage()
-  refresh()
-})
+  initPage();
+  refresh();
+});
 </script>
 
 <script>
-export default { name: 'v1/analyse/activeDay' }
+export default { name: "v1/analyse/activeDay" };
 </script>

+ 142 - 115
src/views/v1/gameLog/agentByDay/index.vue

@@ -1,6 +1,11 @@
 <template>
   <div class="ma-content-block">
-    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm">
+    <sa-table
+      ref="crudRef"
+      :options="options"
+      :columns="columns"
+      :searchForm="searchForm"
+    >
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="4" :xs="24">
@@ -10,28 +15,49 @@
         </a-col>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="5" :xs="24">
           <a-form-item label="注册日期" field="tdate">
-            <a-range-picker class="w-full" v-model="searchForm.tdate" :show-time="false" mode="date" />
+            <a-range-picker
+              class="w-full"
+              v-model="searchForm.tdate"
+              :show-time="false"
+              mode="date"
+            />
           </a-form-item>
         </a-col>
 
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="渠道ID" field="agent_id">
-            <a-input v-model="searchForm.agent_id" placeholder="渠道ID" allow-clear />
+            <a-input
+              v-model="searchForm.agent_id"
+              placeholder="渠道ID"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="渠道名称" field="agent_name">
-            <a-input v-model="searchForm.agent_name" placeholder="渠道名称" allow-clear />
+            <a-input
+              v-model="searchForm.agent_name"
+              placeholder="渠道名称"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="广告位ID" field="site_id">
-            <a-input v-model="searchForm.site_id" placeholder="广告位ID" allow-clear />
+            <a-input
+              v-model="searchForm.site_id"
+              placeholder="广告位ID"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="3" :xs="24">
           <a-form-item label="广告名称" field="site_name">
-            <a-input v-model="searchForm.site_name" placeholder="广告名称" allow-clear />
+            <a-input
+              v-model="searchForm.site_name"
+              placeholder="广告名称"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="4" :xs="24">
@@ -52,205 +78,206 @@
 </template>
 
 <script setup>
-import { onMounted, ref, reactive } from 'vue'
-import api from '../../api/gameLog/channelAnalysis'
-import dayjs from 'dayjs'
-import GameSelect from '@/components/game-select/index.vue'
-import MediaSelect from '@/components/media-select/index.vue'
+import { onMounted, ref, reactive } from "vue";
+import api from "../../api/gameLog/channelAnalysis";
+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'
+import AuthSelect from "@/components/auth-select/index.vue";
 
 // 引用定义
-const crudRef = ref()
-const gameList = ref([])
+const crudRef = ref();
+const gameList = ref([]);
 
 // 搜索表单
 const searchForm = ref({
-  game_id: '',
-  media_id: '',
-  auth_id: '',
-  agent_id: '',
-  agent_name: '',
-  site_name: '',
-  site_id: '',
+  game_id: "",
+  media_id: "",
+  auth_id: "",
+  agent_id: "",
+  agent_name: "",
+  site_name: "",
+  site_id: "",
   tdate: [],
-})
+});
 
 // SaTable 基础配置
 const options = reactive({
   api: api.getAgentDayDataList,
-  pk: 'tdate',
+  pk: "tdate",
 
   showSummary: true,
   showSort: true,
   summary: [
     {
-      action: 'totalRow',
-      dataIndex: 'tdate',
+      action: "totalRow",
+      dataIndex: "tdate",
     },
     {
-      suffixText: '元',
-      action: 'totalRow',
-      dataIndex: 'cost',
+      suffixText: "元",
+      action: "totalRow",
+      dataIndex: "cost",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'install',
+      action: "totalRow",
+      dataIndex: "install",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'reg_dev',
+      action: "totalRow",
+      dataIndex: "reg_dev",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'reg_total',
+      action: "totalRow",
+      dataIndex: "reg_total",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'role_total',
+      action: "totalRow",
+      dataIndex: "role_total",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'role_per',
+      action: "totalRow",
+      dataIndex: "role_per",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'active',
+      action: "totalRow",
+      dataIndex: "active",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'a_cost',
+      action: "totalRow",
+      dataIndex: "a_cost",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'a_per',
+      action: "totalRow",
+      dataIndex: "a_per",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'reg_pay_num',
+      action: "totalRow",
+      dataIndex: "reg_pay_num",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'reg_pay_total',
+      action: "totalRow",
+      dataIndex: "reg_pay_total",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'p_per',
+      action: "totalRow",
+      dataIndex: "p_per",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'da_per',
+      action: "totalRow",
+      dataIndex: "da_per",
     },
     {
-      action: 'totalRow',
-      dataIndex: 're_per',
+      action: "totalRow",
+      dataIndex: "re_per",
     },
     {
-      action: 'totalRow',
-      dataIndex: 're_amount_per',
+      action: "totalRow",
+      dataIndex: "re_amount_per",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'old_login_total',
+      action: "totalRow",
+      dataIndex: "old_login_total",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'reg_cost',
+      action: "totalRow",
+      dataIndex: "reg_cost",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'p_cost',
+      action: "totalRow",
+      dataIndex: "p_cost",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'arpu',
+      action: "totalRow",
+      dataIndex: "arpu",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'r_arpu',
+      action: "totalRow",
+      dataIndex: "r_arpu",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'agent_name',
+      action: "totalRow",
+      dataIndex: "agent_name",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'site_name',
+      action: "totalRow",
+      dataIndex: "site_name",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'auth_name',
+      action: "totalRow",
+      dataIndex: "auth_name",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'pay_total',
+      action: "totalRow",
+      dataIndex: "pay_total",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'pay_amount',
+      action: "totalRow",
+      dataIndex: "pay_amount",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'pay_cost',
+      action: "totalRow",
+      dataIndex: "pay_cost",
     },
   ],
 
   operationColumn: false,
-})
+});
 
 // SaTable 列配置
 const columns = reactive([
-  { title: '日期', dataIndex: 'tdate', width: 130, fixed: 'left' },
-  { title: '支出', dataIndex: 'cost', width: 100 },
-  { title: '展示IP', dataIndex: 'show_ip', width: 100 },
-  { title: '激活', dataIndex: 'install', width: 100 },
-  { title: '激活率', dataIndex: 'i_per', width: 100 },
+  { title: "日期", dataIndex: "tdate", width: 130, fixed: "left" },
+  { title: "支出", dataIndex: "cost", width: 100 },
+  { title: "展示IP", dataIndex: "show_ip", width: 100 },
+  { title: "激活", dataIndex: "install", width: 100 },
+  { title: "激活率", dataIndex: "i_per", width: 100 },
 
-  { title: '注册设备', dataIndex: 'reg_dev', width: 100 },
-  { title: '注册数', dataIndex: 'reg_total', width: 100 },
-  { title: '注册率', dataIndex: 'r_per', width: 100 },
+  { title: "注册设备", dataIndex: "reg_dev", width: 100 },
+  { title: "注册数", dataIndex: "reg_total", width: 100 },
+  { title: "注册率", dataIndex: "r_per", width: 100 },
 
-  { title: '注册成本', dataIndex: 'reg_cost', width: 100 },
-  { title: '创角数', dataIndex: 'role_total', width: 100 },
-  { title: '创角率', dataIndex: 'role_per', width: 100 },
-  { title: '次留数', dataIndex: 'active', width: 100 },
-  { title: '次留成本', dataIndex: 'a_cost', width: 100 },
-  { title: '次留率', dataIndex: 'a_per', width: 100 },
-  { title: '总付费人数', dataIndex: 'reg_pay_num', width: 100 },
-  { title: '总付费金额', dataIndex: 'reg_pay_total', width: 100 },
-  { title: '付费率', dataIndex: 'p_per', width: 100 },
-  { title: '付费成本', dataIndex: 'p_cost', width: 100 },
+  { title: "注册成本", dataIndex: "reg_cost", width: 100 },
+  { title: "创角数", dataIndex: "role_total", width: 100 },
+  { title: "创角率", dataIndex: "role_per", width: 100 },
+  { title: "次留数", dataIndex: "active", width: 100 },
+  { title: "次留成本", dataIndex: "a_cost", width: 100 },
+  { title: "次留率", dataIndex: "a_per", width: 100 },
+  { title: "总付费人数", dataIndex: "reg_pay_num", width: 100 },
+  { title: "总付费金额", dataIndex: "reg_pay_total", width: 100 },
+  { title: "付费率", dataIndex: "p_per", width: 100 },
+  { title: "付费成本", dataIndex: "p_cost", width: 100 },
 
-  { title: 'ARPU', dataIndex: 'arpu', width: 100 },
-  { title: '注册ARPU', dataIndex: 'r_arpu', width: 100 },
+  { title: "ARPU", dataIndex: "arpu", width: 100 },
+  { title: "注册ARPU", dataIndex: "r_arpu", width: 100 },
 
-  { title: '当天回本率', dataIndex: 'da_per', width: 100 },
-  { title: '累计回本率', dataIndex: 're_per', width: 100 },
-  { title: '实际回本率', dataIndex: 're_amount_per', width: 100 },
+  { title: "当天回本率", dataIndex: "da_per", width: 100 },
+  { title: "累计回本率", dataIndex: "re_per", width: 100 },
+  { title: "实际回本率", dataIndex: "re_amount_per", width: 100 },
 
-  { title: '老用户数', dataIndex: 'old_login_total', width: 100 },
-  { title: '当天收入', dataIndex: 'pay_total', width: 100 },
-  { title: '实际收入', dataIndex: 'pay_amount', width: 100 },
-  { title: '实际收支比', dataIndex: 'pay_cost', width: 130 },
-])
+  { title: "老用户数", dataIndex: "old_login_total", width: 100 },
+  { title: "当天收入", dataIndex: "pay_total", width: 100 },
+  { title: "实际收入", dataIndex: "pay_amount", width: 100 },
+  { title: "实际收支比", dataIndex: "pay_cost", width: 130 },
+]);
 
 // 页面数据初始化
 const initPage = () => {
-  searchForm.value.tdate = [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]
-}
+  searchForm.value.tdate[0] = dayjs().subtract(8, "day").format("YYYY-MM-DD");
+  searchForm.value.tdate[1] = dayjs().subtract(1, "day").format("YYYY-MM-DD");
+};
 
 // SaTable 数据请求
 const refresh = async () => {
-  crudRef.value?.refresh()
-}
+  crudRef.value?.refresh();
+};
 
 // 页面加载完成执行
 onMounted(async () => {
-  initPage()
-  refresh()
-})
+  initPage();
+  refresh();
+});
 </script>
 
 <script>
-export default { name: 'v1/channelAnalysis/agentByDay' }
+export default { name: "v1/channelAnalysis/agentByDay" };
 </script>

+ 122 - 82
src/views/v1/gameLog/hour/index.vue

@@ -1,6 +1,11 @@
 <template>
   <div class="ma-content-block">
-    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm">
+    <sa-table
+      ref="crudRef"
+      :options="options"
+      :columns="columns"
+      :searchForm="searchForm"
+    >
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="24" :md="7" :lg="7" :xl="6" :xxl="4" :xs="24">
@@ -11,11 +16,28 @@
         <a-col :sm="24" :md="17" :lg="17" :xl="12" :xxl="8" :xs="24">
           <a-form-item label="注册日期" field="tdate">
             <a-space>
-              <a-range-picker class="w-full" v-model="searchForm.tdate" :show-time="false" mode="date" />
+              <a-range-picker
+                class="w-full"
+                v-model="searchForm.tdate"
+                :show-time="false"
+                mode="date"
+              />
 
-              <a-button size="mini" type="outline" @click="refreshDay('yesterday')">前一天</a-button>
-              <a-button size="mini" type="outline" @click="refreshDay('today')">当天</a-button>
-              <a-button size="mini" type="outline" @click="refreshDay('tomorrow')">后一天</a-button>
+              <a-button
+                size="mini"
+                type="outline"
+                @click="refreshDay('yesterday')"
+                >前一天</a-button
+              >
+              <a-button size="mini" type="outline" @click="refreshDay('today')"
+                >当天</a-button
+              >
+              <a-button
+                size="mini"
+                type="outline"
+                @click="refreshDay('tomorrow')"
+                >后一天</a-button
+              >
             </a-space>
           </a-form-item>
         </a-col>
@@ -26,12 +48,20 @@
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="渠道ID" field="agent_id">
-            <a-input v-model="searchForm.agent_id" placeholder="渠道ID" allow-clear />
+            <a-input
+              v-model="searchForm.agent_id"
+              placeholder="渠道ID"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="广告位ID" field="site_id">
-            <a-input v-model="searchForm.site_id" placeholder="广告位ID" allow-clear />
+            <a-input
+              v-model="searchForm.site_id"
+              placeholder="广告位ID"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
@@ -80,19 +110,19 @@
       <template #h0="{ record }">
         <div>
           <div style="color: purple">
-            {{ record['h0']?.cost }}
+            {{ record["h0"]?.cost }}
           </div>
           <div>
-            {{ record['h0']?.reg_total }}
+            {{ record["h0"]?.reg_total }}
           </div>
           <div style="color: blue">
-            {{ record['h0']?.reg_cost }}
+            {{ record["h0"]?.reg_cost }}
           </div>
           <div style="color: green">
-            {{ record['h0']?.pay_rate }}
+            {{ record["h0"]?.pay_rate }}
           </div>
           <div style="color: red">
-            {{ record['h0']?.roi }}
+            {{ record["h0"]?.roi }}
           </div>
         </div>
       </template>
@@ -120,109 +150,119 @@
 </template>
 
 <script setup>
-import { onMounted, ref, reactive } from 'vue'
-import api from '../../api/gameLog/channelAnalysis'
-import dayjs from 'dayjs'
-import commonApi from '../../api/common'
-import GameSelect from '@/components/game-select/index.vue'
-import MediaSelect from '@/components/media-select/index.vue'
+import { onMounted, ref, reactive } from "vue";
+import api from "../../api/gameLog/channelAnalysis";
+import dayjs from "dayjs";
+import commonApi from "../../api/common";
+import GameSelect from "@/components/game-select/index.vue";
+import MediaSelect from "@/components/media-select/index.vue";
 
-import AuthSelect from '@/components/auth-select/index.vue'
+import AuthSelect from "@/components/auth-select/index.vue";
 
 // 引用定义
-const crudRef = ref()
-const gameList = ref([])
+const crudRef = ref();
+const gameList = ref([]);
 
 // 搜索表单
 const searchForm = ref({
-  game_id: '',
-  media_id: '',
-  auth_id: '',
-  agent_id: '',
-  site_id: '',
+  game_id: "",
+  media_id: "",
+  auth_id: "",
+  agent_id: "",
+  site_id: "",
   tdate: [],
-})
+});
 
 // SaTable 基础配置
 const options = reactive({
   api: api.getHourList,
-  pk: 'id',
+  pk: "id",
 
   operationColumn: false,
-})
+});
 
 // SaTable 列配置
 const columns = reactive([
-  { title: '渠道ID', dataIndex: 'agent_id', width: 80 },
-  { title: '渠道名', dataIndex: 'agent_name', width: 100 },
-  { title: '合计', dataIndex: 'total_raw', width: 80 },
-  { title: '0', dataIndex: 'h0', width: 80 },
-  { title: '1', dataIndex: 'h1', width: 80 },
-  { title: '2', dataIndex: 'h2', width: 80 },
-  { title: '3', dataIndex: 'h3', width: 80 },
-  { title: '4', dataIndex: 'h4', width: 80 },
-  { title: '5', dataIndex: 'h5', width: 80 },
-  { title: '6', dataIndex: 'h6', width: 80 },
-  { title: '7', dataIndex: 'h7', width: 80 },
-  { title: '8', dataIndex: 'h8', width: 80 },
-  { title: '9', dataIndex: 'h9', width: 80 },
-  { title: '10', dataIndex: 'h10', width: 80 },
-  { title: '11', dataIndex: 'h11', width: 80 },
-  { title: '12', dataIndex: 'h12', width: 80 },
-  { title: '13', dataIndex: 'h13', width: 80 },
-  { title: '14', dataIndex: 'h14', width: 80 },
-  { title: '15', dataIndex: 'h15', width: 80 },
-  { title: '16', dataIndex: 'h16', width: 80 },
-  { title: '17', dataIndex: 'h17', width: 80 },
-  { title: '18', dataIndex: 'h18', width: 80 },
-  { title: '19', dataIndex: 'h19', width: 80 },
-  { title: '20', dataIndex: 'h20', width: 80 },
-  { title: '21', dataIndex: 'h21', width: 80 },
-  { title: '22', dataIndex: 'h22', width: 80 },
-  { title: '23', dataIndex: 'h23', width: 80 },
-])
+  { title: "渠道ID", dataIndex: "agent_id", width: 80, fixed: "left" },
+  { title: "渠道名", dataIndex: "agent_name", width: 100, fixed: "left" },
+  { title: "合计", dataIndex: "total_raw", width: 80, fixed: "left" },
+  { title: "0", dataIndex: "h0", width: 80 },
+  { title: "1", dataIndex: "h1", width: 80 },
+  { title: "2", dataIndex: "h2", width: 80 },
+  { title: "3", dataIndex: "h3", width: 80 },
+  { title: "4", dataIndex: "h4", width: 80 },
+  { title: "5", dataIndex: "h5", width: 80 },
+  { title: "6", dataIndex: "h6", width: 80 },
+  { title: "7", dataIndex: "h7", width: 80 },
+  { title: "8", dataIndex: "h8", width: 80 },
+  { title: "9", dataIndex: "h9", width: 80 },
+  { title: "10", dataIndex: "h10", width: 80 },
+  { title: "11", dataIndex: "h11", width: 80 },
+  { title: "12", dataIndex: "h12", width: 80 },
+  { title: "13", dataIndex: "h13", width: 80 },
+  { title: "14", dataIndex: "h14", width: 80 },
+  { title: "15", dataIndex: "h15", width: 80 },
+  { title: "16", dataIndex: "h16", width: 80 },
+  { title: "17", dataIndex: "h17", width: 80 },
+  { title: "18", dataIndex: "h18", width: 80 },
+  { title: "19", dataIndex: "h19", width: 80 },
+  { title: "20", dataIndex: "h20", width: 80 },
+  { title: "21", dataIndex: "h21", width: 80 },
+  { title: "22", dataIndex: "h22", width: 80 },
+  { title: "23", dataIndex: "h23", width: 80 },
+]);
 
 // 页面数据初始化
 const initPage = async () => {
-  searchForm.value.tdate = [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]
-}
+  searchForm.value.tdate = [
+    dayjs().format("YYYY-MM-DD"),
+    dayjs().format("YYYY-MM-DD"),
+  ];
+};
 
 // SaTable 数据请求
 const refresh = async () => {
-  crudRef.value?.refresh()
-}
+  crudRef.value?.refresh();
+};
 
 const refreshDay = async (day) => {
-  console.log(day)
+  console.log(day);
   switch (day) {
-    case 'yesterday':
+    case "yesterday":
       searchForm.value.tdate = [
-        dayjs(searchForm.value.tdate[0]).subtract(1, 'day').format('YYYY-MM-DD'),
-        dayjs(searchForm.value.tdate[1]).subtract(1, 'day').format('YYYY-MM-DD'),
-      ]
-      break
-    case 'today':
-      searchForm.value.tdate = [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]
-      break
-    case 'tomorrow':
+        dayjs(searchForm.value.tdate[0])
+          .subtract(1, "day")
+          .format("YYYY-MM-DD"),
+        dayjs(searchForm.value.tdate[1])
+          .subtract(1, "day")
+          .format("YYYY-MM-DD"),
+      ];
+      break;
+    case "today":
       searchForm.value.tdate = [
-        dayjs(searchForm.value.tdate[0]).add(1, 'day').format('YYYY-MM-DD'),
-        dayjs(searchForm.value.tdate[1]).add(1, 'day').format('YYYY-MM-DD'),
-      ]
-      break
+        dayjs().format("YYYY-MM-DD"),
+        dayjs().format("YYYY-MM-DD"),
+      ];
+      break;
+    case "tomorrow":
+      searchForm.value.tdate = [
+        dayjs(searchForm.value.tdate[0]).add(1, "day").format("YYYY-MM-DD"),
+        dayjs(searchForm.value.tdate[1]).add(1, "day").format("YYYY-MM-DD"),
+      ];
+      break;
     default:
-      break
+      break;
   }
-  refresh()
-}
+  refresh();
+};
 
 // 页面加载完成执行
 onMounted(async () => {
-  initPage()
-  refresh()
-})
+  initPage();
+  refresh();
+});
 </script>
 
 <script>
-export default { name: 'v1/channelAnalysis/hour' }
+export default { name: "v1/channelAnalysis/hour" };
 </script>

+ 226 - 195
src/views/v1/gameLog/ltv/index.vue

@@ -1,6 +1,11 @@
 <template>
   <div class="ma-content-block">
-    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm">
+    <sa-table
+      ref="crudRef"
+      :options="options"
+      :columns="columns"
+      :searchForm="searchForm"
+    >
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="4" :xs="24">
@@ -10,28 +15,49 @@
         </a-col>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="5" :xs="24">
           <a-form-item label="注册日期" field="tdate">
-            <a-range-picker class="w-full" v-model="searchForm.tdate" :show-time="false" mode="date" />
+            <a-range-picker
+              class="w-full"
+              v-model="searchForm.tdate"
+              :show-time="false"
+              mode="date"
+            />
           </a-form-item>
         </a-col>
 
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="渠道ID" field="agent_id">
-            <a-input v-model="searchForm.agent_id" placeholder="渠道ID" allow-clear />
+            <a-input
+              v-model="searchForm.agent_id"
+              placeholder="渠道ID"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="渠道名称" field="agent_name">
-            <a-input v-model="searchForm.agent_name" placeholder="渠道名称" allow-clear />
+            <a-input
+              v-model="searchForm.agent_name"
+              placeholder="渠道名称"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="广告位ID" field="site_id">
-            <a-input v-model="searchForm.site_id" placeholder="广告位ID" allow-clear />
+            <a-input
+              v-model="searchForm.site_id"
+              placeholder="广告位ID"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="3" :xs="24">
           <a-form-item label="广告名称" field="site_name">
-            <a-input v-model="searchForm.site_name" placeholder="广告名称" allow-clear />
+            <a-input
+              v-model="searchForm.site_name"
+              placeholder="广告名称"
+              allow-clear
+            />
           </a-form-item>
         </a-col>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="4" :xs="24">
@@ -46,7 +72,11 @@
         </a-col>
         <a-col :sm="24" :md="8" :lg="8" :xl="6" :xxl="4" :xs="24">
           <a-form-item label="展示类型" field="data_type">
-            <a-select v-model="searchForm.data_type" placeholder="展示类型" :allow-clear="false">
+            <a-select
+              v-model="searchForm.data_type"
+              placeholder="展示类型"
+              :allow-clear="false"
+            >
               <a-option value="recovery">回本率</a-option>
               <a-option value="remount">实际回本率</a-option>
               <a-option value="ltv">LTV</a-option>
@@ -66,332 +96,333 @@
 </template>
 
 <script setup>
-import { onMounted, ref, reactive } from 'vue'
-import api from '../../api/gameLog/channelAnalysis'
-import dayjs from 'dayjs'
-import GameSelect from '@/components/game-select/index.vue'
-import MediaSelect from '@/components/media-select/index.vue'
+import { onMounted, ref, reactive } from "vue";
+import api from "../../api/gameLog/channelAnalysis";
+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'
+import AuthSelect from "@/components/auth-select/index.vue";
 
 // 引用定义
-const crudRef = ref()
-const gameList = ref([])
+const crudRef = ref();
+const gameList = ref([]);
 
 // 搜索表单
 const searchForm = ref({
-  game_id: '',
-  media_id: '',
-  auth_id: '',
-  agent_id: '',
-  agent_name: '',
-  site_name: '',
-  site_id: '',
+  game_id: "",
+  media_id: "",
+  auth_id: "",
+  agent_id: "",
+  agent_name: "",
+  site_name: "",
+  site_id: "",
   tdate: [],
-  data_type: 'recovery',
-})
+  data_type: "recovery",
+});
 
 // SaTable 基础配置
 const options = reactive({
   api: api.getLtvDataList,
-  pk: 'tdate',
+  pk: "tdate",
 
   showSummary: true,
   summary: [
     {
-      action: 'totalRow',
-      dataIndex: 'tdate',
+      action: "totalRow",
+      dataIndex: "tdate",
     },
     {
-      suffixText: '元',
-      action: 'totalRow',
-      dataIndex: 'cost',
+      suffixText: "元",
+      action: "totalRow",
+      dataIndex: "cost",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'reg_total',
+      action: "totalRow",
+      dataIndex: "reg_total",
     },
 
     {
-      action: 'totalRow',
-      dataIndex: 'reg_cost',
+      action: "totalRow",
+      dataIndex: "reg_cost",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd0',
+      action: "totalRow",
+      dataIndex: "d0",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd1',
+      action: "totalRow",
+      dataIndex: "d1",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd2',
+      action: "totalRow",
+      dataIndex: "d2",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd3',
+      action: "totalRow",
+      dataIndex: "d3",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd4',
+      action: "totalRow",
+      dataIndex: "d4",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd5',
+      action: "totalRow",
+      dataIndex: "d5",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd6',
+      action: "totalRow",
+      dataIndex: "d6",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd7',
+      action: "totalRow",
+      dataIndex: "d7",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd8',
+      action: "totalRow",
+      dataIndex: "d8",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd9',
+      action: "totalRow",
+      dataIndex: "d9",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd10',
+      action: "totalRow",
+      dataIndex: "d10",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd11',
+      action: "totalRow",
+      dataIndex: "d11",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd12',
+      action: "totalRow",
+      dataIndex: "d12",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd13',
+      action: "totalRow",
+      dataIndex: "d13",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd14',
+      action: "totalRow",
+      dataIndex: "d14",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd15',
+      action: "totalRow",
+      dataIndex: "d15",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd16',
+      action: "totalRow",
+      dataIndex: "d16",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd17',
+      action: "totalRow",
+      dataIndex: "d17",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd18',
+      action: "totalRow",
+      dataIndex: "d18",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd19',
+      action: "totalRow",
+      dataIndex: "d19",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd20',
+      action: "totalRow",
+      dataIndex: "d20",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd21',
+      action: "totalRow",
+      dataIndex: "d21",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd22',
+      action: "totalRow",
+      dataIndex: "d22",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd23',
+      action: "totalRow",
+      dataIndex: "d23",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd24',
+      action: "totalRow",
+      dataIndex: "d24",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd25',
+      action: "totalRow",
+      dataIndex: "d25",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd26',
+      action: "totalRow",
+      dataIndex: "d26",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd27',
+      action: "totalRow",
+      dataIndex: "d27",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd28',
+      action: "totalRow",
+      dataIndex: "d28",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd29',
+      action: "totalRow",
+      dataIndex: "d29",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd30',
+      action: "totalRow",
+      dataIndex: "d30",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd35',
+      action: "totalRow",
+      dataIndex: "d35",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd40',
+      action: "totalRow",
+      dataIndex: "d40",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd45',
+      action: "totalRow",
+      dataIndex: "d45",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd50',
+      action: "totalRow",
+      dataIndex: "d50",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd55',
+      action: "totalRow",
+      dataIndex: "d55",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd60',
+      action: "totalRow",
+      dataIndex: "d60",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd65',
+      action: "totalRow",
+      dataIndex: "d65",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd70',
+      action: "totalRow",
+      dataIndex: "d70",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd75',
+      action: "totalRow",
+      dataIndex: "d75",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd80',
+      action: "totalRow",
+      dataIndex: "d80",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd85',
+      action: "totalRow",
+      dataIndex: "d85",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd90',
+      action: "totalRow",
+      dataIndex: "d90",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd95',
+      action: "totalRow",
+      dataIndex: "d95",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd100',
+      action: "totalRow",
+      dataIndex: "d100",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd105',
+      action: "totalRow",
+      dataIndex: "d105",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd110',
+      action: "totalRow",
+      dataIndex: "d110",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd115',
+      action: "totalRow",
+      dataIndex: "d115",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'd120',
+      action: "totalRow",
+      dataIndex: "d120",
     },
   ],
 
   operationColumn: false,
-})
+});
 
 // SaTable 列配置
 const columns = reactive([
-  { title: '日期', dataIndex: 'tdate', width: 130, fixed: 'left' },
-  { title: '消耗金额', dataIndex: 'cost', width: 100 },
+  { title: "日期", dataIndex: "tdate", width: 130, fixed: "left" },
+  { title: "消耗金额", dataIndex: "cost", width: 100 },
 
-  { title: '注册数', dataIndex: 'reg_total', width: 80 },
-  { title: '注册成本', dataIndex: 'reg_cost', width: 100 },
-  { title: '累计', dataIndex: 'd0', width: 80 },
-  { title: '1', dataIndex: 'd1', width: 80 },
-  { title: '2', dataIndex: 'd2', width: 80 },
-  { title: '3', dataIndex: 'd3', width: 80 },
-  { title: '4', dataIndex: 'd4', width: 80 },
-  { title: '5', dataIndex: 'd5', width: 80 },
-  { title: '6', dataIndex: 'd6', width: 80 },
-  { title: '7', dataIndex: 'd7', width: 80 },
-  { title: '8', dataIndex: 'd8', width: 80 },
-  { title: '9', dataIndex: 'd9', width: 80 },
-  { title: '10', dataIndex: 'd10', width: 80 },
-  { title: '11', dataIndex: 'd11', width: 80 },
-  { title: '12', dataIndex: 'd12', width: 80 },
-  { title: '13', dataIndex: 'd13', width: 80 },
-  { title: '14', dataIndex: 'd14', width: 80 },
-  { title: '15', dataIndex: 'd15', width: 80 },
-  { title: '16', dataIndex: 'd16', width: 80 },
-  { title: '17', dataIndex: 'd17', width: 80 },
-  { title: '18', dataIndex: 'd18', width: 80 },
-  { title: '19', dataIndex: 'd19', width: 80 },
-  { title: '20', dataIndex: 'd20', width: 80 },
-  { title: '21', dataIndex: 'd21', width: 80 },
-  { title: '22', dataIndex: 'd22', width: 80 },
-  { title: '23', dataIndex: 'd23', width: 80 },
-  { title: '24', dataIndex: 'd24', width: 80 },
-  { title: '25', dataIndex: 'd25', width: 80 },
-  { title: '26', dataIndex: 'd26', width: 80 },
-  { title: '27', dataIndex: 'd27', width: 80 },
-  { title: '28', dataIndex: 'd28', width: 80 },
-  { title: '29', dataIndex: 'd29', width: 80 },
-  { title: '30', dataIndex: 'd30', width: 80 },
-  { title: '35', dataIndex: 'd35', width: 80 },
-  { title: '40', dataIndex: 'd40', width: 80 },
-  { title: '45', dataIndex: 'd45', width: 80 },
-  { title: '50', dataIndex: 'd50', width: 80 },
-  { title: '55', dataIndex: 'd55', width: 80 },
-  { title: '60', dataIndex: 'd60', width: 80 },
-  { title: '65', dataIndex: 'd65', width: 80 },
-  { title: '70', dataIndex: 'd70', width: 80 },
-  { title: '75', dataIndex: 'd75', width: 80 },
-  { title: '80', dataIndex: 'd80', width: 80 },
-  { title: '85', dataIndex: 'd85', width: 80 },
-  { title: '90', dataIndex: 'd90', width: 80 },
-  { title: '95', dataIndex: 'd95', width: 80 },
-  { title: '100', dataIndex: 'd100', width: 80 },
-  { title: '105', dataIndex: 'd105', width: 80 },
-  { title: '110', dataIndex: 'd110', width: 80 },
-  { title: '115', dataIndex: 'd115', width: 80 },
-  { title: '120', dataIndex: 'd120', width: 80 },
-])
+  { title: "注册数", dataIndex: "reg_total", width: 80 },
+  { title: "注册成本", dataIndex: "reg_cost", width: 100 },
+  { title: "累计", dataIndex: "d0", width: 80 },
+  { title: "1", dataIndex: "d1", width: 80 },
+  { title: "2", dataIndex: "d2", width: 80 },
+  { title: "3", dataIndex: "d3", width: 80 },
+  { title: "4", dataIndex: "d4", width: 80 },
+  { title: "5", dataIndex: "d5", width: 80 },
+  { title: "6", dataIndex: "d6", width: 80 },
+  { title: "7", dataIndex: "d7", width: 80 },
+  { title: "8", dataIndex: "d8", width: 80 },
+  { title: "9", dataIndex: "d9", width: 80 },
+  { title: "10", dataIndex: "d10", width: 80 },
+  { title: "11", dataIndex: "d11", width: 80 },
+  { title: "12", dataIndex: "d12", width: 80 },
+  { title: "13", dataIndex: "d13", width: 80 },
+  { title: "14", dataIndex: "d14", width: 80 },
+  { title: "15", dataIndex: "d15", width: 80 },
+  { title: "16", dataIndex: "d16", width: 80 },
+  { title: "17", dataIndex: "d17", width: 80 },
+  { title: "18", dataIndex: "d18", width: 80 },
+  { title: "19", dataIndex: "d19", width: 80 },
+  { title: "20", dataIndex: "d20", width: 80 },
+  { title: "21", dataIndex: "d21", width: 80 },
+  { title: "22", dataIndex: "d22", width: 80 },
+  { title: "23", dataIndex: "d23", width: 80 },
+  { title: "24", dataIndex: "d24", width: 80 },
+  { title: "25", dataIndex: "d25", width: 80 },
+  { title: "26", dataIndex: "d26", width: 80 },
+  { title: "27", dataIndex: "d27", width: 80 },
+  { title: "28", dataIndex: "d28", width: 80 },
+  { title: "29", dataIndex: "d29", width: 80 },
+  { title: "30", dataIndex: "d30", width: 80 },
+  { title: "35", dataIndex: "d35", width: 80 },
+  { title: "40", dataIndex: "d40", width: 80 },
+  { title: "45", dataIndex: "d45", width: 80 },
+  { title: "50", dataIndex: "d50", width: 80 },
+  { title: "55", dataIndex: "d55", width: 80 },
+  { title: "60", dataIndex: "d60", width: 80 },
+  { title: "65", dataIndex: "d65", width: 80 },
+  { title: "70", dataIndex: "d70", width: 80 },
+  { title: "75", dataIndex: "d75", width: 80 },
+  { title: "80", dataIndex: "d80", width: 80 },
+  { title: "85", dataIndex: "d85", width: 80 },
+  { title: "90", dataIndex: "d90", width: 80 },
+  { title: "95", dataIndex: "d95", width: 80 },
+  { title: "100", dataIndex: "d100", width: 80 },
+  { title: "105", dataIndex: "d105", width: 80 },
+  { title: "110", dataIndex: "d110", width: 80 },
+  { title: "115", dataIndex: "d115", width: 80 },
+  { title: "120", dataIndex: "d120", width: 80 },
+]);
 
 // 页面数据初始化
 const initPage = () => {
-  searchForm.value.tdate = [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]
-}
+  searchForm.value.tdate[0] = dayjs().subtract(8, "day").format("YYYY-MM-DD");
+  searchForm.value.tdate[1] = dayjs().subtract(1, "day").format("YYYY-MM-DD");
+};
 
 // SaTable 数据请求
 const refresh = async () => {
-  crudRef.value?.refresh()
-}
+  crudRef.value?.refresh();
+};
 
 // 页面加载完成执行
 onMounted(async () => {
-  initPage()
-  refresh()
-})
+  initPage();
+  refresh();
+});
 </script>
 
 <script>
-export default { name: 'v1/channelAnalysis/ltvd' }
+export default { name: "v1/channelAnalysis/ltvd" };
 </script>

+ 104 - 78
src/views/v1/gameLog/pay/index.vue

@@ -1,6 +1,11 @@
 <template>
   <div class="ma-content-block">
-    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm">
+    <sa-table
+      ref="crudRef"
+      :options="options"
+      :columns="columns"
+      :searchForm="searchForm"
+    >
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
         <a-col :sm="12" :md="6" :lg="7" :xl="6" :xxl="4" :xs="24">
@@ -11,10 +16,27 @@
         <a-col :sm="24" :md="17" :lg="17" :xl="12" :xxl="8" :xs="24">
           <a-form-item label="注册日期" field="tdate">
             <a-space>
-              <a-date-picker class="w-full" v-model="searchForm.tdate" :show-time="false" mode="date" />
-              <a-button size="mini" type="outline" @click="refreshDay('yesterday')">前一天</a-button>
-              <a-button size="mini" type="outline" @click="refreshDay('today')">当天</a-button>
-              <a-button size="mini" type="outline" @click="refreshDay('tomorrow')">后一天</a-button>
+              <a-date-picker
+                class="w-full"
+                v-model="searchForm.tdate"
+                :show-time="false"
+                mode="date"
+              />
+              <a-button
+                size="mini"
+                type="outline"
+                @click="refreshDay('yesterday')"
+                >前一天</a-button
+              >
+              <a-button size="mini" type="outline" @click="refreshDay('today')"
+                >当天</a-button
+              >
+              <a-button
+                size="mini"
+                type="outline"
+                @click="refreshDay('tomorrow')"
+                >后一天</a-button
+              >
             </a-space>
           </a-form-item>
         </a-col>
@@ -25,153 +47,157 @@
 </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'
+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 crudRef = ref();
+const gameList = ref([]);
 
 // 搜索表单
 const searchForm = ref({
-  game_id: '',
-  tdate: '',
-})
+  game_id: "",
+  tdate: "",
+});
 
 // SaTable 基础配置
 const options = reactive({
   api: api.getIncomeAnalysis,
-  pk: 'date',
+  pk: "date",
   showSort: false,
   showSummary: true,
   operationColumn: false,
   summary: [
     {
-      action: 'totalRow',
-      dataIndex: 'tdate',
+      action: "totalRow",
+      dataIndex: "tdate",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'game_id',
+      action: "totalRow",
+      dataIndex: "game_id",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'login_total',
+      action: "totalRow",
+      dataIndex: "login_total",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'pay_total',
+      action: "totalRow",
+      dataIndex: "pay_total",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'pay_num',
+      action: "totalRow",
+      dataIndex: "pay_num",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'pay_arpu',
+      action: "totalRow",
+      dataIndex: "pay_arpu",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'pay_ratio',
+      action: "totalRow",
+      dataIndex: "pay_ratio",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'yestoday_pay_total',
+      action: "totalRow",
+      dataIndex: "yestoday_pay_total",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'pay_increase_yestoday',
+      action: "totalRow",
+      dataIndex: "pay_increase_yestoday",
     },
     {
-      action: 'totalRow',
-      dataIndex: 'pay_increase_week',
+      action: "totalRow",
+      dataIndex: "pay_increase_week",
     },
   ],
-})
+});
 
 // SaTable 列配置
 const columns = reactive([
-  { title: '游戏ID', dataIndex: 'game_id', width: 50, fixed: 'left' },
-  { title: '游戏名', dataIndex: 'game_name', width: 100, fixed: 'left' },
+  { title: "游戏ID", dataIndex: "game_id", width: 50, fixed: "left" },
+  { title: "游戏名", dataIndex: "game_name", width: 100, fixed: "left" },
   {
-    title: 'DAU',
-    dataIndex: 'login_total',
+    title: "DAU",
+    dataIndex: "login_total",
     width: 70,
   },
   {
-    title: '付费人数',
-    dataIndex: 'pay_num',
+    title: "付费人数",
+    dataIndex: "pay_num",
     width: 70,
   },
   {
-    title: '付费金额',
-    dataIndex: 'pay_total',
+    title: "付费金额",
+    dataIndex: "pay_total",
     width: 70,
   },
   {
-    title: 'ARPU',
-    dataIndex: 'pay_arpu',
+    title: "ARPU",
+    dataIndex: "pay_arpu",
     width: 70,
   },
   {
-    title: '收入比例',
-    dataIndex: 'pay_ratio',
+    title: "收入比例",
+    dataIndex: "pay_ratio",
     width: 70,
   },
   {
-    title: '昨日充值',
-    dataIndex: 'yestoday_pay_total',
+    title: "昨日充值",
+    dataIndex: "yestoday_pay_total",
     width: 70,
   },
   {
-    title: '昨日增长',
-    dataIndex: 'pay_increase_yestoday',
+    title: "昨日增长",
+    dataIndex: "pay_increase_yestoday",
     width: 70,
   },
   {
-    title: '上周增长',
-    dataIndex: 'pay_increase_week',
+    title: "上周增长",
+    dataIndex: "pay_increase_week",
     width: 70,
   },
-])
+]);
 
 // 页面数据初始化
 const initPage = async () => {
-  searchForm.value.tdate = dayjs().subtract(1, 'day').format('YYYY-MM-DD')
-}
+  searchForm.value.tdate = dayjs().format("YYYY-MM-DD");
+};
 const refreshDay = async (day) => {
-  console.log(day)
+  console.log(day);
   switch (day) {
-    case 'yesterday':
-      searchForm.value.tdate = dayjs(searchForm.value.tdate).subtract(1, 'day').format('YYYY-MM-DD')
-      break
-    case 'today':
-      searchForm.value.tdate = dayjs().format('YYYY-MM-DD')
-      break
-    case 'tomorrow':
-      searchForm.value.tdate = dayjs(searchForm.value.tdate).add(1, 'day').format('YYYY-MM-DD')
-      break
+    case "yesterday":
+      searchForm.value.tdate = dayjs(searchForm.value.tdate)
+        .subtract(1, "day")
+        .format("YYYY-MM-DD");
+      break;
+    case "today":
+      searchForm.value.tdate = dayjs().format("YYYY-MM-DD");
+      break;
+    case "tomorrow":
+      searchForm.value.tdate = dayjs(searchForm.value.tdate)
+        .add(1, "day")
+        .format("YYYY-MM-DD");
+      break;
     default:
-      break
+      break;
   }
-  refresh()
-}
+  refresh();
+};
 // SaTable 数据请求
 const refresh = async () => {
-  crudRef.value?.refresh()
-}
+  crudRef.value?.refresh();
+};
 
 // 页面加载完成执行
 onMounted(async () => {
-  initPage()
-  refresh()
-})
+  initPage();
+  refresh();
+});
 </script>
 
 <script>
-export default { name: 'v1/analyse/pay' }
+export default { name: "v1/analyse/pay" };
 </script>

+ 67 - 46
src/views/v1/gameLog/regDay/index.vue

@@ -1,16 +1,27 @@
 <template>
   <div class="ma-content-block">
-    <sa-table ref="crudRef" :options="options" :columns="columns" :searchForm="searchForm" @search="handleRequestData">
+    <sa-table
+      ref="crudRef"
+      :options="options"
+      :columns="columns"
+      :searchForm="searchForm"
+      @search="handleRequestData"
+    >
       <!-- 搜索区 tableSearch -->
       <template #tableSearch>
-        <a-col :sm="6" :xs="24">
+        <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="6" :xs="24">
+        <a-col :sm="8" :xs="24">
           <a-form-item label="注册日期" field="tdate">
-            <a-range-picker class="w-full" v-model="searchForm.tdate" :show-time="false" mode="date" />
+            <a-range-picker
+              class="w-full"
+              v-model="searchForm.tdate"
+              :show-time="false"
+              mode="date"
+            />
           </a-form-item>
         </a-col>
       </template>
@@ -21,98 +32,108 @@
 </template>
 
 <script setup>
-import { onMounted, ref, reactive, nextTick } from 'vue'
-import api from '../../api/gameLog/analyse'
-import dayjs from 'dayjs'
-import commonApi from '../../api/common'
-import GameSelect from '@/components/game-select/index.vue'
+import { onMounted, ref, reactive, nextTick } from "vue";
+import api from "../../api/gameLog/analyse";
+import dayjs from "dayjs";
+import commonApi from "../../api/common";
+import GameSelect from "@/components/game-select/index.vue";
 
 // 引用定义
-const crudRef = ref()
-const gameList = ref([])
+const crudRef = ref();
+const gameList = ref([]);
 
 // 搜索表单
 const searchForm = ref({
-  game_id: '',
-  media_id: '',
-  auth_id: '',
-  agent_id: '',
-  site_id: '',
+  game_id: "",
+  media_id: "",
+  auth_id: "",
+  agent_id: "",
+  site_id: "",
   tdate: [],
-})
+});
 
 // SaTable 基础配置
 const options = reactive({
   api: api.getRegDayDataList,
-  pk: 'id',
+  pk: "id",
   singleLine: true,
   showSummary: true,
   operationColumn: false,
   showSort: false,
   summary: [],
-})
+});
 
 // SaTable 列配置
-const columns = ref([])
+const columns = ref([]);
 
 // 页面数据初始化
 const initPage = async () => {
-  searchForm.value.tdate = [dayjs().format('YYYY-MM-DD'), dayjs().format('YYYY-MM-DD')]
-}
+  searchForm.value.tdate[0] = dayjs().subtract(8, "day").format("YYYY-MM-DD");
+  searchForm.value.tdate[1] = dayjs().format("YYYY-MM-DD");
+};
 
 // SaTable 数据请求
 const refresh = async () => {
-  crudRef.value?.refresh()
-}
+  crudRef.value?.refresh();
+};
 
 const handleRequestData = () => {
   // 使用 nextTick 确保在 DOM 更新后再获取数据
   nextTick(() => {
-    const res = crudRef.value.getResponseData()
-    console.log('完整的响应数据:', res)
-    console.log('totalRow 数据:', res?.totalRow)
+    const res = crudRef.value.getResponseData();
+    console.log("完整的响应数据:", res);
+    console.log("totalRow 数据:", res?.totalRow);
 
     // 重新添加动态列,并为每一列添加合计配置
     if (res && res.columns && Array.isArray(res.columns)) {
-      columns.value = res.columns
-      console.log('columns updated:', columns.value)
+      columns.value = res.columns;
+      console.log("columns updated:", columns.value);
 
       // 动态生成 summary 配置,dataIndex 与 columns 保持一致
       if (Array.isArray(res.columns)) {
         // 只对数值类型的列添加合计
         const numericColumns = res.columns.filter((col) => {
           // 排除日期、文本等非数值列
-          const excludeFields = ['reg_date', 'date', 'time', 'name', 'title', 'description', 'game_id', 'game_name']
-          return !excludeFields.includes(col.dataIndex)
-        })
+          const excludeFields = [
+            "reg_date",
+            "date",
+            "time",
+            "name",
+            "title",
+            "description",
+            "game_id",
+            "game_name",
+          ];
+          return !excludeFields.includes(col.dataIndex);
+        });
 
         // 清空并重新设置 summary 配置
-        options.summary.length = 0
+        options.summary.length = 0;
         numericColumns.forEach((col) => {
           options.summary.push({
-            action: 'totalRow',
+            action: "totalRow",
             dataIndex: col.dataIndex,
-          })
-        })
+          });
+        });
 
-        console.log('summary config:', options.summary)
+        console.log("summary config:", options.summary);
         console.log(
-          'numeric columns:',
+          "numeric columns:",
           numericColumns.map((col) => col.dataIndex)
-        )
-        console.log('options.summary length:', options.summary.length)
+        );
+        console.log("options.summary length:", options.summary.length);
       }
     }
-  })
-}
+  });
+};
 
 // 页面加载完成执行
 onMounted(async () => {
-  initPage()
-  refresh()
-})
+  initPage();
+  refresh();
+});
 </script>
 
 <script>
-export default { name: 'v1/analyse/regDay' }
+export default { name: "v1/analyse/regDay" };
 </script>