wjx 1 年之前
父節點
當前提交
5ec6d91fe3

+ 27 - 5
src/pages/gameDataStatistics/adlist/monitor/dayAd.tsx

@@ -1,9 +1,12 @@
 import { useAjax } from "@/Hook/useAjax"
 import { PromotionDataDay, getPromotionDataDayListApi } from "@/services/gameData/adlist"
-import { Drawer } from "antd"
+import { Button, Drawer } from "antd"
 import React, { useEffect, useState } from "react"
 import TableData from "../../components/TableData"
 import columns12 from './tableConfigDay'
+import QueryForm from "@/components/QueryForm"
+import { getPresets } from "@/components/QueryForm/const"
+import { CloseOutlined } from "@ant-design/icons"
 
 interface Props {
     queryForm: PromotionDataDay
@@ -21,6 +24,7 @@ const DayAd: React.FC<Props> = ({ adName, queryForm, promotionId, onClose, visib
 
     /***********************************/
     const [data, setData] = useState<{ pageSize: number, pageNum: number, sortFiled?: string, sortType?: string }>({ pageNum: 1, pageSize: 100 })
+    const [date, setDate] = useState<[string, string]>()
     const getPromotionDataDayList = useAjax((params) => getPromotionDataDayListApi(params))
     /***********************************/
 
@@ -33,15 +37,33 @@ const DayAd: React.FC<Props> = ({ adName, queryForm, promotionId, onClose, visib
         if (promotionId) {
             params.promotionId = promotionId
         }
-        getPromotionDataDayList.run({...params, ...data})
-    }, [promotionId, queryForm, data])
+        if (date && date?.length > 0) {
+            params.costBeginDate = date[0]
+            params.costEndDate = date[1]
+        } else {
+            delete params?.costBeginDate
+            delete params?.costEndDate
+        }
+        getPromotionDataDayList.run({ ...params, ...data })
+    }, [promotionId, queryForm, data, date])
 
-    return <Drawer title={`${adName} 广告每日数据`} placement="right" width={'90%'} onClose={onClose} visible={visible}>
+    return <Drawer title={<div style={{ display: 'flex', justifyContent: 'space-between' }}><span>{`${adName} 广告每日数据`}</span> <Button type="text" icon={<CloseOutlined />} onClick={() => onClose?.()}></Button> </div>} closable={false} placement="right" width={'90%'} onClose={onClose} visible={visible}>
         <TableData
+            leftChild={<QueryForm
+                onChange={(data: any) => {
+                    const { costBeginDay, costEndDay } = data
+                    if (costBeginDay && costEndDay) {
+                        setDate([costBeginDay, costEndDay])
+                    } else {
+                        setDate(undefined)
+                    }
+                }}
+                isConsumeDay={{ ranges: getPresets() }}
+            />}
             scroll={{ x: 1000, y: 600 }}
             ajax={getPromotionDataDayList}
             fixed={{ left: 3, right: 0 }}
-            dataSource={getPromotionDataDayList?.data?.records?.map((item: any, index: number) => ({ ...item, id:  Number(data.pageNum.toString() + index.toString()) }))}
+            dataSource={getPromotionDataDayList?.data?.records?.map((item: any, index: number) => ({ ...item, id: Number(data.pageNum.toString() + index.toString()) }))}
             total={getPromotionDataDayList?.data?.total}
             page={queryForm.pageNum}
             pageSize={queryForm.pageSize}

+ 27 - 5
src/pages/gameDataStatistics/adlist/tencentMonitor/dayAd.tsx

@@ -1,9 +1,12 @@
 import { useAjax } from "@/Hook/useAjax"
 import { PromotionDataDay, getPromotionDataTencentDayListApi } from "@/services/gameData/adlist"
-import { Drawer } from "antd"
+import { Button, Drawer, Space } from "antd"
 import React, { useEffect, useState } from "react"
 import TableData from "../../components/TableData"
 import columns12 from './tableConfigDay'
+import { getPresets } from "@/components/QueryForm/const"
+import QueryForm from "@/components/QueryForm"
+import { CloseOutlined } from "@ant-design/icons"
 
 interface Props {
     queryForm: PromotionDataDay
@@ -21,6 +24,7 @@ const DayAd: React.FC<Props> = ({ adName, queryForm, promotionId, onClose, visib
 
     /***********************************/
     const [data, setData] = useState<{ pageSize: number, pageNum: number, sortFiled?: string, sortType?: string }>({ pageNum: 1, pageSize: 100 })
+    const [date, setDate] = useState<[string, string]>()
     const getPromotionDataTencentDayList = useAjax((params) => getPromotionDataTencentDayListApi(params))
     /***********************************/
 
@@ -33,15 +37,33 @@ const DayAd: React.FC<Props> = ({ adName, queryForm, promotionId, onClose, visib
         if (promotionId) {
             params.promotionId = promotionId
         }
-        getPromotionDataTencentDayList.run({...params, ...data})
-    }, [promotionId, queryForm, data])
+        if (date && date?.length > 0) {
+            params.costBeginDate = date[0]
+            params.costEndDate = date[1]
+        } else {
+            delete params?.costBeginDate
+            delete params?.costEndDate
+        }
+        getPromotionDataTencentDayList.run({ ...params, ...data })
+    }, [promotionId, queryForm, data, date])
 
-    return <Drawer title={`${adName} 腾讯广告每日数据`} placement="right" width={'90%'} onClose={onClose} visible={visible}>
+    return <Drawer title={<div style={{ display: 'flex', justifyContent: 'space-between' }}><span>{`${adName} 腾讯广告每日数据`}</span> <Button type="text" icon={<CloseOutlined />} onClick={() => onClose?.()}></Button> </div>} closable={false} placement="right" width={'90%'} onClose={onClose} visible={visible}>
         <TableData
+            leftChild={<QueryForm
+                onChange={(data: any) => {
+                    const { costBeginDay, costEndDay } = data
+                    if (costBeginDay && costEndDay) {
+                        setDate([costBeginDay, costEndDay])
+                    } else {
+                        setDate(undefined)
+                    }
+                }}
+                isConsumeDay={{ ranges: getPresets() }}
+            />}
             scroll={{ x: 1000, y: 600 }}
             ajax={getPromotionDataTencentDayList}
             fixed={{ left: 3, right: 0 }}
-            dataSource={getPromotionDataTencentDayList?.data?.records?.map((item: any, index: number) => ({ ...item, id:  Number(data.pageNum.toString() + index.toString()) }))}
+            dataSource={getPromotionDataTencentDayList?.data?.records?.map((item: any, index: number) => ({ ...item, id: Number(data.pageNum.toString() + index.toString()) }))}
             total={getPromotionDataTencentDayList?.data?.total}
             page={queryForm.pageNum}
             pageSize={queryForm.pageSize}

+ 5 - 5
src/pages/gameDataStatistics/pitcher/everyDay/tableConfig.tsx

@@ -353,7 +353,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: number) => <Statistic value={a} precision={2} valueStyle={a < 0 ? { color: 'red' } : {}} />
                 },
                 {
-                    title: '当天回收率', dataIndex: 'todayRoi', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    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,
@@ -382,7 +382,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     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,
+                    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="%" />
                 },
                 {
@@ -406,11 +406,11 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '当天充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 13,
+                    title: '至今充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 13,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '当天复充率', dataIndex: 'todayAgainRate', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    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="%" />
                 },
                 {
@@ -422,7 +422,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '当天付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    title: '至今付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {

+ 5 - 5
src/pages/gameDataStatistics/pitcher/everyDayGame/tableConfig.tsx

@@ -366,7 +366,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: number) => <Statistic value={a} precision={2} valueStyle={a < 0 ? { color: 'red' } : {}} />
                 },
                 {
-                    title: '当天回收率', dataIndex: 'todayRoi', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    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,
@@ -395,7 +395,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     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,
+                    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="%" />
                 },
                 {
@@ -419,11 +419,11 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '当天充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 16,
+                    title: '至今充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 16,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '当天复充率', dataIndex: 'todayAgainRate', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    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="%" />
                 },
                 {
@@ -435,7 +435,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '当天付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    title: '至今付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {

+ 5 - 5
src/pages/gameDataStatistics/pitcher/total/tableConfig.tsx

@@ -179,7 +179,7 @@ function columns12() {
                     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,
+                    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="%" />
                 },
                 {
@@ -216,7 +216,7 @@ function columns12() {
                     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,
+                    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="%" />
                 },
                 {
@@ -248,7 +248,7 @@ function columns12() {
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '当天充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 16,
+                    title: '至今充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 16,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
@@ -256,7 +256,7 @@ function columns12() {
                     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,
+                    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="%" />
                 },
                 // {
@@ -281,7 +281,7 @@ function columns12() {
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '当天付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    title: '至今付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {

+ 5 - 5
src/pages/gameDataStatistics/pitcher/totalGame/tableConfig.tsx

@@ -192,7 +192,7 @@ function columns12() {
                     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,
+                    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="%" />
                 },
                 {
@@ -229,7 +229,7 @@ function columns12() {
                     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,
+                    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="%" />
                 },
                 {
@@ -261,7 +261,7 @@ function columns12() {
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '当天充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 19,
+                    title: '至今充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 19,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
@@ -269,7 +269,7 @@ function columns12() {
                     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,
+                    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="%" />
                 },
                 // {
@@ -294,7 +294,7 @@ function columns12() {
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '当天付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    title: '至今付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 {