wjx 1 ano atrás
pai
commit
b4d70afa91

+ 31 - 0
config/routerConfig.ts

@@ -236,6 +236,37 @@ const gameDataStatistics = {
                 },
             ]
         },
+        {
+            path: '/gameDataStatistics/medium',
+            name: '媒体数据',
+            access: 'medium',
+            routes: [
+                {
+                    path: '/gameDataStatistics/medium/promotionEvery',
+                    name: '推广媒体每日数据',
+                    access: 'promotionEvery',
+                    component: './gameDataStatistics/medium/promotionEvery',
+                },
+                {
+                    path: '/gameDataStatistics/medium/promotionTotal',
+                    name: '推广媒体总数据',
+                    access: 'promotionTotal',
+                    component: './gameDataStatistics/medium/promotionTotal',
+                },
+                {
+                    path: '/gameDataStatistics/medium/pitcherEvery',
+                    name: '投手媒体每日数据',
+                    access: 'pitcherEvery',
+                    component: './gameDataStatistics/medium/pitcherEvery',
+                },
+                {
+                    path: '/gameDataStatistics/medium/pitcherTotal',
+                    name: '投手媒体总数据',
+                    access: 'pitcherTotal',
+                    component: './gameDataStatistics/medium/pitcherTotal',
+                },
+            ]
+        },
         {
             path: '/gameDataStatistics/gameServer',
             name: '游戏区服',

+ 4 - 0
src/components/BaseTable/index.less

@@ -0,0 +1,4 @@
+.pagination {
+    padding: 16px 0;
+    text-align: right;
+}

+ 16 - 3
src/components/BaseTable/index.tsx

@@ -1,9 +1,17 @@
-import React from "react"
+import { useSize } from "ahooks";
+import React, { useRef } from "react"
 import Table, { Column, ColumnShape } from 'react-base-table'
 import 'react-base-table/styles.css'
+import './index.less'
+import { Pagination } from "antd";
 
 const BaseTable: React.FC = () => {
 
+    /***************************************/
+    const ref = useRef(null);
+    const size = useSize(ref);
+    /***************************************/
+
     let columns: ColumnShape<any>[] = [
         {
             key: 'name',
@@ -115,7 +123,7 @@ const BaseTable: React.FC = () => {
             width: 100,
             align: Column.Alignment.CENTER,
             frozen: Column.FrozenDirection.RIGHT,
-            
+
             cellRenderer: ({ rowData }: any) => (
                 <button
                     onClick={() => {
@@ -142,7 +150,12 @@ const BaseTable: React.FC = () => {
         country: 'aaasdsad',
     }));
 
-    return <Table fixed columns={columns} data={defaultData} width={600} height={400} />
+    return <div ref={ref}>
+        <Table fixed columns={columns} data={defaultData} width={size.width || 900} height={600} />
+        <div className="pagination">
+            <Pagination defaultCurrent={6} total={500} />
+        </div>
+    </div>
 }
 
 export default React.memo(BaseTable)

+ 8 - 8
src/components/QueryForm/index.tsx

@@ -813,40 +813,40 @@ const QueryForm: React.FC<Props> = (props) => {
 
             {/* 用户注册日期搜索 */}
             {isRegDay && <Col><Form.Item name='regDay'>
-                <DatePicker.RangePicker placeholder={['用户注册开始日期', '用户注册结束日期']} {...isRegDay} />
+                <DatePicker.RangePicker style={{ width: 230 }} placeholder={['用户注册开始日期', '用户注册结束日期']} {...isRegDay} />
             </Form.Item></Col>}
 
             {/* 消耗日期 搜索 */}
             {isConsumeDay && <Col><Form.Item name='consumeDay'>
-                <DatePicker.RangePicker placeholder={['消耗开始日期', '消耗结束日期']} {...isConsumeDay} />
+                <DatePicker.RangePicker style={{ width: 230 }} placeholder={['消耗开始日期', '消耗结束日期']} {...isConsumeDay} />
             </Form.Item></Col>}
 
             {/* 消耗日期 搜索 */}
             {isBeginDay && <Col><Form.Item name='beginDay'>
-                <DatePicker.RangePicker placeholder={['开始日期', '结束日期']} />
+                <DatePicker.RangePicker style={{ width: 230 }} placeholder={['开始日期', '结束日期']} />
             </Form.Item></Col>}
 
             {/* 订单创建日期搜索 */}
             {isCreateDay && <Col><Form.Item name='createDay'>
-                <DatePicker.RangePicker placeholder={['订单创建开始日期', '订单创建结束日期']} {...isCreateDay} />
+                <DatePicker.RangePicker style={{ width: 230 }} placeholder={['订单创建开始日期', '订单创建结束日期']} {...isCreateDay} />
             </Form.Item></Col>}
             {/* 充值日期搜索 */}
             {rechargeDay && <Col><Form.Item name='rechargeDay'>
-                <DatePicker.RangePicker placeholder={['充值开始日期', '充值结束日期']} {...rechargeDay} />
+                <DatePicker.RangePicker style={{ width: 230 }} placeholder={['充值开始日期', '充值结束日期']} {...rechargeDay} />
             </Form.Item></Col>}
 
             {/* 单个充值日期搜索 */}
             {payTimeDay && <Col><Form.Item name='payTime'>
-                <DatePicker.RangePicker placeholder={['支付开始日期', '支付结束日期']} {...payTimeDay} />
+                <DatePicker.RangePicker style={{ width: 230 }} placeholder={['支付开始日期', '支付结束日期']} {...payTimeDay} />
             </Form.Item></Col>}
             {/* 单个充值日期搜索 */}
             {placeAnOrderDay && <Col><Form.Item name='placeAnOrderTime'>
-                <DatePicker.RangePicker placeholder={['下单开始日期', '下单结束日期']} {...placeAnOrderDay} />
+                <DatePicker.RangePicker style={{ width: 230 }} placeholder={['下单开始日期', '下单结束日期']} {...placeAnOrderDay} />
             </Form.Item></Col>}
 
             {/* 开服日期搜索 */}
             {isServerDay && <Col><Form.Item name='serverDay'>
-                <DatePicker.RangePicker placeholder={['开服开始日期', '开服结束日期']} {...isServerDay} />
+                <DatePicker.RangePicker style={{ width: 230 }} placeholder={['开服开始日期', '开服结束日期']} {...isServerDay} />
             </Form.Item></Col>}
 
             {/* 单个充值日期搜索 */}

+ 101 - 0
src/pages/gameDataStatistics/medium/pitcherEvery/index.tsx

@@ -0,0 +1,101 @@
+import { useAjax } from "@/Hook/useAjax"
+import { MediaPromotionDayProps, getMediaPitcherDayListApi, getMediaPitcherTotalApi } from "@/services/gameData/medium"
+import React, { useEffect, useState } from "react"
+import moment from 'moment'
+import columns12 from "./tableConfig"
+import { getPresets } from "@/components/QueryForm/const"
+import QueryForm from "@/components/QueryForm"
+import TableData from "../../components/TableData"
+
+
+/**
+ * 投手推广每日数据
+ * @returns 
+ */
+const PitcherEvery: React.FC = () => {
+
+    /*****************************/
+    const [queryForm, setQueryForm] = useState<MediaPromotionDayProps>({
+        pageNum: 1, pageSize: 50,
+        sourceSystem: 'ZX_ONE',
+        beginDate: moment().format('YYYY-MM-DD'), //subtract(30, 'd').
+        endDate: moment().format('YYYY-MM-DD')
+    })
+    const [totalData, setTotalData] = useState<any[]>([])
+
+    const getMediaPitcherDayList = useAjax((params) => getMediaPitcherDayListApi(params))
+    const getMediaPitcherTotal = useAjax((params) => getMediaPitcherTotalApi(params))
+    /*****************************/
+
+
+    useEffect(() => {
+        getMediaPitcherDayList.run(queryForm)
+        getMediaPitcherTotal.run(queryForm).then((res: { id: number; pitcher: string, beginDay?: string }) => {
+            res.id = 1
+            res.pitcher = '总计'
+            res.beginDay = queryForm.beginDate
+            setTotalData([res])
+        })
+    }, [queryForm])
+
+
+    return <div>
+        <TableData
+            leftChild={<QueryForm
+                initialValues={{ consumeDay: [moment(), moment()], sourceSystem: 'ZX_ONE' }}
+                onChange={(data: any) => {
+                    console.log(data)
+                    const { costBeginDay, costEndDay, type, ...params } = data
+                    let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                    newQueryForm.pageNum = 1
+                    newQueryForm.accountType = type
+                    if (costBeginDay && costEndDay) {
+                        newQueryForm.beginDate = costBeginDay
+                        newQueryForm.endDate = costEndDay
+                    } else {
+                        delete newQueryForm.beginDate
+                        delete newQueryForm.endDate
+                    }
+                    setQueryForm({ ...newQueryForm, ...params })
+                }}
+                isSource
+                isConsumeDay={{ ranges: getPresets() }}
+                isSysUserId
+                isType
+            />}
+            isZj
+            totalData={totalData}
+            scroll={{ x: 1000, y: 600 }}
+            ajax={getMediaPitcherDayList}
+            fixed={{ left: 2, right: 1 }}
+            dataSource={getMediaPitcherDayList?.data?.records?.map((item: any, index: number) => ({ ...item, id: Number(queryForm.pageNum.toString() + index.toString()) }))}
+            total={getMediaPitcherDayList?.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 PitcherEvery

+ 417 - 0
src/pages/gameDataStatistics/medium/pitcherEvery/tableConfig.tsx

@@ -0,0 +1,417 @@
+import WidthEllipsis from "@/components/widthEllipsis"
+import { Statistic } from "antd"
+import React from "react"
+import { version } from "../../components/TableData"
+import moment from "moment"
+import style from '../../extensionData/everyday/index.less'
+
+function columns12(): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
+
+    const roiC = Array(29).fill('').map((_item: string, index: number) => {
+        let data = {
+            title: `${index + 2}日ROI`,
+            dataIndex: `roi${index + 2}`,
+            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="%" />
+        }
+        index++;
+        return data
+    })
+
+    let defaultValue = [  // 默认展示字段
+        { label: '充值人数', key: 'rechargeUserCount', type: '付费趋势' },
+        { label: '充值金额', key: 'rechargeMoney', type: '付费趋势' },
+        { label: '增', key: 'increase', type: '付费趋势' },
+        { label: '回', key: 'back', type: '付费趋势' },
+        { label: '倍', key: 'multiples', type: '付费趋势' },
+    ]
+    const getFieldDta = () => {
+        let mySelectFieldData = localStorage.getItem(`myAdFieldConfig${version}_投手推广每日数据`)
+        let newSelectFieldData: any = {}
+        if (mySelectFieldData) {
+            newSelectFieldData = JSON.parse(mySelectFieldData).date_field
+        } else {
+            newSelectFieldData = defaultValue
+        }
+        return newSelectFieldData
+    }
+    // 总付费趋势
+    let defaultStart = 16
+    const zC = Array(90).fill('').map((_item: string, index: number) => {
+        let field = `amountD${index + 1}Trend`
+        let data = {
+            title: `D${index + 1}`,
+            dataIndex: `D${index + 1}`,
+            label: "时间区间跨度",
+            width: 110,
+            render: (a: any, b: any) => {
+                let date1 = moment()
+                if (b?.pitcher === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.dt)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
+                let fieldData = getFieldDta()
+                if (fieldData?.length > 0 && index <= day) {
+                    let data: any = {}
+                    let keyS: string[] = fieldData?.map((item: any) => item.key)
+                    switch (fieldData[0].type) {
+                        case '付费趋势':
+                            if (b?.[field]) {
+                                data = b?.[field]
+                                return <div className={style.dbox}>
+                                    {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
+                                    {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
+                                    {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
+                                    {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
+                                    {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
+                                </div>
+                            }
+                            return '--'
+                    }
+                }
+                return '--'
+            },
+        }
+        if (index < 30) {
+            data['default'] = defaultStart + index
+        }
+        return data
+    })
+
+    // let mDefaultStart = 109, count = 0
+    const Mc = [4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => {
+        let field = `amountM${index}Trend`
+        let data = {
+            title: `M${index}`,
+            dataIndex: `M${index}`,
+            label: "时间区间跨度",
+            width: 110,
+            render: (a: any, b: any) => {
+                let date1 = moment()
+                if (b?.pitcher === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.dt)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
+                let fieldData = getFieldDta()
+                if (fieldData?.length > 0 && index * 30 <= day) {
+                    let data: any = {}
+                    let keyS: string[] = fieldData?.map((item: any) => item.key)
+                    switch (fieldData[0].type) {
+                        case '付费趋势':
+                            if (b?.[field]) {
+                                data = b?.[field]
+                                return <div className={style.dbox}>
+                                    {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
+                                    {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
+                                    {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
+                                    {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
+                                    {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
+                                </div>
+                            }
+                            return '--'
+                    }
+                }
+                return '--'
+            },
+        }
+        // data['default'] = mDefaultStart + count
+        // count++;
+        return data
+    })
+
+
+    Mc.push({
+        title: "总",
+        default: 46,
+        dataIndex: "amountSumTrend",
+        label: "时间区间跨度",
+        align: "center",
+        width: 110,
+        render: (a: any, b: any) => {
+            let fieldData = getFieldDta()
+            if (fieldData?.length > 0) {
+                let data: any = {}
+                let keyS: string[] = fieldData?.map((item: any) => item.key)
+                switch (fieldData[0].type) {
+                    case '付费趋势':
+                        if (a) {
+                            data = a
+                            return <div className={style.dbox}>
+                                {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
+                                {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
+                                {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
+                                {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
+                                {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
+                            </div>
+                        }
+                        return '--'
+                }
+            }
+            return '--'
+        },
+    } as any)
+
+    return [
+        {
+            label: '基本信息',
+            data: [
+                {
+                    title: '投手', dataIndex: 'pitcher', label: '基本信息', align: 'center', width: 95, default: 1,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '推广媒体', dataIndex: 'accountType', label: '基本信息', align: 'center', width: 95, default: 2,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '时间', dataIndex: 'dt', label: '基本信息', align: 'center', width: 110, default: 3, sorter: true,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '消耗', dataIndex: 'cost', label: '基本信息', align: 'center', width: 70, default: 4, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '推广账号数量', dataIndex: 'accountCount', label: '基本信息', align: 'center', width: 80, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '推广渠道数量', dataIndex: 'agentCount', label: '基本信息', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '推广计划数量', dataIndex: 'planCount', label: '基本信息', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                }
+            ]
+        },
+        {
+            label: '用户数据',
+            data: [
+                {
+                    title: '注册人数', dataIndex: 'registerNum', label: '用户数据', align: 'center', width: 70, sorter: true, default: 5,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '注册成本', dataIndex: 'registerCost', label: '用户数据', align: 'center', width: 70, sorter: true, default: 6,
+                    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: 'firstRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计创角人数', dataIndex: 'newUserTotalRoleNum', label: '用户数据', align: 'center', width: 100, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日创角成本', dataIndex: 'firstRoleCost', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计创角成本', dataIndex: 'newUserTotalRoleCost', label: '用户数据', align: 'center', width: 70, 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: 'firstRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                //     render: (a: string) => <Statistic value={a || 0} />
+                // },
+                // {
+                //     title: '新用户累计创角量', dataIndex: 'newUserTotalRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                //     render: (a: string) => <Statistic value={a || 0} />
+                // },
+                {
+                    title: '首日创角率', dataIndex: 'firstRoleRate', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新用户创角率', dataIndex: 'roleNumRate', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                }
+            ]
+        },
+        {
+            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: 7,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日新用户充值金额', dataIndex: 'firstNewUserAmount', label: '付费数据', align: 'center', width: 70, sorter: true, default: 8,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值次数', dataIndex: 'oldAmountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值人数', dataIndex: 'oldAmountNum', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值金额', dataIndex: 'oldAmount', 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: 'buyNewUserTotalAmountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计充值人数', dataIndex: 'buyNewUserTotalAmountNum', label: '付费数据', align: 'center', width: 70, sorter: true, default: 9,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计充值金额', dataIndex: 'buyNewUserTotalAmount', label: '付费数据', align: 'center', width: 70, sorter: true, default: 10,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日ROI', dataIndex: 'firstRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 11,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '毛利额', dataIndex: 'grossProfit', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a} precision={2} valueStyle={a < 0 ? { color: 'red' } : {}} />
+                },
+                {
+                    title: '至今回收率', dataIndex: 'todayRoi', 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="%" />
+                },
+                ...roiC,
+                {
+                    title: '60日ROI', dataIndex: 'roi60', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 0.9 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '90日ROI', dataIndex: 'roi90', 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: '180日ROI', dataIndex: 'roi180', 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: '1年ROI', dataIndex: 'roi1yaer', 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: '总ROI', dataIndex: 'todayRoi', label: '付费数据', align: 'center', width: 80, default: 12, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日付费率', dataIndex: 'firstRate', 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: 'todayRate', 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: 'newUserAmountRatio', 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: 'firstAvg', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今客单价', dataIndex: 'buyAvg', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面客单价', dataIndex: 'paperAvg', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日充值成本', dataIndex: 'firstAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 13,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 14,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今复充率', dataIndex: 'todayAgainRate', 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: '新增注册ARPPU', dataIndex: 'newRegArpu', label: '付费数据', align: 'center', width: 70, sorter: true, default: 15,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日付费ARPPU', dataIndex: 'firstArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面ARPPU', dataIndex: 'paperArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                }
+            ]
+        },
+        {
+            fieldSHow: {
+                label: '日期区间字段展示',
+                saveField: 'date_field',
+                defaultValue,
+                data: [
+                    {
+                        label: '付费趋势',
+                        data: defaultValue
+                    },
+                ]
+            },
+            label: '时间区间跨度',
+            data: [
+                ...zC,
+                ...Mc
+            ]
+        }
+    ]
+}
+
+export default columns12

+ 109 - 0
src/pages/gameDataStatistics/medium/pitcherTotal/index.tsx

@@ -0,0 +1,109 @@
+import { useAjax } from "@/Hook/useAjax"
+import { MediaPitcherTotalProps, getMediaPitcherTotalListApi, getMediaPitcherTotalSumApi } from "@/services/gameData/medium"
+import React, { useEffect, useState } from "react"
+import moment from "moment"
+import TableData from "../../components/TableData"
+import QueryForm from "@/components/QueryForm"
+import { getPresets } from "@/components/QueryForm/const"
+import columns12 from "./tableConfig"
+
+
+/**
+ * 投手推广总数居
+ * @returns 
+ */
+const PitcherTotal: React.FC = () => {
+
+    /*****************************/
+    const [queryForm, setQueryForm] = useState<MediaPitcherTotalProps>({
+        pageNum: 1, pageSize: 100,
+        sourceSystem: 'ZX_ONE',
+        amountBeginDate: moment().format('YYYY-MM-DD'), //.subtract(30, 'd')
+        amountEndDate: moment().format('YYYY-MM-DD'),
+        beginDate: moment().format('YYYY-MM-DD'), //subtract(30, 'd').
+        endDate: moment().format('YYYY-MM-DD')
+    })
+    const [totalData, setTotalData] = useState<any[]>([])
+
+    const getMediaPitcherTotalList = useAjax((params) => getMediaPitcherTotalListApi(params))
+    const getMediaPitcherTotalSum = useAjax((params) => getMediaPitcherTotalSumApi(params))
+    /*****************************/
+
+    useEffect(() => {
+        getMediaPitcherTotalList.run(queryForm)
+        getMediaPitcherTotalSum.run(queryForm).then((res: { id: number; pitcher: string }) => {
+            res.id = 1
+            res.pitcher = '总计'
+            setTotalData([res])
+        })
+    }, [queryForm])
+
+    return <div>
+        <TableData
+            leftChild={<QueryForm
+                initialValues={{ rechargeDay: [moment(), moment()], consumeDay: [moment(), moment()], sourceSystem: 'ZX_ONE' }}
+                onChange={(data: any) => {
+                    console.log(data)
+                    const { costBeginDay, costEndDay, rechargeDay, type, gameClassify, cpName, ...params } = data
+                    let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                    newQueryForm.pageNum = 1
+                    newQueryForm.accountType = type
+                    if (costBeginDay && costEndDay) {
+                        newQueryForm.beginDate = costBeginDay
+                        newQueryForm.endDate = costEndDay
+                    } else {
+                        delete newQueryForm.beginDate
+                        delete newQueryForm.endDate
+                    }
+                
+                    if (rechargeDay && rechargeDay?.length === 2) {
+                        newQueryForm['amountBeginDate'] = moment(rechargeDay[0]).format('YYYY-MM-DD')
+                        newQueryForm['amountEndDate'] = moment(rechargeDay[1]).format('YYYY-MM-DD')
+                    } else {
+                        delete newQueryForm['amountBeginDate']
+                        delete newQueryForm['amountEndDate']
+                    }
+                    setQueryForm({ ...newQueryForm, ...params })
+                }}
+                isSource
+                isConsumeDay={{ ranges: getPresets() }}
+                rechargeDay={{ ranges: getPresets() }}
+                isSysUserId
+                isType
+            />}
+            isZj
+            totalData={totalData}
+            scroll={{ x: 1000, y: 600 }}
+            ajax={getMediaPitcherTotalList}
+            fixed={{ left: 2, right: 1 }}
+            dataSource={getMediaPitcherTotalList?.data?.records?.map((item: any, index: number) => ({ ...item, id: Number(queryForm.pageNum.toString() + index.toString()) }))}
+            total={getMediaPitcherTotalList?.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 PitcherTotal

+ 302 - 0
src/pages/gameDataStatistics/medium/pitcherTotal/tableConfig.tsx

@@ -0,0 +1,302 @@
+import { gameClassifyEnum } from "@/components/QueryForm/const"
+import WidthEllipsis from "@/components/widthEllipsis"
+import { Statistic } from "antd"
+import React from "react"
+
+function columns12() {
+
+    const roiC = Array(29).fill('').map((_item: string, index: number) => {
+        let data = {
+            title: `${index + 2}日ROI`,
+            dataIndex: `roi${index + 2}`,
+            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="%" />
+        }
+        index++;
+        return data
+    })
+
+    let newArr: { label: string, data: any[] }[] = [
+        {
+            label: '基本信息',
+            data: [
+                {
+                    title: '投手', dataIndex: 'pitcher', label: '基本信息', align: 'center', width: 95, default: 1,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '推广媒体', dataIndex: 'accountType', label: '基本信息', align: 'center', width: 95, default: 2,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '消耗', dataIndex: 'cost', label: '基本信息', align: 'center', width: 70, default: 3, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '推广账号数量', dataIndex: 'accountCount', label: '基本信息', align: 'center', width: 80, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '推广渠道数量', dataIndex: 'agentCount', label: '基本信息', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                // {
+                //     title: '推广游戏数量', dataIndex: 'cost', label: '基本信息', align: 'center', width: 90, sorter: true,
+                // },
+                {
+                    title: '推广计划数量', dataIndex: 'planCount', label: '基本信息', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                }
+            ]
+        },
+        {
+            label: '用户数据',
+            data: [
+                {
+                    title: '注册人数', dataIndex: 'registerNum', label: '用户数据', align: 'center', width: 70, sorter: true, default: 4,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '注册成本', dataIndex: 'registerCost', label: '用户数据', align: 'center', width: 70, sorter: true, default: 5,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                // {
+                //     title: '活跃用户人数', dataIndex: 'clickRate', label: '用户数据', align: 'center', width: 80, sorter: true,
+                //     render: (a: number) => <Statistic value={a || 0} valueStyle={a >= 100 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                // },
+                {
+                    title: '创角人数', dataIndex: 'roleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日创角人数', dataIndex: 'firstRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计创角人数', dataIndex: 'newUserTotalRoleNum', label: '用户数据', align: 'center', width: 100, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日创角成本', dataIndex: 'firstRoleCost', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计创角成本', dataIndex: 'newUserTotalRoleCost', label: '用户数据', align: 'center', width: 70, 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: 'firstRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                //     render: (a: string) => <Statistic value={a || 0} />
+                // },
+                // {
+                //     title: '新用户累计创角量', dataIndex: 'newUserTotalRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                //     render: (a: string) => <Statistic value={a || 0} />
+                // },
+                // {
+                //     title: '新用户累计有效创角量', dataIndex: 'totalAmount', label: '用户数据', align: 'center', width: 70, sorter: true,
+                // },
+                {
+                    title: '首日创角率', dataIndex: 'firstRoleRate', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新用户创角率', dataIndex: 'roleNumRate', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                }
+            ]
+        },
+        {
+            label: '付费数据',
+            data: [
+                {
+                    title: '新用户充值次数', dataIndex: 'newUserAmountCount', label: '付费数据', align: 'center', width: 90,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户充值人数', dataIndex: 'newUserAmountNum', label: '付费数据', align: 'center', width: 100, sorter: true, default: 6,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户充值金额', dataIndex: 'newUserAmount', label: '付费数据', align: 'center', width: 70, default: 7,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    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: 8,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日新用户充值金额', dataIndex: 'firstNewUserAmount', label: '付费数据', align: 'center', width: 70, sorter: true, default: 9,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值次数', dataIndex: 'oldAmountCount', label: '付费数据', align: 'center', width: 70,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值人数', dataIndex: 'oldAmountNum', label: '付费数据', align: 'center', width: 70,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值金额', dataIndex: 'oldAmount', label: '付费数据', align: 'center', width: 70,
+                    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: 'buyNewUserTotalAmountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计充值人数', dataIndex: 'buyNewUserTotalAmountNum', label: '付费数据', align: 'center', width: 70, sorter: true, default: 10,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计充值金额', dataIndex: 'buyNewUserTotalAmount', label: '付费数据', align: 'center', width: 70, sorter: true, default: 11,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日ROI', dataIndex: 'firstRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 13,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新用户回收率', dataIndex: 'newUserRoi', label: '付费数据', align: 'center', width: 70, default: 12,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '至今回收率', dataIndex: 'todayRoi', 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: 'grossProfit', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a} precision={2} valueStyle={a < 0 ? { color: 'red' } : {}} />
+                },
+                ...roiC,
+                {
+                    title: '60日ROI', dataIndex: 'roi60', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 0.9 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '90日ROI', dataIndex: 'roi90', 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: '180日ROI', dataIndex: 'roi180', 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: '1年ROI', dataIndex: 'roi1yaer', 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: '总ROI', dataIndex: 'todayRoi', label: '付费数据', align: 'center', width: 80, default: 14, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日付费率', dataIndex: 'firstRate', 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: 'newUserAmountRate', 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: 'todayRate', 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: 'newUserAmountRatio', 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: 'newUserRate1', 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: 'firstAvg', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户客单价', dataIndex: 'newUserAvg', label: '付费数据', align: 'center', width: 70,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面客单价', dataIndex: 'paperAvg', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日充值成本', dataIndex: 'firstAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 16,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户充值成本', dataIndex: 'newUserAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 15,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 17,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户复充率', dataIndex: 'newUserAgainRate', label: '付费数据', align: 'center', width: 70, sorter: true, default: 18,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '至今复充率', dataIndex: 'todayAgainRate', 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: 'newUserRate4', 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: '新增注册ARPPU', dataIndex: 'newRegArpu', label: '付费数据', align: 'center', width: 70, sorter: true, default: 19,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                // {
+                //     title: '活跃ARPPU', dataIndex: 'regUserArpu1', label: '付费数据', align: 'center', width: 70, sorter: true,
+                //     render: (a: string) => <Statistic value={a || 0} />
+                // },
+                {
+                    title: '首日付费ARPPU', dataIndex: 'firstArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户付费ARPPU', dataIndex: 'newUserArpu', label: '付费数据', align: 'center', width: 70,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面ARPPU', dataIndex: 'paperArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                }
+            ]
+        }
+    ]
+    return newArr
+}
+
+export default columns12

+ 104 - 0
src/pages/gameDataStatistics/medium/promotionEvery/index.tsx

@@ -0,0 +1,104 @@
+import React, { useEffect, useState } from "react"
+import moment from "moment"
+import { useAjax } from "@/Hook/useAjax"
+import { MediaPromotionDayProps, getMediaPromotionDayListApi, getMediaPromotionDayTotalApi } from "@/services/gameData/medium"
+import TableData from "../../components/TableData"
+import QueryForm from "@/components/QueryForm"
+import { getPresets } from "@/components/QueryForm/const"
+import columns12 from "./tableConfig"
+
+/**
+ * 推广媒体每日数据
+ * @returns 
+ */
+const PromotionEvery: React.FC = () => {
+
+    /*****************************/
+    const [queryForm, setQueryForm] = useState<MediaPromotionDayProps>({
+        pageNum: 1, pageSize: 50,
+        sourceSystem: 'ZX_ONE',
+        beginDate: moment().format('YYYY-MM-DD'), //subtract(30, 'd').
+        endDate: moment().format('YYYY-MM-DD')
+    })
+    const [totalData, setTotalData] = useState<any[]>([])
+
+    const getMediaPromotionDayList = useAjax((params) => getMediaPromotionDayListApi(params))
+    const getMediaPromotionDayTotal = useAjax((params) => getMediaPromotionDayTotalApi(params))
+    /*****************************/
+
+
+    useEffect(() => {
+        getMediaPromotionDayList.run(queryForm)
+        getMediaPromotionDayTotal.run(queryForm).then((res: { id: number; pitcher: string, beginDay?: string }) => {
+            res.id = 1
+            res.pitcher = '总计'
+            res.beginDay = queryForm.beginDate
+            setTotalData([res])
+        })
+    }, [queryForm])
+
+    return <div>
+        <TableData
+            leftChild={<QueryForm
+                initialValues={{ consumeDay: [moment(), moment()], sourceSystem: 'ZX_ONE' }}
+                onChange={(data: any) => {
+                    console.log(data)
+                    const { costBeginDay, costEndDay, type, gameClassify, cpName, ...params } = data
+                    let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                    newQueryForm.pageNum = 1
+                    newQueryForm.accountType = type
+                    newQueryForm.gameType = gameClassify
+                    newQueryForm.gameCp = cpName
+                    if (costBeginDay && costEndDay) {
+                        newQueryForm.beginDate = costBeginDay
+                        newQueryForm.endDate = costEndDay
+                    } else {
+                        delete newQueryForm.beginDate
+                        delete newQueryForm.endDate
+                    }
+                    setQueryForm({ ...newQueryForm, ...params })
+                }}
+                isSource
+                isConsumeDay={{ ranges: getPresets() }}
+                isCpName
+                isSysUserId
+                isGameId
+                isBGGameClassify
+                isType
+            />}
+            isZj
+            totalData={totalData}
+            scroll={{ x: 1000, y: 600 }}
+            ajax={getMediaPromotionDayList}
+            fixed={{ left: 2, right: 1 }}
+            dataSource={getMediaPromotionDayList?.data?.records?.map((item: any, index: number) => ({ ...item, id: Number(queryForm.pageNum.toString() + index.toString()) }))}
+            total={getMediaPromotionDayList?.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 PromotionEvery

+ 430 - 0
src/pages/gameDataStatistics/medium/promotionEvery/tableConfig.tsx

@@ -0,0 +1,430 @@
+import WidthEllipsis from "@/components/widthEllipsis"
+import { Statistic } from "antd"
+import React from "react"
+import { version } from "../../components/TableData"
+import moment from "moment"
+import style from '../../extensionData/everyday/index.less'
+import { gameClassifyEnum } from "@/components/QueryForm/const"
+
+function columns12(): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
+
+    const roiC = Array(29).fill('').map((_item: string, index: number) => {
+        let data = {
+            title: `${index + 2}日ROI`,
+            dataIndex: `roi${index + 2}`,
+            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="%" />
+        }
+        index++;
+        return data
+    })
+
+    let defaultValue = [  // 默认展示字段
+        { label: '充值人数', key: 'rechargeUserCount', type: '付费趋势' },
+        { label: '充值金额', key: 'rechargeMoney', type: '付费趋势' },
+        { label: '增', key: 'increase', type: '付费趋势' },
+        { label: '回', key: 'back', type: '付费趋势' },
+        { label: '倍', key: 'multiples', type: '付费趋势' },
+    ]
+    const getFieldDta = () => {
+        let mySelectFieldData = localStorage.getItem(`myAdFieldConfig${version}_推广媒体每日数据`)
+        let newSelectFieldData: any = {}
+        if (mySelectFieldData) {
+            newSelectFieldData = JSON.parse(mySelectFieldData).date_field
+        } else {
+            newSelectFieldData = defaultValue
+        }
+        return newSelectFieldData
+    }
+    // 总付费趋势
+    let defaultStart = 19
+    const zC = Array(90).fill('').map((_item: string, index: number) => {
+        let field = `amountD${index + 1}Trend`
+        let data = {
+            title: `D${index + 1}`,
+            dataIndex: `D${index + 1}`,
+            label: "时间区间跨度",
+            width: 110,
+            render: (a: any, b: any) => {
+                let date1 = moment()
+                if (b?.pitcher === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.dt)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
+                let fieldData = getFieldDta()
+                if (fieldData?.length > 0 && index <= day) {
+                    let data: any = {}
+                    let keyS: string[] = fieldData?.map((item: any) => item.key)
+                    switch (fieldData[0].type) {
+                        case '付费趋势':
+                            if (b?.[field]) {
+                                data = b?.[field]
+                                return <div className={style.dbox}>
+                                    {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
+                                    {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
+                                    {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
+                                    {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
+                                    {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
+                                </div>
+                            }
+                            return '--'
+                    }
+                }
+                return '--'
+            },
+        }
+        if (index < 30) {
+            data['default'] = defaultStart + index
+        }
+        return data
+    })
+
+    // let mDefaultStart = 109, count = 0
+    const Mc = [4, 5, 6, 7, 8, 9, 10, 11, 12].map(index => {
+        let field = `amountM${index}Trend`
+        let data = {
+            title: `M${index}`,
+            dataIndex: `M${index}`,
+            label: "时间区间跨度",
+            width: 110,
+            render: (a: any, b: any) => {
+                let date1 = moment()
+                if (b?.pitcher === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.dt)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
+                let fieldData = getFieldDta()
+                if (fieldData?.length > 0 && index * 30 <= day) {
+                    let data: any = {}
+                    let keyS: string[] = fieldData?.map((item: any) => item.key)
+                    switch (fieldData[0].type) {
+                        case '付费趋势':
+                            if (b?.[field]) {
+                                data = b?.[field]
+                                return <div className={style.dbox}>
+                                    {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
+                                    {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
+                                    {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
+                                    {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
+                                    {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
+                                </div>
+                            }
+                            return '--'
+                    }
+                }
+                return '--'
+            },
+        }
+        // data['default'] = mDefaultStart + count
+        // count++;
+        return data
+    })
+
+
+    Mc.push({
+        title: "总",
+        default: 49,
+        dataIndex: "amountSumTrend",
+        label: "时间区间跨度",
+        align: "center",
+        width: 110,
+        render: (a: any, b: any) => {
+            let fieldData = getFieldDta()
+            if (fieldData?.length > 0) {
+                let data: any = {}
+                let keyS: string[] = fieldData?.map((item: any) => item.key)
+                switch (fieldData[0].type) {
+                    case '付费趋势':
+                        if (a) {
+                            data = a
+                            return <div className={style.dbox}>
+                                {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
+                                {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
+                                {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
+                                {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
+                                {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
+                            </div>
+                        }
+                        return '--'
+                }
+            }
+            return '--'
+        },
+    } as any)
+
+    return [
+        {
+            label: '基本信息',
+            data: [
+                {
+                    title: '投手', dataIndex: 'pitcher', label: '基本信息', align: 'center', width: 95, default: 1,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '推广游戏名称', dataIndex: 'gameName', label: '基本信息', align: 'center', width: 95, default: 2,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '推广游戏CP名称', dataIndex: 'gameCp', label: '基本信息', align: 'center', width: 95, default: 3,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '推广游戏应用类型', dataIndex: 'gameType', label: '基本信息', align: 'center', width: 95, default: 4,
+                    render: (a: string, b: any) => (<WidthEllipsis value={gameClassifyEnum[a]} />)
+                },
+                {
+                    title: '推广媒体', dataIndex: 'accountType', label: '基本信息', align: 'center', width: 95, default: 5,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '时间', dataIndex: 'dt', label: '基本信息', align: 'center', width: 110, default: 6, sorter: true,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '消耗', dataIndex: 'cost', label: '基本信息', align: 'center', width: 70, default: 7, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '推广账号数量', dataIndex: 'accountCount', label: '基本信息', align: 'center', width: 80, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '推广渠道数量', dataIndex: 'agentCount', label: '基本信息', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '推广计划数量', dataIndex: 'planCount', label: '基本信息', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                }
+            ]
+        },
+        {
+            label: '用户数据',
+            data: [
+                {
+                    title: '注册人数', dataIndex: 'registerNum', label: '用户数据', align: 'center', width: 70, sorter: true, default: 8,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '注册成本', dataIndex: 'registerCost', label: '用户数据', align: 'center', width: 70, sorter: true, default: 9,
+                    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: 'firstRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计创角人数', dataIndex: 'newUserTotalRoleNum', label: '用户数据', align: 'center', width: 100, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日创角成本', dataIndex: 'firstRoleCost', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计创角成本', dataIndex: 'newUserTotalRoleCost', label: '用户数据', align: 'center', width: 70, 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: 'firstRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                //     render: (a: string) => <Statistic value={a || 0} />
+                // },
+                // {
+                //     title: '新用户累计创角量', dataIndex: 'newUserTotalRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                //     render: (a: string) => <Statistic value={a || 0} />
+                // },
+                {
+                    title: '首日创角率', dataIndex: 'firstRoleRate', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新用户创角率', dataIndex: 'roleNumRate', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                }
+            ]
+        },
+        {
+            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: 10,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日新用户充值金额', dataIndex: 'firstNewUserAmount', label: '付费数据', align: 'center', width: 70, sorter: true, default: 11,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值次数', dataIndex: 'oldAmountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值人数', dataIndex: 'oldAmountNum', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值金额', dataIndex: 'oldAmount', 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: 'buyNewUserTotalAmountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计充值人数', dataIndex: 'buyNewUserTotalAmountNum', label: '付费数据', align: 'center', width: 70, sorter: true, default: 12,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计充值金额', dataIndex: 'buyNewUserTotalAmount', label: '付费数据', align: 'center', width: 70, sorter: true, default: 13,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日ROI', dataIndex: 'firstRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 14,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '毛利额', dataIndex: 'grossProfit', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a} precision={2} valueStyle={a < 0 ? { color: 'red' } : {}} />
+                },
+                {
+                    title: '至今回收率', dataIndex: 'todayRoi', 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="%" />
+                },
+                ...roiC,
+                {
+                    title: '60日ROI', dataIndex: 'roi60', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 0.9 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '90日ROI', dataIndex: 'roi90', 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: '180日ROI', dataIndex: 'roi180', 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: '1年ROI', dataIndex: 'roi1yaer', 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: '总ROI', dataIndex: 'todayRoi', label: '付费数据', align: 'center', width: 80, default: 15, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日付费率', dataIndex: 'firstRate', 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: 'todayRate', 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: 'newUserAmountRatio', 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: 'firstAvg', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今客单价', dataIndex: 'buyAvg', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面客单价', dataIndex: 'paperAvg', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日充值成本', dataIndex: 'firstAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 16,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 17,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今复充率', dataIndex: 'todayAgainRate', 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: '新增注册ARPPU', dataIndex: 'newRegArpu', label: '付费数据', align: 'center', width: 70, sorter: true, default: 18,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日付费ARPPU', dataIndex: 'firstArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面ARPPU', dataIndex: 'paperArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                }
+            ]
+        },
+        {
+            fieldSHow: {
+                label: '日期区间字段展示',
+                saveField: 'date_field',
+                defaultValue,
+                data: [
+                    {
+                        label: '付费趋势',
+                        data: defaultValue
+                    },
+                ]
+            },
+            label: '时间区间跨度',
+            data: [
+                ...zC,
+                ...Mc
+            ]
+        }
+    ]
+}
+
+export default columns12

+ 113 - 0
src/pages/gameDataStatistics/medium/promotionTotal/index.tsx

@@ -0,0 +1,113 @@
+import React, { useEffect, useState } from "react"
+import { useAjax } from "@/Hook/useAjax"
+import { MediaPromotionTotalProps, getMediaPromotionTotalListApi, getMediaPromotionTotalSumApi } from "@/services/gameData/medium"
+import moment from "moment"
+import TableData from "../../components/TableData"
+import QueryForm from "@/components/QueryForm"
+import { getPresets } from "@/components/QueryForm/const"
+import columns12 from "./tableConfig"
+
+/**
+ * 推广媒体总数据
+ * @returns 
+ */
+const PromotionTotal: React.FC = () => {
+
+    /*****************************/
+    const [queryForm, setQueryForm] = useState<MediaPromotionTotalProps>({
+        pageNum: 1, pageSize: 100,
+        sourceSystem: 'ZX_ONE',
+        amountBeginDate: moment().format('YYYY-MM-DD'), //.subtract(30, 'd')
+        amountEndDate: moment().format('YYYY-MM-DD'),
+        beginDate: moment().format('YYYY-MM-DD'), //subtract(30, 'd').
+        endDate: moment().format('YYYY-MM-DD')
+    })
+    const [totalData, setTotalData] = useState<any[]>([])
+
+    const getMediaPromotionTotalList = useAjax((params) => getMediaPromotionTotalListApi(params))
+    const getMediaPromotionTotalSum = useAjax((params) => getMediaPromotionTotalSumApi(params))
+    /*****************************/
+
+    useEffect(() => {
+        getMediaPromotionTotalList.run(queryForm)
+        getMediaPromotionTotalSum.run(queryForm).then((res: { id: number; pitcher: string }) => {
+            res.id = 1
+            res.pitcher = '总计'
+            setTotalData([res])
+        })
+    }, [queryForm])
+
+    return <div>
+        <TableData
+            leftChild={<QueryForm
+                initialValues={{ rechargeDay: [moment(), moment()], consumeDay: [moment(), moment()], sourceSystem: 'ZX_ONE' }}
+                onChange={(data: any) => {
+                    console.log(data)
+                    const { costBeginDay, costEndDay, rechargeDay, type, gameClassify, cpName, ...params } = data
+                    let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                    newQueryForm.pageNum = 1
+                    newQueryForm.accountType = type
+                    newQueryForm.gameType = gameClassify
+                    newQueryForm.gameCp = cpName
+                    if (costBeginDay && costEndDay) {
+                        newQueryForm.beginDate = costBeginDay
+                        newQueryForm.endDate = costEndDay
+                    } else {
+                        delete newQueryForm.beginDate
+                        delete newQueryForm.endDate
+                    }
+                
+                    if (rechargeDay && rechargeDay?.length === 2) {
+                        newQueryForm['amountBeginDate'] = moment(rechargeDay[0]).format('YYYY-MM-DD')
+                        newQueryForm['amountEndDate'] = moment(rechargeDay[1]).format('YYYY-MM-DD')
+                    } else {
+                        delete newQueryForm['amountBeginDate']
+                        delete newQueryForm['amountEndDate']
+                    }
+                    setQueryForm({ ...newQueryForm, ...params })
+                }}
+                isSource
+                isConsumeDay={{ ranges: getPresets() }}
+                rechargeDay={{ ranges: getPresets() }}
+                isCpName
+                isSysUserId
+                isGameId
+                isBGGameClassify
+                isType
+            />}
+            isZj
+            totalData={totalData}
+            scroll={{ x: 1000, y: 600 }}
+            ajax={getMediaPromotionTotalList}
+            fixed={{ left: 2, right: 1 }}
+            dataSource={getMediaPromotionTotalList?.data?.records?.map((item: any, index: number) => ({ ...item, id: Number(queryForm.pageNum.toString() + index.toString()) }))}
+            total={getMediaPromotionTotalList?.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 PromotionTotal

+ 314 - 0
src/pages/gameDataStatistics/medium/promotionTotal/tableConfig.tsx

@@ -0,0 +1,314 @@
+import { gameClassifyEnum } from "@/components/QueryForm/const"
+import WidthEllipsis from "@/components/widthEllipsis"
+import { Statistic } from "antd"
+import React from "react"
+
+function columns12() {
+
+    const roiC = Array(29).fill('').map((_item: string, index: number) => {
+        let data = {
+            title: `${index + 2}日ROI`,
+            dataIndex: `roi${index + 2}`,
+            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="%" />
+        }
+        index++;
+        return data
+    })
+
+    let newArr: { label: string, data: any[] }[] = [
+        {
+            label: '基本信息',
+            data: [
+                {
+                    title: '投手', dataIndex: 'pitcher', label: '基本信息', align: 'center', width: 95, default: 1,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '推广游戏名称', dataIndex: 'gameName', label: '基本信息', align: 'center', width: 95, default: 2,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '推广游戏CP名称', dataIndex: 'gameCp', label: '基本信息', align: 'center', width: 95, default: 3,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '推广游戏应用类型', dataIndex: 'gameType', label: '基本信息', align: 'center', width: 95, default: 4,
+                    render: (a: string, b: any) => (<WidthEllipsis value={gameClassifyEnum[a]} />)
+                },
+                {
+                    title: '推广媒体', dataIndex: 'accountType', label: '基本信息', align: 'center', width: 95, default: 5,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '消耗', dataIndex: 'cost', label: '基本信息', align: 'center', width: 70, default: 6, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '推广账号数量', dataIndex: 'accountCount', label: '基本信息', align: 'center', width: 80, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '推广渠道数量', dataIndex: 'agentCount', label: '基本信息', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                // {
+                //     title: '推广游戏数量', dataIndex: 'cost', label: '基本信息', align: 'center', width: 90, sorter: true,
+                // },
+                {
+                    title: '推广计划数量', dataIndex: 'planCount', label: '基本信息', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                }
+            ]
+        },
+        {
+            label: '用户数据',
+            data: [
+                {
+                    title: '注册人数', dataIndex: 'registerNum', label: '用户数据', align: 'center', width: 70, sorter: true, default: 7,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '注册成本', dataIndex: 'registerCost', label: '用户数据', align: 'center', width: 70, sorter: true, default: 8,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                // {
+                //     title: '活跃用户人数', dataIndex: 'clickRate', label: '用户数据', align: 'center', width: 80, sorter: true,
+                //     render: (a: number) => <Statistic value={a || 0} valueStyle={a >= 100 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                // },
+                {
+                    title: '创角人数', dataIndex: 'roleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日创角人数', dataIndex: 'firstRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计创角人数', dataIndex: 'newUserTotalRoleNum', label: '用户数据', align: 'center', width: 100, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日创角成本', dataIndex: 'firstRoleCost', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计创角成本', dataIndex: 'newUserTotalRoleCost', label: '用户数据', align: 'center', width: 70, 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: 'firstRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                //     render: (a: string) => <Statistic value={a || 0} />
+                // },
+                // {
+                //     title: '新用户累计创角量', dataIndex: 'newUserTotalRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                //     render: (a: string) => <Statistic value={a || 0} />
+                // },
+                // {
+                //     title: '新用户累计有效创角量', dataIndex: 'totalAmount', label: '用户数据', align: 'center', width: 70, sorter: true,
+                // },
+                {
+                    title: '首日创角率', dataIndex: 'firstRoleRate', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新用户创角率', dataIndex: 'roleNumRate', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                }
+            ]
+        },
+        {
+            label: '付费数据',
+            data: [
+                {
+                    title: '新用户充值次数', dataIndex: 'newUserAmountCount', label: '付费数据', align: 'center', width: 90,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户充值人数', dataIndex: 'newUserAmountNum', label: '付费数据', align: 'center', width: 100, sorter: true, default: 9,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户充值金额', dataIndex: 'newUserAmount', label: '付费数据', align: 'center', width: 70, default: 10,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    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: 11,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日新用户充值金额', dataIndex: 'firstNewUserAmount', label: '付费数据', align: 'center', width: 70, sorter: true, default: 12,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值次数', dataIndex: 'oldAmountCount', label: '付费数据', align: 'center', width: 70,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值人数', dataIndex: 'oldAmountNum', label: '付费数据', align: 'center', width: 70,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '老用户充值金额', dataIndex: 'oldAmount', label: '付费数据', align: 'center', width: 70,
+                    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: 'buyNewUserTotalAmountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计充值人数', dataIndex: 'buyNewUserTotalAmountNum', label: '付费数据', align: 'center', width: 70, sorter: true, default: 13,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计充值金额', dataIndex: 'buyNewUserTotalAmount', label: '付费数据', align: 'center', width: 70, sorter: true, default: 14,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日ROI', dataIndex: 'firstRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 16,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新用户回收率', dataIndex: 'newUserRoi', label: '付费数据', align: 'center', width: 70, default: 15,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '至今回收率', dataIndex: 'todayRoi', 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: 'grossProfit', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a} precision={2} valueStyle={a < 0 ? { color: 'red' } : {}} />
+                },
+                ...roiC,
+                {
+                    title: '60日ROI', dataIndex: 'roi60', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 0.9 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '90日ROI', dataIndex: 'roi90', 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: '180日ROI', dataIndex: 'roi180', 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: '1年ROI', dataIndex: 'roi1yaer', 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: '总ROI', dataIndex: 'todayRoi', label: '付费数据', align: 'center', width: 80, default: 17, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日付费率', dataIndex: 'firstRate', 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: 'newUserAmountRate', 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: 'todayRate', 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: 'newUserAmountRatio', 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: 'newUserRate1', 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: 'firstAvg', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户客单价', dataIndex: 'newUserAvg', label: '付费数据', align: 'center', width: 70,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面客单价', dataIndex: 'paperAvg', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日充值成本', dataIndex: 'firstAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 19,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户充值成本', dataIndex: 'newUserAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 18,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 20,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户复充率', dataIndex: 'newUserAgainRate', label: '付费数据', align: 'center', width: 70, sorter: true, default: 21,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '至今复充率', dataIndex: 'todayAgainRate', 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: 'newUserRate4', 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: '新增注册ARPPU', dataIndex: 'newRegArpu', label: '付费数据', align: 'center', width: 70, sorter: true, default: 22,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                // {
+                //     title: '活跃ARPPU', dataIndex: 'regUserArpu1', label: '付费数据', align: 'center', width: 70, sorter: true,
+                //     render: (a: string) => <Statistic value={a || 0} />
+                // },
+                {
+                    title: '首日付费ARPPU', dataIndex: 'firstArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户付费ARPPU', dataIndex: 'newUserArpu', label: '付费数据', align: 'center', width: 70,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '账面ARPPU', dataIndex: 'paperArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                }
+            ]
+        }
+    ]
+    return newArr
+}
+
+export default columns12

+ 135 - 0
src/services/gameData/medium.ts

@@ -0,0 +1,135 @@
+import { request } from 'umi';
+import { api } from '../api';
+import { Paging, SortProps } from './rankingList';
+let wapi = api + '/gameData'
+
+export interface MediaPromotionTotalProps extends Paging, SortProps {
+    amountBeginDate?: string
+    amountEndDate?: string
+    gameCp?: string,
+    gameId?: number,
+    gameType?: number,
+    beginDate?: string,    // 消耗开始时间
+    endDate?: string,
+    pitcherId?: number,   // 投手ID
+    accountType?: string
+}
+/**
+ * 推广媒体总数居
+ * @param data 
+ * @returns 
+ */
+export async function getMediaPromotionTotalListApi(data: MediaPromotionTotalProps) {
+    return request(wapi + `/media/pitcherGame/total`, {
+        method: 'POST',
+        data
+    });
+}
+
+/**
+ * 推广媒体总数居总计
+ * @param data 
+ * @returns 
+ */
+export async function getMediaPromotionTotalSumApi(data: MediaPromotionTotalProps) {
+    return request(wapi + `/media/pitcherGame/dayTotal`, {
+        method: 'POST',
+        data
+    });
+}
+
+export interface MediaPromotionDayProps extends Paging, SortProps {
+    beginDate?: string,    // 消耗开始时间
+    endDate?: string,
+    pitcherId?: number,   // 投手ID
+    accountType?: string,
+    gameCp?: string,
+    gameId?: number
+    gameType?: number
+}
+/**
+ * 推广每日数据数居
+ * @param data 
+ * @returns 
+ */
+export async function getMediaPromotionDayListApi(data: MediaPromotionDayProps) {
+    return request(wapi + `/media/pitcherGame/day`, {
+        method: 'POST',
+        data
+    });
+}
+/**
+ * 总计
+ * @param data 
+ * @returns 
+ */
+export async function getMediaPromotionDayTotalApi(data: MediaPromotionDayProps) {
+    return request(wapi + `/media/pitcherGame/dayTotal`, {
+        method: 'POST',
+        data
+    });
+}
+
+
+
+export interface MediaPitcherDayProps extends Paging, SortProps {
+    beginDate?: string,    // 消耗开始时间
+    endDate?: string,
+    pitcherId?: number,   // 投手ID
+    accountType?: string
+}
+/**
+ * 投手每日数据数居
+ * @param data 
+ * @returns 
+ */
+export async function getMediaPitcherDayListApi(data: MediaPitcherDayProps) {
+    return request(wapi + `/media/pitcher/day`, {
+        method: 'POST',
+        data
+    });
+}
+/**
+ * 总计
+ * @param data 
+ * @returns 
+ */
+export async function getMediaPitcherTotalApi(data: MediaPitcherDayProps) {
+    return request(wapi + `/media/pitcher/dayTotal`, {
+        method: 'POST',
+        data
+    });
+}
+
+
+
+export interface MediaPitcherTotalProps extends Paging, SortProps {
+    amountBeginDate?: string,    // 充值开始时间
+    amountEndDate?: string,
+    beginDate?: string,    // 消耗开始时间
+    endDate?: string,
+    pitcherId?: number,   // 投手ID
+    accountType?: string
+}
+/**
+ * 投手总数据数居
+ * @param data 
+ * @returns 
+ */
+export async function getMediaPitcherTotalListApi(data: MediaPitcherTotalProps) {
+    return request(wapi + `/media/pitcher/total`, {
+        method: 'POST',
+        data
+    });
+}
+/**
+ * 总计
+ * @param data 
+ * @returns 
+ */
+export async function getMediaPitcherTotalSumApi(data: MediaPitcherTotalProps) {
+    return request(wapi + `/media/pitcher/totalSum`, {
+        method: 'POST',
+        data
+    });
+}