wjx před 1 rokem
rodič
revize
77147d77e9

+ 6 - 0
config/routerConfig.ts

@@ -197,6 +197,12 @@ const gameDataStatistics = {
                     access: 'again',
                     component: './gameDataStatistics/gameData/again',
                 },
+                {
+                    path: '/gameDataStatistics/gameData/active',
+                    name: '游戏留存数据',
+                    access: 'active',
+                    component: './gameDataStatistics/gameData/active',
+                },
             ]
         },
         {

+ 14 - 0
src/components/QueryForm/const.tsx

@@ -65,4 +65,18 @@ export const PayType = {
     'alipay': '支付宝',
     'wxpay': '微信支付',
     'mpay': '米大师'
+}
+
+// 留存数据的枚举
+export enum ActiveEnum {
+    reg = '注册留存',
+    role = '角色留存',
+    amount = '付费留存'
+}
+
+// 展示数据种类
+export enum TableEnum {
+    buy = '买量',
+    nature = '自然量',
+    total = '总量'
 }

+ 16 - 2
src/components/QueryForm/index.tsx

@@ -3,7 +3,7 @@ import React, { useEffect, useState } from "react"
 import moment from "moment"
 import { useAjax } from "@/Hook/useAjax"
 import { getAllOfOwnerUserApi, getChannelChoiceListApi, getGameChoiceListApi, getGameChoiceParentListType1Api, getPayListApi, getSubUserWithSelfListApi, getTtAllUserListApi, getUserSystemTypeChoiceListApi } from "@/services/gameData"
-import { PayStatus, TYPE, gameClassifyEnum } from "./const"
+import { ActiveEnum, PayStatus, TYPE, gameClassifyEnum } from "./const"
 import { ADSTATUSEnum as ADSTTTATUSEnum } from "@/pages/gameDataStatistics/adlist/monitor/const"
 import { ADSTATUSEnum } from "@/pages/gameDataStatistics/adlist/tencentMonitor/const"
 import IntervalTime from "./intervalTime"
@@ -143,6 +143,8 @@ interface Props {
     }
     /** 是否开启 充值到支付的间隔时间 搜索 */
     isPayIntervalTime?: boolean
+    /** 是否开启 留存数据的类型 搜索 */
+    isActiveTypes?: boolean
 }
 /**
  * 游戏数据系统 请求参数
@@ -155,7 +157,7 @@ const QueryForm: React.FC<Props> = (props) => {
         onChange, initialValues, isSource, isAccount, isAccountId, isCompanyId, isAgentKey, isAgentName, isCpId, isCpName, isCpOrderId, isCpStatus, isCreateDay, isDevice, isGameName, isRechargeGameName, isGameId, isOrderGameId, isGameRoleId,
         isGameRoleName, isFirstRecharge, isSwitch, isMerchantNo, isOrderId, isMerchantOrderNo, isPayStatus, isPayWay, isProductName, isRegAgent, isAgentId, isPutAgent, isRegDay, isOs, isParentId, isProjectId, isProjectName, isPromotionId, isPromotionName,
         isSysUserName, isRechargeDate, isBGGameClassify, isGameUserId, isSysUserId, isUserName, isUserId, isSelectRanking, isGameType, isConsumeDay, rechargeDay, isBeginDay, isType, isAdTTStatus, isUserEnterType, isServerName, isServerId, isServerDay, isAdTXStatus,
-        payTimeDay, placeAnOrderDay, isPayIntervalTime
+        payTimeDay, placeAnOrderDay, isPayIntervalTime, isActiveTypes
     } = props
     const [form] = Form.useForm()
     const [accountList, setAccountList] = useState<any[]>([])
@@ -345,6 +347,18 @@ const QueryForm: React.FC<Props> = (props) => {
                     <Select.Option value="total">总量</Select.Option>
                 </Select>
             </Form.Item></Col>}
+            {isActiveTypes && <Col><Form.Item name='activeTypes'>
+                <Select
+                    showSearch
+                    style={{ width: 130 }}
+                    placeholder={'留存数据的类型'}
+                    filterOption={(input, option) =>
+                        (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
+                    }
+                >
+                    {Object.keys(ActiveEnum).map(key => <Select.Option value={key} key={key}>{ActiveEnum[key]}</Select.Option>)}
+                </Select>
+            </Form.Item></Col>}
             {/* 不同排行榜选择 */}
             {isSelectRanking && <Col><Form.Item name='dateType'>
                 <Radio.Group>

+ 4 - 0
src/pages/gameDataStatistics/adlist/monitor/tableConfig.tsx

@@ -259,6 +259,10 @@ function columns12(dayHandle: (data: any) => void): { label: string, fieldSHow?:
                     title: 'ltv1(广告)', dataIndex: 'ltvDay1', label: '广告媒体端数据', align: 'center', width: 60, sorter: true, default: 25, className: 'adDataBackColorClass',
                     render: (a: any) => <Statistic value={a || 0} />
                 },
+                {
+                    title: 'ltv1(实际数据) ', dataIndex: 'ltvDay1ActualData', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 70, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                }
             ]
         },
         {

+ 4 - 0
src/pages/gameDataStatistics/adlist/monitor/tableConfigDay.tsx

@@ -267,6 +267,10 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                 {
                     title: 'ltv1(广告)', dataIndex: 'ltvDay1', label: '广告媒体端数据', align: 'center', width: 60, sorter: true, default: 26, className: 'adDataBackColorClass',
                     render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: 'ltv1(实际数据) ', dataIndex: 'ltvDay1ActualData', label: '广告媒体端数据', align: 'center', className: "adDataBackColorClass", width: 70, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
                 }
             ]
         },

+ 27 - 0
src/pages/gameDataStatistics/gameData/active/index.less

@@ -0,0 +1,27 @@
+.dbox {
+    display: flex;
+    flex-flow: column;
+    align-items: center;
+    font-size: 12px;
+    // padding: 10px;
+    >span {
+        display: flex;
+        justify-content: left;
+        width: 100%;
+    }
+}
+
+.tabsBottom0 .ant-tabs-nav {
+    margin-bottom: 0;
+}
+
+.userPopover {
+
+    .ant-popover-inner-content {
+        padding: 3px 6px;
+    }
+
+    .ant-pagination {
+        margin: 8px 0 4px;
+    }
+}

+ 102 - 0
src/pages/gameDataStatistics/gameData/active/index.tsx

@@ -0,0 +1,102 @@
+import React, { useEffect, useState } from "react"
+import TableData from "../../components/TableData"
+import QueryForm from "@/components/QueryForm"
+import { useAjax } from "@/Hook/useAjax"
+import { ActiveDataProps, getActiveDataListApi, getActiveDataTotalApi } from "@/services/gameData/game"
+import columns12 from "./tableConfig"
+import moment from "moment"
+import { ActiveEnum, TableEnum, getPresets } from "@/components/QueryForm/const"
+
+/**
+ * 游戏留存数据
+ * @returns 
+ */
+const Active: React.FC = () => {
+
+    /************************************/
+    const [queryForm, setQueryForm] = useState<ActiveDataProps>({
+        activeTypes: 'reg' as ActiveEnum,
+        tableTypes: 'buy' as TableEnum,
+        pageNum: 1, pageSize: 50,
+        registeredBeginDate: moment().format('YYYY-MM-DD'),
+        registeredEndDate: moment().format('YYYY-MM-DD'),
+        sourceSystem: 'ZX_ONE'
+    })
+    const [totalData, setTotalData] = useState<any[]>([])
+
+    const getActiveDataList = useAjax((params) => getActiveDataListApi(params))
+    const getActiveDataTotal = useAjax((params) => getActiveDataTotalApi(params))
+    /************************************/
+
+    useEffect(() => {
+        getActiveDataList.run(queryForm)
+        getActiveDataTotal.run(queryForm).then((res: { id: number; costDate: string; beginDay: string | undefined }) => {
+            res.id = 1
+            res.costDate = '总计'
+            res.beginDay = queryForm.registeredBeginDate
+            setTotalData([res])
+        })
+    }, [queryForm])
+
+    return <div>
+        <TableData
+            leftChild={<QueryForm
+                initialValues={{ regDay: [moment(), moment()], sourceSystem: 'ZX_ONE', tableTypes: 'buy', activeTypes: 'reg' }}
+                onChange={(data: any) => {
+                    console.log(data)
+                    const { regStartDay, gameClassify, regEndDay, rechargeDay, ...params } = data
+                    let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                    newQueryForm.pageNum = 1
+                    if (regStartDay && regEndDay) {
+                        newQueryForm.registeredBeginDate = regStartDay
+                        newQueryForm.registeredEndDate = regEndDay
+                    } else {
+                        delete newQueryForm.registeredBeginDate
+                        delete newQueryForm.registeredEndDate
+                    }
+                    newQueryForm.classify = gameClassify
+                    setQueryForm({ ...newQueryForm, ...params })
+                }}
+                isSource
+                isRegDay={{ ranges: getPresets() }}
+                isGameId
+                isBGGameClassify
+                isUserEnterType
+                isActiveTypes
+            />}
+            isZj
+            totalData={totalData}
+            scroll={{ x: 1000, y: 600 }}
+            ajax={getActiveDataList}
+            fixed={{ left: 2, right: 0 }}
+            dataSource={getActiveDataList?.data?.records?.map((item: any, index: number) => ({ ...item, activeTypes: queryForm?.activeTypes, id: Number(queryForm.pageNum.toString() + index.toString()) }))}
+            total={getActiveDataList?.data?.total}
+            page={queryForm.pageNum}
+            pageSize={queryForm.pageSize}
+            sortData={{
+                field: queryForm?.sortFiled,
+                order: queryForm?.sortType === 'asc' ? 'ascend' : 'descend'
+            }}
+            title={`游戏留存数据`}
+            onChange={(props: any) => {
+                let { pagination, sortData } = props
+                let { current, pageSize } = pagination
+                let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                if (sortData && sortData?.order) {
+                    newQueryForm['sortType'] = sortData?.order === 'ascend' ? 'asc' : 'desc'
+                    newQueryForm['sortFiled'] = sortData?.field
+                } else {
+                    delete newQueryForm['sortType']
+                    delete newQueryForm['sortFiled']
+                }
+                newQueryForm.pageNum = current
+                newQueryForm.pageSize = pageSize
+                setQueryForm({ ...newQueryForm })
+            }}
+            config={columns12()}
+            configName={'游戏留存数据'}
+        />
+    </div>
+}
+
+export default React.memo(Active)

+ 502 - 0
src/pages/gameDataStatistics/gameData/active/tableConfig.tsx

@@ -0,0 +1,502 @@
+import React from "react"
+import { Statistic, Tooltip } from "antd"
+import { gameClassifyEnum } from "@/components/QueryForm/const"
+import WidthEllipsis from "@/components/widthEllipsis"
+import moment from "moment"
+import style from './index.less'
+import { QuestionCircleOutlined } from "@ant-design/icons"
+
+function columnsUser12(): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
+
+    let defaultStart = 13
+    // 留存数据
+    const activeDay = Array(90).fill('').map((_item: string, index: number) => {
+        let field = `da${index + 1}Trend`
+        let data = {
+            title: `D${index + 1}`,
+            dataIndex: field,
+            label: "留存数据",
+            align: "center",
+            width: 125,
+            render: (_: any, b: any) => {
+                let date1 = moment()
+                if (b?.costDate === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b?.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.costDate)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
+                if (index <= day) {
+                    let data: any = {}
+                    switch (b?.activeTypes) {
+                        case 'reg':
+                            if (b?.[field]) {
+                                data = b?.[field]
+                                return <div>
+                                    <div style={{ alignItems: 'center', fontSize: 12, fontWeight: 'bold' }}>注册留存</div>
+                                    <div className={style.dbox}>
+                                        <span style={{ color: '#d81b60', fontWeight: 600 }}>活跃人数:<span>{data?.activeNum}</span></span>
+                                        <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>留存率:<span>{(data?.regActiveRate * 100)?.toFixed(2)}%</span></span>
+                                    </div>
+                                </div>
+                            }
+                            return '--'
+                        case 'role':
+                            if (b?.[field]) {
+                                data = b?.[field]
+                                return <div>
+                                    <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 5, fontSize: 12, fontWeight: 'bold' }}>
+                                        角色留存
+                                        <Tooltip title="鼠标悬停展示完整名称">
+                                            <QuestionCircleOutlined />
+                                        </Tooltip>
+                                    </div>
+                                    <div className={style.dbox}>
+                                        <span style={{ color: '#d81b60', fontWeight: 600 }}>
+                                            <Tooltip title="累计到第N天的活跃用户数" placement='left'>
+                                                <span>活跃数:</span>
+                                            </Tooltip>
+                                            <span>{data?.roleNewActiveUserTotalNum}</span>
+                                        </span>
+                                        <span style={{ color: '#faad14', fontWeight: 600 }}>
+                                            <Tooltip title="第N天的新增创角用户数" placement='left'>
+                                                <span>新增创角:</span>
+                                            </Tooltip>
+                                            <span>{data?.roleNewUserNum}</span>
+                                        </span>
+                                        <span style={{ color: '#0f538a', fontWeight: 600 }}>
+                                            <Tooltip title="累计到第N天的创角用户数" placement='left'>
+                                                <span>累计创角:</span>
+                                            </Tooltip>
+                                            <span>{data?.roleNewUserTotalNum}</span>
+                                        </span>
+                                        <span style={{ color: '#eb2f96', fontWeight: 600 }}>
+                                            <Tooltip title="第N天的老活跃用户数" placement='left'>
+                                                <span>老活跃数:</span>
+                                            </Tooltip>
+                                            <span>{data?.roleOldActiveUserNum}</span>
+                                        </span>
+                                        <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>
+                                            <Tooltip title="创角留存率" placement='left'>
+                                                <span>留存率:</span>
+                                            </Tooltip>
+                                            <span>{(data?.roleActiveRate * 100)?.toFixed(2)}%</span>
+                                        </span>
+                                    </div>
+                                </div>
+                            }
+                            return '--'
+                        case 'amount':
+                            if (b?.[field]) {
+                                data = b?.[field]
+                                return <div>
+                                    <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 5, fontSize: 12, fontWeight: 'bold' }}>
+                                        付费留存
+                                        <Tooltip title="鼠标悬停展示完整名称">
+                                            <QuestionCircleOutlined />
+                                        </Tooltip>
+                                    </div>
+                                    <div className={style.dbox}>
+                                        <span style={{ color: '#d81b60', fontWeight: 600 }}>
+                                            <Tooltip title="累计到第N天的活跃用户数" placement='left'>
+                                                <span>活跃数:</span>
+                                            </Tooltip>
+                                            <span>{data?.newActiveUserTotalNum}</span>
+                                        </span>
+                                        <span style={{ color: '#faad14', fontWeight: 600 }}>
+                                            <Tooltip title="第N天的新增付费用户" placement='left'>
+                                                <span>新增付费:</span>
+                                            </Tooltip>
+                                            <span>{data?.newUserAmountNum}</span>
+                                        </span>
+                                        <span style={{ color: '#0f538a', fontWeight: 600 }}>
+                                            <Tooltip title="累计到第N天的付费用户数" placement='left'>
+                                                <span>付费人数:</span>
+                                            </Tooltip>
+                                            <span>{data?.newUserTotalAmountNum}</span>
+                                        </span>
+                                        <span style={{ color: '#eb2f96', fontWeight: 600 }}>
+                                            <Tooltip title="第N天的老活跃用户数" placement='left'>
+                                                <span>老活跃数:</span>
+                                            </Tooltip>
+                                            <span>{data?.oldActiveUserNum}</span>
+                                        </span>
+                                        <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>
+                                            <Tooltip title="付费留存率" placement='left'>
+                                                <span>留存率:</span>
+                                            </Tooltip>
+                                            <span>{(data?.amountActiveRate * 100)?.toFixed(2)}%</span>
+                                        </span>
+                                    </div>
+                                </div>
+                            }
+                            return '--'
+                        default:
+                            return '--'
+                    }
+                }
+                return '--'
+            }
+        }
+        data['default'] = defaultStart + index
+        return data
+    })
+
+    // 用户LTV月
+    let defaultStartM = 103
+    let activeMonth = [4, 5, 6, 7, 8, 9, 10, 11, 12].map((item, index) => {
+        let field = `m${item}Trend`
+        let data = {
+            title: `M${item}`,
+            dataIndex: field,
+            label: "留存数据",
+            align: "center",
+            width: 125,
+            render: (_: any, b: any) => {
+                let date1 = moment()
+                if (b?.costDate === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b?.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.costDate)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
+                if (item * 30 <= day) {
+                    let data: any = {}
+                    switch (b?.activeTypes) {
+                        case 'reg':
+                            if (b?.[field]) {
+                                data = b?.[field]
+                                return <div>
+                                    <div style={{ alignItems: 'center', fontSize: 12, fontWeight: 'bold' }}>注册留存</div>
+                                    <div className={style.dbox}>
+                                        <span style={{ color: '#d81b60', fontWeight: 600 }}>活跃人数:<span>{data?.activeNum}</span></span>
+                                        <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>留存率:<span>{(data?.regActiveRate * 100)?.toFixed(2)}%</span></span>
+                                    </div>
+                                </div>
+                            }
+                            return '--'
+                        case 'role':
+                            if (b?.[field]) {
+                                data = b?.[field]
+                                return <div>
+                                    <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 5, fontSize: 12, fontWeight: 'bold' }}>
+                                        角色留存
+                                        <Tooltip title="鼠标悬停展示完整名称">
+                                            <QuestionCircleOutlined />
+                                        </Tooltip>
+                                    </div>
+                                    <div className={style.dbox}>
+                                        <span style={{ color: '#d81b60', fontWeight: 600 }}>
+                                            <Tooltip title="累计到第N天的活跃用户数" placement='left'>
+                                                <span>活跃数:</span>
+                                            </Tooltip>
+                                            <span>{data?.roleNewActiveUserTotalNum}</span>
+                                        </span>
+                                        <span style={{ color: '#faad14', fontWeight: 600 }}>
+                                            <Tooltip title="第N天的新增创角用户数" placement='left'>
+                                                <span>新增创角:</span>
+                                            </Tooltip>
+                                            <span>{data?.roleNewUserNum}</span>
+                                        </span>
+                                        <span style={{ color: '#0f538a', fontWeight: 600 }}>
+                                            <Tooltip title="累计到第N天的创角用户数" placement='left'>
+                                                <span>累计创角:</span>
+                                            </Tooltip>
+                                            <span>{data?.roleNewUserTotalNum}</span>
+                                        </span>
+                                        <span style={{ color: '#eb2f96', fontWeight: 600 }}>
+                                            <Tooltip title="第N天的老活跃用户数" placement='left'>
+                                                <span>老活跃数:</span>
+                                            </Tooltip>
+                                            <span>{data?.roleOldActiveUserNum}</span>
+                                        </span>
+                                        <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>
+                                            <Tooltip title="创角留存率" placement='left'>
+                                                <span>留存率:</span>
+                                            </Tooltip>
+                                            <span>{(data?.roleActiveRate * 100)?.toFixed(2)}%</span>
+                                        </span>
+                                    </div>
+                                </div>
+                            }
+                            return '--'
+                        case 'amount':
+                            if (b?.[field]) {
+                                data = b?.[field]
+                                return <div>
+                                    <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 5, fontSize: 12, fontWeight: 'bold' }}>
+                                        付费留存
+                                        <Tooltip title="鼠标悬停展示完整名称">
+                                            <QuestionCircleOutlined />
+                                        </Tooltip>
+                                    </div>
+                                    <div className={style.dbox}>
+                                        <span style={{ color: '#d81b60', fontWeight: 600 }}>
+                                            <Tooltip title="累计到第N天的活跃用户数" placement='left'>
+                                                <span>活跃数:</span>
+                                            </Tooltip>
+                                            <span>{data?.newActiveUserTotalNum}</span>
+                                        </span>
+                                        <span style={{ color: '#faad14', fontWeight: 600 }}>
+                                            <Tooltip title="第N天的新增付费用户" placement='left'>
+                                                <span>新增付费:</span>
+                                            </Tooltip>
+                                            <span>{data?.newUserAmountNum}</span>
+                                        </span>
+                                        <span style={{ color: '#0f538a', fontWeight: 600 }}>
+                                            <Tooltip title="累计到第N天的付费用户数" placement='left'>
+                                                <span>付费人数:</span>
+                                            </Tooltip>
+                                            <span>{data?.newUserTotalAmountNum}</span>
+                                        </span>
+                                        <span style={{ color: '#eb2f96', fontWeight: 600 }}>
+                                            <Tooltip title="第N天的老活跃用户数" placement='left'>
+                                                <span>老活跃数:</span>
+                                            </Tooltip>
+                                            <span>{data?.oldActiveUserNum}</span>
+                                        </span>
+                                        <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>
+                                            <Tooltip title="付费留存率" placement='left'>
+                                                <span>留存率:</span>
+                                            </Tooltip>
+                                            <span>{(data?.amountActiveRate * 100)?.toFixed(2)}%</span>
+                                        </span>
+                                    </div>
+                                </div>
+                            }
+                            return '--'
+                        default:
+                            return '--'
+                    }
+                }
+                return '--'
+            }
+        }
+        data['default'] = defaultStartM + index
+        return data
+    })
+
+    return [
+        {
+            label: '游戏信息',
+            data: [
+                {
+                    title: '推广游戏名称', dataIndex: 'gameName', label: '游戏信息', align: 'center', width: 70, default: 2,
+                    render: (a: string, b: any) => (<WidthEllipsis isCopy={b?.costDate !== '总计'} value={a} />)
+                },
+                {
+                    title: '推广游戏应用类型', dataIndex: 'gameClassify', label: '游戏信息', align: 'center', width: 80,
+                    render: (a: string) => (<WidthEllipsis value={gameClassifyEnum[a]} />)
+                }
+            ]
+        },
+        {
+            label: '时间',
+            data: [
+                {
+                    title: '日期', dataIndex: 'costDate', label: '时间', align: 'center', width: 90, default: 1,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+            ]
+        },
+        {
+            label: '消耗',
+            data: [
+                {
+                    title: '消耗', dataIndex: 'cost', label: '消耗', align: 'center', width: 90, sorter: true, default: 3,
+                    render: (a: string) => <Statistic value={a || 0} />
+                }
+            ]
+        },
+        {
+            label: '用户数据',
+            data: [
+                {
+                    title: '注册人数', dataIndex: 'regNum', label: '用户数据', align: 'center', width: 70, sorter: true, default: 4,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '注册成本', dataIndex: 'regCost', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                }
+            ]
+        },
+        {
+            label: '付费数据',
+            data: [
+                {
+                    title: '首日新用户充值次数', dataIndex: 'firstNewUserAmountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日新用户充值人数', dataIndex: 'firstNewUserAmountNum', label: '付费数据', align: 'center', width: 70, sorter: true, default: 5,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日新用户充值金额', dataIndex: 'firstNewUserAmount', label: '付费数据', align: 'center', width: 70, sorter: true, default: 6,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值次数', dataIndex: 'oldUserCount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值人数', dataIndex: 'oldUserNum', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值金额', dataIndex: 'oldUserAmount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面充值次数', dataIndex: 'amountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面充值人数', dataIndex: 'amountNum', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面充值金额', dataIndex: 'amount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计充值次数', dataIndex: 'newUserTotalAmountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计充值人数', dataIndex: 'newUserTotalAmountNum', label: '付费数据', align: 'center', width: 70, sorter: true, default: 7,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计充值金额', dataIndex: 'newUserTotalAmount', label: '付费数据', align: 'center', width: 70, sorter: true, default: 8,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日ROI', dataIndex: 'firstRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 9,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '总ROI', dataIndex: 'totalRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 12,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日付费率', dataIndex: 'firstAmountRate', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '至今付费率', tips: '至今付费率(总)=新用户累计充值人数/注册人数', dataIndex: 'todayAmountRate', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新用户付费比', dataIndex: 'newUserRate', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日客单价', dataIndex: 'firstAvgAmount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日充值成本', dataIndex: 'firstNewUserRechargeCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 10,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '总充值成本', dataIndex: 'totalRechargeCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 11,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今客单价', tips: '至今客单价(总)=新用户累计充值金额/新用户累计充值次数', dataIndex: 'todayAvgAmount', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面客单价', dataIndex: 'avgAmount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '复充率', tips: '复充率(总)=新用户复充人数/新用户累计充值人数(新用户复充人数为累计充值次数n≥2)', dataIndex: 'userAgainRate', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+
+                {
+                    title: '单日付费100+人数', dataIndex: 'hundredUserNum', label: '付费数据', align: 'center', width: 90, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '单日付费100+成本', dataIndex: 'hundredUserNumCost', label: '付费数据', align: 'center', width: 90, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} precision={2} />
+                },
+                {
+                    title: '首日创角人数', dataIndex: 'firstRoleNum', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '创角人数', dataIndex: 'roleNum', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计创角人数', dataIndex: 'newUserTotalRoleNum', label: '付费数据', align: 'center', width: 85, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日创角人数成本', dataIndex: 'firstRoleNumCost', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} precision={2} />
+                },
+                {
+                    title: '创角人数成本', dataIndex: 'roleNumCost', label: '付费数据', align: 'center', width: 75, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} precision={2} />
+                },
+                {
+                    title: '新用户累计创角人数成本', dataIndex: 'newUserTotalRoleNumCost', label: '付费数据', align: 'center', width: 90, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} precision={2} />
+                },
+                {
+                    title: '首日创角率', dataIndex: 'firstRoleNumRate', label: '付费数据', align: 'center', width: 75, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '创角率', dataIndex: 'roleNumRate', label: '付费数据', align: 'center', width: 75, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新用户累计创角率', dataIndex: 'newUserTotalRoleNumRate', label: '付费数据', align: 'center', width: 90, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新增注册ARPPU', dataIndex: 'regUserArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日付费ARPPU', dataIndex: 'firstAmountArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今付费ARPPU', dataIndex: 'todayAmountArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面ARPPU', dataIndex: 'amountArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                }
+            ]
+        },
+        {
+            label: '留存数据',
+            data: [
+                ...activeDay,
+                ...activeMonth
+            ]
+        },
+    ]
+}
+
+export default columnsUser12

+ 34 - 0
src/services/gameData/game.ts

@@ -1,6 +1,7 @@
 import { request } from 'umi';
 import { api } from '../api';
 import { Paging, SortProps } from './rankingList';
+import { ActiveEnum, TableEnum } from '@/components/QueryForm/const';
 let wapi = api + '/gameData'
 
 export interface GameWaterProps extends Paging, SortProps {
@@ -182,4 +183,37 @@ export async function getDetailsApi(data: AgainListProps) {
         method: 'POST',
         data
     });
+}
+
+export interface ActiveDataProps extends Paging, SortProps {
+    tableTypes?: TableEnum,
+    activeTypes: ActiveEnum,
+    classify?: number,
+    gameId?: number,
+    // 注册开始时间
+    registeredBeginDate?: string,
+    registeredEndDate?: string,
+}
+/**
+ * 留存数据
+ * @param data 
+ * @returns 
+ */
+export async function getActiveDataListApi(data: ActiveDataProps) {
+    return request(wapi + `/gameData/activeData/day`, {
+        method: 'POST',
+        data
+    });
+}
+
+/**
+ * 留存总计
+ * @param data 
+ * @returns 
+ */
+export async function getActiveDataTotalApi(data: ActiveDataProps) {
+    return request(wapi + `/gameData/activeData/total`, {
+        method: 'POST',
+        data
+    });
 }