wjx 3 weeks ago
parent
commit
bc0451640f

+ 6 - 0
config/routerConfig.ts

@@ -175,6 +175,12 @@ const gameDataStatistics = {
                     name: '游戏发码器',
                     access: 'codeSender',
                     component: './gameDataStatistics/roleOperate/codeSender',
+                },
+                {
+                    path: '/gameDataStatistics/roleOperate/playrWhiteList',
+                    name: '玩家充值白名单',
+                    access: 'playrWhiteList',
+                    component: './gameDataStatistics/roleOperate/playrWhiteList',
                 }
             ]
         },

+ 25 - 3
src/components/QueryForm/index.tsx

@@ -284,6 +284,8 @@ interface Props {
     isRemark?: boolean
     /** 是否 公会 查找 */
     isCountry?: boolean
+    /** 是否 区服ID单个 查找 */
+    isServerIdDg?: boolean
 }
 /**
  * 游戏数据系统 请求参数
@@ -298,7 +300,7 @@ const QueryForm: React.FC<Props> = (props) => {
         isSysUserName, isRechargeDate, LastRechargeDay, isBGGameClassify, isGameUserId, isSysUserId, isSysUserIds, isUserName, isUserId, isSelectRanking, isGameType, isConsumeDay, rechargeDay, isBeginDay, isType, isAdTTStatus, isUserEnterType, isServerName, isServerId, isServerDay, isAdTXStatus,
         payTimeDay, placeAnOrderDay, isPayIntervalTime, isActiveTypes, isNickname, isMobile, isRegIp, isIsAuth, isIsBindMobile, isIsRecharge, isUserStatus, isCreateRole, isRoleCount, isVipLevel, isRoleLevel, isCreateRoleDay, isLastActiveTime, isIsChange, isIsSendMail, isWeChatCompany, isWeChat,
         isCustomerServerId, isOperatorId, isGsId, isServerIds, isRankingNum, isIsMergeServer, isIsParticipateMerge, isSuperParentGameId, isGameServerName, isIp, isDeviceType, isLoginType, isServerIdUn, isSourceServerName, isProjectId1, isDynamicCreativeId, isRemoveGame, isRemoveGameForSystem, isOrderLy, isAddCorpWechat,
-        isWakeUp, isUserPhoneStatus, isBackStatus, isGameDimension, isUserLastRegTime, isUserLastRegAgentId, isUserLastPitcherId, isRechargeAmountWithin24h, isRechargeTotalAmountWithin24h, isRegisterType, isConfiguredStatus, isIpCity, isIpProv, isLoginIpCity, isLoginIpProv, isXjRole, isRemark
+        isWakeUp, isUserPhoneStatus, isBackStatus, isGameDimension, isUserLastRegTime, isUserLastRegAgentId, isUserLastPitcherId, isRechargeAmountWithin24h, isRechargeTotalAmountWithin24h, isRegisterType, isConfiguredStatus, isIpCity, isIpProv, isLoginIpCity, isLoginIpProv, isXjRole, isRemark, isServerIdDg
     } = props
     const [form] = Form.useForm()
     const parentId = Form.useWatch('parentId', form)
@@ -936,7 +938,7 @@ const QueryForm: React.FC<Props> = (props) => {
                         (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
                     }
                     onChange={(e) => {
-                        if (isServerIds && e) {
+                        if ((isServerIds && e) || (isServerIdDg && e)) {
                             form.setFieldsValue({ serverIds: undefined })
                             getGameServerList.run({ gameId: e })
                             getGameUnMergeServerList.run({ gameId: e })
@@ -971,7 +973,7 @@ const QueryForm: React.FC<Props> = (props) => {
                                 getGameServerList?.data && getGameServerList.mutate([])
                             }
                         }
-                        if (isServerIdUn) {
+                        if (isServerIdUn || isServerIdDg) {
                             form.setFieldsValue({ serverId: undefined })
                             if (option?.['data-super-id']) {
                                 getGameServerUnList.run({ gameId: option['data-super-id'] })
@@ -1064,6 +1066,26 @@ const QueryForm: React.FC<Props> = (props) => {
                         {getGameServerUnList?.data?.filter((item: { isSourceServer: any }) => item.isSourceServer)?.map((item: any) => <Select.Option value={item.serverId} key={item.serverId}>{item.serverName}</Select.Option>)}
                     </Select>
                 </Form.Item></Col>}
+
+                {/* 区服id */}
+                {isServerIdDg && <Col><Form.Item name='serverId'>
+                    <Select
+                        maxTagCount={1}
+                        showSearch
+                        disabled={serverName}
+                        style={{ minWidth: 140 }}
+                        allowClear
+                        placeholder={'请选择区服'}
+                        filterOption={(input, option) =>
+                            (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
+                        }
+                        loading={getGameServerList.loading}
+                    >
+                        {(isIsParticipateMerge && isParticipateMerge)
+                            ? getGameUnMergeServerList?.data?.filter((item: { isSourceServer: any }) => (isIsMergeServer && ((!isMergeServer && item.isSourceServer) || (isMergeServer && !item.isSourceServer))) || !isIsMergeServer)?.map((item: any) => <Select.Option value={item.serverId} key={item.serverId}>{item.serverName}</Select.Option>)
+                            : getGameServerList?.data?.filter((item: { isSourceServer: any }) => (isIsMergeServer && ((!isMergeServer && item.isSourceServer) || (isMergeServer && !item.isSourceServer))) || !isIsMergeServer)?.map((item: any) => <Select.Option value={item.serverId} key={item.serverId}>{item.serverName}</Select.Option>)}
+                    </Select>
+                </Form.Item></Col>}
             </>}
 
             {/* 游戏应用类型搜索 */}

+ 77 - 0
src/pages/gameDataStatistics/roleOperate/playrWhiteList/addWhite.tsx

@@ -0,0 +1,77 @@
+import React, { useState } from 'react';
+import { Form, Input, Select, Modal, message } from 'antd';
+import { DefaultOptionType } from 'antd/lib/select';
+import { useAjax } from '@/Hook/useAjax';
+import { addPlayerWhiteApi } from '@/services/gameData/roleOperate';
+
+
+interface Props {
+    gameList: DefaultOptionType[]
+    visible?: boolean;
+    onClose?: () => void;
+    onChange?: () => void;
+}
+
+/**
+ * 添加白名单
+ * @param param0 
+ * @returns 
+ */
+const AddWhite: React.FC<Props> = ({ gameList, visible, onClose, onChange }) => {
+
+    /***********************************/
+    const [form] = Form.useForm()
+
+    const addPlayerWhite = useAjax((params) => addPlayerWhiteApi(params))
+    /***********************************/
+
+    const handleOk = () => {
+        form.validateFields().then(value => {
+            addPlayerWhite.run(value).then(res => {
+                if (res) {
+                    message.success('添加成功')
+                    onChange?.()
+                }
+            })
+        })
+    }
+
+    return <Modal
+        title={<strong>添加白名单</strong>}
+        visible={visible}
+        onCancel={onClose}
+        onOk={handleOk}
+        confirmLoading={addPlayerWhite.loading}
+    >
+        <Form
+            name="addWhiteList"
+            layout="vertical"
+            form={form}
+        >
+            <Form.Item
+                label="游戏"
+                name="gameId"
+                rules={[{ required: true, message: '请选择游戏!' }]}
+            >
+                <Select
+                    showSearch
+                    style={{ minWidth: 140 }}
+                    placeholder={'请选择游戏'}
+                    filterOption={(input, option) =>
+                        (option?.label as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
+                    }
+                    options={gameList}
+                />
+            </Form.Item>
+            <Form.Item
+                label="玩家"
+                name="account"
+                rules={[{ required: true, message: '请输入玩家账号/手机号/id' }]}
+            >
+                <Input.TextArea placeholder="请输入玩家账号/手机号/id" />
+            </Form.Item>
+        </Form>
+    </Modal>
+};
+
+export default AddWhite;

+ 157 - 0
src/pages/gameDataStatistics/roleOperate/playrWhiteList/index.tsx

@@ -0,0 +1,157 @@
+import Tables from '@/components/Tables';
+import { useAjax } from '@/Hook/useAjax';
+import { Button, Card, Col, Form, Input, message, Row, Select, Space } from 'antd';
+import React, { useEffect, useState } from 'react';
+import style from '../../components/TableData/index.less'
+import { DefaultOptionType } from 'antd/lib/select';
+import columnsPos from './tableConfig';
+import { delPlayerWhiteApi, getPlayerWhiteListApi, GetPlayerWhiteListProps, getWhiteGameListApi } from '@/services/gameData/roleOperate';
+import { PlusOutlined } from '@ant-design/icons';
+import AddWhite from './addWhite';
+
+const PlayrWhiteList: React.FC = () => {
+
+    /*********************************/
+    const [form] = Form.useForm()
+    const [queryFrom, setQueryFrom] = React.useState<GetPlayerWhiteListProps>({ gameId: 0, pageNum: 1, pageSize: 20 })
+    const [gameList, setGameList] = useState<DefaultOptionType[]>([])
+    const [addVisible, setAddVisible] = useState<boolean>(false)
+
+    const getWhiteGameList = useAjax(() => getWhiteGameListApi())
+    const getPlayerWhiteList = useAjax((params) => getPlayerWhiteListApi(params))
+    const delPlayerWhite = useAjax((params) => delPlayerWhiteApi(params))
+    /*********************************/
+
+    useEffect(() => {
+        getWhiteGameList.run().then(res => {
+            if (res) {
+                const arrayGame = Object.keys(res)
+                setGameList(arrayGame.map(key => ({ label: res[key], value: key })))
+                form.setFieldsValue({ gameId: arrayGame[0] })
+                setQueryFrom({ ...queryFrom, gameId: arrayGame[0] as any })
+            }
+        })
+    }, [])
+
+
+    useEffect(() => {
+        if (queryFrom.gameId) {
+            getPlayerWhiteList.run(queryFrom)
+        }
+    }, [queryFrom])
+
+    const onFinish = (data: any) => {
+        const oldQueryFrom = JSON.parse(JSON.stringify(queryFrom))
+        const { ...params } = { ...oldQueryFrom, ...data, pageNum: 1 }
+        setQueryFrom(params)
+    }
+
+    // 删除
+    const delHandle = (id: number) => {
+        const hide = message.loading('正在删除...', 0)
+        delPlayerWhite.run({ id }).then(res => {
+            hide()
+            if (res) {
+                message.success('删除成功')
+                getPlayerWhiteList.refresh()
+            }
+        }).catch(() => hide())
+    }
+
+    return <Card
+        style={{ borderRadius: 8 }}
+        headStyle={{ textAlign: 'left' }}
+        bodyStyle={{ padding: '5px 10px' }}
+    >
+        <div style={{ textAlign: 'center', fontWeight: 'bold', padding: '4px 6px 6px', fontSize: 16, marginBottom: 4, position: 'relative' }}>
+            玩家充值白名单
+        </div>
+
+        <Space style={{ width: '100%' }} direction="vertical" size={10}>
+            <Form
+                layout="inline"
+                className='queryForm'
+                name="basicGameChat"
+                form={form}
+                onFinish={onFinish}
+                initialValues={{
+                    gameId: gameList[0]?.value
+                }}
+            >
+                <Row gutter={[0, 6]}>
+                    <Col><Form.Item name='gameId'>
+                        <Select
+                            showSearch
+                            style={{ minWidth: 140 }}
+                            placeholder={'请选择游戏'}
+                            filterOption={(input, option) =>
+                                (option?.label as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
+                            }
+                            options={gameList}
+                        />
+                    </Form.Item></Col>
+                    <Col><Form.Item name='account'>
+                        <Input placeholder="玩家账号/手机号/ID" allowClear style={{ width: 180 }} />
+                    </Form.Item></Col>
+                    <Col><Form.Item name='roleName'>
+                        <Input placeholder="角色名称" allowClear style={{ width: 140 }} />
+                    </Form.Item></Col>
+                    <Col><Form.Item name='roleId'>
+                        <Input placeholder="角色ID" allowClear style={{ width: 140 }} />
+                    </Form.Item></Col>
+                    <Col>
+                        <Space>
+                            <Button type="primary" htmlType="submit">搜索</Button>
+                            <Button onClick={() => form.resetFields()}>重置</Button>
+                            <Button type="primary" icon={<PlusOutlined />} onClick={() => { setAddVisible(true) }}>新增白名单</Button>
+                        </Space>
+                    </Col>
+                </Row>
+            </Form>
+
+            <div className={`${style['small']}`}>
+                <Tables
+                    className={`all_table content_table_body`}
+                    bordered
+                    sortDirections={['ascend', 'descend', null]}
+                    current={queryFrom.pageNum}
+                    pageSize={queryFrom.pageSize}
+                    columns={columnsPos(delHandle)}
+                    dataSource={getPlayerWhiteList?.data?.records}
+                    scroll={{ x: 1000, y: 600 }}
+                    onChange={(pagination: any, filters: any, sortData: any) => {
+                        let { current, pageSize } = pagination
+                        let newQueryForm = JSON.parse(JSON.stringify(queryFrom))
+                        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
+                        setQueryFrom({ ...newQueryForm })
+                    }}
+                    size="small"
+                    total={getPlayerWhiteList?.data?.total}
+                    loading={getPlayerWhiteList?.loading}
+                    defaultPageSize={20}
+                />
+            </div>
+        </Space>
+
+        {/* 新增白名单 */}
+        {addVisible && <AddWhite
+            gameList={gameList}
+            visible={addVisible}
+            onChange={() => {
+                getPlayerWhiteList.refresh()
+                setAddVisible(false)
+            }}
+            onClose={() => { setAddVisible(false) }}
+        />}
+    </Card>
+};
+
+export default PlayrWhiteList;

+ 70 - 0
src/pages/gameDataStatistics/roleOperate/playrWhiteList/tableConfig.tsx

@@ -0,0 +1,70 @@
+
+
+import WidthEllipsis from "@/components/widthEllipsis"
+import { Popconfirm, Space } from "antd"
+import React from "react"
+
+function columnsPos(delHandle?: (id: number) => void) {
+
+    let newArr: any = [
+        {
+            title: '游戏',
+            dataIndex: 'gameName',
+            key: 'gameName',
+            align: 'center',
+            width: 120,
+            render: (a: string) => (<WidthEllipsis value={a} />)
+        },
+        {
+            title: '游戏ID',
+            dataIndex: 'gameId',
+            key: 'gameId',
+            align: 'center',
+            width: 70,
+            render: (a: string) => (<WidthEllipsis value={a} />)
+        },
+        {
+            title: '玩家名称',
+            dataIndex: 'username',
+            key: 'username',
+            width: 250,
+            render: (a: string) => (<WidthEllipsis value={a} />)
+        },
+        {
+            title: '玩家ID',
+            dataIndex: 'userId',
+            key: 'userId',
+            align: 'center',
+            width: 90,
+            render: (a: string) => (<WidthEllipsis value={a} />)
+        },
+        {
+            title: '玩家手机号',
+            dataIndex: 'mobile',
+            key: 'mobile',
+            align: 'center',
+            width: 100,
+            render: (a: string) => (<WidthEllipsis value={a} />)
+        },
+        {
+            title: '操作',
+            dataIndex: 'cz',
+            key: 'cz',
+            render: (_: any, records: any) => {
+                return <Space>
+
+                    <Popconfirm
+                        title="确定删除?"
+                        onConfirm={() => delHandle?.(records.id)}
+                    >
+                        <a style={{ color: 'red', fontSize: 12 }}>删除</a>
+                    </Popconfirm>
+                </Space>
+            }
+        }
+    ]
+    return newArr
+}
+
+
+export default columnsPos

+ 2 - 1
src/pages/gameDataStatistics/roleOperate/roleRechargeRanking/tableConfig.tsx

@@ -202,6 +202,7 @@ function columns12(
                         return diff ? <span style={Math.floor((diff / 1000) / (3600 * 24)) > 1 ? { color: 'red' } : {}}><WidthEllipsis value={secondsToDhms(diff / 1000)} /></span> : '--'
                     }
                 },
+                { title: '角色昨日聊天总数', dataIndex: 'role_chat_count', label: '角色充值信息', align: 'center', width: 85, sorter: true, default: 20, render: (a: string) => <Statistic value={a || 0} /> }
             ],
         },
         {
@@ -342,7 +343,7 @@ function columns12(
                     label: '操作',
                     align: 'center',
                     width: 190,
-                    default: 20,
+                    default: 21,
                     render: (a: any, b: any) => {
                         return <Space>
                             <a style={{ fontSize: 12 }} onClick={() => { roleHandle([b]) }}>角色操作</a>

+ 6 - 4
src/pages/gsData/roleChatNum/index.tsx

@@ -17,7 +17,9 @@ const RoleChatNum: React.FC = () => {
     /****************************************/
     const [queryForm, setQueryForm] = useState<GetRoleChatListProps>({
         pageNum: 1,
-        pageSize: 30
+        pageSize: 30,
+        startDate: moment().format('YYYY-MM-DD'),
+        endDate: moment().format('YYYY-MM-DD')
     })
     const [detaisData, setDetailsData] = useState<{ visible: boolean, roleId: any, dt: any }>({ visible: false, roleId: undefined, dt: undefined })
     const getRoleChatList = useAjax((params) => getRoleChatListApi(params))
@@ -34,7 +36,8 @@ const RoleChatNum: React.FC = () => {
     return <div>
         <TablePro
             leftChild={<QueryForm
-                isServerId
+                initialValues={{createRoleDay: [moment(), moment()]}}
+                isServerIdDg
                 isCreateRoleDay={{placeholder: ['日期开始', '日期结束']}}
                 isGameRoleName
                 isGameRoleId
@@ -42,10 +45,9 @@ const RoleChatNum: React.FC = () => {
                 isCountry
                 onChange={(data: any) => {
                     console.log(data)
-                    const { superParentGameId, createRoleDay, serverIds, ...params } = data
+                    const { superParentGameId, createRoleDay, ...params } = data
                     let newQueryForm = JSON.parse(JSON.stringify(queryForm))
                     newQueryForm.pageNum = 1
-                    newQueryForm.serverId = serverIds
                     newQueryForm.superGameId = superParentGameId
                     if (createRoleDay && createRoleDay?.length === 2) {
                         newQueryForm['startDate'] = moment(createRoleDay[0]).format('YYYY-MM-DD')

+ 6 - 7
src/pages/gsData/roleChatNum/tableConfig.tsx

@@ -48,13 +48,12 @@ function columns12(detailsHandle: (data: any) => void): { label: string, fieldSH
                     title: '最近聊天时间', dataIndex: 'lastChatTime', label: '基本信息', align: 'center', width: 125, default: 10, sorter: true,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
-                {
-                    title: '操作', dataIndex: 'cz', label: '基本信息', align: 'center', width: 80, default: 11,
-                    render: (_: any, b: any) => {
-                        return <a onClick={() => detailsHandle(b)}>详情</a>
-                    }
-                }
-
+                // {
+                //     title: '操作', dataIndex: 'cz', label: '基本信息', align: 'center', width: 80, default: 11,
+                //     render: (_: any, b: any) => {
+                //         return <a onClick={() => detailsHandle(b)}>详情</a>
+                //     }
+                // }
             ]
         }
     ]

+ 56 - 1
src/services/gameData/roleOperate.ts

@@ -746,7 +746,7 @@ export async function updatePackLinkApi(data: AddPackLinkProps) {
  * @param params 
  * @returns 
  */
-export async function delPackLinkApi(params: {id: number}) {
+export async function delPackLinkApi(params: { id: number }) {
     return request(apiManage + `/game/gift/pack/link/delete`, {
         method: 'DELETE',
         params
@@ -838,4 +838,59 @@ export async function getPackLinkLqLogListApi(data: GetPackLinkLogListProps) {
         method: 'POST',
         data
     })
+}
+
+export interface GetPlayerWhiteListProps {
+    pageNum: number
+    pageSize: number
+    gameId: number,
+    account?: string, // 玩家账号/手机号/id
+    roleId?: string,
+    roleName?: string
+}
+
+/**
+ * 获取白名单列表
+ * @param data 
+ * @returns 
+ */
+export async function getPlayerWhiteListApi(data: GetPlayerWhiteListProps) {
+    return request(apiManage + `/user/recharge/white/list`, {
+        method: 'POST',
+        data
+    })
+}
+
+/**
+ * 获取游戏列表
+ * @returns 
+ */
+export async function getWhiteGameListApi() {
+    return request(apiManage + `/user/recharge/white/game/list`, {
+        method: 'GET',
+    });
+}
+
+/**
+ * 删除白名单
+ * @param params 
+ * @returns 
+ */
+export async function delPlayerWhiteApi(params: { id: number }) {
+    return request(apiManage + `/user/recharge/white/del`, {
+        method: 'DELETE',
+        params
+    });
+}
+
+/**
+ * 新增白名单
+ * @param data 
+ * @returns 
+ */
+export async function addPlayerWhiteApi(data: { gameId: number, account: string }) {
+    return request(apiManage + `/user/recharge/white/add`, {
+        method: 'PUT',
+        data
+    });
 }