wjx 1 maand geleden
bovenliggende
commit
9d48b7022c

+ 6 - 0
config/routerConfig.ts

@@ -516,6 +516,12 @@ const gsData = {
             name: '游戏帮派角色表(仙剑)',
             access: 'gandRole',
             component: './gsData/gandRole',
+        },
+        {
+            path: '/gsData/roleChatNum',
+            name: '角色日维度聊天数量统计',
+            access: 'roleChatNum',
+            component: './gsData/roleChatNum',
         }
     ]
 }

+ 8 - 1
src/components/QueryForm/index.tsx

@@ -44,6 +44,7 @@ interface Props {
     /** 是否开启 角色创建日期 搜索 */
     isCreateRoleDay?: {
         ranges?: any
+        placeholder?: [string, string]
     }
     /** 是否开启 最近活跃时间 搜索 */
     isLastActiveTime?: {
@@ -281,6 +282,8 @@ interface Props {
     isXjRole?: boolean
     /** 是否 备注 查找 */
     isRemark?: boolean
+    /** 是否 公会 查找 */
+    isCountry?: boolean
 }
 /**
  * 游戏数据系统 请求参数
@@ -290,7 +293,7 @@ const QueryForm: React.FC<Props> = (props) => {
 
     /**************************/
     const {
-        onChange, initialValues, isSource, isAccount, isAccountId, isAccountIds, isCompanyId, isAgentKey, isAgentName, isCpId, isCpName, isCpOrderId, isCpStatus, isCreateDay, isCreateDayXz, isDevice, isGameName, isRechargeGameName, isGameId, isGameIds, isOrderGameId, isGameRoleId,
+        onChange, initialValues, isSource, isAccount, isAccountId, isAccountIds, isCompanyId, isAgentKey, isAgentName, isCpId, isCpName, isCpOrderId, isCpStatus, isCreateDay, isCreateDayXz, isDevice, isGameName, isRechargeGameName, isGameId, isGameIds, isOrderGameId, isGameRoleId, isCountry,
         isGameRoleName, isFirstRecharge, isSwitch, isMerchantNo, isOrderId, isMerchantOrderNo, isPayStatus, isPayWay, isProductName, isRegAgent, isAgentId, isPutAgent, isRegDay, isOs, isParentId, isParentIds, isProjectId, isProjectName, isDynamicCreativeName, isPromotionId, isPromotionId1, isPromotionName,
         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,
@@ -660,6 +663,10 @@ const QueryForm: React.FC<Props> = (props) => {
             {isAccount && <Col><Form.Item name='accountName'>
                 <Input placeholder="广告账号名称" allowClear style={{ width: 140 }} />
             </Form.Item></Col>}
+            {/* 公会名称 */}
+            {isCountry && <Col><Form.Item name='country'>
+                <Input placeholder="公会名称" allowClear style={{ width: 140 }} />
+            </Form.Item></Col>}
             {/* 广告账号ID */}
             {isAccountId && <Col><Form.Item name='accountId'>
                 <Select

+ 92 - 0
src/pages/gsData/roleChatNum/details.tsx

@@ -0,0 +1,92 @@
+import QueryForm from "@/components/QueryForm"
+import { useAjax } from "@/Hook/useAjax"
+import TablePro from "@/pages/gameDataStatistics/components/TablePro"
+import { getRoleChatDetailsListApi, GetRoleChatDetailsListApiProps } from "@/services/gsData"
+import React, { useEffect, useState } from "react"
+import moment from "moment"
+import { Modal } from "antd"
+import columns13 from "./tableConfigDetails"
+
+interface RoleChatDetailsProps {
+    roleId: string
+    dt: string
+    visible?: boolean
+    onClose?: () => void
+}
+/**
+ * 角色IP风险监控
+ * @returns 
+ */
+const RoleChatDetails: React.FC<RoleChatDetailsProps> = ({ roleId, dt, visible, onClose }) => {
+
+
+    /****************************************/
+    const [queryForm, setQueryForm] = useState<GetRoleChatDetailsListApiProps>({
+        pageNum: 1,
+        pageSize: 30,
+        startDate: dt,
+        endDate: dt,
+    })
+    const getRoleChatDetailsList = useAjax((params) => getRoleChatDetailsListApi(params))
+    /****************************************/
+
+    useEffect(() => {
+        getRoleChatDetailsList.run({ ...queryForm, roleId })
+    }, [queryForm, roleId])
+
+    return <Modal
+        title={<strong>角色聊天详情</strong>}
+        visible={visible}
+        footer={null}
+        onCancel={onClose}
+        width={1000}
+        bodyStyle={{ padding: 0 }}
+    >
+        <TablePro
+            leftChild={<QueryForm
+                initialValues={{ createRoleDay: [moment(dt), moment(dt)] }}
+                isCreateRoleDay={{ placeholder: ['日期开始', '日期结束'] }}
+                onChange={(data: any) => {
+                    console.log(data)
+                    const { createRoleDay, ...params } = data
+                    let newQueryForm = JSON.parse(JSON.stringify(queryForm))
+                    newQueryForm.pageNum = 1
+                    if (createRoleDay && createRoleDay?.length === 2) {
+                        newQueryForm['startDate'] = moment(createRoleDay[0]).format('YYYY-MM-DD')
+                        newQueryForm['endDate'] = moment(createRoleDay[1]).format('YYYY-MM-DD')
+                    } else {
+                        delete newQueryForm['startDate']
+                        delete newQueryForm['endDate']
+                    }
+                    setQueryForm({ ...newQueryForm, ...params })
+                }}
+            />}
+            config={columns13()}
+            configName={'角色聊天详情列表'}
+            fixed={{ left: 2, right: 1 }}
+            scroll={{ x: 1000, y: 620 }}
+            loading={getRoleChatDetailsList.loading}
+            ajax={getRoleChatDetailsList}
+            page={getRoleChatDetailsList?.data?.current || 1}
+            pageSize={getRoleChatDetailsList?.data?.size || 20}
+            total={getRoleChatDetailsList?.data?.total || 0}
+            dataSource={getRoleChatDetailsList?.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['sortType'] = sortData?.order === 'ascend' ? 'asc' : 'desc'
+                    newQueryForm['sortFiled'] = sortData?.field
+                } else {
+                    delete newQueryForm['sortType']
+                    delete newQueryForm['sortFiled']
+                }
+                newQueryForm.pageNum = current || newQueryForm.pageNum
+                newQueryForm.pageSize = pageSize || newQueryForm.pageSize
+                setQueryForm({ ...newQueryForm })
+            }}
+        />
+    </Modal>
+}
+
+export default RoleChatDetails

+ 95 - 0
src/pages/gsData/roleChatNum/index.tsx

@@ -0,0 +1,95 @@
+import QueryForm from "@/components/QueryForm"
+import { useAjax } from "@/Hook/useAjax"
+import TablePro from "@/pages/gameDataStatistics/components/TablePro"
+import { getRoleChatListApi, GetRoleChatListProps } from "@/services/gsData"
+import React, { useEffect, useState } from "react"
+import moment from "moment"
+import columns12 from "./tableConfig"
+import Details from "./details"
+
+/**
+ * 角色IP风险监控
+ * @returns 
+ */
+const RoleChatNum: React.FC = () => {
+
+
+    /****************************************/
+    const [queryForm, setQueryForm] = useState<GetRoleChatListProps>({
+        pageNum: 1,
+        pageSize: 30
+    })
+    const [detaisData, setDetailsData] = useState<{ visible: boolean, roleId: any, dt: any }>({ visible: false, roleId: undefined, dt: undefined })
+    const getRoleChatList = useAjax((params) => getRoleChatListApi(params))
+    /****************************************/
+
+    useEffect(() => {
+        getRoleChatList.run(queryForm)
+    }, [queryForm])
+
+    const detailsHandle = (data: any) => {
+        setDetailsData({ visible: true, roleId: data.roleId, dt: data.dt })
+    }
+
+    return <div>
+        <TablePro
+            leftChild={<QueryForm
+                isServerId
+                isCreateRoleDay={{placeholder: ['日期开始', '日期结束']}}
+                isGameRoleName
+                isGameRoleId
+                isSuperParentGameId
+                isCountry
+                onChange={(data: any) => {
+                    console.log(data)
+                    const { superParentGameId, createRoleDay, serverIds, ...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')
+                        newQueryForm['endDate'] = moment(createRoleDay[1]).format('YYYY-MM-DD')
+                    } else {
+                        delete newQueryForm['startDate']
+                        delete newQueryForm['endDate']
+                    }
+                    setQueryForm({ ...newQueryForm, ...params })
+                }}
+            />}
+            config={columns12(detailsHandle)}
+            configName={'角色日维度的聊天数量统计列表'}
+            fixed={{ left: 2, right: 1 }}
+            scroll={{ x: 1000, y: 620 }}
+            title='角色日维度的聊天数量统计列表'
+            loading={getRoleChatList.loading}
+            ajax={getRoleChatList}
+            page={getRoleChatList?.data?.current || 1}
+            pageSize={getRoleChatList?.data?.size || 20}
+            total={getRoleChatList?.data?.total || 0}
+            dataSource={getRoleChatList?.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['sortType'] = sortData?.order === 'ascend' ? 'asc' : 'desc'
+                    newQueryForm['sortFiled'] = sortData?.field
+                } else {
+                    delete newQueryForm['sortType']
+                    delete newQueryForm['sortFiled']
+                }
+                newQueryForm.pageNum = current || newQueryForm.pageNum
+                newQueryForm.pageSize = pageSize || newQueryForm.pageSize
+                setQueryForm({ ...newQueryForm })
+            }}
+        />
+
+        {/* 角色聊天详情 */}
+        {detaisData.visible && <Details
+            {...detaisData}
+            onClose={() => setDetailsData({ ...detaisData, visible: false })}
+        />}
+    </div>
+}
+
+export default RoleChatNum

+ 63 - 0
src/pages/gsData/roleChatNum/tableConfig.tsx

@@ -0,0 +1,63 @@
+import WidthEllipsis from "@/components/widthEllipsis"
+import { Statistic } from "antd"
+import React from "react"
+
+function columns12(detailsHandle: (data: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
+
+    return [
+        {
+            label: '基本信息',
+            data: [
+                {
+                    title: '角色名称', dataIndex: 'roleName', label: '基本信息', align: 'center', width: 85, default: 1,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '角色ID', dataIndex: 'roleId', label: '基本信息', align: 'center', width: 85, default: 2,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '日期', dataIndex: 'dt', label: '基本信息', align: 'center', width: 125, default: 3, sorter: true, 
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '游戏名称', dataIndex: 'superGameName', label: '基本信息', align: 'center', width: 85, default: 4,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '游戏ID', dataIndex: 'superGameId', label: '基本信息', align: 'center', width: 85, default: 5,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '区服名称', dataIndex: 'serverName', label: '基本信息', align: 'center', width: 80, default: 6,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '区服ID', dataIndex: 'serverId', label: '基本信息', align: 'center', width: 80, default: 7,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '公会名称', dataIndex: 'country', label: '基本信息', align: 'center', width: 90, default: 8,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '角色聊天总数', dataIndex: 'roleChatCount', label: '基本信息', align: 'center', width: 60, sorter: true, default: 9,
+                    render: (a: string) => <Statistic value={a || 0} />
+                },
+                {
+                    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>
+                    }
+                }
+
+            ]
+        }
+    ]
+}
+
+export default columns12

+ 51 - 0
src/pages/gsData/roleChatNum/tableConfigDetails.tsx

@@ -0,0 +1,51 @@
+import WidthEllipsis from "@/components/widthEllipsis"
+import React from "react"
+
+function columns13(): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
+
+    return [
+        {
+            label: '基本信息',
+            data: [
+                {
+                    title: '角色名称', dataIndex: 'roleName', label: '基本信息', align: 'center', width: 85, default: 1,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '角色ID', dataIndex: 'roleId', label: '基本信息', align: 'center', width: 85, default: 2,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '游戏名称', dataIndex: 'superGameName', label: '基本信息', align: 'center', width: 85, default: 3,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '游戏ID', dataIndex: 'superGameId', label: '基本信息', align: 'center', width: 85, default: 4,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '区服名称', dataIndex: 'serverName', label: '基本信息', align: 'center', width: 80, default: 5,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '区服ID', dataIndex: 'serverId', label: '基本信息', align: 'center', width: 80, default: 6,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '公会名称', dataIndex: 'country', label: '基本信息', align: 'center', width: 90, default: 7,
+                    render: (a: string) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '聊天日期', dataIndex: 'chatTime', label: '基本信息', align: 'center', width: 125, default: 8,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                },
+                {
+                    title: '聊天内容', dataIndex: 'content', label: '基本信息', width: 300, default: 9,
+                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                }
+            ]
+        }
+    ]
+}
+
+export default columns13

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

@@ -330,4 +330,42 @@ export async function getSuspectedRoleDetailListApi(data: { roleId: string }) {
         method: 'POST',
         data
     });
+}
+
+export interface GetRoleChatListProps extends Paging, SortProps {
+    roleId?: string
+    roleName?: string
+    superGameId?: number
+    serverId?: number
+    country?: string
+    startDate?: string
+    endDate?: string
+}
+/**
+ * 角色日维度的聊天数量统计列表
+ * @param data 
+ * @returns 
+ */
+export async function getRoleChatListApi(data: GetRoleChatListProps) {
+    return request(api + `/gameData/role/chatListOfPage`, {
+        method: 'POST',
+        data
+    });
+}
+
+export interface GetRoleChatDetailsListApiProps extends Paging, SortProps {
+    roleId?: string
+    startDate?: string
+    endDate?: string
+}
+/**
+ * 聊天详情
+ * @param data 
+ * @returns 
+ */
+export async function getRoleChatDetailsListApi(data: GetRoleChatDetailsListApiProps) {
+    return request(api + `/gameData/role/chatDetailListOfPage`, {
+        method: 'POST',
+        data
+    });
 }