wjx 5 maanden geleden
bovenliggende
commit
0cba1c4a17

+ 10 - 0
config/routerConfig.ts

@@ -232,6 +232,11 @@ const iaaNovelData = [
                 name: '投手每日数据',
                 component: './iaaData/novel/tencent/pitcherEveryDay',
             },
+            {
+                path: '/iaaData/novel/tencent/pitcherEveryDayGroup',
+                name: '投手每日汇总',
+                component: './iaaData/novel/tencent/pitcherEveryDayGroup',
+            },
             {
                 path: '/iaaData/novel/tencent/appEveryDayData',
                 name: '应用每日数据',
@@ -267,6 +272,11 @@ const iaaPlayletData = [
                 name: '投手每日数据',
                 component: './iaaData/playlet/tencent/pitcherEveryDay',
             },
+            {
+                path: '/iaaData/playlet/tencent/pitcherEveryDayGroup',
+                name: '投手每日汇总',
+                component: './iaaData/playlet/tencent/pitcherEveryDayGroup',
+            },
             {
                 path: '/iaaData/playlet/tencent/appEveryDayData',
                 name: '应用每日数据',

+ 99 - 0
src/pages/iaaData/novel/tencent/pitcherEveryDayGroup/index.tsx

@@ -0,0 +1,99 @@
+import { useAjax } from "@/Hook/useAjax";
+import { getNovelPutUserGroupListApi, GetNovelPutUserGroupListProps, getNovelPutUserGroupTotalApi } from "@/services/iaaData";
+import React, { useEffect, useState } from "react"
+import { useModel } from "umi";
+import moment from "moment";
+import TablePro from "@/components/TablePro";
+import QueryFormNovel from "@/components/QueryForm/queryFormNovel";
+import columns12 from "./tableConfig";
+
+/**
+ * 投手每日汇总
+ * @returns 
+ */
+const PitcherEveryDayGroupNovel: React.FC<{ configName?: string }> = ({ configName }) => {
+
+    /****************************************/
+    const { initialState } = useModel('@@initialState');
+    const [queryForm, setQueryForm] = useState<GetNovelPutUserGroupListProps>({
+        pageNum: 1,
+        pageSize: 30,
+        costDayBegin: moment().format('YYYY-MM-DD'),
+        costDayEnd: moment().format('YYYY-MM-DD'),
+    })
+    const [totalData, setTotalData] = useState<any[]>([])
+
+    const getNovelPutUserGroupList = useAjax((params) => getNovelPutUserGroupListApi(params))
+    const getNovelPutUserGroupTotal = useAjax((params) => getNovelPutUserGroupTotalApi(params))
+    /****************************************/
+
+    useEffect(() => {
+        if (initialState?.iaaApp) {
+            const [appId, productType] = initialState.iaaApp.split('||')
+            getNovelPutUserGroupList.run({ ...queryForm, appId, productType })
+            getNovelPutUserGroupTotal.run({ ...queryForm, appId, productType }).then((res: { data: { id: number; appName: string } }) => {
+                if (res?.data) {
+                    let data = res?.data
+                    data.id = 1
+                    data.appName = '总计'
+                    setTotalData([data])
+                } else {
+                    setTotalData([{ id: 1, appName: '总计' }])
+                }
+            })
+        }
+
+    }, [queryForm, initialState?.iaaApp])
+
+    return <div>
+        <TablePro
+            leftChild={<QueryFormNovel
+                initialValues={{ day1: [moment(), moment()] }}
+                day1={{ placeholder: ['消耗日期开始', '消耗日期结束'] }}
+                isPutUserIdList
+                onChange={(data: any) => {
+                    console.log(data)
+                    const { day1, ...params } = data
+                    let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                    if (day1 && day1?.length === 2) {
+                        newQueryForm['costDayBegin'] = moment(day1[0]).format('YYYY-MM-DD')
+                        newQueryForm['costDayEnd'] = moment(day1[1]).format('YYYY-MM-DD')
+                    } else {
+                        delete newQueryForm['costDayBegin']
+                        delete newQueryForm['costDayEnd']
+                    }
+                    setQueryForm({ ...newQueryForm, ...params })
+                }}
+            />}
+            isZj
+            totalData={totalData}
+            config={columns12()}
+            configName={configName || '小说腾讯投手每日汇总'}
+            fixed={{ left: 4, right: 0 }}
+            scroll={{ x: 1000, y: 620 }}
+            title='投手每日汇总'
+            loading={getNovelPutUserGroupList.loading}
+            ajax={getNovelPutUserGroupList}
+            page={getNovelPutUserGroupList?.data?.data?.current || 1}
+            pageSize={getNovelPutUserGroupList?.data?.data?.size || 20}
+            total={getNovelPutUserGroupList?.data?.data?.total || 0}
+            dataSource={getNovelPutUserGroupList?.data?.data?.records?.map((item: any, index: number) => ({ ...item, id: Number(queryForm.pageNum.toString() + (index + '')) }))}
+            onChange={(pagination: any, _: any, sortData: any) => {
+                let { current, pageSize } = pagination
+                let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                if (sortData && sortData?.order) {
+                    newQueryForm['sortAsc'] = sortData?.order === 'ascend' ? true : false
+                    newQueryForm['sortFiled'] = sortData?.field
+                } else {
+                    delete newQueryForm['sortAsc']
+                    delete newQueryForm['sortFiled']
+                }
+                newQueryForm.pageNum = current || newQueryForm.pageNum
+                newQueryForm.pageSize = pageSize || newQueryForm.pageSize
+                setQueryForm({ ...newQueryForm })
+            }}
+        />
+    </div>
+}
+
+export default PitcherEveryDayGroupNovel

+ 127 - 0
src/pages/iaaData/novel/tencent/pitcherEveryDayGroup/tableConfig.tsx

@@ -0,0 +1,127 @@
+import WidthEllipsis from "@/components/widthEllipsis"
+import { Progress, Statistic } from "antd"
+import React from "react"
+
+function columns12(): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
+
+    return [
+        {
+            label: '基础信息',
+            data: [
+                {
+                    title: '应用', dataIndex: 'appName', label: '基础信息', align: 'center', width: 120, default: 1,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '应用ID', dataIndex: 'appId', label: '基础信息', align: 'center', width: 80,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '小程序名称', dataIndex: 'mpName', label: '基础信息', align: 'center', width: 85, default: 2,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '小程序ID', dataIndex: 'mpId', label: '基础信息', align: 'center', width: 80,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '投手名称', dataIndex: 'pitcherName', label: '基础信息', align: 'center', width: 80, default: 3,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '每日消耗', dataIndex: 'todayCost', label: '基础信息', align: 'right', width: 85, default: 4, sorter: true,
+                    className: 'padding_0',
+                    render: (a: number) => <div style={{ height: 25.5, position: 'relative' }}>
+                        <Progress
+                            strokeColor={{
+                                from: '#ff5900',
+                                to: '#ffd380',
+                            }}
+                            status="active"
+                            showInfo={false}
+                            percent={a ? a / 20000 * 100 : 0}
+                        />
+                        <span style={{ position: 'absolute', left: '50%', top: '50%', width: '100%', padding: '0 5px', transform: 'translate(-50%, -50%)' }}><Statistic value={a || 0} precision={2} valueStyle={a >= 20000 ? { color: '#000', fontWeight: 'bold' } : { fontWeight: 'bold' }} /></span>
+                    </div>
+                },
+                {
+                    title: '推广广告账号数量', dataIndex: 'acountCount', label: '基础信息', align: 'center', width: 80, default: 5, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '推广广告数量', dataIndex: 'adgroupCount', label: '基础信息', align: 'center', width: 80, default: 6, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} />
+                }
+            ]
+        },
+        {
+            label: '广告曝光指标(媒体)',
+            data: [
+                {
+                    title: '点击均价', dataIndex: 'cpc', label: '广告曝光指标(媒体)', align: 'center', width: 65, default: 7, sorter: true,
+                    render: (a: string) => <Statistic value={a || 0} precision={2} />
+                }
+            ]
+        },
+        {
+            label: '广告转化指标(媒体)',
+            data: [
+                {
+                    title: '注册人数', dataIndex: 'regDedupPv', label: '广告转化指标(媒体)', width: 65, align: 'center', sorter: true, default: 8,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '注册次数', dataIndex: 'regPv', label: '广告转化指标(媒体)', align: 'center', width: 80, sorter: true, default: 9,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '注册成本(人数)', dataIndex: 'regDedupCost', label: '广告转化指标(媒体)', align: 'right', width: 70, sorter: true, default: 10,
+                    render: (a: string) => <Statistic value={a || 0} precision={2} />
+                },
+                {
+                    title: '注册成本(次数)', dataIndex: 'regCost', label: '广告转化指标(媒体)', align: 'right', width: 70, sorter: true, default: 11,
+                    render: (a: string) => <Statistic value={a || 0} precision={2} />
+                },
+                {
+                    title: '注册率', dataIndex: 'regRate', label: '广告转化指标(媒体)', align: 'center', width: 70, default: 12, 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: '激活首日广告变现ROI', dataIndex: 'incomeRoi1', label: '广告变现指标(媒体)', align: 'center', width: 85, sorter: true, default: 13,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '激活首24小时广告变现ROI', dataIndex: 'incomeRoi24h', label: '广告变现指标(媒体)', align: 'center', width: 90, sorter: true, default: 14,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '激活3日广告变现ROI', dataIndex: 'incomeRoi3', label: '广告变现指标(媒体)', align: 'center', width: 75, sorter: true, default: 15,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '广告变现人数', dataIndex: 'appAdPayingUsers', label: '广告变现指标(媒体)', align: 'right', width: 70, sorter: true, default: 16,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '广告变现成本', dataIndex: 'appAdPayingCost', label: '广告变现指标(媒体)', align: 'right', width: 70, sorter: true, default: 17,
+                    render: (a: string) => <Statistic value={a || 0} precision={2} />
+                },
+                {
+                    title: '广告变现金额', dataIndex: 'adMonetizationAmount', label: '广告变现指标(媒体)', align: 'right', width: 90, sorter: true, default: 18,
+                    render: (a: string) => <Statistic value={a || 0} precision={2} />
+                },
+                {
+                    title: '广告变现ARPPU', dataIndex: 'adMonetizationArppu', label: '广告变现指标(媒体)', width: 70, align: 'center', sorter: true, default: 19,
+                    render: (a: string) => <Statistic value={a || 0} precision={2} />
+                }
+            ]
+        }
+    ]
+}
+
+export default columns12

+ 15 - 0
src/pages/iaaData/playlet/tencent/pitcherEveryDayGroup/index.tsx

@@ -0,0 +1,15 @@
+import PitcherEveryDayGroupNovel from "@/pages/iaaData/novel/tencent/pitcherEveryDayGroup"
+import React from "react"
+
+
+/**
+ * 投手每日汇总
+ * @returns 
+ */
+const PitcherEveryDayGroup: React.FC = () => {
+
+
+    return <PitcherEveryDayGroupNovel configName="短剧腾讯投手每日汇总" />
+}
+
+export default PitcherEveryDayGroup

+ 31 - 0
src/services/iaaData/index.ts

@@ -554,6 +554,37 @@ export async function getNovelPutUserTotalApi(data: GetNovelPutUserListProps) {
 }
 
 
+export interface GetNovelPutUserGroupListProps extends Paging, SortProps{
+    putUserIdList?: number[]
+    costDayBegin?: string
+    costDayEnd?: string
+}
+
+/**
+ * 投手每日汇总
+ * @param data 
+ * @returns 
+ */
+export async function getNovelPutUserGroupListApi(data: GetNovelPutUserGroupListProps) {
+    return request(wapi + `/monitor/novel/putUser/group/listOfPage`, {
+        method: 'POST',
+        data
+    });
+}
+
+/**
+ * 投手每日汇总 总计
+ * @param data 
+ * @returns 
+ */
+export async function getNovelPutUserGroupTotalApi(data: GetNovelPutUserGroupListProps) {
+    return request(wapi + `/monitor/novel/putUser/group/total`, {
+        method: 'POST',
+        data
+    });
+}
+
+
 export interface GetNovelAppListProps extends Paging, SortProps {
     costDayBegin?: string
     costDayEnd?: string