wjx преди 1 година
родител
ревизия
deded95ae8
променени са 30 файла, в които са добавени 1340 реда и са изтрити 317 реда
  1. 6 6
      config/proxy.ts
  2. 0 1
      src/Hook/useEcharts.tsx
  3. 7 7
      src/app.tsx
  4. 22 12
      src/components/QueryForm/const.tsx
  5. 55 9
      src/components/QueryForm/index.tsx
  6. 5 5
      src/components/RightContent/AvatarDropdown.tsx
  7. 1 1
      src/components/RightContent/index.tsx
  8. 1 1
      src/models/useOperating/useWxGroupList.ts
  9. 38 0
      src/pages/gameDataStatistics/adlist/monitor/const.ts
  10. 25 16
      src/pages/gameDataStatistics/adlist/monitor/index.tsx
  11. 384 101
      src/pages/gameDataStatistics/adlist/monitor/tableConfig.tsx
  12. 0 1
      src/pages/gameDataStatistics/allSurvey/index.less
  13. 37 15
      src/pages/gameDataStatistics/allSurvey/index.tsx
  14. 12 3
      src/pages/gameDataStatistics/allSurvey/lineC.tsx
  15. 4 19
      src/pages/gameDataStatistics/extensionData/everyday/index.tsx
  16. 85 12
      src/pages/gameDataStatistics/extensionData/everyday/tableConfig.tsx
  17. 3 2
      src/pages/gameDataStatistics/extensionData/total/index.tsx
  18. 17 17
      src/pages/gameDataStatistics/extensionData/total/tableConfig.tsx
  19. 4 2
      src/pages/gameDataStatistics/gameData/everyday/index.tsx
  20. 196 15
      src/pages/gameDataStatistics/gameData/everyday/tableConfig.tsx
  21. 204 20
      src/pages/gameDataStatistics/gameData/everyday/tableConfigBuy.tsx
  22. 196 15
      src/pages/gameDataStatistics/gameData/everyday/tableConfigNature.tsx
  23. 3 2
      src/pages/gameDataStatistics/gameData/h5Recharge/index.tsx
  24. 3 3
      src/pages/gameDataStatistics/gameData/total/index.tsx
  25. 3 2
      src/pages/gameDataStatistics/order/index.tsx
  26. 5 5
      src/pages/gameDataStatistics/rankingList/account/index.tsx
  27. 4 5
      src/pages/gameDataStatistics/rankingList/channel/index.tsx
  28. 4 4
      src/pages/gameDataStatistics/rankingList/game/index.tsx
  29. 4 4
      src/pages/gameDataStatistics/rankingList/gamer/index.tsx
  30. 12 12
      src/pages/user/login/index.tsx

+ 6 - 6
config/proxy.ts

@@ -10,20 +10,20 @@
  export default {
   dev: {
     '/api/': {
-      target: 'http://test.api.zanxiangwl.com',
-      // target: 'http://game.84game.cn',
+      // target: 'http://test.api.zanxiangwl.com',
+      target: 'http://game.84game.cn',
       changeOrigin: true,
       pathRewrite: { '/api': '' },
     },
     '/erpApi/': {
-      target: 'http://test.api.zanxiangwl.com',
-      // target: 'http://api.zanxiangwl.com',
+      // target: 'http://test.api.zanxiangwl.com',
+      target: 'http://api.zanxiangwl.com',
       changeOrigin: true,
       pathRewrite: { '/erpApi': '' },
     },
     '/gameApi/': {
-      target: 'http://test.api.zanxiangwl.com',//服务器
-      // target: 'https://game.84game.cn',//服务器
+      // target: 'http://test.api.zanxiangwl.com',//服务器
+      target: 'https://game.84game.cn',//服务器
       changeOrigin: true,
       pathRewrite: { '^/gameApi/': '' },
     },

+ 0 - 1
src/Hook/useEcharts.tsx

@@ -1,5 +1,4 @@
 import React, { useEffect, useRef, useState } from 'react'
-import * as echarts from 'echarts'
 import { EChartsOption, init, dispose, registerMap } from 'echarts'
 import { Empty } from 'antd'
 import { china } from '@/utils/dictionary'

+ 7 - 7
src/app.tsx

@@ -43,7 +43,7 @@ export async function getInitialState(): Promise<{
     onCollapse?: (onCollapse: boolean) => void
 }> {
     // 如果是登录页面,不执行
-    if (sessionStorage.getItem('Admin-Token')) {
+    if (localStorage.getItem('Admin-Token')) {
         //开始版本号对比
         versions()
         try {
@@ -138,7 +138,7 @@ export const layout = ({
             headrRouter(initialState, history)
             let { pathname, query } = history.location
             if (query?.t) {//带token直接进入对应页面
-                sessionStorage.setItem('Admin-Token', decodeURIComponent(query.t as any))
+                localStorage.setItem('Admin-Token', decodeURIComponent(query.t as any))
                 location.href = window.location.origin + '/#' + pathname
                 location.reload()
             } else if (!initialState?.currentUser?.name && history.location.pathname !== '/user/login') {
@@ -195,7 +195,7 @@ const errorHandler = (error: ResponseError) => {
 export const request: any = {
     errorHandler,
     timeout: 300000,
-    headers: { ['Authorization']: 'Bearer ' + sessionStorage.getItem('Admin-Token') },
+    headers: { ['Authorization']: 'Bearer ' + localStorage.getItem('Admin-Token') },
     errorConfig: {
         adaptor: (resData: any) => {
             if (resData.code === 500) {
@@ -206,7 +206,7 @@ export const request: any = {
                             const key = `open${Date.now()}`;
                             const btn = (
                                 <Button type="primary" onClick={() => {
-                                    sessionStorage.removeItem('Admin-Token')
+                                    localStorage.removeItem('Admin-Token')
                                     history.push('/user/login')
                                     notification.close(key)
                                     sessionStorage.removeItem('msg')
@@ -229,7 +229,7 @@ export const request: any = {
                                 key,
                                 style: { zIndex: 999999, right: '50%', top: '50%', transform: 'translate(50%, -50%)', position: 'fixed', transition: 'all 0s' },
                                 onClose: () => {
-                                    sessionStorage.removeItem('Admin-Token')
+                                    localStorage.removeItem('Admin-Token')
                                     history.push('/user/login')
                                     sessionStorage.removeItem('msg')
                                 }
@@ -237,7 +237,7 @@ export const request: any = {
                         }
                         return { ...resData }
                     } else {
-                        sessionStorage.removeItem('Admin-Token')
+                        localStorage.removeItem('Admin-Token')
                     }
                 }
                 if (!msg) {
@@ -253,7 +253,7 @@ export const request: any = {
             }
             if (resData.code === 310) {//权限错误
                 let msg = sessionStorage.getItem('msg')
-                sessionStorage.removeItem('Admin-Token')
+                localStorage.removeItem('Admin-Token')
                 history.push('/user/login')
                 if (!msg) {
                     sessionStorage.setItem('msg', 'true')

+ 22 - 12
src/components/QueryForm/const.tsx

@@ -2,19 +2,29 @@ import { Badge } from "antd";
 import moment from "moment";
 import React from "react";
 
-export const rangePresets: any = {
-    '今天排行': [moment(), moment()],
-    '昨天排行': [moment().subtract(1, 'd'), moment().subtract(1, 'd')],
-    '7日排行': [moment().subtract(7, 'd'), moment()],
-    '30日排行': [moment().subtract(30, 'd'), moment()]
-};
+// 排行默认时间
+export const getPresetsRanking = () => {
+    let date = {
+        '今天排行': [moment(), moment()],
+        '昨天排行': [moment().subtract(1, 'd'), moment().subtract(1, 'd')],
+        '7日排行': [moment().subtract(7, 'd'), moment()],
+        '30日排行': [moment().subtract(30, 'd'), moment()]
+    }
+    date['当月排行'] = [moment().startOf('month'), moment()]
+    return date
+}
 
-export const czPresets: any = {
-    '今天': [moment(), moment()],
-    '昨天': [moment().subtract(1, 'd'), moment().subtract(1, 'd')],
-    '7日': [moment().subtract(7, 'd'), moment()],
-    '30日': [moment().subtract(30, 'd'), moment()]
-};
+// 获取默认设置时间
+export const getPresets = () => {
+    let date = {
+        '今天': [moment(), moment()],
+        '昨天': [moment().subtract(1, 'd'), moment().subtract(1, 'd')],
+        '7日': [moment().subtract(7, 'd'), moment()],
+        '30日': [moment().subtract(30, 'd'), moment()]
+    }
+    date['当月'] = [moment().startOf('month'), moment()]
+    return date
+}
 
 // 推广媒体
 export enum TYPE {

+ 55 - 9
src/components/QueryForm/index.tsx

@@ -4,6 +4,7 @@ import moment from "moment"
 import { useAjax } from "@/Hook/useAjax"
 import { getAllOfOwnerUserApi, getChannelChoiceListApi, getGameChoiceListApi, getGameChoiceParentListType1Api, getPayListApi, getSubUserWithSelfListApi, getTtAllUserListApi, getUserSystemTypeChoiceListApi } from "@/services/gameData"
 import { PayStatus, TYPE, gameClassifyEnum } from "./const"
+import { ADSTATUSEnum } from "@/pages/gameDataStatistics/adlist/monitor/const"
 
 
 interface Props {
@@ -27,7 +28,9 @@ interface Props {
     /** 是否开启 CP通知状态 搜索 */
     isCpStatus?: boolean
     /** 是否开启 订单创建日期 搜索 */
-    isCreateDay?: boolean
+    isCreateDay?: {
+        ranges?: any
+    }
     /** 是否开启 操作设备 搜索 */
     isDevice?: boolean
     /** 是否开启 注册游戏名 搜索 */
@@ -73,7 +76,9 @@ interface Props {
     /** 是否开启 投放渠道名 搜索 */
     isPutAgent?: boolean
     /** 是否开启 用户注册日期 搜索 */
-    isRegDay?: boolean
+    isRegDay?: {
+        ranges?: any
+    }
     /** 是否开启 投手名称 搜索 */
     isSysUserName?: boolean
     /** 是否开启 投手ID 搜索 */
@@ -104,6 +109,16 @@ interface Props {
     isOs?: boolean
     /** 是否开启 推广媒体 选择 */
     isType?: boolean
+    /** 是否开启 计划ID 搜索 */
+    isProjectId?: boolean
+    /** 是否开启 计划名称 搜索 */
+    isProjectName?: boolean
+    /** 是否开启 广告ID 搜索 */
+    isPromotionId?: boolean
+    /** 是否开启 广告名称 搜索 */
+    isPromotionName?: boolean
+    /** 是否开启 广告状态 搜索 */
+    isAdStatus?: boolean
 }
 /**
  * 游戏数据系统 请求参数
@@ -114,8 +129,8 @@ const QueryForm: React.FC<Props> = (props) => {
     /**************************/
     const {
         onChange, initialValues, isSource, isAccount, isAccountId, isCompanyId, isAgentKey, isAgentName, isCpId, isCpName, isCpOrderId, isCpStatus, isCreateDay, isDevice, isGameName, isRechargeGameName, isGameId, isOrderGameId, isGameRoleId,
-        isGameRoleName, isFirstRecharge, isSwitch, isMerchantNo, isOrderId, isMerchantOrderNo, isPayStatus, isPayWay, isProductName, isRegAgent, isAgentId, isPutAgent, isRegDay, isOs, isParentId,
-        isSysUserName, isRechargeDate, isBGGameClassify, isGameUserId, isSysUserId, isUserName, isUserId, isSelectRanking, isGameType, isConsumeDay, rechargeDay, isBeginDay, isType
+        isGameRoleName, isFirstRecharge, isSwitch, isMerchantNo, isOrderId, isMerchantOrderNo, isPayStatus, isPayWay, isProductName, isRegAgent, isAgentId, isPutAgent, isRegDay, isOs, isParentId, isProjectId, isProjectName, isPromotionId, isPromotionName,
+        isSysUserName, isRechargeDate, isBGGameClassify, isGameUserId, isSysUserId, isUserName, isUserId, isSelectRanking, isGameType, isConsumeDay, rechargeDay, isBeginDay, isType, isAdStatus
     } = props
     const [form] = Form.useForm()
     const [accountList, setAccountList] = useState<any[]>([])
@@ -300,7 +315,7 @@ const QueryForm: React.FC<Props> = (props) => {
             </Form.Item></Col>}
             {/* 广告账户名称 */}
             {isAccount && <Col><Form.Item name='accountName'>
-                <Input placeholder="请输入广告账号" allowClear style={{ width: 140 }} />
+                <Input placeholder="广告账号名称" allowClear style={{ width: 140 }} />
             </Form.Item></Col>}
             {/* 广告账号ID */}
             {isAccountId && <Col><Form.Item name='accountId'>
@@ -376,7 +391,38 @@ const QueryForm: React.FC<Props> = (props) => {
                 </Select>
             </Form.Item></Col>}
 
-
+            {/* 计划名称 */}
+            {isProjectName && <Col><Form.Item name='projectName'>
+                <Input placeholder="请输入计划名称" allowClear style={{ width: 140 }} />
+            </Form.Item></Col>}
+            {/* 计划ID */}
+            {isProjectId && <Col><Form.Item name='projectId'>
+                <Input placeholder="请输入计划ID" allowClear style={{ width: 140 }} />
+            </Form.Item></Col>}
+            {/* 广告名称 */}
+            {isPromotionName && <Col><Form.Item name='promotionName'>
+                <Input placeholder="请输入广告名称" allowClear style={{ width: 140 }} />
+            </Form.Item></Col>}
+            {/* 广告ID */}
+            {isPromotionId && <Col><Form.Item name='promotionId'>
+                <Input placeholder="请输入广告ID" allowClear style={{ width: 140 }} />
+            </Form.Item></Col>}
+            {/* 广告状态 */}
+            {isAdStatus && <Col><Form.Item name='status'>
+                <Select
+                    maxTagCount={1}
+                    showSearch
+                    style={{ minWidth: 140 }}
+                    allowClear
+                    dropdownMatchSelectWidth={false}
+                    placeholder={'请选择广告状态'}
+                    filterOption={(input, option) =>
+                        (option?.children as any)?.toLowerCase().indexOf(input.toLowerCase()) >= 0
+                    }
+                >
+                    {Object.keys(ADSTATUSEnum).map(key => <Select.Option value={key} key={key}>{ADSTATUSEnum[key]}</Select.Option>)}
+                </Select>
+            </Form.Item></Col>}
             {/* 操作设备 */}
             {isDevice && <Col><Form.Item name='device'>
                 <Input placeholder="请输入操作设备" allowClear style={{ width: 140 }} />
@@ -579,7 +625,7 @@ const QueryForm: React.FC<Props> = (props) => {
             {isAgentKey && <Col><Form.Item name='agentKey'>
                 <Input placeholder="请输入渠道标识" allowClear style={{ width: 140 }} />
             </Form.Item></Col>}
-            
+
             {/* 渠道名称 */}
             {isAgentName && <Col><Form.Item name='agentName'>
                 <Input placeholder="请输入渠道名称" allowClear style={{ width: 140 }} />
@@ -668,7 +714,7 @@ const QueryForm: React.FC<Props> = (props) => {
 
             {/* 用户注册日期搜索 */}
             {isRegDay && <Col><Form.Item name='regDay'>
-                <DatePicker.RangePicker placeholder={['用户注册开始日期', '用户注册结束日期']} />
+                <DatePicker.RangePicker placeholder={['用户注册开始日期', '用户注册结束日期']} {...isRegDay} />
             </Form.Item></Col>}
 
             {/* 消耗日期 搜索 */}
@@ -683,7 +729,7 @@ const QueryForm: React.FC<Props> = (props) => {
 
             {/* 订单创建日期搜索 */}
             {isCreateDay && <Col><Form.Item name='createDay'>
-                <DatePicker.RangePicker placeholder={['订单创建开始日期', '订单创建结束日期']} />
+                <DatePicker.RangePicker placeholder={['订单创建开始日期', '订单创建结束日期']} {...isCreateDay} />
             </Form.Item></Col>}
             {/* 充值日期搜索 */}
             {rechargeDay && <Col><Form.Item name='rechargeDay'>

+ 5 - 5
src/components/RightContent/AvatarDropdown.tsx

@@ -26,7 +26,7 @@ const loginOut = async () => {
   if (window.location.pathname !== '/user/login' && !redirect) {
     outLogin()
     // setCookie('Admin-Token', '1', -300)
-    sessionStorage.removeItem('Admin-Token')
+    localStorage.removeItem('Admin-Token')
     history.replace({
       pathname: '/user/login',
       search: stringify({
@@ -64,12 +64,12 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
         return
       }
       if (key === 'admin') {
-        let token = sessionStorage.getItem('Admin-Token')
+        let token = localStorage.getItem('Admin-Token')
         window.open(api.includes('test') || api === 'api' ? `http://test.zanxiangnet.com/admin/#/login?token=${token}` : `https://mp.zanxiangnet.com/admin/#/login?token=${token}`)
         return
       }
       if (key === 'release') {
-        let token = sessionStorage.getItem('Admin-Token')
+        let token = localStorage.getItem('Admin-Token')
         window.open(api.includes('test') || api === 'api' ? `http://test.adq.zanxiangnet.com/#/user/login?token=${token}` : `http://adq.zanxiangnet.com/#/user/login?token=${token}`)
         return
       }
@@ -174,7 +174,7 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
   const setCompanyHandle = (companyId: number) => {
     selectCompany.run(companyId).then((res: any) => {
       setDialogVisible(false)
-      sessionStorage.setItem('Admin-Token', res?.data?.token)
+      localStorage.setItem('Admin-Token', res?.data?.token)
       window.location.reload()
     })
   }
@@ -182,7 +182,7 @@ const AvatarDropdown: React.FC<GlobalHeaderRightProps> = ({ menu }) => {
     <>
       <HeaderDropdown overlay={menuHeaderDropdown}>
         <span className={`${styles.action} ${styles.account}`} onClick={() => {
-          let AdminToken: any = sessionStorage.getItem('Admin-Token')
+          let AdminToken: any = localStorage.getItem('Admin-Token')
           copy(AdminToken)
         }}>
           <Avatar size="small" className={styles.avatar} src={currentUser.avatar || headImg} alt="avatar" />

+ 1 - 1
src/components/RightContent/index.tsx

@@ -75,7 +75,7 @@ const GlobalHeaderRight: React.FC<{}> = () => {
   }, [])
 
   const open = () => {
-    let token = sessionStorage.getItem('Admin-Token')
+    let token = localStorage.getItem('Admin-Token')
     window.open(`http://gg.84game.cn/#/login?token=${token}`)
     return
   }

+ 1 - 1
src/models/useOperating/useWxGroupList.ts

@@ -91,7 +91,7 @@ export default function useWxGroupList() {
   //首次获取列表
   useEffect(() => {
     let ok: any = true;
-    if (sessionStorage.getItem('Admin-Token') && history?.location?.pathname !== '/user/login') {
+    if (localStorage.getItem('Admin-Token') && history?.location?.pathname !== '/user/login') {
       //===============测试临时===========
       // auth_token.run()
       //定时请求版本号对比

+ 38 - 0
src/pages/gameDataStatistics/adlist/monitor/const.ts

@@ -0,0 +1,38 @@
+
+/** 广告状态 */
+export enum ADSTATUSEnum {
+    NOT_DELETED = '不限',
+    ALL = '不限(包含已删除)',
+    OK = '投放中',
+    DELETED = '已删除',
+    PROJECT_OFFLINE_BUDGET = '项目超出预算',
+    PROJECT_PREOFFLINE_BUDGET = '项目接近预算',
+    TIME_NO_REACH = '未到达投放时间',
+    TIME_DONE = '已完成',
+    NO_SCHEDULE = '不在投放时段',
+    AUDIT = '新建审核中',
+    REAUDIT = '修改审核中',
+    FROZEN = '已终止',
+    AUDIT_DENY = '审核不通过',
+    OFFLINE_BUDGET = '广告超出预算',
+    OFFLINE_BALANCE = '账户余额不足',
+    PREOFFLINE_BUDGET = '广告接近预算',
+    DISABLED = '已暂停',
+    PROJECT_DISABLED = '已被项目暂停',
+    LIVE_ROOM_OFF = '关联直播间不可投',
+    PRODUCT_OFFLINE = '关联商品不可投',
+    AWEME_ACCOUNT_DISABLED = '关联抖音账号不可投',
+    AWEME_ANCHOR_DISABLED = '锚点不可投',
+    DISABLE_BY_QUOTA = '已暂停(配额达限)'
+}
+
+/** 出价方式 */
+export enum PRICINGEnum {
+    PRICING_CPC = 'CPC(点击付费)',
+    PRICING_CPM = 'CPM(展示付费)',
+    PRICING_OCPC = 'OCPC(已下线)',
+    PRICING_OCPM = 'OCPM(转化量付费)',
+    PRICING_CPV = 'CPV',
+    PRICING_CPA = 'CPA(已下线)',
+    PRICING_CPC_OCPM = 'CPC - OCPM两阶段出价(仅搜索广告可用)'
+}

+ 25 - 16
src/pages/gameDataStatistics/adlist/monitor/index.tsx

@@ -1,37 +1,44 @@
 import { useAjax } from "@/Hook/useAjax"
-import { PromotionDataDay, getPromotionDataDatListApi } from "@/services/gameData/adlist"
+import { PromotionDataDay, getPromotionDataDatListApi, getPromotionDataDatTotalApi } from "@/services/gameData/adlist"
 import React, { useEffect, useState } from "react"
 import columns12 from "./tableConfig"
 import QueryForm from "@/components/QueryForm"
 import TableData from "../../components/TableData"
-
+import moment from "moment"
+import { getPresets } from "@/components/QueryForm/const"
 
 
 const Monitor = () => {
 
     /***************************************/
-    const [queryForm, setQueryForm] = useState<PromotionDataDay>({ pageNum: 1, pageSize: 20, sourceSystem: 'ZX_ONE' })
+    const [queryForm, setQueryForm] = useState<PromotionDataDay>({ pageNum: 1, pageSize: 20, sourceSystem: 'ZX_ONE', costBeginDate: moment().format('YYYY-MM-DD'), costEndDate: moment().format('YYYY-MM-DD') })
+    const [totalData, setTotalData] = useState<any[]>([])
 
     const getPromotionDataDatList = useAjax((params) => getPromotionDataDatListApi(params))
+    const getPromotionDataDatTotal = useAjax((params) => getPromotionDataDatTotalApi(params))
     /***************************************/
 
     useEffect(() => {
         getPromotionDataDatList.run(queryForm)
+        getPromotionDataDatTotal.run(queryForm).then(res => {
+            res.id = 1
+            res.agentName = '总计'
+            setTotalData([res])
+        })
     }, [queryForm])
 
     return <div>
         <TableData
             leftChild={<QueryForm
-                initialValues={{ sourceSystem: 'ZX_ONE' }}
+                initialValues={{ sourceSystem: 'ZX_ONE', consumeDay: [moment(), moment()] }}
                 onChange={(data: any) => {
-                    const { type, gameType, costBeginDay, costEndDay, pitcherId, sysUserName, ...params } = data
-                    console.log(params, pitcherId)
+                    const { type, gameClassify, costBeginDay, costEndDay, pitcherId, sysUserName, ...params } = data
                     let newQueryForm = JSON.parse(JSON.stringify(queryForm))
                     newQueryForm.pageNum = 1
                     newQueryForm.zxPitcherId = pitcherId
                     newQueryForm.pitcherName = sysUserName
                     newQueryForm.accountType = type
-                    newQueryForm.classify = gameType
+                    newQueryForm.classify = gameClassify
                     if (costBeginDay && costEndDay) {
                         newQueryForm.costBeginDate = costBeginDay
                         newQueryForm.costEndDate = costEndDay
@@ -47,16 +54,19 @@ const Monitor = () => {
                 isAccount
                 isType
                 isAgentId
-                isAgentKey
-                isAgentName
-                isGameType
-                isConsumeDay={{}}
+                isBGGameClassify
+                isConsumeDay={{ ranges: getPresets() }}
                 isCpName
                 isGameId
-                isGameName
                 isSysUserId
-                isSysUserName
+                isProjectId
+                isProjectName
+                isPromotionId
+                isPromotionName
+                isAdStatus
             />}
+            isZj
+            totalData={totalData}
             scroll={{ x: 1000, y: 600 }}
             ajax={getPromotionDataDatList}
             fixed={{ left: 3, right: 0 }}
@@ -64,9 +74,8 @@ const Monitor = () => {
             total={getPromotionDataDatList?.data?.total}
             page={queryForm.pageNum}
             pageSize={queryForm.pageSize}
-            title='订单明细'
+            title='广告监控'
             onChange={(props: any) => {
-                console.log('props--->', props)
                 let { pagination, sortData } = props
                 let { current, pageSize } = pagination
                 let newQueryForm = JSON.parse(JSON.stringify(queryForm))
@@ -82,7 +91,7 @@ const Monitor = () => {
                 setQueryForm({ ...newQueryForm })
             }}
             config={columns12()}
-            configName={'订单明细'}
+            configName={'广告监控'}
         />
     </div>
 }

+ 384 - 101
src/pages/gameDataStatistics/adlist/monitor/tableConfig.tsx

@@ -1,42 +1,105 @@
-import { PayStatus, gameClassifyEnum } from "@/components/QueryForm/const"
+import { TYPE, gameClassifyEnum } from "@/components/QueryForm/const"
 import WidthEllipsis from "@/components/widthEllipsis"
 import { Statistic } from "antd"
 import React from "react"
+import { PRICINGEnum } from './const'
 
 
 function columns12(): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
 
+    const data = [{ lable: '次日', value: 2 }, { lable: 'D3', value: 3 }, { lable: 'D7', value: 7 }, { lable: 'D15', value: 15 }]
+    let date = data.map(item => {
+        let field = `d${item.value}Trend`
+        return {
+            title: item.lable,
+            dataIndex: `D${item.value}`,
+            label: '付费数据',
+            align: 'center',
+            width: 85,
+            children: [
+                {
+                    title: 'ROI',
+                    dataIndex: 'roi',
+                    key: 'roi',
+                    width: 60,
+                    align: 'center',
+                    render: (_: any, b: any) => {
+                        let data: any = {}
+                        if (b?.[field]) {
+                            data = b?.[field]
+                            return <Statistic value={data?.roi ? data?.roi * 100 : 0} precision={2} valueStyle={data?.roi >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                        }
+                        return '--'
+                    }
+                },
+                {
+                    title: '付费',
+                    dataIndex: 'rechargeMoney',
+                    key: 'rechargeMoney',
+                    width: 60,
+                    align: 'center',
+                    render: (_: any, b: any) => {
+                        let data: any = {}
+                        if (b?.[field]) {
+                            data = b?.[field]
+                            return <Statistic value={data?.rechargeMoney || 0} />
+                        }
+                        return '--'
+                    }
+                },
+                {
+                    title: '倍数',
+                    dataIndex: 'multiples',
+                    key: 'multiples',
+                    width: 40,
+                    align: 'center',
+                    render: (_: any, b: any) => {
+                        let data: any = {}
+                        if (b?.[field]) {
+                            data = b?.[field]
+                            return <span>{data?.multiples || 0}</span>
+                        }
+                        return '--'
+                    }
+                },
+            ]
+        }
+    })
+
     return [
         {
             label: '账户信息',
             data: [
                 {
-                    title: '推广账号名称', dataIndex: 'accountName', label: '账户信息', align: 'center', width: 85, default: 1,
+                    title: '推广账号名称', dataIndex: 'accountName', label: '账户信息', align: 'center', width: 85, default: 2,
                     render: (a: string, b: any) => (<WidthEllipsis value={b?.day} />)
                 },
                 {
-                    title: '推广账号ID', dataIndex: 'accountId', label: '账户信息', align: 'center', width: 120, default: 2,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '推广账号ID', dataIndex: 'accountId', label: '账户信息', align: 'center', width: 120,
+                    render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />)
                 },
                 {
-                    title: '备注', dataIndex: 'notes', label: '账户信息', align: 'center', width: 130, default: 3,
+                    title: '备注', dataIndex: 'notes', label: '账户信息', align: 'center', width: 120,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '投手', dataIndex: 'pitcherName', label: '账户信息', align: 'center', width: 85, default: 4,
+                    title: '投手', dataIndex: 'pitcherName', label: '账户信息', align: 'center', width: 70,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
-                { title: '投放渠道', dataIndex: 'agentName', label: '账户信息', align: 'center', width: 65, default: 5 },
                 {
-                    title: '服务商', dataIndex: 'service', label: '账户信息', align: 'center', width: 95, default: 6,
+                    title: '投放渠道', dataIndex: 'agentName', label: '账户信息', align: 'center', width: 75, default: 1,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '投放媒体', dataIndex: 'accountType', label: '账户信息', align: 'center', width: 135, default: 7,
+                    title: '服务商', dataIndex: 'service', label: '账户信息', align: 'center', width: 95,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '余额', dataIndex: 'balance', label: '账户信息', align: 'center', width: 70, default: 8,
+                    title: '投放媒体', dataIndex: 'accountType', label: '账户信息', align: 'center', width: 70,
+                    render: (a: string, b: any) => (<WidthEllipsis value={TYPE[a]} />)
+                },
+                {
+                    title: '余额', dataIndex: 'balance', label: '账户信息', align: 'center', width: 70, default: 3,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 }
             ]
@@ -45,11 +108,11 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
             label: '推广内容',
             data: [
                 {
-                    title: '推广游戏名称', dataIndex: 'gameName', label: '推广内容', align: 'center', width: 70, default: 9,
+                    title: '推广游戏名称', dataIndex: 'gameName', label: '推广内容', align: 'center', width: 70,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '推广游戏应用类型', dataIndex: 'classify', label: '推广内容', align: 'center', width: 95, default: 10,
+                    title: '推广游戏应用类型', dataIndex: 'classify', label: '推广内容', align: 'center', width: 95,
                     render: (a: string) => (<span>{gameClassifyEnum[a]}</span>)
                 }
             ]
@@ -58,58 +121,89 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
             label: '广告信息',
             data: [
                 {
-                    title: '推广广告名称', dataIndex: 'promotionName', label: '广告信息', align: 'center', width: 80, default: 11,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '推广广告名称', dataIndex: 'promotionName', label: '广告信息', align: 'center', width: 130, default: 4,
+                    render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />)
                 },
                 {
-                    title: '广告ID', dataIndex: 'promotionId', label: '广告信息', align: 'center', width: 65, default: 12,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '广告ID', dataIndex: 'promotionId', label: '广告信息', align: 'center', width: 90,
+                    render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />)
                 },
                 {
-                    title: '推广计划名称', dataIndex: 'projectName', label: '广告信息', align: 'center', width: 70, default: 13,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '推广计划名称', dataIndex: 'projectName', label: '广告信息', align: 'center', width: 130,
+                    render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />)
                 },
                 {
-                    title: '计划ID', dataIndex: 'projectId', label: '广告信息', align: 'center', width: 80, default: 14,
+                    title: '计划ID', dataIndex: 'projectId', label: '广告信息', align: 'center', width: 90,
+                    render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />)
+                },
+                {
+                    title: '广告状态', dataIndex: 'status', label: '广告信息', align: 'center', width: 85, default: 5,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '广告状态', dataIndex: 'status', label: '广告信息', align: 'center', width: 85, default: 15,
+                    title: '推广目标', dataIndex: 'landingType', label: '广告信息', align: 'center', width: 80,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '推广目标', dataIndex: 'landingType', label: '广告信息', align: 'center', width: 80, default: 16,
-                    render: (a: any) => <Statistic value={a || 0} precision={2} />
+                    title: '出价方式', dataIndex: 'pricing', label: '广告信息', align: 'center', width: 80, default: 6,
+                    render: (a: string, b: any) => (<WidthEllipsis value={PRICINGEnum[a]} />)
                 },
                 {
-                    title: '出价方式', dataIndex: 'pricing', label: '广告信息', align: 'center', width: 80, default: 17,
-                    render: (a: any) => <Statistic value={a || 0} precision={2} />
+                    title: '当前出价', dataIndex: 'cpaBid', label: '广告信息', align: 'center', width: 70, default: 7,
+                    render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '当前出价', dataIndex: 'cpaBid', label: '广告信息', align: 'center', width: 95, default: 18,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '深度转化ROI系数', dataIndex: 'roiGoal', label: '广告信息', align: 'center', width: 65,
+                    render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '深度转化ROI系数', dataIndex: 'roiGoal', label: '广告信息', align: 'center', width: 65, default: 19,
+                    title: '日预算', dataIndex: 'budget', label: '广告信息', align: 'center', width: 70,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '日预算', dataIndex: 'budget', label: '广告信息', align: 'center', width: 95, default: 20,
+                    title: '投放时间', dataIndex: 'scheduleTime', label: '广告信息', align: 'center', width: 135,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '投放时间', dataIndex: 'scheduleTime', label: '广告信息', align: 'center', width: 95, default: 21,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
-                }
+                    title: '注册人数(广告)', dataIndex: 'active', label: '广告信息', align: 'center', width: 70,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '注册成本(广告)', dataIndex: 'activeCost', label: '广告信息', align: 'center', width: 70,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日转化成本(广告)', dataIndex: 'firstConvertCost', label: '广告信息', align: 'center', width: 70,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首次付费率(广告)', dataIndex: 'firstActivePayRate', label: '广告信息', align: 'center', width: 70,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日付费金额(广告)', dataIndex: 'firstAttributionGameInAppLtv1day', label: '广告信息', align: 'center', width: 70,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日付费ROI(广告)', dataIndex: 'firstAttributionGameInAppRoi1day', label: '广告信息', align: 'center', width: 70,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '付费次数(广告)', dataIndex: 'gamePayCount', label: '广告信息', align: 'center', width: 70,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
             ]
         },
         {
             label: '消耗',
             data: [
-                { title: '今日消耗', dataIndex: 'todayCost', label: '消耗', align: 'center', width: 85, default: 22 },
                 {
-                    title: '总消耗', dataIndex: 'promotionTotalCost', label: '消耗', align: 'center', width: 85, default: 23,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '今日消耗', dataIndex: 'todayCost', label: '消耗', align: 'center', width: 85, sorter: true, default: 8,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '总消耗', dataIndex: 'promotionTotalCost', label: '消耗', align: 'center', width: 100,
+                    render: (a: any) => <Statistic value={a || 0} />
                 }
             ]
         },
@@ -117,99 +211,288 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
             label: '曝光数据',
             data: [
                 {
-                    title: '曝光量', dataIndex: 'showCount', label: '曝光数据', align: 'center', width: 50, default: 24,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '曝光量', dataIndex: 'showCount', label: '曝光数据', align: 'center', width: 60, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '千次曝光成本', dataIndex: 'thousandDisplayPrice', label: '曝光数据', align: 'center', width: 45, default: 25,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '千次曝光成本', dataIndex: 'thousandDisplayPrice', label: '曝光数据', align: 'center', width: 65, sorter: true, default: 9,
+                    render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '点击量', dataIndex: 'clickCount', label: '曝光数据', align: 'center', width: 65, default: 26,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '点击量', dataIndex: 'clickCount', label: '曝光数据', align: 'center', width: 60, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '点击均价', dataIndex: 'avgClickCost', label: '曝光数据', align: 'center', width: 45, default: 27,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '点击均价', dataIndex: 'avgClickCost', label: '曝光数据', align: 'center', width: 60, sorter: true, default: 10,
+                    render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '点击率', dataIndex: 'ctr', label: '曝光数据', align: 'center', width: 135, default: 28,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '点击率', dataIndex: 'ctr', label: '曝光数据', align: 'center', width: 60, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '转化目标', dataIndex: 'convertTarget', label: '曝光数据', align: 'center', width: 135, default: 29,
+                    title: '转化目标', dataIndex: 'convertTarget', label: '曝光数据', align: 'center', width: 70,
                     render: (a: string, b: any) => (<WidthEllipsis value={a} />)
                 },
                 {
-                    title: '转化目标量', dataIndex: 'convertCount', label: '曝光数据', align: 'center', width: 85, default: 30,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '转化目标量', dataIndex: 'convertCount', label: '曝光数据', align: 'center', width: 60, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
                 },
                 {
-                    title: '转化目标成本', dataIndex: 'convertCost', label: '曝光数据', align: 'center', width: 45, default: 31,
-                    render: (a: string, b: any) => (<WidthEllipsis value={a} />)
+                    title: '转化目标成本', dataIndex: 'convertCost', label: '曝光数据', align: 'center', width: 75, sorter: true, default: 11,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '目标转化率', dataIndex: 'convertRate', label: '曝光数据', align: 'center', width: 60, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
-                { title: '目标转化率', dataIndex: 'convertRate', label: '曝光数据', align: 'center', width: 85 },
             ]
         },
         {
             label: '用户数据',
             data: [
-                { title: '新增用户数', dataIndex: 'regNum', label: '用户数据', align: 'center', width: 85 },
-                { title: '总注册人数', dataIndex: 'regTotalNum', label: '用户数据', align: 'center', width: 85 },
-                { title: '首日创角人数', dataIndex: 'firstRoleNum', label: '用户数据', align: 'center', width: 85 },
-                { title: '新用户累计创角人数', dataIndex: 'newUserTotalRoleNum', label: '用户数据', align: 'center', width: 85 },
-                { title: '总创角人数', dataIndex: 'roleTotalNum', label: '用户数据', align: 'center', width: 85 },
-                { title: '注册成本', dataIndex: 'regCost', label: '用户数据', align: 'center', width: 85 },
-                { title: '总注册成本', dataIndex: 'regTotalCost', label: '用户数据', align: 'center', width: 85 },
-                { title: '首日创角成本', dataIndex: 'firstRoleCost', label: '用户数据', align: 'center', width: 85 },
-                { title: '新用户创角成本', dataIndex: 'newUserTotalRoleCost', label: '用户数据', align: 'center', width: 85 },
-                { title: '总创角成本', dataIndex: 'roleTotalCost', label: '用户数据', align: 'center', width: 85 },
-                { title: '首日创角率', dataIndex: 'firstRoleRate', label: '用户数据', align: 'center', width: 85 },
-                { title: '新用户创角率', dataIndex: 'newUserTotalRoleRate', label: '用户数据', align: 'center', width: 85 },
-                { title: '总创角率', dataIndex: 'roleTotalRate', label: '用户数据', align: 'center', width: 85 },
+                {
+                    title: '新增用户数', dataIndex: 'regNum', label: '用户数据', align: 'center', width: 60, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '总注册人数', dataIndex: 'regTotalNum', label: '用户数据', align: 'center', width: 60, default: 12,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日创角人数', dataIndex: 'firstRoleNum', label: '用户数据', align: 'center', width: 60, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户累计创角人数', dataIndex: 'newUserTotalRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '总创角人数', dataIndex: 'roleTotalNum', label: '用户数据', align: 'center', width: 60,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '注册成本', dataIndex: 'regCost', label: '用户数据', align: 'center', width: 70, sorter: true, default: 13,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '总注册成本', dataIndex: 'regTotalCost', label: '用户数据', align: 'center', width: 70,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日创角成本', dataIndex: 'firstRoleCost', label: '用户数据', align: 'center', width: 60, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户创角成本', dataIndex: 'newUserTotalRoleCost', label: '用户数据', align: 'center', width: 65, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '总创角成本', dataIndex: 'roleTotalCost', label: '用户数据', align: 'center', width: 60,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日创角率', dataIndex: 'firstRoleRate', label: '用户数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新用户创角率', dataIndex: 'newUserTotalRoleRate', label: '用户数据', align: 'center', width: 70, sorter: true, default: 14,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '总创角率', dataIndex: 'roleTotalRate', label: '用户数据', align: 'center', width: 80,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
             ]
         },
         {
             label: '付费数据',
             data: [
-                { title: '新增付费次数', dataIndex: 'firstNewUserAmountCount', label: '付费数据', align: 'center', width: 85 },
-                { title: '新增付费人数', dataIndex: 'firstNewUserAmountNum', label: '付费数据', align: 'center', width: 85 },
-                { title: '新增付费金额', dataIndex: 'firstNewUserAmount', label: '付费数据', align: 'center', width: 85 },
-                { title: '至今付费次数', dataIndex: 'newUserTotalAmountCount', label: '付费数据', align: 'center', width: 85 },
-                { title: '至今付费人数', dataIndex: 'newUserTotalAmountNum', label: '付费数据', align: 'center', width: 85 },
-                { title: '至今付费金额', dataIndex: 'newUserTotalAmount', label: '付费数据', align: 'center', width: 85 },
-                { title: '总充值次数', dataIndex: 'totalAmountCount', label: '付费数据', align: 'center', width: 85 },
-                { title: '总充值人数', dataIndex: 'totalAmountNum', label: '付费数据', align: 'center', width: 85 },
-                { title: '总充值金额', dataIndex: 'totalAmount', label: '付费数据', align: 'center', width: 85 },
-                { title: '首日ROI', dataIndex: 'firstRoi', label: '付费数据', align: 'center', width: 85 },
-                { title: '24小时ROI', dataIndex: 'twentyFourHoursRoi', label: '付费数据', align: 'center', width: 85 },
-                { title: '总ROI', dataIndex: 'totalRoi', label: '付费数据', align: 'center', width: 85 },
-                { title: '广告总ROI', dataIndex: 'promotionTotalRoi', label: '付费数据', align: 'center', width: 85 },
-                { title: '次日ROI', dataIndex: 'b14', label: '付费数据', align: 'center', width: 85 },
-                { title: '3日ROI', dataIndex: 'b15', label: '付费数据', align: 'center', width: 85 },
-                { title: '7日ROI', dataIndex: 'b16', label: '付费数据', align: 'center', width: 85 },
-                { title: '15日ROI', dataIndex: 'b17', label: '付费数据', align: 'center', width: 85 },
-                { title: '新增付费成本', dataIndex: 'firstNewUserRechargeCost', label: '付费数据', align: 'center', width: 85 },
-                { title: '至今付费成本', dataIndex: 'newUserTotalRechargeCost', label: '付费数据', align: 'center', width: 85 },
-                { title: '总付费成本', dataIndex: 'totalRechargeCost', label: '付费数据', align: 'center', width: 85 },
-                { title: '新增付费ARPPU', dataIndex: 'firstNewUserArppu', label: '付费数据', align: 'center', width: 85 },
-                { title: '至今付费ARPPU', dataIndex: 'newUserTotalAmountArppu', label: '付费数据', align: 'center', width: 85 },
-                { title: '新增付费100+用户数', dataIndex: 'firstNewUserHundredUserNum', label: '付费数据', align: 'center', width: 85 },
-                { title: '新增付费100+用户付费成本', dataIndex: 'firstNewUserHundredUserCost', label: '付费数据', align: 'center', width: 85 },
-                { title: '首充50~100元用户数', dataIndex: 'firstRechargeFiftyHundredNum', label: '付费数据', align: 'center', width: 85 },
-                { title: '首充50~100元占比', dataIndex: 'firstRechargeFiftyHundredRate', label: '付费数据', align: 'center', width: 85 },
-                { title: '新增付费200+人数', dataIndex: 'firstNewUserTwoHundredUserNum', label: '付费数据', align: 'center', width: 85 },
-                { title: '新增付费200+用户付费成本', dataIndex: 'firstNewUserTwoHundredUserCost', label: '付费数据', align: 'center', width: 85 },
-                { title: '至今付费100+用户数', dataIndex: 'newUserTotalHundredUserNum', label: '付费数据', align: 'center', width: 85 },
-                { title: '首日IOS付费人数占比', dataIndex: 'firstIosAmountNumRate', label: '付费数据', align: 'center', width: 85 },
-                { title: '首日IOS付费金额占比', dataIndex: 'firstIosAmountRate', label: '付费数据', align: 'center', width: 85 },
-                { title: '首日IOS付费ROI', dataIndex: 'firstIosAmountRoi', label: '付费数据', align: 'center', width: 85 },
-                { title: '首日Android付费ROI', dataIndex: 'firstAndroidAmountRoi', label: '付费数据', align: 'center', width: 85 },
-                { title: '首日付费率', dataIndex: 'firstAmountRate', label: '付费数据', align: 'center', width: 85 },
-                // { title: '活跃用户付费率', dataIndex: 'b35', label: '付费数据', align: 'center', width: 85 },
-                { title: '新增客单价', dataIndex: 'firstNewUserAvgPrice', label: '付费数据', align: 'center', width: 85 },
-                { title: '至今客单价', dataIndex: 'newUserTotalAvgPrice', label: '付费数据', align: 'center', width: 85 },
-                { title: '账面客单价', dataIndex: 'b38', label: '付费数据', align: 'center', width: 85 },
+                {
+                    title: '新增付费次数', dataIndex: 'firstNewUserAmountCount', label: '付费数据', align: 'center', width: 60, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新增付费人数', dataIndex: 'firstNewUserAmountNum', label: '付费数据', align: 'center', width: 60, sorter: true, default: 15,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新增付费金额', dataIndex: 'firstNewUserAmount', label: '付费数据', align: 'center', width: 80, sorter: true, default: 16,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今付费次数', dataIndex: 'newUserTotalAmountCount', label: '付费数据', align: 'center', width: 60, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今付费人数', dataIndex: 'newUserTotalAmountNum', label: '付费数据', align: 'center', width: 60, sorter: true, default: 18,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今付费金额', dataIndex: 'newUserTotalAmount', label: '付费数据', align: 'center', width: 80, sorter: true, default: 19,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新用户24小时充值金额', dataIndex: 'twentyFourHoursAmount', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '总充值金额', dataIndex: 'totalAmount', label: '付费数据', align: 'center', width: 60,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '总充值次数', dataIndex: 'totalAmountCount', label: '付费数据', align: 'center', width: 50,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '总充值人数', dataIndex: 'totalAmountNum', label: '付费数据', align: 'center', width: 50,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '总充值金额', dataIndex: 'totalAmount', label: '付费数据', align: 'center', width: 70,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日ROI', dataIndex: 'firstRoi', label: '付费数据', align: 'center', width: 65, sorter: true, default: 21,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '24小时ROI', dataIndex: 'twentyFourHoursRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 22,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '总ROI', dataIndex: 'totalRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 23,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '广告总ROI', dataIndex: 'promotionTotalRoi', label: '付费数据', align: 'center', width: 70,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新增付费成本', dataIndex: 'firstNewUserRechargeCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 17,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今付费成本', dataIndex: 'newUserTotalRechargeCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 20,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '总付费成本', dataIndex: 'totalRechargeCost', label: '付费数据', align: 'center', width: 70,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新增付费ARPPU', dataIndex: 'firstNewUserArppu', label: '付费数据', align: 'center', width: 60, sorter: true, default: 24,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今付费ARPPU', dataIndex: 'newUserTotalAmountArppu', label: '付费数据', align: 'center', width: 60, sorter: true, default: 25,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新增付费100+用户数', dataIndex: 'firstNewUserHundredUserNum', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新增付费100+用户付费成本', dataIndex: 'firstNewUserHundredUserCost', label: '付费数据', align: 'center', width: 85, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今付费100+用户付费成本', dataIndex: 'newUserTotalHundredUserCost', label: '付费数据', align: 'center', width: 85, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首充50~100元用户数', dataIndex: 'firstRechargeFiftyHundredNum', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首充50~100元占比', dataIndex: 'firstRechargeFiftyHundredRate', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新增付费200+人数', dataIndex: 'firstNewUserTwoHundredUserNum', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '新增付费200+用户付费成本', dataIndex: 'firstNewUserTwoHundredUserCost', label: '付费数据', align: 'center', width: 85, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今付费100+用户数', dataIndex: 'newUserTotalHundredUserNum', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日IOS付费次数', dataIndex: 'firstIosAmountCount', label: '付费数据', align: 'center', width: 75, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日IOS付费人数', dataIndex: 'firstIosAmountNum', label: '付费数据', align: 'center', width: 75, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日IOS付费金额', dataIndex: 'firstIosAmount', label: '付费数据', align: 'center', width: 75, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日IOS付费人数占比', dataIndex: 'firstIosAmountNumRate', label: '付费数据', align: 'center', width: 75, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日IOS付费金额占比', dataIndex: 'firstIosAmountRate', label: '付费数据', align: 'center', width: 75, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日IOS付费ROI', dataIndex: 'firstIosAmountRoi', label: '付费数据', align: 'center', width: 75, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日Android付费次数', dataIndex: 'firstAndroidAmountCount', label: '付费数据', align: 'center', width: 78, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日Android付费人数', dataIndex: 'firstAndroidAmountNum', label: '付费数据', align: 'center', width: 78, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日Android付费金额', dataIndex: 'firstAndroidAmount', label: '付费数据', align: 'center', width: 78, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '首日Android付费人数占比', dataIndex: 'firstAndroidAmountNumRate', label: '付费数据', align: 'center', width: 95, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日Android付费金额占比', dataIndex: 'firstAndroidAmountRate', label: '付费数据', align: 'center', width: 95, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日Android付费ROI', dataIndex: 'firstAndroidAmountRoi', label: '付费数据', align: 'center', width: 80, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '首日付费率', dataIndex: 'firstAmountRate', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
+                },
+                {
+                    title: '新增客单价', dataIndex: 'firstNewUserAvgPrice', label: '付费数据', align: 'center', width: 60, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '至今客单价', dataIndex: 'newUserTotalAvgPrice', label: '付费数据', align: 'center', width: 60, sorter: true,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: 'ltv1', dataIndex: 'ltvDay1', label: '付费数据', align: 'center', width: 60,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '每日扣单数', dataIndex: 'subOrderNum', label: '付费数据', align: 'center', width: 60,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                {
+                    title: '每日扣单金额', dataIndex: 'subOrderAmount', label: '付费数据', align: 'center', width: 60,
+                    render: (a: any) => <Statistic value={a || 0} />
+                },
+                ...date
             ]
         }
     ]

+ 0 - 1
src/pages/gameDataStatistics/allSurvey/index.less

@@ -39,7 +39,6 @@
 
     >div {
         display: flex;
-        justify-content: space-between;
         gap: 8px;
     }
 }

+ 37 - 15
src/pages/gameDataStatistics/allSurvey/index.tsx

@@ -23,6 +23,8 @@ const AllSurvey: React.FC = () => {
     const size = useSize(ref);  // div大小
     const size3 = useSize(ref3);  // div大小
     const scroll = useScroll(ref);
+    const [scrollDivWidth, setScrollDivWidth] = useState<number>(2000)
+    const [badWidth, setBadWidth] = useState<number>(0)
 
     const [leftShow, setLeftShow] = useState<boolean>(false)
     const [rightShow, setRightShow] = useState<boolean>(false)
@@ -32,13 +34,34 @@ const AllSurvey: React.FC = () => {
 
     const getAllSurveyTotalData = useAjax((params) => getAllSurveyTotalDataApi(params))
 
+    useEffect(() => {
+        if (size?.width) {
+            let width = 2000
+            let b = 6
+            if (queryForm?.gameId) {
+                b = 5
+                width = 1672
+            } else {
+                b = 6
+                width = 2000
+            }
+            let w = size?.width || 0
+            if (w > width) {
+                let badW = w - width
+                width = w
+                setBadWidth(badW / b)
+            }
+            setScrollDivWidth(width)
+        }
+    }, [queryForm?.gameId, size])
+
     // 处理左右按钮隐藏 显示
     useEffect(() => {
         // console.log('isHovering---->', isHovering, 'size---->', size, 'scroll--->', scroll);
         if (isHovering || isHovering1 || isHovering2) {
             let width = size.width || 0
             let left = scroll.left || 0
-            if (width >= 1960) { // 容器大于内容宽度 兼容
+            if (width >= scrollDivWidth) { // 容器大于内容宽度 兼容
                 setLeftShow(false)
                 setRightShow(false)
             } else {
@@ -47,10 +70,10 @@ const AllSurvey: React.FC = () => {
                 } else {
                     setLeftShow(true)
                 }
-                if (width < 1960) {
+                if (width < scrollDivWidth) {
                     setRightShow(true)
                 }
-                if (width + left === 1960) {
+                if (width + left === scrollDivWidth) {
                     setRightShow(false)
                 }
             }
@@ -58,7 +81,7 @@ const AllSurvey: React.FC = () => {
             setLeftShow(false)
             setRightShow(false)
         }
-    }, [isHovering, isHovering1, isHovering2, size, scroll])
+    }, [isHovering, isHovering1, isHovering2, size, scroll, ref, scrollDivWidth])
 
     // 左右移动
     const aboutHandle = (about: 'left' | 'right') => {
@@ -101,7 +124,6 @@ const AllSurvey: React.FC = () => {
                         isGameId
                         isSysUserId
                         isAgentId
-                    // isBeginDay
                     />
                 </Card>
             </div>
@@ -110,8 +132,8 @@ const AllSurvey: React.FC = () => {
                     <div className={style.left}><Button type="primary" ref={ref1} style={{ opacity: leftShow ? 1 : 0 }} onClick={() => aboutHandle('left')} shape="circle" icon={<LeftOutlined />} /></div>
                     <div className={style.right}><Button type="primary" ref={ref2} style={{ opacity: rightShow ? 1 : 0 }} onClick={() => aboutHandle('right')} shape="circle" icon={<RightOutlined />} /></div>
                     <div className={style.overviews} ref={ref}>
-                        <div>
-                            <Card bordered={false} style={{ width: 320, borderRadius: 8 }} bodyStyle={{ width: 320 }}>
+                        <div style={{ width: scrollDivWidth }}>
+                            <Card bordered={false} style={{ borderRadius: 8 }} bodyStyle={{ width: 320 + badWidth }}>
                                 <div className={style.overview}>
                                     <div className={style.left}>
                                         <UsergroupAddOutlined style={{ fontSize: 24 }} />
@@ -128,7 +150,7 @@ const AllSurvey: React.FC = () => {
                                     </div>
                                 </div>
                             </Card>
-                            <Card bordered={false} style={{ width: 320, borderRadius: 8 }} bodyStyle={{ width: 320 }}>
+                            <Card bordered={false} style={{ borderRadius: 8 }} bodyStyle={{ width: 320 + badWidth }}>
                                 <div className={style.overview}>
                                     <div className={style.left} style={{ backgroundColor: '#36a3f7' }}>
                                         <TransactionOutlined style={{ fontSize: 24 }} />
@@ -145,7 +167,7 @@ const AllSurvey: React.FC = () => {
                                     </div>
                                 </div>
                             </Card>
-                            <Card bordered={false} style={{ width: 320, borderRadius: 8 }} bodyStyle={{ width: 320 }}>
+                            <Card bordered={false} style={{ borderRadius: 8 }} bodyStyle={{ width: 320 + badWidth }}>
                                 <div className={style.overview}>
                                     <div className={style.left} style={{ backgroundColor: '#f4516c' }}>
                                         <MoneyCollectOutlined style={{ fontSize: 24 }} />
@@ -168,7 +190,7 @@ const AllSurvey: React.FC = () => {
                                     </div>
                                 </div>
                             </Card>
-                            <Card bordered={false} style={{ width: 320, borderRadius: 8 }} bodyStyle={{ width: 320 }}>
+                            <Card bordered={false} style={{ borderRadius: 8 }} bodyStyle={{ width: 320 + badWidth }}>
                                 <div className={style.overview}>
                                     <div className={style.left} style={{ backgroundColor: '#52c41a' }}>
                                         <AppstoreOutlined style={{ fontSize: 24 }} />
@@ -185,7 +207,7 @@ const AllSurvey: React.FC = () => {
                                     </div>
                                 </div>
                             </Card>
-                            {!queryForm?.gameId && <Card bordered={false} style={{ width: 320, borderRadius: 8 }} bodyStyle={{ width: 320 }}>
+                            {!queryForm?.gameId && <Card bordered={false} style={{ borderRadius: 8 }} bodyStyle={{ width: 320 + badWidth }}>
                                 <div className={style.overview}>
                                     <div className={style.left} style={{ backgroundColor: '#597ef7' }}>
                                         <BuildOutlined style={{ fontSize: 24 }} />
@@ -202,7 +224,7 @@ const AllSurvey: React.FC = () => {
                                     </div>
                                 </div>
                             </Card>}
-                            <Card bordered={false} style={{ width: 360, borderRadius: 8 }} bodyStyle={{ width: 360 }}>
+                            <Card bordered={false} style={{ borderRadius: 8 }} bodyStyle={{ width: 360 + badWidth }}>
                                 <div className={style.overview}>
                                     <div className={style.left} style={{ backgroundColor: '#9254de' }}>
                                         <AccountBookOutlined style={{ fontSize: 24 }} />
@@ -218,8 +240,8 @@ const AllSurvey: React.FC = () => {
                                                 <div><span style={{ color: 'red' }}>今日:</span><Statistic value={totalData?.firstRoi || 0} suffix="%" precision={2} /></div>
                                             </div>
                                             <div style={{ justifyContent: 'space-between', flex: 1 }}>
-                                                <div>7天:<Statistic value={totalData?.d7TotalRoi || 0} suffix="%" precision={2} /></div>
-                                                <div>30天:<Statistic value={totalData?.d30TotalRoi || 0} suffix="%" precision={2} /></div>
+                                                <div>7天:<Statistic value={totalData?.d7TotalRoi || 0} suffix="%" precision={2} /></div>
+                                                <div>30天:<Statistic value={totalData?.d30TotalRoi || 0} suffix="%" precision={2} /></div>
                                             </div>
                                         </div>
                                     </div>
@@ -231,7 +253,7 @@ const AllSurvey: React.FC = () => {
             </Spin>
 
         </Space>
-        <LineC height={size3.height || 0} queryForm={queryForm} />
+        <LineC width={size3.width || 0} height={size3.height || 0} queryForm={queryForm} />
     </div>
 }
 

+ 12 - 3
src/pages/gameDataStatistics/allSurvey/lineC.tsx

@@ -1,14 +1,17 @@
 import useEcharts from "@/Hook/useEcharts"
 import { Card, DatePicker, Radio, Space, Spin } from "antd"
-import React, { useEffect, useRef, useState } from "react"
+import React, { useEffect, useRef, useState, useMemo } from "react"
 import style from './index.less'
 import './index1.less'
 import { AllSurveyTotalDataProps, getAllSurveyLineDataApi } from "@/services/gameData/allSurvey"
 import { useAjax } from "@/Hook/useAjax"
 import moment from "moment"
+import { getPresets } from "@/components/QueryForm/const"
+let ranges = getPresets()
 
 interface Props {
     height: number
+    width: number
     queryForm: AllSurveyTotalDataProps
 }
 /**
@@ -18,7 +21,7 @@ interface Props {
 const LineC: React.FC<Props> = (props) => {
 
     /******************/
-    const { height = 0, queryForm } = props
+    const { height = 0, width, queryForm } = props
     const { LineMonitor } = useEcharts()
     const ref = useRef(null);
     const [type, setType] = useState<string>('a')
@@ -69,6 +72,11 @@ const LineC: React.FC<Props> = (props) => {
         })
     }, [queryForm, beginDate, endDate])
 
+    const Line = useMemo(() => {
+        let lineData = data[type] || []
+        return <LineMonitor style={{ width: '100%', height: '100%' }} series smooth data={JSON.parse(JSON.stringify(lineData))} />
+    }, [type, data, width, height])
+
     return <div className={style.lineCont} ref={ref} style={{ height: `calc(100% - ${145.43 + height}px)` }}>
         <Spin wrapperClassName={'spin_100'} spinning={getAllSurveyLineData.loading}>
             <Card
@@ -82,6 +90,7 @@ const LineC: React.FC<Props> = (props) => {
                     </Radio.Group>
                     <DatePicker.RangePicker
                         placeholder={['开始日期', '结束日期']}
+                        ranges={ranges as any}
                         value={(beginDate && endDate) ? ([moment(beginDate), moment(endDate)] as any) : undefined}
                         onChange={(e) => {
                             if (e && e.length === 2) {
@@ -96,7 +105,7 @@ const LineC: React.FC<Props> = (props) => {
                 </Space>}
                 bodyStyle={{ padding: '0 0 24px', height: 'calc(100% - 68px)' }}
             >
-                <LineMonitor style={{ width: '100%', height: '100%' }} series smooth data={data[type]} />
+                {Line}
             </Card>
         </Spin>
 

+ 4 - 19
src/pages/gameDataStatistics/extensionData/everyday/index.tsx

@@ -4,42 +4,31 @@ import { EverydayListType, getPromoteDayListApi, getPromoteDayTotalApi } from "@
 import React, { useEffect, useState } from "react"
 import TableData from "../../components/TableData"
 import columns12 from "./tableConfig"
-import { getGameChoiceParentListType1Api } from "@/services/gameData"
 import moment from "moment"
 import RechargeTrend from "@/components/rechargeTrend"
+import { getPresets } from "@/components/QueryForm/const"
 
 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<{ accountId?: number, visible: boolean, agentId?: number, beginDate?: string, sourceSystem?: string }>({ visible: false })
 
     const getPromoteDayList = useAjax((params) => getPromoteDayListApi(params))
     const getPromoteDayTotal = useAjax((params) => getPromoteDayTotalApi(params))
-    const getGameChoiceParentListType1 = useAjax(() => getGameChoiceParentListType1Api())
     /***************************/
 
     useEffect(() => {
         getPromoteDayTotal.run(queryForm).then(res => {
             res.id = 1
             res.dt = '总计'
+            res.beginDay = queryForm.beginDay
             setTotalData([res])
         })
         getPromoteDayList.run(queryForm)
     }, [queryForm])
 
-    useEffect(() => {
-        getGameChoiceParentListType1.run().then(res => {
-            let newType: any = {}
-            res.forEach((item: { id: number, name: string }) => {
-                newType[item.id] = item.name
-            })
-            setGameType(newType)
-        })
-    }, [])
-
     const rechargeTrendHandle = (data: any) => {
         if (data?.accountId) {
             setRtConfig({ visible: true, accountId: data?.accountId, agentId: data.agentId, beginDate: data.dt, sourceSystem: data.sourceSystem })
@@ -65,12 +54,9 @@ const Everyday: React.FC = () => {
                 isAccountId
                 isAgentId
                 isType
-                isConsumeDay={{}}
+                isConsumeDay={{ ranges: getPresets() }}
                 isBGGameClassify
-                // isCpName
-                // isGameName
                 isGameId
-                // isGameType
                 isSysUserId
             />}
             isZj
@@ -84,7 +70,6 @@ const Everyday: React.FC = () => {
             pageSize={queryForm.pageSize}
             title='推广每日数据'
             onChange={(props: any) => {
-                console.log('props--->', props)
                 let { pagination, sortData } = props
                 let { current, pageSize } = pagination
                 let newQueryForm = JSON.parse(JSON.stringify(queryForm))
@@ -99,7 +84,7 @@ const Everyday: React.FC = () => {
                 newQueryForm.pageSize = pageSize
                 setQueryForm({ ...newQueryForm })
             }}
-            config={columns12(gameType, rechargeTrendHandle)}
+            config={columns12(rechargeTrendHandle)}
             configName={'推广每日数据'}
         />
         {rtConfig.visible && <RechargeTrend {...rtConfig} onClose={() => setRtConfig({ visible: false })} />}

+ 85 - 12
src/pages/gameDataStatistics/extensionData/everyday/tableConfig.tsx

@@ -3,8 +3,9 @@ import React from "react"
 import style from './index.less'
 import { gameClassifyEnum } from "@/components/QueryForm/const"
 import { version } from "../../components/TableData"
+import moment from 'moment';
 
-function columns12(gameType: any, rechargeTrendHandle: (data: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
+function columns12(rechargeTrendHandle: (data: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
 
     let defaultValue = [  // 默认展示字段
         { label: '充值人数', key: 'rechargeCount', type: '付费趋势' },
@@ -34,8 +35,20 @@ function columns12(gameType: any, rechargeTrendHandle: (data: any) => void): { l
             label: "时间区间跨度",
             width: 110,
             render: (a: any, b: any) => {
+                let date1 = moment()
+                if (b?.dt === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.dt)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
                 let fieldData = getFieldDta()
-                if (fieldData?.length > 0) {
+                if (fieldData?.length > 0 && index <= day) {
                     let data: any = {}
                     let keyS: string[] = fieldData?.map((item: any) => item.key)
                     switch (fieldData[0].type) {
@@ -65,11 +78,11 @@ function columns12(gameType: any, rechargeTrendHandle: (data: any) => void): { l
 
     const roiC = Array(30).fill('').map((_item: string, index: number) => {
         let data = {
-            title: `${index + 1}日ROI`, 
-            dataIndex: `roiDay${index + 1}`, 
-            label: '付费数据', 
-            align: 'center', 
-            width: 70, 
+            title: `${index + 1}日ROI`,
+            dataIndex: `roiDay${index + 1}`,
+            label: '付费数据',
+            align: 'center',
+            width: 70,
             sorter: true,
             render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
         }
@@ -273,8 +286,20 @@ function columns12(gameType: any, rechargeTrendHandle: (data: any) => void): { l
                     label: "时间区间跨度",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.dt === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.dt)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 30 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -300,8 +325,20 @@ function columns12(gameType: any, rechargeTrendHandle: (data: any) => void): { l
                     label: "时间区间跨度",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.dt === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.dt)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 60 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -327,8 +364,20 @@ function columns12(gameType: any, rechargeTrendHandle: (data: any) => void): { l
                     label: "时间区间跨度",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.dt === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.dt)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 90 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -354,8 +403,20 @@ function columns12(gameType: any, rechargeTrendHandle: (data: any) => void): { l
                     label: "时间区间跨度",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.dt === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.dt)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 180 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -381,8 +442,20 @@ function columns12(gameType: any, rechargeTrendHandle: (data: any) => void): { l
                     label: "时间区间跨度",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.dt === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.dt)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 365 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {

+ 3 - 2
src/pages/gameDataStatistics/extensionData/total/index.tsx

@@ -6,6 +6,7 @@ import { PromoteTotalProps, getPromoteTotalApi, getPromoteTotalListApi } from "@
 import QueryForm from "@/components/QueryForm"
 import moment from "moment"
 import { getGameChoiceParentListType1Api } from "@/services/gameData"
+import { getPresets } from "@/components/QueryForm/const"
 
 const Total: React.FC = () => {
 
@@ -70,14 +71,14 @@ const Total: React.FC = () => {
                 isSource
                 isAccountId
                 isAgentId
-                isConsumeDay={{}}
+                isConsumeDay={{ ranges: getPresets() }}
                 isBGGameClassify
                 isType
                 // isCpName
                 // isGameName
                 isGameId
                 // isGameType
-                rechargeDay={{}}
+                rechargeDay={{ ranges: getPresets() }}
                 isSysUserId
             />}
             isZj

+ 17 - 17
src/pages/gameDataStatistics/extensionData/total/tableConfig.tsx

@@ -12,7 +12,7 @@ function columns12(gameType: any) {
             dataIndex: `roiDay${index + 1}`,
             label: '付费数据',
             align: 'center',
-            width: 70,
+            width: 80,
             sorter: true,
             render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
         }
@@ -88,7 +88,7 @@ function columns12(gameType: any) {
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 { title: '千次曝光成本', dataIndex: 'thousandViewCost', label: '广告曝光数据', align: 'center', width: 70, default: 13, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2} /> },
-                { title: '平均点击均价', dataIndex: 'avgClickCost', label: '广告曝光数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
+                { title: '平均点击均价', dataIndex: 'avgClickCost', label: '广告曝光数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2}/> },
                 { title: '应用下载开始量', dataIndex: 'appDownloadCount', label: '广告曝光数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
                 { title: '应用下载开始成本', dataIndex: 'appDownloadCost', label: '广告曝光数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2} /> },
                 {
@@ -158,23 +158,23 @@ function columns12(gameType: any) {
                 },
                 ...roiC,
                 {
-                    title: '60日ROI', dataIndex: 'roiDay60', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    title: '60日ROI', dataIndex: 'roiDay60', label: '付费数据', align: 'center', width: 80, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 0.9 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '90日ROI', dataIndex: 'roiDay90', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    title: '90日ROI', dataIndex: 'roiDay90', label: '付费数据', align: 'center', width: 80, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '180日ROI', dataIndex: 'roiDay180', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    title: '180日ROI', dataIndex: 'roiDay180', label: '付费数据', align: 'center', width: 80, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '1年ROI', dataIndex: 'roiYear1', label: '付费数据', align: 'center', width: 70, sorter: true,
+                    title: '1年ROI', dataIndex: 'roiYear1', label: '付费数据', align: 'center', width: 80, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
-                    title: '总ROI', dataIndex: 'roiTotal', label: '付费数据', align: 'center', width: 70, default: 25, sorter: true,
+                    title: '总ROI', dataIndex: 'roiTotal', label: '付费数据', align: 'center', width: 80, default: 25, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
                 {
@@ -189,11 +189,11 @@ function columns12(gameType: any) {
                     title: '当天付费率', dataIndex: 'todayRechargeRate', label: '付费数据', align: 'center', width: 70, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
-                { title: '新用户付费比', dataIndex: 'newUserRechargeRatio', label: '付费数据', align: 'center', width: 70, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '首日客单价', dataIndex: 'avgFirstUserRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '新用户客单价', dataIndex: 'avgUserRecharge', label: '付费数据', align: 'center', width: 70, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '当天客单价', dataIndex: 'avgTodayRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '账面客单价', dataIndex: 'avgShowUserRecharge', label: '付费数据', align: 'center', width: 70, render: (a: string) => <Statistic value={a || 0} /> },
+                { title: '新用户付费比', dataIndex: 'newUserRechargeRatio', label: '付费数据', align: 'center', width: 70, render: (a: string) => <Statistic value={a || 0} precision={2}/> },
+                { title: '首日客单价', dataIndex: 'avgFirstUserRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2}/> },
+                { title: '新用户客单价', dataIndex: 'avgUserRecharge', label: '付费数据', align: 'center', width: 70, render: (a: string) => <Statistic value={a || 0} precision={2}/> },
+                { title: '当天客单价', dataIndex: 'avgTodayRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2}/> },
+                { title: '账面客单价', dataIndex: 'avgShowUserRecharge', label: '付费数据', align: 'center', width: 70, render: (a: string) => <Statistic value={a || 0} precision={2}/> },
                 { title: '首日充值成本', dataIndex: 'firstRechargeCost', label: '付费数据', align: 'center', width: 90, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2} /> },
                 { title: '新用户充值成本', dataIndex: 'userRechargeCost', label: '付费数据', align: 'center', width: 90, render: (a: string) => <Statistic value={a || 0} precision={2} /> },
                 { title: '当天充值成本', dataIndex: 'todayRechargeCost', label: '付费数据', align: 'center', width: 90, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2} /> },
@@ -214,11 +214,11 @@ function columns12(gameType: any) {
                     title: '当天复充率', dataIndex: 'todayRepeatRechargeRate', label: '付费数据', align: 'center', width: 70, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
-                { title: '新增注册ARPPU', dataIndex: 'newRegArpu', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '首日付费ARPPU', dataIndex: 'firstRechargeArpu', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '新用户付费ARPPU', dataIndex: 'userRechargeArpu', label: '付费数据', align: 'center', width: 80, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '当天付费ARPPU', dataIndex: 'todayRechargeArpu', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
-                { title: '账面ARPPU', dataIndex: 'showRechargeArpu', label: '付费数据', align: 'center', width: 80, render: (a: string) => <Statistic value={a || 0} /> }
+                { title: '新增注册ARPPU', dataIndex: 'newRegArpu', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2}/> },
+                { title: '首日付费ARPPU', dataIndex: 'firstRechargeArpu', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2}/> },
+                { title: '新用户付费ARPPU', dataIndex: 'userRechargeArpu', label: '付费数据', align: 'center', width: 80, render: (a: string) => <Statistic value={a || 0} precision={2}/> },
+                { title: '当天付费ARPPU', dataIndex: 'todayRechargeArpu', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} precision={2}/> },
+                { title: '账面ARPPU', dataIndex: 'showRechargeArpu', label: '付费数据', align: 'center', width: 80, render: (a: string) => <Statistic value={a || 0} precision={2}/> }
             ]
         },
         // {

+ 4 - 2
src/pages/gameDataStatistics/gameData/everyday/index.tsx

@@ -10,6 +10,7 @@ import moment from "moment"
 import RechargeTrendGame from "@/components/rechargeTrend/index_game"
 import { Tabs } from "antd"
 import './index.less'
+import { getPresets } from "@/components/QueryForm/const"
 
 /**
  * 游戏每日数据
@@ -38,6 +39,7 @@ const Everyday: React.FC = () => {
         getGameDayTotal.run(queryForm).then(res => {
             res.id = 1
             res.costDate = '总计'
+            res.beginDay = queryForm.registeredBeginDate
             setTotalData([res])
         })
     }, [queryForm])
@@ -77,7 +79,7 @@ const Everyday: React.FC = () => {
                     setQueryForm({ ...newQueryForm, ...params })
                 }}
                 isSource
-                isRegDay
+                isRegDay={{ ranges: getPresets() }}
                 isGameId
                 isBGGameClassify
             />}
@@ -109,7 +111,7 @@ const Everyday: React.FC = () => {
             config={accessKey === '1' ? columnsBuy12(rechargeTrendHandle) : accessKey === '2' ? columnsNature12(rechargeTrendHandle) : columns12(rechargeTrendHandle)}
             configName={accessKey === '1' ? `游戏每日付费趋势Buy` : accessKey === '2' ? '游戏每日付费趋势Nature' : '游戏每日付费趋势'}
         />
-        
+
         {rtConfig.visible && <RechargeTrendGame {...rtConfig} onClose={() => setRtConfig({ visible: false })} />}
     </div>
 }

+ 196 - 15
src/pages/gameDataStatistics/gameData/everyday/tableConfig.tsx

@@ -3,6 +3,7 @@ import style from './index.less'
 import { Statistic } from "antd"
 import { gameClassifyEnum } from "@/components/QueryForm/const"
 import { version } from "../../components/TableData"
+import moment from "moment"
 
 function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
 
@@ -34,8 +35,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
             align: "center",
             width: 110,
             render: (a: any, b: any) => {
+                let date1 = moment()
+                if (b?.costDate === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b?.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.costDate)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
                 let fieldData = getFieldDta()
-                if (fieldData?.length > 0) {
+                if (fieldData?.length > 0 && index <= day) {
                     let data: any = {}
                     let keyS: string[] = fieldData?.map((item: any) => item.key)
                     switch (fieldData[0].type) {
@@ -69,8 +82,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
             align: "center",
             width: 110,
             render: (a: any, b: any) => {
+                let date1 = moment()
+                if (b?.costDate === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b?.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.costDate)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
                 let fieldData = getFieldDta()
-                if (fieldData?.length > 0) {
+                if (fieldData?.length > 0 && index <= day) {
                     let data: any = {}
                     let keyS: string[] = fieldData?.map((item: any) => item.key)
                     switch (fieldData[0].type) {
@@ -106,8 +131,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
             align: "center",
             width: 110,
             render: (a: any, b: any) => {
+                let date1 = moment()
+                if (b?.costDate === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b?.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.costDate)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
                 let fieldData = getFieldDta()
-                if (fieldData?.length > 0) {
+                if (fieldData?.length > 0 && index <= day) {
                     let data: any = {}
                     let keyS: string[] = fieldData?.map((item: any) => item.key)
                     switch (fieldData[0].type) {
@@ -485,8 +522,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 30 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -513,8 +562,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 60 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -541,8 +602,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 90 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -569,8 +642,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 180 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -632,8 +717,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     default: 43,
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 30 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -660,8 +757,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 60 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -688,8 +797,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 90 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -716,8 +837,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 180 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -779,8 +912,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     width: 110,
                     default: 43,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 30 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -807,8 +952,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 60 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -835,8 +992,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 90 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -863,8 +1032,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 180 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {

+ 204 - 20
src/pages/gameDataStatistics/gameData/everyday/tableConfigBuy.tsx

@@ -3,6 +3,7 @@ import style from './index.less'
 import { Statistic } from "antd"
 import { gameClassifyEnum } from "@/components/QueryForm/const"
 import { version } from "../../components/TableData"
+import moment from "moment"
 
 function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
 
@@ -34,9 +35,21 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
             label: "买量付费趋势",
             align: "center",
             width: 110,
-            render: (a: any, b: any) => {
+            render: (_: any, b: any) => {
+                let date1 = moment()
+                if (b?.costDate === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b?.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.costDate)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
                 let fieldData = getFieldDta()
-                if (fieldData?.length > 0) {
+                if (fieldData?.length > 0 && index <= day) {
                     let data: any = {}
                     let keyS: string[] = fieldData?.map((item: any) => item.key)
                     switch (fieldData[0].type) {
@@ -73,9 +86,21 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
             label: "自然量付费趋势",
             align: "center",
             width: 110,
-            render: (a: any, b: any) => {
+            render: (_: any, b: any) => {
+                let date1 = moment()
+                if (b?.costDate === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b?.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.costDate)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
                 let fieldData = getFieldDta()
-                if (fieldData?.length > 0) {
+                if (fieldData?.length > 0 && index <= day) {
                     let data: any = {}
                     let keyS: string[] = fieldData?.map((item: any) => item.key)
                     switch (fieldData[0].type) {
@@ -108,9 +133,21 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
             label: "总付费趋势",
             align: "center",
             width: 110,
-            render: (a: any, b: any) => {
+            render: (_: any, b: any) => {
+                let date1 = moment()
+                if (b?.costDate === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b?.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.costDate)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
                 let fieldData = getFieldDta()
-                if (fieldData?.length > 0) {
+                if (fieldData?.length > 0 && index <= day) {
                     let data: any = {}
                     let keyS: string[] = fieldData?.map((item: any) => item.key)
                     switch (fieldData[0].type) {
@@ -189,7 +226,7 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                 { title: '买量首日新用户充值次数', dataIndex: 'buyFirstNewUserAmountCount', label: '买量付费数据', align: 'center', width: 70, sorter: true },
                 { title: '买量首日新用户充值人数', dataIndex: 'buyFirstNewUserAmountNum', label: '买量付费数据', align: 'center', width: 70, default: 6, sorter: true },
                 {
-                    title: '买量首日新用户充值金额', dataIndex: 'buyFirstNewUserAmount', label: '买量付费数据', align: 'center', width: 70,  default: 7, sorter: true,
+                    title: '买量首日新用户充值金额', dataIndex: 'buyFirstNewUserAmount', label: '买量付费数据', align: 'center', width: 70, default: 7, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
                 },
                 { title: '买量老用户充值次数', dataIndex: 'buyOldUserCount', label: '买量付费数据', align: 'center', width: 70, sorter: true },
@@ -254,6 +291,9 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     title: '买量复充率', dataIndex: 'buyUserAgainRate', label: '买量付费数据', align: 'center', width: 70, sorter: true,
                     render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
                 },
+
+                
+
                 {
                     title: '买量新增注册ARPPU', dataIndex: 'buyRegUserArpu', label: '买量付费数据', align: 'center', width: 70, sorter: true,
                     render: (a: string) => <Statistic value={a || 0} />
@@ -485,9 +525,21 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     align: "center",
                     default: 43,
                     width: 110,
-                    render: (a: any, b: any) => {
+                    render: (_: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 30 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -514,8 +566,20 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 60 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -542,8 +606,20 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 90 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -570,8 +646,20 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 180 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -632,8 +720,20 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 30 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -660,8 +760,20 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 60 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -688,8 +800,20 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 90 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -716,8 +840,20 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 180 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -778,8 +914,20 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 30 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -806,8 +954,20 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 60 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -834,8 +994,20 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 90 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -862,8 +1034,20 @@ function columnsBuy12(rechargeTrendHandle: (data: any) => void): { label: string
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 180 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {

+ 196 - 15
src/pages/gameDataStatistics/gameData/everyday/tableConfigNature.tsx

@@ -3,6 +3,7 @@ import style from './index.less'
 import { Statistic } from "antd"
 import { gameClassifyEnum } from "@/components/QueryForm/const"
 import { version } from "../../components/TableData"
+import moment from "moment"
 
 function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
 
@@ -34,8 +35,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
             align: "center",
             width: 110,
             render: (a: any, b: any) => {
+                let date1 = moment()
+                if (b?.costDate === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b?.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.costDate)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
                 let fieldData = getFieldDta()
-                if (fieldData?.length > 0) {
+                if (fieldData?.length > 0 && index <= day) {
                     let data: any = {}
                     let keyS: string[] = fieldData?.map((item: any) => item.key)
                     switch (fieldData[0].type) {
@@ -70,8 +83,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
             align: "center",
             width: 110,
             render: (a: any, b: any) => {
+                let date1 = moment()
+                if (b?.costDate === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b?.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.costDate)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
                 let fieldData = getFieldDta()
-                if (fieldData?.length > 0) {
+                if (fieldData?.length > 0 && index <= day) {
                     let data: any = {}
                     let keyS: string[] = fieldData?.map((item: any) => item.key)
                     switch (fieldData[0].type) {
@@ -108,8 +133,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
             align: "center",
             width: 110,
             render: (a: any, b: any) => {
+                let date1 = moment()
+                if (b?.costDate === '总计') {
+                    if (b?.beginDay) {
+                        date1 = moment(b?.beginDay)
+                    } else {
+                        date1 = moment()
+                    }
+                } else {
+                    date1 = moment(b.costDate)
+                }
+                let dt = moment()
+                let day = dt.diff(date1, 'day');
                 let fieldData = getFieldDta()
-                if (fieldData?.length > 0) {
+                if (fieldData?.length > 0 && index <= day) {
                     let data: any = {}
                     let keyS: string[] = fieldData?.map((item: any) => item.key)
                     switch (fieldData[0].type) {
@@ -484,8 +521,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 30 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -512,8 +561,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 60 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -540,8 +601,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 90 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -568,8 +641,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 180 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -631,8 +716,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     default: 43,
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 30 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -659,8 +756,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 60 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -687,8 +796,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 90 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -715,8 +836,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 180 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -777,8 +910,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 30 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -805,8 +950,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 60 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -833,8 +990,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 90 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {
@@ -861,8 +1030,20 @@ function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: str
                     align: "center",
                     width: 110,
                     render: (a: any, b: any) => {
+                        let date1 = moment()
+                        if (b?.costDate === '总计') {
+                            if (b?.beginDay) {
+                                date1 = moment(b?.beginDay)
+                            } else {
+                                date1 = moment()
+                            }
+                        } else {
+                            date1 = moment(b.costDate)
+                        }
+                        let dt = moment()
+                        let day = dt.diff(date1, 'day');
                         let fieldData = getFieldDta()
-                        if (fieldData?.length > 0) {
+                        if (fieldData?.length > 0 && 180 <= day) {
                             let data: any = {}
                             let keyS: string[] = fieldData?.map((item: any) => item.key)
                             switch (fieldData[0].type) {

+ 3 - 2
src/pages/gameDataStatistics/gameData/h5Recharge/index.tsx

@@ -5,6 +5,7 @@ import { GameH5Props, getGameH5ListApi } from "@/services/gameData/game"
 import { useAjax } from "@/Hook/useAjax"
 import QueryForm from "@/components/QueryForm"
 import moment from "moment"
+import { getPresets } from "@/components/QueryForm/const"
 
 const H5Recharge: React.FC = () => {
 
@@ -52,9 +53,9 @@ const H5Recharge: React.FC = () => {
                     setQueryForm({ ...newQueryForm, ...params })
                 }}
                 isSource
-                isRegDay
+                isRegDay={{ ranges: getPresets() }}
                 isGameId
-                rechargeDay={{}}
+                rechargeDay={{ ranges: getPresets() }}
             />}
             scroll={{ x: 1000, y: 600 }}
             ajax={getGameH5List}

+ 3 - 3
src/pages/gameDataStatistics/gameData/total/index.tsx

@@ -6,7 +6,7 @@ import columnsNature12 from './tableConfigNature'
 import { useAjax } from "@/Hook/useAjax"
 import { GameTotalProps, getGameTotalListApi } from "@/services/gameData/game"
 import QueryForm from "@/components/QueryForm"
-import { czPresets } from "@/components/QueryForm/const"
+import { getPresets } from "@/components/QueryForm/const"
 import moment from "moment"
 import { Tabs } from "antd"
 import '../everyday/index.less'
@@ -66,10 +66,10 @@ const Total: React.FC = () => {
                     setQueryForm({ ...newQueryForm, ...params })
                 }}
                 isSource
-                isRegDay
+                isRegDay={{ ranges: getPresets() }}
                 isGameId
                 isBGGameClassify
-                rechargeDay={{ ranges: czPresets }}
+                rechargeDay={{ ranges: getPresets() }}
             />}
             scroll={{ x: 1000, y: 600 }}
             ajax={getGameTotalList}

+ 3 - 2
src/pages/gameDataStatistics/order/index.tsx

@@ -4,6 +4,7 @@ import { getOrderListApi, OrderListType } from "@/services/gameData/order"
 import React, { useEffect, useState } from "react"
 import TableData from "../components/TableData"
 import columns12 from "./tableConfig"
+import { getPresets } from "@/components/QueryForm/const"
 
 
 
@@ -63,8 +64,8 @@ const Order: React.FC = () => {
                 isGameRoleId
                 isUserName
                 isSysUserId
-                isCreateDay
-                isRegDay
+                isCreateDay={{ ranges: getPresets() }}
+                isRegDay={{ ranges: getPresets() }}
             />}
             scroll={{ x: 1000, y: 600 }}
             ajax={getOrderList}

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

@@ -4,13 +4,13 @@ import columns12 from "./tableConfig"
 import { useAjax } from "@/Hook/useAjax"
 import { AccountProps, getAccountRechargeRankingListApi } from "@/services/gameData/rankingList"
 import QueryForm from "@/components/QueryForm"
-import { rangePresets } from "@/components/QueryForm/const"
-
+import { getPresetsRanking } from "@/components/QueryForm/const"
+import moment from "moment"
 
 const Account: React.FC = () => {
 
     /********************************/
-    const [queryForm, setQueryForm] = useState<AccountProps>({ pageNum: 1, pageSize: 20, sourceSystem: 'ZX_ONE' })
+    const [queryForm, setQueryForm] = useState<AccountProps>({ pageNum: 1, pageSize: 20, sourceSystem: 'ZX_ONE', beginDay: moment().format('YYYY-MM-DD'), endDay: moment().format('YYYY-MM-DD') })
 
     const getAccountRechargeRankingList = useAjax((params) => getAccountRechargeRankingListApi(params))
     /********************************/
@@ -23,7 +23,7 @@ const Account: React.FC = () => {
 
         <TableData
             leftChild={<QueryForm
-                initialValues={{ sourceSystem: 'ZX_ONE' }}
+                initialValues={{ sourceSystem: 'ZX_ONE', consumeDay: [moment(), moment()] }}
                 onChange={(data: any) => {
                     console.log(data)
                     const { costBeginDay, costEndDay, ...params } = data
@@ -39,7 +39,7 @@ const Account: React.FC = () => {
                     setQueryForm({ ...newQueryForm, ...params })
                 }}
                 isSource
-                isConsumeDay={{ ranges: rangePresets }}
+                isConsumeDay={{ ranges: getPresetsRanking() }}
                 isSysUserId
                 isType
                 isAccountId

+ 4 - 5
src/pages/gameDataStatistics/rankingList/channel/index.tsx

@@ -1,4 +1,3 @@
-import { Radio, Space } from "antd"
 import React, { useEffect, useState } from "react"
 import TableData from "../../components/TableData"
 import columns12 from "./tableConfig"
@@ -6,13 +5,13 @@ import moment from "moment"
 import { useAjax } from "@/Hook/useAjax"
 import { ChannelProps, getAgentRechargeRankingListApi } from "@/services/gameData/rankingList"
 import QueryForm from "@/components/QueryForm"
-import { rangePresets } from "@/components/QueryForm/const"
+import { getPresetsRanking } from "@/components/QueryForm/const"
 
 
 const Channel: React.FC = () => {
 
     /********************************/
-    const [queryForm, setQueryForm] = useState<ChannelProps>({ pageNum: 1, pageSize: 20, sourceSystem: 'ZX_ONE' })
+    const [queryForm, setQueryForm] = useState<ChannelProps>({ pageNum: 1, pageSize: 20, sourceSystem: 'ZX_ONE', beginDay: moment().format('YYYY-MM-DD'), endDay: moment().format('YYYY-MM-DD') })
 
     const getAgentRechargeRankingList = useAjax((params) => getAgentRechargeRankingListApi(params))
     /********************************/
@@ -25,7 +24,7 @@ const Channel: React.FC = () => {
 
         <TableData
             leftChild={<QueryForm
-                initialValues={{ sourceSystem: 'ZX_ONE' }}
+                initialValues={{ sourceSystem: 'ZX_ONE', rechargeDay: [moment(), moment()] }}
                 onChange={(data: any) => {
                     console.log(data)
                     const { rechargeDay, ...params } = data
@@ -41,7 +40,7 @@ const Channel: React.FC = () => {
                     setQueryForm({ ...newQueryForm, ...params })
                 }}
                 isSource
-                rechargeDay={{ ranges: rangePresets }}
+                rechargeDay={{ ranges: getPresetsRanking() }}
                 isSysUserId
                 isAgentId
                 isType

+ 4 - 4
src/pages/gameDataStatistics/rankingList/game/index.tsx

@@ -5,14 +5,14 @@ import TableData from "../../components/TableData"
 import columns12 from "./tableConfig"
 import moment from "moment"
 import QueryForm from "@/components/QueryForm"
-import { rangePresets } from "@/components/QueryForm/const"
+import { getPresetsRanking } from "@/components/QueryForm/const"
 import { getGameChoiceParentListType1Api } from "@/services/gameData"
 
 
 const Game: React.FC = () => {
 
     /************************/
-    const [queryForm, setQueryForm] = useState<GameRechargeListType>({ pageNum: 1, pageSize: 20, sourceSystem: 'ZX_ONE' })
+    const [queryForm, setQueryForm] = useState<GameRechargeListType>({ pageNum: 1, pageSize: 20, sourceSystem: 'ZX_ONE', beginDay: moment().format('YYYY-MM-DD'), endDay: moment().format('YYYY-MM-DD') })
     const [gameType, setGameType] = useState<any>({})
 
     const getRechargeGameList = useAjax((params) => getRechargeGameListApi(params))
@@ -35,7 +35,7 @@ const Game: React.FC = () => {
     return <div>
         <TableData
             leftChild={<QueryForm
-                initialValues={{ sourceSystem: 'ZX_ONE' }}
+                initialValues={{ sourceSystem: 'ZX_ONE', rechargeDay: [moment(), moment()] }}
                 onChange={(data: any) => {
                     console.log(data)
                     const { rechargeDay, beginDay, endDay, ...par } = data
@@ -56,7 +56,7 @@ const Game: React.FC = () => {
                     setQueryForm({ ...newQueryForm, ...par })
                 }}
                 isSource
-                rechargeDay={{ ranges: rangePresets }}
+                rechargeDay={{ ranges: getPresetsRanking() }}
             />}
             scroll={{ x: 1200, y: 600 }}
             ajax={getRechargeGameList}

+ 4 - 4
src/pages/gameDataStatistics/rankingList/gamer/index.tsx

@@ -5,12 +5,12 @@ import TableData from "../../components/TableData"
 import columns12 from "./tableConfig"
 import QueryForm from "@/components/QueryForm"
 import moment from "moment"
-import { rangePresets } from "@/components/QueryForm/const"
+import { getPresetsRanking } from "@/components/QueryForm/const"
 
 const Gamer: React.FC = () => {
 
     /************************/
-    const [queryForm, setQueryForm] = useState<UserRechargeListType>({ pageNum: 1, pageSize: 20, sourceSystem: 'ZX_ONE' })
+    const [queryForm, setQueryForm] = useState<UserRechargeListType>({ pageNum: 1, pageSize: 20, sourceSystem: 'ZX_ONE', beginDay: moment().format('YYYY-MM-DD'), endDay: moment().format('YYYY-MM-DD') })
     const getRechargeUserList = useAjax((params) => getRechargeUserListApi(params))
     /************************/
 
@@ -22,7 +22,7 @@ const Gamer: React.FC = () => {
 
         <TableData
             leftChild={<QueryForm
-                initialValues={{ sourceSystem: 'ZX_ONE' }}
+                initialValues={{ sourceSystem: 'ZX_ONE', rechargeDay: [moment(), moment()] }}
                 onChange={(data: any) => {
                     console.log(data)
                     const { rechargeDay, beginDay, endDay, ...par } = data
@@ -43,7 +43,7 @@ const Gamer: React.FC = () => {
                     setQueryForm({ ...newQueryForm, ...par })
                 }}
                 isSource
-                rechargeDay={{ ranges: rangePresets }}
+                rechargeDay={{ ranges: getPresetsRanking() }}
             />}
             scroll={{ x: 1000, y: 600 }}
             ajax={getRechargeUserList}

+ 12 - 12
src/pages/user/login/index.tsx

@@ -11,7 +11,7 @@ import { erpApi } from '@/services/api';
 
 /**  退出登录,并且将当前的 url 保存 */
 const loginOut = async () => {
-	sessionStorage.removeItem('Admin-Token')
+	localStorage.removeItem('Admin-Token')
 };
 
 const Login: React.FC<{}> = () => {
@@ -42,7 +42,7 @@ const Login: React.FC<{}> = () => {
 		let hash = window.location.hash
 		if (hash?.includes('token')) {
 			let token = hash?.split('token=')[1]
-			sessionStorage.setItem('Admin-Token', token)
+			localStorage.setItem('Admin-Token', token)
 			setTimeout(() => { window.location.href = '/'; }, 50)
 		}
 	}, [])
@@ -78,16 +78,16 @@ const Login: React.FC<{}> = () => {
 	}, [show])
 	// 钉钉登录
 	useEffect(() => {
-		if (!sessionStorage.getItem('Admin-Token')) {
+		if (!localStorage.getItem('Admin-Token')) {
 			let query = history?.location?.query
 			if (query?.code) {
 				Ddlogin.run({ code: query?.code, state: query?.state, stateKey: sessionStorage.getItem('DDK') }).then((msg: any) => {
 					if (msg.code === 200) {
-						sessionStorage.setItem('Admin-Token', msg?.data?.token)
+						localStorage.setItem('Admin-Token', msg?.data?.token)
 						let companyInfo = msg?.data?.companyRelationInfo?.filter((item: { companyId: number }) => item.companyId !== 4 && item.companyId !== 3)
 						setIsLogin(false)
 						if (companyInfo?.length === 0) {
-							sessionStorage.removeItem('Admin-Token')
+							localStorage.removeItem('Admin-Token')
 							message.error('登录失败,请用趣程运营平台账号登录')
 							return
 						} else if (companyInfo?.length === 1) {
@@ -144,13 +144,13 @@ const Login: React.FC<{}> = () => {
 			}
 		}
 
-	}, [tab, sessionStorage.getItem('Admin-Token')])
+	}, [tab, localStorage.getItem('Admin-Token')])
 	// 选择公司
 	const setCompanyHandle = (companyId: number) => {
 		setLoading(() => true)
 		fetch(erpApi + `/erp/user/chooseCompany/${companyId}`, {
 			method: 'PUT',
-			headers: { ['Authorization']: 'Bearer ' + sessionStorage.getItem('Admin-Token') }
+			headers: { ['Authorization']: 'Bearer ' + localStorage.getItem('Admin-Token') }
 		}).then(res => res.json()).then((res: any) => {
 			setLoading(() => false)
 			if (res?.code === 200) {
@@ -162,11 +162,11 @@ const Login: React.FC<{}> = () => {
 				}).then(res => res.json()).then(js => {
 					if (js?.data?.configValue === 'true') {
 						message.error('版本更新中....请关注大群公告!!!!', 5, () => {
-							sessionStorage.removeItem('Admin-Token')
+							localStorage.removeItem('Admin-Token')
 							window.location.href = '/';
 						})
 					} else {
-						sessionStorage.setItem('Admin-Token', res?.data?.token)
+						localStorage.setItem('Admin-Token', res?.data?.token)
 						window.location.href = '/';
 						// setTimeout(() => {
 						//   refresh();
@@ -238,10 +238,10 @@ const Login: React.FC<{}> = () => {
 				try {
 					if (res.code === 200) {
 						setIsLogin(false)
-						sessionStorage.setItem('Admin-Token', res?.data?.token)
+						localStorage.setItem('Admin-Token', res?.data?.token)
 						let companyInfo = res?.data?.companyRelationInfo?.filter((item: { companyId: number }) => item.companyId !== 4 && item.companyId !== 3)
 						if (companyInfo?.length === 0) {
-							sessionStorage.removeItem('Admin-Token')
+							localStorage.removeItem('Admin-Token')
 							message.error('登录失败,请用趣程运营平台账号登录')
 							return
 						} else if (companyInfo?.length === 1) {
@@ -271,7 +271,7 @@ const Login: React.FC<{}> = () => {
 					<div className={`${styles.container}`} id='login'>
 						<div className={styles.content}>
 
-							{sessionStorage.getItem('Admin-Token') && companyList?.length > 0 ? <div className={`${styles.company}  ${isMobile ? '' : show ? '' : styles.login_hide}`}>
+							{localStorage.getItem('Admin-Token') && companyList?.length > 0 ? <div className={`${styles.company}  ${isMobile ? '' : show ? '' : styles.login_hide}`}>
 								<h1>趣程游戏数据系统</h1>
 
 								<div className={styles.companyAccount}>