wjx hace 8 meses
padre
commit
f79e7ae2b4

+ 3 - 4
src/pages/gameDataStatistics/gameServer/serverData/tableConfig.tsx

@@ -11,12 +11,11 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
     let defaultStart = 13
     const day = Array(90).fill('').map((_item: string, index: number) => {
         let field = `da${index + 1}Trend`
-        let data = {
+        let data: any = {
             title: `D${index + 1}`,
             dataIndex: field,
             label: "D1~Dn",
             align: "center",
-            width: 120,
             children: [{
                 title: `新创角`,
                 dataIndex: field,
@@ -214,7 +213,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
     let defaultStartM = 103
     let month = [4, 5, 6, 7, 8, 9, 10, 11, 12].map((item, index) => {
         let field = `m${item}Trend`
-        let data = {
+        let data: any = {
             title: `M${item}`,
             dataIndex: field,
             label: "D1~Dn",
@@ -485,7 +484,7 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                 { title: '游戏ID', dataIndex: 'gameId', label: '游戏信息', align: 'center', width: 90 },
                 {
                     title: '游戏应用类型', dataIndex: 'classify', label: '游戏信息', align: 'center', width: 80, default: 2,
-                    render: (a: string) => (<WidthEllipsis value={gameClassifyEnum[a]} />)
+                    render: (a: string) => (<WidthEllipsis value={gameClassifyEnum[a as keyof typeof gameClassifyEnum]} />)
                 },
                 {
                     title: '区服名称', dataIndex: 'serverName', label: '游戏信息', align: 'center', width: 90, default: 3,

+ 7 - 0
src/pages/gsData/serverPayRetained/index.less

@@ -0,0 +1,7 @@
+.adDataBackColorClass {
+    background-color: #fff2e8;
+}
+
+.payDataBackColorClass {
+    background-color: #f9f0ff;
+}

+ 3 - 3
src/pages/gsData/serverPayRetained/index.tsx

@@ -16,7 +16,7 @@ const ServerPayRetained: React.FC = () => {
     /***************************************/
     const [queryForm, setQueryForm] = useState<GetServerPayRetainedProps>({
         pageNum: 1,
-        pageSize: 30,
+        pageSize: 10,
         sourceSystem: 'ZX_ONE'
     })
     const [totalData, setTotalData] = useState<any[]>([])
@@ -30,7 +30,7 @@ const ServerPayRetained: React.FC = () => {
         getServerPayRetainedTotal.run(queryForm).then((res: { id: number; gsName: string, beginDay?: string }) => {
             res.id = 1
             res.gsName = '总计'
-            res.beginDay = queryForm.serveDayBegin || moment().subtract(366, 'days').format('YYYY-MM-DD')
+            res.beginDay = queryForm.serverStartBegin || moment().subtract(366, 'days').format('YYYY-MM-DD')
             setTotalData([res])
         })
     }, [queryForm])
@@ -38,7 +38,7 @@ const ServerPayRetained: React.FC = () => {
     return <div>
         <TablePro
             leftChild={<QueryFormGS
-                initialValues={{ sourceSystem: 'ZX_ONE', roleSource: 2 }}
+                initialValues={{ sourceSystem: 'ZX_ONE' }}
                 isSource
                 isGsId
                 isServeDay={{}}

+ 206 - 46
src/pages/gsData/serverPayRetained/tableConfig.tsx

@@ -3,46 +3,142 @@ import { Statistic, Tag } from "antd"
 import React from "react"
 import moment from "moment"
 import style from '../../gameDataStatistics/extensionData/everyday/index.less'
-
+import './index.less'
 
 function columns12(): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
 
 
     let defaultStart = 26
     const Dn = Array(90).fill('').map((_item: string, index: number) => {
-        let field = `da${index + 1}`
+        let field = `retainedDa${index + 1}`
         let data: any = {
             title: `D${index + 1}`,
             dataIndex: `D${index + 1}`,
             label: "游戏区服数据",
-            width: 140,
-            render: (a: any, b: any) => {
-                let date1 = moment()
-                if (b?.gsName === '总计') {
-                    if (b?.beginDay) {
-                        date1 = moment(b.beginDay)
-                    } else {
-                        date1 = moment()
+            children: [
+                {
+                    title: `用户人数`,
+                    dataIndex: field,
+                    key: field + 'user',
+                    width: 110,
+                    className: "adDataBackColorClass",
+                    render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.gsName === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.startTime)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
+                        if (index <= day) {
+                            return <div className={style.dbox}>
+                                <span style={{ color: '#52c41a', fontWeight: 600 }}>活跃:<span>{a?.activeNum || 0}</span></span>
+                                <span style={{ color: '#a0d911', fontWeight: 600 }}>付费:<span>{a?.payNum || 0}</span></span>
+                                <span style={{ color: '#1677ff', fontWeight: 600 }}>累计付费:<span>{a?.totalPayNum || 0}</span></span>
+                                <span style={{ color: '#0f538a', fontWeight: 600 }}>小R:<span>{a?.sRNum || 0}</span></span>
+                                <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>中R:<span>{a?.mRNum || 0}</span></span>
+                                <span style={{ color: '#ff5722', fontWeight: 600 }}>大R:<span>{a?.bRNum || 0}</span></span>
+                                <span style={{ color: '#d81b60', fontWeight: 600 }}>超R:<span>{a?.superRNum || 0}</span></span>
+                                <span style={{ color: '#52c41a', fontWeight: 600 }}>R总:<span>{a?.totalRNum || 0}</span></span>
+                            </div>
+                        }
+                        return '--'
+                    },
+                },
+                {
+                    title: `付费金额`,
+                    dataIndex: field,
+                    key: field + 'Pay',
+                    align: "right",
+                    width: 75,
+                    render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.gsName === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.startTime)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
+                        if (index <= day) {
+                            return <Statistic value={a?.payMoney || 0} />
+                        }
+                        return '--'
                     }
-                } else {
-                    date1 = moment(b.serveDayBegin)
-                }
-                let dt = moment()
-                let day = dt.diff(date1, 'day');
-                if (index <= day && b?.[field]) {
-                    let [count1, count2, count3, count4, count5, count6, count7] = b?.[field]?.split('/')
-                    return <div className={style.dbox}>
-                        <span style={{ color: '#52c41a', fontWeight: 600 }}>活跃人数:<span>{count1}</span></span>
-                        <span style={{ color: '#a0d911', fontWeight: 600 }}>付费人数:<span>{count2}</span></span>
-                        <span style={{ color: '#1677ff', fontWeight: 600 }}>付费累计人数:<span>{count3}</span></span>
-                        <span style={{ color: '#0f538a', fontWeight: 600 }}>付费金额:<span><Statistic value={count4 || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>
-                        <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>付费率:<span>{(count5 * 100)?.toFixed(2)}%</span></span>
-                        <span style={{ color: '#ff5722', fontWeight: 600 }}>活跃留存率:<span>{(count6 * 100)?.toFixed(2)}%</span></span>
-                        <span style={{ color: '#d81b60', fontWeight: 600 }}>付费留存率:<span>{(count7 * 100)?.toFixed(2)}%</span></span>
-                    </div>
-                }
-                return '--'
-            },
+                },
+                {
+                    title: `用户占比`,
+                    dataIndex: field,
+                    key: field + 'Rate',
+                    width: 140,
+                    className: 'payDataBackColorClass',
+                    render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.gsName === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.startTime)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
+                        if (index <= day) {
+                            return <div className={style.dbox}>
+                                <span style={{ color: '#d81b60', fontWeight: 600 }}>付费率:<span>{((a?.payRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                <span style={{ color: '#ff5722', fontWeight: 600 }}>小R付费比:<span>{a?.sRRate || '0.0'}</span></span>
+                                <span style={{ color: '#0f538a', fontWeight: 600 }}>中R付费比:<span>{a?.mRRate || '0.0'}</span></span>
+                                <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>大R付费比:<span>{a?.bRRate || '0.0'}</span></span>
+                                <span style={{ color: '#52c41a', fontWeight: 600 }}>超R付费比:<span>{a?.superRRate || '0.0'}</span></span>
+                            </div>
+                        }
+                        return '--'
+                    },
+                },
+                {
+                    title: `留存率`,
+                    dataIndex: field,
+                    key: field + 'Ret',
+                    width: 100,
+                    render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.gsName === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.startTime)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
+                        if (index <= day) {
+                            return <div className={style.dbox}>
+                                <span style={{ color: '#1677ff', fontWeight: 600 }}>活跃:<span>{((a?.activeRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                <span style={{ color: '#0f538a', fontWeight: 600 }}>付费:<span>{((a?.payRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                <span style={{ color: '#d81b60', fontWeight: 600 }}>小R:<span>{((a?.sRRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                <span style={{ color: '#a0d911', fontWeight: 600 }}>中R:<span>{((a?.mRRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                <span style={{ color: '#52c41a', fontWeight: 600 }}>大R:<span>{((a?.bRRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>超R:<span>{((a?.superRRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                <span style={{ color: '#ff5722', fontWeight: 600 }}>R总:<span>{((a?.totalRRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                            </div>
+                        }
+                        return '--'
+                    },
+                },
+            ]
         }
         data['default'] = defaultStart + index
         return data
@@ -180,25 +276,89 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
                 ...Dn,
                 {
                     title: `D总`,
-                    dataIndex: `total`,
+                    dataIndex: `retainedTotal`,
                     label: "游戏区服数据",
-                    width: 140,
                     default: 116,
-                    render: (a: string) => {
-                        if (a) {
-                            let [count1, count2, count3, count4, count5, count6, count7] = a?.split('/')
-                            return <div className={style.dbox}>
-                                <span style={{ color: '#52c41a', fontWeight: 600 }}>活跃人数:<span>{count1}</span></span>
-                                <span style={{ color: '#a0d911', fontWeight: 600 }}>付费人数:<span>{count2}</span></span>
-                                <span style={{ color: '#1677ff', fontWeight: 600 }}>付费累计人数:<span>{count3}</span></span>
-                                <span style={{ color: '#0f538a', fontWeight: 600 }}>付费金额:<span><Statistic value={count4 || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>
-                                <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>付费率:<span>{(Number(count5) * 100)?.toFixed(2)}%</span></span>
-                                <span style={{ color: '#ff5722', fontWeight: 600 }}>活跃留存率:<span>{(Number(count6) * 100)?.toFixed(2)}%</span></span>
-                                <span style={{ color: '#d81b60', fontWeight: 600 }}>付费留存率:<span>{(Number(count7) * 100)?.toFixed(2)}%</span></span>
-                            </div>
-                        }
-                        return '--'
-                    },
+                    children: [
+                        {
+                            title: `用户人数`,
+                            dataIndex: 'retainedTotal',
+                            key: 'retainedTotaluser',
+                            width: 110,
+                            fixed: "right",
+                            className: "adDataBackColorClass",
+                            render: (a: any, b: any) => {
+                                if (a) {
+                                    return <div className={style.dbox}>
+                                        <span style={{ color: '#52c41a', fontWeight: 600 }}>活跃:<span>{a?.activeNum || 0}</span></span>
+                                        <span style={{ color: '#a0d911', fontWeight: 600 }}>付费:<span>{a?.payNum || 0}</span></span>
+                                        <span style={{ color: '#1677ff', fontWeight: 600 }}>累计付费:<span>{a?.totalPayNum || 0}</span></span>
+                                        <span style={{ color: '#0f538a', fontWeight: 600 }}>小R:<span>{a?.sRNum || 0}</span></span>
+                                        <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>中R:<span>{a?.mRNum || 0}</span></span>
+                                        <span style={{ color: '#ff5722', fontWeight: 600 }}>大R:<span>{a?.bRNum || 0}</span></span>
+                                        <span style={{ color: '#d81b60', fontWeight: 600 }}>超R:<span>{a?.superRNum || 0}</span></span>
+                                        <span style={{ color: '#52c41a', fontWeight: 600 }}>R总:<span>{a?.totalRNum || 0}</span></span>
+                                    </div>
+                                }
+                                return '--'
+                            },
+                        },
+                        {
+                            title: `付费金额`,
+                            dataIndex: 'retainedTotal',
+                            key: 'retainedTotalPay',
+                            align: "right",
+                            width: 80,
+                            fixed: "right",
+                            render: (a: any, b: any) => {
+                                if (a) {
+                                    return <Statistic value={a?.payMoney || 0} />
+                                }
+                                return '--'
+                            }
+                        },
+                        {
+                            title: `用户占比`,
+                            dataIndex: 'retainedTotal',
+                            key: 'retainedTotalRate',
+                            width: 140,
+                            fixed: "right",
+                            className: 'payDataBackColorClass',
+                            render: (a: any) => {
+                                if (a) {
+                                    return <div className={style.dbox}>
+                                        <span style={{ color: '#d81b60', fontWeight: 600 }}>付费率:<span>{((a?.payRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                        <span style={{ color: '#ff5722', fontWeight: 600 }}>小R付费比:<span>{a?.sRRate || '0.0'}</span></span>
+                                        <span style={{ color: '#0f538a', fontWeight: 600 }}>中R付费比:<span>{a?.mRRate || '0.0'}</span></span>
+                                        <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>大R付费比:<span>{a?.bRRate || '0.0'}</span></span>
+                                        <span style={{ color: '#52c41a', fontWeight: 600 }}>超R付费比:<span>{a?.superRRate || '0.0'}</span></span>
+                                    </div>
+                                }
+                                return '--'
+                            },
+                        },
+                        {
+                            title: `留存率`,
+                            dataIndex: 'retainedTotal',
+                            key: 'retainedTotalRet',
+                            width: 100,
+                            fixed: "right",
+                            render: (a: any) => {
+                                if (a) {
+                                    return <div className={style.dbox}>
+                                        <span style={{ color: '#1677ff', fontWeight: 600 }}>活跃:<span>{((a?.activeRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                        <span style={{ color: '#0f538a', fontWeight: 600 }}>付费:<span>{((a?.payRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                        <span style={{ color: '#d81b60', fontWeight: 600 }}>小R:<span>{((a?.sRRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                        <span style={{ color: '#a0d911', fontWeight: 600 }}>中R:<span>{((a?.mRRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                        <span style={{ color: '#52c41a', fontWeight: 600 }}>大R:<span>{((a?.bRRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                        <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>超R:<span>{((a?.superRRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                        <span style={{ color: '#ff5722', fontWeight: 600 }}>R总:<span>{((a?.totalRRetainedRate || 0) * 100)?.toFixed(2)}%</span></span>
+                                    </div>
+                                }
+                                return '--'
+                            },
+                        },
+                    ]
                 }
             ]
         }