wjx před 9 měsíci
rodič
revize
e90c1834fe

+ 6 - 0
config/routerConfig.ts

@@ -438,6 +438,12 @@ const gsData = {
             access: 'rolePayRetained',
             component: './gsData/rolePayRetained',
         },
+        {
+            path: '/gsData/roleRemoveMonitor',
+            name: '角色流失监控',
+            access: 'roleRemoveMonitor',
+            component: './gsData/roleRemoveMonitor',
+        },
     ]
 }
 

+ 2 - 1
src/pages/gsData/bidREveryday/index.tsx

@@ -43,6 +43,7 @@ const BidREveryday: React.FC = () => {
                 isSuperParentGameId
                 isGameRoleName
                 isServerIds
+                isRoleSource
                 isServeStatus
                 onChange={(data: any) => {
                     console.log(data)
@@ -106,4 +107,4 @@ const BidREveryday: React.FC = () => {
     </div>
 }
 
-export default React.memo(BidREveryday)
+export default BidREveryday

+ 97 - 0
src/pages/gsData/roleRemoveMonitor/index.tsx

@@ -0,0 +1,97 @@
+import { useAjax } from "@/Hook/useAjax"
+import { getRoleRemoveListApi, GetRoleRemoveProps } from "@/services/gsData"
+import React, { useEffect, useState } from "react"
+import columns12 from "./tableConfig"
+import TablePro from "@/pages/gameDataStatistics/components/TablePro"
+import QueryFormGS from "@/components/QueryForm/indexGs"
+import moment from "moment"
+
+/**
+ * 角色流失监控
+ * @returns 
+ */
+const RoleRemoveMonitor: React.FC = () => {
+
+    /****************************************/
+    const [queryForm, setQueryForm] = useState<GetRoleRemoveProps>({
+        pageNum: 1,
+        pageSize: 30,
+        sourceSystem: 'ZX_ONE',
+        roleSource: 2
+    })
+    const getRoleRemoveList = useAjax((params) => getRoleRemoveListApi(params))
+    /****************************************/
+
+    useEffect(() => {
+        getRoleRemoveList.run(queryForm)
+    }, [queryForm])
+
+    return <div>
+        <TablePro
+            leftChild={<QueryFormGS
+                initialValues={{ sourceSystem: 'ZX_ONE', roleSource: 2, rechargeDay: [moment(), moment()] }}
+                isSource
+                isGsId
+                isCreateRoleDay={{}}
+                isServeDay={{}}
+                isParentId
+                isSuperParentGameId
+                isGameRoleName
+                isServerIds
+                isRoleSource
+                onChange={(data: any) => {
+                    console.log(data)
+                    const { gsId, parentId, createRoleDay, serveDay, superParentGameId, serverIds, ...params } = data
+                    let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                    newQueryForm.pageNum = 1
+                    newQueryForm.gsIdList = gsId
+                    newQueryForm.parentGameId = parentId
+                    newQueryForm.superGameId = superParentGameId
+                    newQueryForm.serverIdList = serverIds
+                    if (createRoleDay && createRoleDay?.length === 2) {
+                        newQueryForm['roleCreateDayBegin'] = moment(createRoleDay[0]).format('YYYY-MM-DD')
+                        newQueryForm['roleCreateDayEnd'] = moment(createRoleDay[1]).format('YYYY-MM-DD')
+                    } else {
+                        delete newQueryForm['roleCreateDayBegin']
+                        delete newQueryForm['roleCreateDayEnd']
+                    }
+                    if (serveDay && serveDay?.length === 2) {
+                        newQueryForm['serveDayBegin'] = moment(serveDay[0]).format('YYYY-MM-DD')
+                        newQueryForm['serveDayEnd'] = moment(serveDay[1]).format('YYYY-MM-DD')
+                    } else {
+                        delete newQueryForm['serveDayBegin']
+                        delete newQueryForm['serveDayEnd']
+                    }
+                    setQueryForm({ ...newQueryForm, ...params })
+                }}
+            />}
+            config={columns12()}
+            configName={'角色流失监控'}
+            fixed={{ left: 4, right: 0 }}
+            scroll={{ x: 1000, y: 620 }}
+            title='角色流失监控'
+            loading={getRoleRemoveList.loading}
+            ajax={getRoleRemoveList}
+            page={getRoleRemoveList?.data?.current || 1}
+            pageSize={getRoleRemoveList?.data?.size || 20}
+            total={getRoleRemoveList?.data?.total || 0}
+            dataSource={getRoleRemoveList?.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 RoleRemoveMonitor

+ 128 - 0
src/pages/gsData/roleRemoveMonitor/tableConfig.tsx

@@ -0,0 +1,128 @@
+import WidthEllipsis from "@/components/widthEllipsis"
+import { Badge, Statistic, Tag } 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: 'GS名称', dataIndex: 'gsName', label: '基本信息', align: 'center', width: 75, default: 1,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '父游戏名称', dataIndex: 'parentGameName', label: '基本信息', align: 'center', width: 85, default: 2,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '角色名称', dataIndex: 'roleName', label: '基本信息', align: 'center', width: 85, default: 3,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '角色创建时间', dataIndex: 'roleTime', label: '基本信息', align: 'center', width: 125, default: 4,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '角色创角天数', dataIndex: 'roleCreateDayDiff', label: '基本信息', align: 'center', width: 60, default: 5,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '角色来源', dataIndex: 'roleSource', label: '基本信息', align: 'center', width: 75, default: 6,
+                    render: (a: string) => (<WidthEllipsis value={{ '1': '区服指派', '2': '角色指派' }[a]} />)
+                },
+                {
+                    title: '角色所在区服名称', dataIndex: 'endServerName', label: '基本信息', align: 'center', width: 80, default: 7,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '服务时间', dataIndex: 'gsStartTime', label: '基本信息', align: 'center', width: 160, default: 8,
+                    render: (a: string, b: any) => (<WidthEllipsis value={`${a}-${b?.gsEndTime}`} />)
+                },
+                {
+                    title: '服务天数', dataIndex: 'gsServeDays', label: '基本信息', align: 'center', width: 45, default: 9,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '服务状态', dataIndex: 'serveStatus', label: '基本信息', align: 'center', width: 75, default: 10,
+                    render: (a: boolean) => {
+                        return a ? <Tag color="success" style={{ marginRight: 0 }}>服务完成</Tag> : <Tag color="processing" style={{ marginRight: 0 }}>服务中</Tag>
+                    }
+                },
+                {
+                    title: '角色当前状态(系统)', dataIndex: 'systemRemoveGameStatus', label: '基本信息', align: 'center', width: 75, default: 11,
+                    render: (a: number) => {
+                        return a === 0 ? <Badge status="success" text={<span style={{ fontSize: 12 }}>正常</span>} /> : a === 1 ? <Badge status="error" text={<span style={{ fontSize: 12 }}>退游</span>} /> : '--'
+                    }
+                },
+                {
+                    title: '角色当前状态(人工)', dataIndex: 'humanRemoveGameStatus', label: '基本信息', align: 'center', width: 75, default: 12,
+                    render: (a: number) => {
+                        return a === 0 ? <Badge status="success" text={<span style={{ fontSize: 12 }}>正常</span>} /> : a === 1 ? <Badge status="error" text={<span style={{ fontSize: 12 }}>退游</span>} /> : '--'
+                    }
+                },
+            ]
+        },
+        {
+            label: '角色游戏数据',
+            data: [
+                {
+                    title: '角色VIP等级', dataIndex: 'roleVip', label: '角色游戏数据', align: 'center', width: 55, sorter: true, default: 13,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '角色攻击力', dataIndex: 'combatNum', label: '角色游戏数据', align: 'right', width: 80, sorter: true, default: 14,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '角色游戏等级', dataIndex: 'roleLevel', label: '角色游戏数据', align: 'center', width: 60, sorter: true, default: 15,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '角色首充金额', dataIndex: 'firstAmount', label: '角色游戏数据', align: 'right', width: 55, sorter: true, default: 16,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '创角24小时付费金额', dataIndex: 'roleHourAmount', label: '角色游戏数据', align: 'right', width: 70, sorter: true, default: 17,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '角色累计充值次数', dataIndex: 'totalCnt', label: '角色游戏数据', align: 'center', width: 70, sorter: true, default: 18,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '角色累计充值金额', dataIndex: 'totalAmount', label: '角色游戏数据', align: 'right', width: 70, sorter: true, default: 19,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '角色最近充值金额', dataIndex: 'lastAmount', label: '角色游戏数据', align: 'right', width: 70, sorter: true, default: 20,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '角色最近充值产品', dataIndex: 'productName', label: '角色游戏数据', align: 'center', width: 85, default: 21,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '角色最近充值时间', dataIndex: 'lastOrderTime', label: '角色游戏数据', align: 'center', width: 120, default: 22,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '角色最近活跃时间', dataIndex: 'activeTime', label: '角色游戏数据', align: 'center', width: 120, default: 23,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '角色最近充值时间距今', dataIndex: 'lastOrderDayDiff', label: '角色游戏数据', align: 'center', width: 65, default: 24,
+                    render: (a: number) => (<span style={{ fontSize: 12, color: a > 5 ? 'red' : '#000' }}>{a}</span>)
+                },
+                {
+                    title: '角色最近活跃时间距今', dataIndex: 'roleActiveDayDiff', label: '角色游戏数据', align: 'center', width: 65, default: 25,
+                    render: (a: number) => (<span style={{ fontSize: 12, color: a > 5 ? 'red' : '#000' }}>{a}</span>)
+                }
+            ]
+        }
+    ]
+}
+
+export default columns12

+ 28 - 0
src/services/gsData/index.ts

@@ -63,4 +63,32 @@ export async function getRolePayRetainedTotalApi(data: GetRolePayRetainedProps)
         method: 'POST',
         data
     });
+}
+
+
+
+
+export interface GetRoleRemoveProps extends Paging, SortProps {
+    roleSource: 1 | 2, // 必填:角色来源:1:区服指派;2:角色指派
+    sourceSystem: string, // 必填:SDK来源;默认ZX_ONE
+    gsIdList?: number[],    // gs id 列表
+    parentGameId?: number,   // 父游戏id
+    roleCreateDayBegin?: string  // 角色创建日期开始
+    roleCreateDayEnd?: string
+    roleName?: string   // 角色名称
+    serveDayBegin?: string, // 服务日期开始
+    serveDayEnd?: string,
+    serverIdList?: string[], // 角色当前所在区服id列表
+    superGameId?: number,  //超父游戏id
+}
+/**
+ * 大R每日充值比
+ * @param data 
+ * @returns 
+ */
+export async function getRoleRemoveListApi(data: GetRoleRemoveProps) {
+    return request(wapi + `/game/parent/role/remove/game/monitor`, {
+        method: 'POST',
+        data
+    });
 }