wjx преди 1 година
родител
ревизия
4577fbcda1

+ 4 - 2
src/components/QueryForm/index.tsx

@@ -81,7 +81,9 @@ interface Props {
     /** 是否开启 不同排行榜选择 搜索 */
     isSelectRanking?: boolean
     /** 是否开启 消耗日期 搜索 */
-    isConsumeDay?: boolean
+    isConsumeDay?: {
+        ranges?: any
+    }
     /** 是否开启 充值日期 搜索 */
     rechargeDay?: {
         ranges?: any
@@ -643,7 +645,7 @@ const QueryForm: React.FC<Props> = (props) => {
 
             {/* 消耗日期 搜索 */}
             {isConsumeDay && <Col><Form.Item name='consumeDay'>
-                <DatePicker.RangePicker placeholder={['消耗开始日期', '消耗结束日期']} />
+                <DatePicker.RangePicker placeholder={['消耗开始日期', '消耗结束日期']} {...isConsumeDay}/>
             </Form.Item></Col>}
 
             {/* 消耗日期 搜索 */}

+ 51 - 0
src/components/rechargeTrend/index.less

@@ -0,0 +1,51 @@
+.column {
+    display: flex;
+    flex-flow: column;
+    align-content: center;
+
+    >span {
+        text-align: left;
+
+        span {
+            width: 50%;
+            text-align: right;
+            display: inline-block;
+        }
+    }
+}
+
+.sevenDay .ant-table.ant-table-small .ant-table-tbody .ant-table-wrapper:only-child .ant-table {
+    margin: -8px -8px -8px -6px;
+}
+
+.sumTable {
+    .ant-table-tbody>tr>td {
+        padding: 0 !important;
+    }
+}
+
+.my_progrss {
+    width: 100%;
+    position: relative;
+
+    .ant-progress-bg {
+        height: 15px !important;
+    }
+
+    .ant-progress-inner {
+        box-shadow: 0 0 0 1px #c2c2c2
+    }
+
+    >.content {
+        position: absolute;
+        top: 50%;
+        left: 50%;
+        transform: translate(-50%, -50%);
+        z-index: 10;
+        color: #000;
+    }
+}
+
+.zdred {
+    background: rgb(255, 233, 227);
+}

+ 96 - 21
src/components/rechargeTrend/index.tsx

@@ -1,44 +1,119 @@
 import { useAjax } from "@/Hook/useAjax"
 import { getPromoteAgainListApi } from "@/services/gameData/extensionData"
-import { getGameDataAgainListApi } from "@/services/gameData/game"
-import { Button, Drawer } from "antd"
-import React, { useEffect, useState } from "react"
-
+import { Col, Drawer, Empty, Progress, Row, Spin, Statistic, Table } from "antd"
+import React, { useEffect, useMemo } from "react"
+import style from './table.less'
+import './index.less'
+import moment from "moment"
+import { FallOutlined, RiseOutlined } from "@ant-design/icons"
+import { useAddTime } from "@/utils/utils"
 
 interface Props {
-    // 'EXTEN' 推广每日数据付费趋势  'GAME' 游戏每日付费趋势
-    type: 'EXTEN' | 'GAME'
-    id?: number,
-    gameName?: string
+    accountId?: number,
+    agentId?: number,
+    beginDate?: string
+    sourceSystem?: string
     visible?: boolean
     onClose?: () => void
 }
 /**
- * 复充趋势
+ * 推广 复充趋势
  * @returns 
  */
-const RechargeTrend: React.FC<Props> = ({ visible, onClose, type, id, gameName }) => {
+const RechargeTrend: React.FC<Props> = ({ visible, onClose, accountId, agentId, beginDate, sourceSystem }) => {
 
     /************************************* */
-    const [queryForm, setQueryForm] = useState<any>()
 
     const getPromoteAgainList = useAjax((params) => getPromoteAgainListApi(params)) // 推广
-    const getGameDataAgainList = useAjax((params) => getGameDataAgainListApi(params)) // 游戏
     /************************************* */
 
     useEffect(() => {
-        if (visible) {
-            if (type === 'EXTEN') {
-                getPromoteAgainList.run({ accountId: id })
-            } else if (type === 'GAME') {
-                getGameDataAgainList.run({ gameId: id, gameName, ...queryForm })
+        getPromoteAgainList.run({ accountId, agentId, beginDate, sourceSystem })
+    }, [accountId, visible, agentId, beginDate, sourceSystem])
+
+    const TableTrend = useMemo(() => {
+        if (getPromoteAgainList?.data && JSON.stringify(getPromoteAgainList?.data) !== '{}') {
+            let col: any[] = []
+            let data: any[] = [{ count: '1', id: 1 }, { count: '2', id: 2 }, { count: '3', id: 3 }, { count: '4', id: 4 }, { count: '5', id: 5 }, { count: '5-10', id: 6 }, { count: '10-20', id: 7 }, { count: '20次以上', id: 8 }]
+            let date: string = ''
+            Object.keys(getPromoteAgainList?.data).forEach((key, index) => {
+                date = key
+                col.push({
+                    title: key,
+                    dataIndex: 'd' + (index + 1),
+                    key: 'd' + (index + 1),
+                    align: 'center',
+                    width: 120,
+                    render: (value1: any, value2: any) => {
+                        return <Row gutter={[10, 0]} key={index} className={`${style.mytable_body_div} ${style.show}`} >
+                            <Col style={{ color: '#3f51b5', fontWeight: 600 }} span={24} ><span>原:</span>
+                                <Statistic value={value1?.original || 0} valueStyle={{ color: '#3f51b5', fontSize: 12, fontWeight: 600 }} />
+                            </Col>
+                            <Col style={{ color: '#ff9800', fontWeight: 600 }} span={24} ><span>现:</span>
+                                <Statistic value={value1?.present || 0} valueStyle={{ color: '#ff9800', fontSize: 12, fontWeight: 600 }} />
+                            </Col>
+                            <Col style={{ color: 'red', fontWeight: 600 }} span={24} ><span>增:</span>
+                                <Statistic value={value1?.increase || 0} valueStyle={{ color: 'red', fontSize: 12, fontWeight: 600 }} prefix={<RiseOutlined />} />
+                            </Col>
+                            <Col style={{ color: 'green', fontWeight: 600 }} span={24} ><span>移:</span>
+                                <Statistic value={value1?.decrease || 0} valueStyle={{ color: 'green', fontSize: 12, fontWeight: 600 }} prefix={<FallOutlined />} />
+                            </Col>
+                            <Col style={{ color: '#000', fontWeight: 600 }} span={24} >
+                                <div className={style.bitRate}>
+                                    <span>比:</span>
+                                    <div className="my_progrss">
+                                        <span className='content'>{(value1?.rate * 100)?.toFixed(2) || '0.00'}%</span>
+                                        <Progress
+                                            strokeColor="#82d0fa"
+                                            showInfo={false}
+                                            style={{ height: 25 }}
+                                            percent={(value1?.rate * 100) || 0}
+                                        />
+                                    </div>
+                                </div>
+                            </Col>
+                        </Row>
+                    }
+                })
+                getPromoteAgainList?.data[key]?.forEach((item: any, eq: number) => {
+                    data[eq][`d${index + 1}`] = item
+                })
+            })
+            let nullCol: any[] = []
+            if (col.length < 30) {
+                Array(30 - col.length).fill('').forEach((item, index) => {
+                    nullCol.push({
+                        title: useAddTime(index, 'days', 'YYYY-MM-DD', date || moment().format('YYYY-MM-DD')),
+                        dataIndex: 'd' + (index + 1),
+                        key: 'd' + (index + 1),
+                        align: 'center',
+                        width: 120,
+                        className: 'zdred',
+                        render: () => {
+                            return '--'
+                        }
+                    })
+                })
             }
+            const columns: any = [
+                {
+                    title: '充值次数',
+                    dataIndex: 'count',
+                    key: 'count',
+                    width: 50,
+                    align: 'center'
+                },
+                ...col,
+                ...nullCol
+            ]
+            return <Table columns={columns} scroll={{ x: 1000, y: 700 }} className="sumTable" rowKey={'id'} size="small" dataSource={data} bordered pagination={false} />
+        } else {
+            return <Empty />
         }
-    }, [id, type, visible, queryForm])
-
-    return <Drawer title={`复充趋势`} visible={visible} onClose={() => onClose?.()} width={'90%'}>
+    }, [getPromoteAgainList?.data])
 
-        1123123
+    return <Drawer title={`${accountId} 推广每日数据复充趋势`} visible={visible} onClose={() => onClose?.()} width={'90%'}>
+        <Spin spinning={getPromoteAgainList.loading} >{TableTrend}</Spin>
     </Drawer>
 }
 

+ 121 - 0
src/components/rechargeTrend/index_game.tsx

@@ -0,0 +1,121 @@
+import { useAjax } from "@/Hook/useAjax"
+import { Col, Drawer, Empty, Progress, Row, Spin, Statistic, Table } from "antd"
+import React, { useEffect, useMemo } from "react"
+import style from './table.less'
+import './index.less'
+import moment from "moment"
+import { FallOutlined, RiseOutlined } from "@ant-design/icons"
+import { useAddTime } from "@/utils/utils"
+import { getGameDataAgainListApi } from "@/services/gameData/game"
+
+interface Props {
+    gameId?: number
+    gameName?: string
+    beginDate?: string
+    sourceSystem?: string
+    visible?: boolean
+    onClose?: () => void
+}
+/**
+ * 游戏 复充趋势
+ * @returns 
+ */
+const RechargeTrendGame: React.FC<Props> = ({ visible, onClose, gameName, gameId, beginDate, sourceSystem }) => {
+
+    /************************************* */
+
+    const getGameDataAgainList = useAjax((params) => getGameDataAgainListApi(params)) // 游戏
+    /************************************* */
+
+    useEffect(() => {
+        getGameDataAgainList.run({ gameId, gameName, beginDate, sourceSystem })
+    }, [gameId, visible, gameName, beginDate, sourceSystem])
+
+    const TableTrend = useMemo(() => {
+        if (getGameDataAgainList?.data && JSON.stringify(getGameDataAgainList?.data) !== '{}') {
+            let col: any[] = []
+            let data: any[] = [{ count: '1', id: 1 }, { count: '2', id: 2 }, { count: '3', id: 3 }, { count: '4', id: 4 }, { count: '5', id: 5 }, { count: '5-10', id: 6 }, { count: '10-20', id: 7 }, { count: '20次以上', id: 8 }]
+            let date: string = ''
+            Object.keys(getGameDataAgainList?.data).forEach((key, index) => {
+                date = key
+                col.push({
+                    title: key,
+                    dataIndex: 'd' + (index + 1),
+                    key: 'd' + (index + 1),
+                    align: 'center',
+                    width: 120,
+                    render: (value1: any, value2: any) => {
+                        return <Row gutter={[10, 0]} key={index} className={`${style.mytable_body_div} ${style.show}`} >
+                            <Col style={{ color: '#3f51b5', fontWeight: 600 }} span={24} ><span>原:</span>
+                                <Statistic value={value1?.original || 0} valueStyle={{ color: '#3f51b5', fontSize: 12, fontWeight: 600 }} />
+                            </Col>
+                            <Col style={{ color: '#ff9800', fontWeight: 600 }} span={24} ><span>现:</span>
+                                <Statistic value={value1?.present || 0} valueStyle={{ color: '#ff9800', fontSize: 12, fontWeight: 600 }} />
+                            </Col>
+                            <Col style={{ color: 'red', fontWeight: 600 }} span={24} ><span>增:</span>
+                                <Statistic value={value1?.increase || 0} valueStyle={{ color: 'red', fontSize: 12, fontWeight: 600 }} prefix={<RiseOutlined />} />
+                            </Col>
+                            <Col style={{ color: 'green', fontWeight: 600 }} span={24} ><span>移:</span>
+                                <Statistic value={value1?.decrease || 0} valueStyle={{ color: 'green', fontSize: 12, fontWeight: 600 }} prefix={<FallOutlined />} />
+                            </Col>
+                            <Col style={{ color: '#000', fontWeight: 600 }} span={24} >
+                                <div className={style.bitRate}>
+                                    <span>比:</span>
+                                    <div className="my_progrss">
+                                        <span className='content'>{(value1?.rate * 100)?.toFixed(2) || '0.00'}%</span>
+                                        <Progress
+                                            strokeColor="#82d0fa"
+                                            showInfo={false}
+                                            style={{ height: 25 }}
+                                            percent={(value1?.rate * 100) || 0}
+                                        />
+                                    </div>
+                                </div>
+                            </Col>
+                        </Row>
+                    }
+                })
+                getGameDataAgainList?.data[key]?.forEach((item: any, eq: number) => {
+                    data[eq][`d${index + 1}`] = item
+                })
+            })
+            let nullCol: any[] = []
+            if (col.length < 30) {
+                Array(30 - col.length).fill('').forEach((item, index) => {
+                    nullCol.push({
+                        title: useAddTime(index, 'days', 'YYYY-MM-DD', date || moment().format('YYYY-MM-DD')),
+                        dataIndex: 'd' + (index + 1),
+                        key: 'd' + (index + 1),
+                        align: 'center',
+                        width: 120,
+                        className: 'zdred',
+                        render: () => {
+                            return '--'
+                        }
+                    })
+                })
+            }
+            const columns: any = [
+                {
+                    title: '充值次数',
+                    dataIndex: 'count',
+                    key: 'count',
+                    width: 50,
+                    align: 'center'
+                },
+                ...col,
+                ...nullCol
+            ]
+            console.log('columns--->', columns, data)
+            return <Table columns={columns} scroll={{ x: 1000, y: 700 }} className="sumTable" rowKey={'id'} size="small" dataSource={data} bordered pagination={false} />
+        } else {
+            return <Empty />
+        }
+    }, [getGameDataAgainList?.data])
+
+    return <Drawer title={`${gameName} 游戏每日数据复充趋势`} visible={visible} onClose={() => onClose?.()} width={'90%'}>
+        <Spin spinning={getGameDataAgainList.loading} >{TableTrend}</Spin>
+    </Drawer>
+}
+
+export default React.memo(RechargeTrendGame)

+ 37 - 0
src/components/rechargeTrend/table.less

@@ -0,0 +1,37 @@
+.mytable_body_div {
+    display: flex;
+    justify-content: space-between;
+    flex-flow: row wrap;
+    padding: 5px;
+    // margin-right: 10px;
+    box-sizing: border-box;
+    margin: 0 !important;
+    position: relative;
+
+    >div {
+        display: flex;
+        justify-content: start;
+        font-size: 12px;
+    }
+
+    >.red {
+        background: rgb(255, 233, 227);
+        position: absolute;
+        top: 0;
+        left: 0;
+        bottom: 0;
+        right: 0;
+        z-index: 20;
+    }
+}
+
+.show {
+    // background: #fff;
+}
+
+.bitRate {
+    width: 100%;
+    display: flex;
+    justify-content: flex-start;
+    align-items: center;
+}

+ 9 - 6
src/pages/gameDataStatistics/components/TableData/index.tsx

@@ -96,16 +96,19 @@ function TableData(props: Prosp) {
                 setoldSelectData(() => selectData.selectData)
                 setoldFixed(() => selectData.fixed)
                 if (newArr.length > 0) {
-                    setNewColumns(newArr.map((item: any, index: number) => {
-                        item = newConfig.find((c: { dataIndex: any }) => c.dataIndex === item.dataIndex)
+                    setNewColumns(newArr.map((newItem: any, index: number) => {
+                        let oldItem = newConfig.find((c: { dataIndex: any }) => c.dataIndex === newItem.dataIndex)
+                        if (newItem?.width !== oldItem?.width) {
+                            oldItem.width = newItem?.width
+                        }
                         if (index < Number(fixedData.left)) {//设置左悬浮
-                            item['fixed'] = 'left'
+                            oldItem['fixed'] = 'left'
                         } else if (index > (newArr?.length - Number(fixedData.right) - 1)) {//设置右悬浮
-                            item['fixed'] = 'right'
+                            oldItem['fixed'] = 'right'
                         } else {
-                            item['fixed'] = false
+                            oldItem['fixed'] = false
                         }
-                        let { label, default: a, ...ite } = item
+                        let { label, default: a, ...ite } = oldItem
                         return ite
                     }))
                 }

+ 5 - 5
src/pages/gameDataStatistics/extensionData/everyday/index.tsx

@@ -14,7 +14,7 @@ const Everyday: React.FC = () => {
     const [queryForm, setQueryForm] = useState<EverydayListType>({ pageNum: 1, pageSize: 20, beginDay: moment().format('YYYY-MM-DD'), endDay: moment().format('YYYY-MM-DD'), sourceSystem: 'ZX_ONE' })
     const [gameType, setGameType] = useState<any>({})
     const [totalData, setTotalData] = useState<any[]>([])
-    const [rtConfig, setRtConfig] = useState<{ id?: number, visible: boolean }>({ visible: false })
+    const [rtConfig, setRtConfig] = useState<{ accountId?: number, visible: boolean, agentId?: number, beginDate?: string, sourceSystem?: string }>({ visible: false })
 
     const getPromoteDayList = useAjax((params) => getPromoteDayListApi(params))
     const getPromoteDayTotal = useAjax((params) => getPromoteDayTotalApi(params))
@@ -42,7 +42,7 @@ const Everyday: React.FC = () => {
 
     const rechargeTrendHandle = (data: any) => {
         if (data?.accountId) {
-            setRtConfig({ visible: true, id: data?.accountId })
+            setRtConfig({ visible: true, accountId: data?.accountId, agentId: data.agentId, beginDate: data.dt, sourceSystem: data.sourceSystem })
         }
     }
 
@@ -63,7 +63,7 @@ const Everyday: React.FC = () => {
                 isSource
                 isAccountId
                 isAgentId
-                isConsumeDay
+                isConsumeDay={{}}
                 isBGGameClassify
                 // isCpName
                 // isGameName
@@ -75,7 +75,7 @@ const Everyday: React.FC = () => {
             totalData={totalData}
             scroll={{ x: 1000, y: 600 }}
             ajax={getPromoteDayList}
-            fixed={{ left: 5, right: 0 }}
+            fixed={{ left: 5, right: 1 }}
             dataSource={getPromoteDayList?.data?.records}
             total={getPromoteDayList?.data?.total}
             page={queryForm.pageNum}
@@ -100,7 +100,7 @@ const Everyday: React.FC = () => {
             config={columns12(gameType, rechargeTrendHandle)}
             configName={'推广每日数据'}
         />
-        {rtConfig.visible && <RechargeTrend type="EXTEN" {...rtConfig} onClose={() => setRtConfig({ visible: false })} />}
+        {rtConfig.visible && <RechargeTrend {...rtConfig} onClose={() => setRtConfig({ visible: false })} />}
     </div>
 }
 

+ 11 - 11
src/pages/gameDataStatistics/extensionData/everyday/tableConfig.tsx

@@ -441,17 +441,17 @@ function columns12(gameType: any, rechargeTrendHandle: (data: any) => void): { l
                 },
             }]
         },
-        // {
-        //     label: '操作',
-        //     data: [
-        //         {
-        //             default: 28,
-        //             title: '操作', dataIndex: 'cz', label: '操作', align: 'center', width: 70, render: (a: string, b: any) => {
-        //                 return <a onClick={() => rechargeTrendHandle(b)}>复充趋势</a>
-        //             }
-        //         },
-        //     ]
-        // },
+        {
+            label: '操作',
+            data: [
+                {
+                    default: 28,
+                    title: '操作', dataIndex: 'cz', label: '操作', align: 'center', width: 70, render: (a: string, b: any) => {
+                        return <a onClick={() => rechargeTrendHandle(b)}>复充趋势</a>
+                    }
+                },
+            ]
+        },
     ]
 }
 

+ 1 - 1
src/pages/gameDataStatistics/extensionData/total/index.tsx

@@ -62,7 +62,7 @@ const Total: React.FC = () => {
                 isSource
                 isAccountId
                 isAgentId
-                isConsumeDay
+                isConsumeDay={{}}
                 isBGGameClassify
                 // isCpName
                 // isGameName

+ 5 - 5
src/pages/gameDataStatistics/gameData/everyday/index.tsx

@@ -5,7 +5,7 @@ import { GameDayProps, getGameDayListApi } from "@/services/gameData/game"
 import { useAjax } from "@/Hook/useAjax"
 import QueryForm from "@/components/QueryForm"
 import moment from "moment"
-import RechargeTrend from "@/components/rechargeTrend"
+import RechargeTrendGame from "@/components/rechargeTrend/index_game"
 
 /**
  * 游戏每日数据
@@ -21,7 +21,7 @@ const Everyday: React.FC = () => {
         sourceSystem: 'ZX_ONE'
     })
 
-    const [rtConfig, setRtConfig] = useState<{ id?: number, gameName?: string, visible: boolean }>({ visible: false })
+    const [rtConfig, setRtConfig] = useState<{ gameId?: number, gameName?: string, beginDate?: string, sourceSystem?: string, visible: boolean }>({ visible: false })
 
     const getGameDayList = useAjax((params) => getGameDayListApi(params))
     /*****************************/
@@ -31,7 +31,7 @@ const Everyday: React.FC = () => {
     }, [queryForm])
 
     const rechargeTrendHandle = (data: any) => {
-        setRtConfig({ visible: true, gameName: data?.gameName, id: data?.gameId })
+        setRtConfig({ visible: true, gameName: data?.gameName, gameId: data?.gameId, sourceSystem: data?.sourceSystem, beginDate: data.costDate })
     }
 
     return <div>
@@ -66,7 +66,7 @@ const Everyday: React.FC = () => {
             />}
             scroll={{ x: 1000, y: 600 }}
             ajax={getGameDayList}
-            fixed={{ left: 5, right: 0 }}
+            fixed={{ left: 5, right: 1 }}
             dataSource={getGameDayList?.data?.records?.map((item: any, index: number) => ({ ...item, id: Number(queryForm.pageNum.toString() + index.toString()) }))}
             total={getGameDayList?.data?.total}
             page={queryForm.pageNum}
@@ -90,7 +90,7 @@ const Everyday: React.FC = () => {
             config={columns12(rechargeTrendHandle)}
             configName={'游戏每日数据'}
         />
-        {rtConfig.visible && <RechargeTrend type="GAME" {...rtConfig} onClose={() => setRtConfig({ visible: false })} />}
+        {rtConfig.visible && <RechargeTrendGame {...rtConfig} onClose={() => setRtConfig({ visible: false })} />}
     </div>
 }
 

+ 16 - 16
src/pages/gameDataStatistics/gameData/everyday/tableConfig.tsx

@@ -1008,22 +1008,22 @@ function columns12(rechargeTrendHandle: (data: any) => void): { label: string, f
                 },
             }]
         },
-        // {
-        //     label: '操作',
-        //     data: [
-        //         {
-        //             title: '操作',
-        //             dataIndex: 'cz',
-        //             label: '操作',
-        //             default: 55,
-        //             align: 'center',
-        //             width: 75,
-        //             render: (a: number, b: any) => {
-        //                 return <a onClick={() => rechargeTrendHandle(b)}>复充趋势</a>
-        //             },
-        //         }
-        //     ]
-        // }
+        {
+            label: '操作',
+            data: [
+                {
+                    title: '操作',
+                    dataIndex: 'cz',
+                    label: '操作',
+                    default: 55,
+                    align: 'center',
+                    width: 75,
+                    render: (a: number, b: any) => {
+                        return <a onClick={() => rechargeTrendHandle(b)}>复充趋势</a>
+                    },
+                }
+            ]
+        }
     ]
 }
 

+ 0 - 1
src/pages/gameDataStatistics/order/index.tsx

@@ -1,7 +1,6 @@
 import QueryForm from "@/components/QueryForm"
 import { useAjax } from "@/Hook/useAjax"
 import { getOrderListApi, OrderListType } from "@/services/gameData/order"
-import { Statistic, Table } from "antd"
 import React, { useEffect, useState } from "react"
 import TableData from "../components/TableData"
 import columns12 from "./tableConfig"

+ 5 - 5
src/pages/gameDataStatistics/rankingList/account/index.tsx

@@ -27,12 +27,12 @@ const Account: React.FC = () => {
                 initialValues={{ sourceSystem: 'ZX_ONE' }}
                 onChange={(data: any) => {
                     console.log(data)
-                    const { rechargeDay, ...params } = data
+                    const { costBeginDay, costEndDay, ...params } = data
                     let newQueryForm = JSON.parse(JSON.stringify(queryForm))
                     newQueryForm.pageNum = 1
-                    if (rechargeDay && rechargeDay?.length === 2) {
-                        newQueryForm.beginDay = moment(rechargeDay[0]).format('YYYY-MM-DD')
-                        newQueryForm.endDay = moment(rechargeDay[1]).format('YYYY-MM-DD')
+                    if (costBeginDay && costEndDay) {
+                        newQueryForm.beginDay = costBeginDay
+                        newQueryForm.endDay = costEndDay
                     } else {
                         delete newQueryForm.beginDay
                         delete newQueryForm.endDay
@@ -40,7 +40,7 @@ const Account: React.FC = () => {
                     setQueryForm({ ...newQueryForm, ...params })
                 }}
                 isSource
-                rechargeDay={{ ranges: rangePresets }}
+                isConsumeDay={{ ranges: rangePresets }}
                 isSysUserId
                 isType
                 isAccountId

+ 13 - 12
src/pages/gameDataStatistics/rankingList/gamer/tableConfig.tsx

@@ -10,19 +10,20 @@ function columns12() {
             data: [
                 { title: '玩家ID', dataIndex: 'playerId', label: '玩家充值排行榜', align: 'center', width: 70, default: 1 },
                 { title: '玩家账号', dataIndex: 'playerAccountId', label: '玩家充值排行榜', align: 'center', width: 120, default: 2, render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />) },
-                { title: '注册渠道', dataIndex: 'regAgentId', label: '玩家充值排行榜', align: 'center', width: 80, default: 3 },
-                { title: '注册时间', dataIndex: 'regUserTime', label: '玩家充值排行榜', align: 'center', width: 140, default: 4, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
-                { title: '注册游戏', dataIndex: 'regGameName', label: '玩家充值排行榜', align: 'center', width: 70, default: 5, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
-                { title: '玩家操作系统', dataIndex: 'playerOs', label: '玩家充值排行榜', align: 'center', width: 70, default: 6 },
-                { title: '当天充值金额', dataIndex: 'todayTotalAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 7, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '首充金额', dataIndex: 'firstAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 8, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '最近充值金额', dataIndex: 'lastAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 9, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '累计充值金额', dataIndex: 'totalAmount', label: '玩家充值排行榜', align: 'center', width: 100, default: 10, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '平均单价', dataIndex: 'avgAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 11, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '累计充值次数', dataIndex: 'totalAmountCount', label: '玩家充值排行榜', align: 'center', width: 70, default: 12, sorter: true },
+                { title: '注册渠道', dataIndex: 'regAgentName', label: '玩家充值排行榜', align: 'center', width: 80, default: 3, render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />) },
+                { title: '注册渠道ID', dataIndex: 'regAgentId', label: '玩家充值排行榜', align: 'center', width: 80, default: 4 },
+                { title: '注册时间', dataIndex: 'regUserTime', label: '玩家充值排行榜', align: 'center', width: 140, default: 5, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
+                { title: '注册游戏', dataIndex: 'regGameName', label: '玩家充值排行榜', align: 'center', width: 70, default: 6, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
+                { title: '玩家操作系统', dataIndex: 'playerOs', label: '玩家充值排行榜', align: 'center', width: 70, default: 7 },
+                { title: '当天充值金额', dataIndex: 'todayTotalAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 8, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
+                { title: '首充金额', dataIndex: 'firstAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 9, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
+                { title: '最近充值金额', dataIndex: 'lastAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 10, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
+                { title: '累计充值金额', dataIndex: 'totalAmount', label: '玩家充值排行榜', align: 'center', width: 100, default: 11, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
+                { title: '平均单价', dataIndex: 'avgAmount', label: '玩家充值排行榜', align: 'center', width: 70, default: 12, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
+                { title: '累计充值次数', dataIndex: 'totalAmountCount', label: '玩家充值排行榜', align: 'center', width: 70, default: 13, sorter: true },
                 // { title: '玩家等级标签', dataIndex: '13', label: '玩家充值排行榜', align: 'center', width: 70, default: 14 },
-                { title: '最近充值游戏', dataIndex: 'lastAmountGameName', label: '玩家充值排行榜', align: 'center', width: 70, default: 13, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
-                { title: '最近充值时间', dataIndex: 'lastAmountTime', label: '玩家充值排行榜', align: 'center', width: 140, default: 14, render: (a: string, b: any) => (<WidthEllipsis value={a} />) }
+                { title: '最近充值游戏', dataIndex: 'lastAmountGameName', label: '玩家充值排行榜', align: 'center', width: 70, default: 14, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
+                { title: '最近充值时间', dataIndex: 'lastAmountTime', label: '玩家充值排行榜', align: 'center', width: 140, default: 15, render: (a: string, b: any) => (<WidthEllipsis value={a} />) }
             ]
         },
     ]

+ 8 - 0
src/utils/utils.ts

@@ -1,5 +1,6 @@
 import { message } from 'antd';
 import { parse } from 'querystring';
+import moment from 'moment';
 
 /* eslint no-useless-escape:0 import/prefer-default-export:0 */
 const reg = /(((^https?:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+(?::\d+)?|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)$/;
@@ -90,4 +91,11 @@ export const copy = (str: string) => {
   document.execCommand("Copy")
   document.body.removeChild(element);
   message.success(`复制成功:${str}`)
+}
+
+type Type = "day" | "week" | "month" | "year" | "years" | "y" | "months" | "M" | "weeks" | "w" | "days" | "d" | "hour" | "hours" | "h" | "minute"
+type Format = 'YYYY-MM-DD' | 'YYYY-MM-DD HH' | 'YYYY-MM-DD HH:mm' | 'YYYY-MM-DD HH:mm:ss'
+/**往后日期 */
+export function useAddTime(num: number, type: Type, format?: Format, date?: Date | string): string {
+  return moment(date || new Date()).add(num, type).format(format || 'YYYY-MM-DD')
 }