|
@@ -4,31 +4,9 @@ import { Statistic, Tooltip } from "antd"
|
|
|
import React from "react"
|
|
|
import moment from "moment"
|
|
|
import style from './index.less'
|
|
|
-import { version } from "../../components/TableData"
|
|
|
|
|
|
function columns12(): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
|
|
|
|
|
|
- const getFieldDta = () => {
|
|
|
- let defaultValue = [ // 默认展示字段
|
|
|
- { label: '新用户人数', key: 'regNum', type: 'D1~Dn' },
|
|
|
- { label: '创角人数', key: 'roleNum', type: 'D1~Dn' },
|
|
|
- { label: '活跃人数', key: 'activeNum', type: 'D1~Dn' },
|
|
|
- { label: '付费人数', key: 'amountNum', type: 'D1~Dn' },
|
|
|
- { label: '付费金额', key: 'amount', type: 'D1~Dn' },
|
|
|
- { label: '滚服人数', key: 'rollServerNum', type: 'D1~Dn' },
|
|
|
- { label: '滚服付费人数', key: 'rollServerAmountNum', type: 'D1~Dn' },
|
|
|
- { label: '滚服付费金额', key: 'rollServerAmount', type: 'D1~Dn' },
|
|
|
- { label: '滚服(付费金额)占比', key: 'rollServerAmountRate', type: 'D1~Dn' },
|
|
|
- ]
|
|
|
- let mySelectFieldData = localStorage.getItem(`myAdFieldConfig${version}_区服数据`)
|
|
|
- let newSelectFieldData: any = {}
|
|
|
- if (mySelectFieldData) {
|
|
|
- newSelectFieldData = JSON.parse(mySelectFieldData).date_field
|
|
|
- } else {
|
|
|
- newSelectFieldData = defaultValue
|
|
|
- }
|
|
|
- return newSelectFieldData
|
|
|
- }
|
|
|
|
|
|
let defaultStart = 13
|
|
|
const day = Array(90).fill('').map((_item: string, index: number) => {
|
|
@@ -58,24 +36,19 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
|
|
|
}
|
|
|
let dt = moment()
|
|
|
let day = dt.diff(date1, 'day');
|
|
|
- let fieldData = getFieldDta()
|
|
|
- if (fieldData?.length > 0 && index <= day) {
|
|
|
+ if (index <= day) {
|
|
|
let data: any = {}
|
|
|
- let keyS: string[] = fieldData?.map((item: any) => item.key)
|
|
|
- switch (fieldData[0].type) {
|
|
|
- case 'D1~Dn':
|
|
|
- if (b?.[field]) {
|
|
|
- data = b?.[field]
|
|
|
- return <div className={style.dbox}>
|
|
|
- {keyS?.includes('regNum') && <span style={{ color: '#2f54eb', fontWeight: 600 }}>新用户人数:<span>{data?.regNum}</span></span>}
|
|
|
- {keyS?.includes('roleNum') && <span style={{ color: '#722ed1', fontWeight: 600 }}>创角人数:<span>{data?.roleNum}</span></span>}
|
|
|
- {keyS?.includes('activeNum') && <span style={{ color: '#eb2f96', fontWeight: 600 }}>活跃人数:<span>{data?.activeNum}</span></span>}
|
|
|
- {keyS?.includes('amountNum') && <span style={{ color: '#d81b60', fontWeight: 600 }}>付费人数:<span>{data?.amountNum}</span></span>}
|
|
|
- {keyS?.includes('amount') && <span style={{ color: '#0f538a', fontWeight: 600 }}>付费金额:<span><Statistic value={data?.amount || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
|
|
|
- </div>
|
|
|
- }
|
|
|
- return '--'
|
|
|
+ if (b?.[field]) {
|
|
|
+ data = b?.[field]
|
|
|
+ return <div className={style.dbox}>
|
|
|
+ <span style={{ color: '#2f54eb', fontWeight: 600 }}>新用户人数:<span>{data?.regNum}</span></span>
|
|
|
+ <span style={{ color: '#722ed1', fontWeight: 600 }}>创角人数:<span>{data?.roleNum}</span></span>
|
|
|
+ <span style={{ color: '#eb2f96', fontWeight: 600 }}>活跃人数:<span>{data?.activeNum}</span></span>
|
|
|
+ <span style={{ color: '#d81b60', fontWeight: 600 }}>付费人数:<span>{data?.amountNum}</span></span>
|
|
|
+ <span style={{ color: '#0f538a', fontWeight: 600 }}>付费金额:<span><Statistic value={data?.amount || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>
|
|
|
+ </div>
|
|
|
}
|
|
|
+ return '--'
|
|
|
}
|
|
|
return '--'
|
|
|
},
|
|
@@ -98,23 +71,18 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
|
|
|
}
|
|
|
let dt = moment()
|
|
|
let day = dt.diff(date1, 'day');
|
|
|
- let fieldData = getFieldDta()
|
|
|
- if (fieldData?.length > 0 && index <= day) {
|
|
|
+ if (index <= day) {
|
|
|
let data: any = {}
|
|
|
- let keyS: string[] = fieldData?.map((item: any) => item.key)
|
|
|
- switch (fieldData[0].type) {
|
|
|
- case 'D1~Dn':
|
|
|
- if (b?.[field]) {
|
|
|
- data = b?.[field]
|
|
|
- return <div className={style.dbox}>
|
|
|
- {keyS?.includes('rollServerNum') && <span style={{ color: '#13c2c2', fontWeight: 600 }}>滚服人数:<span>{data?.rollServerNum}</span></span>}
|
|
|
- {keyS?.includes('rollServerAmountNum') && <span style={{ color: '#faad14', fontWeight: 600 }}>滚服付费人数:<span>{data?.rollServerAmountNum}</span></span>}
|
|
|
- {keyS?.includes('rollServerAmount') && <span style={{ color: '#0f538a', fontWeight: 600 }}>滚服付费金额:<span><Statistic value={data?.rollServerAmount || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
|
|
|
- {keyS?.includes('rollServerAmountRate') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>滚服占比:<span>{(data?.rollServerAmountRate * 100)?.toFixed(2)}%</span></span>}
|
|
|
- </div>
|
|
|
- }
|
|
|
- return '--'
|
|
|
+ if (b?.[field]) {
|
|
|
+ data = b?.[field]
|
|
|
+ return <div className={style.dbox}>
|
|
|
+ <span style={{ color: '#13c2c2', fontWeight: 600 }}>滚服人数:<span>{data?.rollServerNum}</span></span>
|
|
|
+ <span style={{ color: '#faad14', fontWeight: 600 }}>滚服付费人数:<span>{data?.rollServerAmountNum}</span></span>
|
|
|
+ <span style={{ color: '#0f538a', fontWeight: 600 }}>滚服付费金额:<span><Statistic value={data?.rollServerAmount || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>
|
|
|
+ <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>滚服占比:<span>{(data?.rollServerAmountRate * 100)?.toFixed(2)}%</span></span>
|
|
|
+ </div>
|
|
|
}
|
|
|
+ return '--'
|
|
|
}
|
|
|
return '--'
|
|
|
},
|
|
@@ -137,9 +105,6 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
|
|
|
}
|
|
|
let dt = moment()
|
|
|
let day = dt.diff(date1, 'day');
|
|
|
- if (index < 1 && b?.gameName === '暗影防线H5') {
|
|
|
- console.log('========', index, day)
|
|
|
- }
|
|
|
if (index <= day) {
|
|
|
let data: any = {}
|
|
|
switch (b?.activeTypes) {
|
|
@@ -272,24 +237,19 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
|
|
|
}
|
|
|
let dt = moment()
|
|
|
let day = dt.diff(date1, 'day');
|
|
|
- let fieldData = getFieldDta()
|
|
|
- if (fieldData?.length > 0 && item * 30 <= day) {
|
|
|
+ if (item * 30 <= day) {
|
|
|
let data: any = {}
|
|
|
- let keyS: string[] = fieldData?.map((item: any) => item.key)
|
|
|
- switch (fieldData[0].type) {
|
|
|
- case 'D1~Dn':
|
|
|
- if (b?.[field]) {
|
|
|
- data = b?.[field]
|
|
|
- return <div className={style.dbox}>
|
|
|
- {keyS?.includes('regNum') && <span style={{ color: '#2f54eb', fontWeight: 600 }}>新用户人数:<span>{data?.regNum}</span></span>}
|
|
|
- {keyS?.includes('roleNum') && <span style={{ color: '#722ed1', fontWeight: 600 }}>创角人数:<span>{data?.roleNum}</span></span>}
|
|
|
- {keyS?.includes('activeNum') && <span style={{ color: '#eb2f96', fontWeight: 600 }}>活跃人数:<span>{data?.activeNum}</span></span>}
|
|
|
- {keyS?.includes('amountNum') && <span style={{ color: '#d81b60', fontWeight: 600 }}>付费人数:<span>{data?.amountNum}</span></span>}
|
|
|
- {keyS?.includes('amount') && <span style={{ color: '#0f538a', fontWeight: 600 }}>付费金额:<span><Statistic value={data?.amount || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
|
|
|
- </div>
|
|
|
- }
|
|
|
- return '--'
|
|
|
+ if (b?.[field]) {
|
|
|
+ data = b?.[field]
|
|
|
+ return <div className={style.dbox}>
|
|
|
+ <span style={{ color: '#2f54eb', fontWeight: 600 }}>新用户人数:<span>{data?.regNum}</span></span>
|
|
|
+ <span style={{ color: '#722ed1', fontWeight: 600 }}>创角人数:<span>{data?.roleNum}</span></span>
|
|
|
+ <span style={{ color: '#eb2f96', fontWeight: 600 }}>活跃人数:<span>{data?.activeNum}</span></span>
|
|
|
+ <span style={{ color: '#d81b60', fontWeight: 600 }}>付费人数:<span>{data?.amountNum}</span></span>
|
|
|
+ <span style={{ color: '#0f538a', fontWeight: 600 }}>付费金额:<span><Statistic value={data?.amount || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>
|
|
|
+ </div>
|
|
|
}
|
|
|
+ return '--'
|
|
|
}
|
|
|
return '--'
|
|
|
},
|
|
@@ -312,27 +272,22 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
|
|
|
}
|
|
|
let dt = moment()
|
|
|
let day = dt.diff(date1, 'day');
|
|
|
- let fieldData = getFieldDta()
|
|
|
- if (fieldData?.length > 0 && item * 30 <= day) {
|
|
|
+ if (item * 30 <= day) {
|
|
|
let data: any = {}
|
|
|
- let keyS: string[] = fieldData?.map((item: any) => item.key)
|
|
|
- switch (fieldData[0].type) {
|
|
|
- case 'D1~Dn':
|
|
|
- if (b?.[field]) {
|
|
|
- data = b?.[field]
|
|
|
- return <div className={style.dbox}>
|
|
|
- {keyS?.includes('rollServerNum') && <span style={{ color: '#13c2c2', fontWeight: 600 }}>滚服人数:<span>{data?.rollServerNum}</span></span>}
|
|
|
- {keyS?.includes('rollServerAmountNum') && <span style={{ color: '#faad14', fontWeight: 600 }}>滚服付费人数:<span>{data?.rollServerAmountNum}</span></span>}
|
|
|
- {keyS?.includes('rollServerAmount') && <span style={{ color: '#0f538a', fontWeight: 600 }}>滚服付费金额:<span><Statistic value={data?.rollServerAmount || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
|
|
|
- {keyS?.includes('rollServerAmountRate') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>滚服占比:<span>{(data?.rollServerAmountRate * 100)?.toFixed(2)}%</span></span>}
|
|
|
- </div>
|
|
|
- }
|
|
|
- return '--'
|
|
|
+ if (b?.[field]) {
|
|
|
+ data = b?.[field]
|
|
|
+ return <div className={style.dbox}>
|
|
|
+ <span style={{ color: '#13c2c2', fontWeight: 600 }}>滚服人数:<span>{data?.rollServerNum}</span></span>
|
|
|
+ <span style={{ color: '#faad14', fontWeight: 600 }}>滚服付费人数:<span>{data?.rollServerAmountNum}</span></span>
|
|
|
+ <span style={{ color: '#0f538a', fontWeight: 600 }}>滚服付费金额:<span><Statistic value={data?.rollServerAmount || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>
|
|
|
+ <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>滚服占比:<span>{(data?.rollServerAmountRate * 100)?.toFixed(2)}%</span></span>
|
|
|
+ </div>
|
|
|
}
|
|
|
+ return '--'
|
|
|
}
|
|
|
return '--'
|
|
|
},
|
|
|
- },{
|
|
|
+ }, {
|
|
|
title: `留存`,
|
|
|
dataIndex: field,
|
|
|
key: 'retained',
|
|
@@ -470,24 +425,16 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
|
|
|
align: "center",
|
|
|
width: 140,
|
|
|
render: (a: any, b: any) => {
|
|
|
- let fieldData = getFieldDta()
|
|
|
- if (fieldData?.length > 0) {
|
|
|
- let data: any = {}
|
|
|
- let keyS: string[] = fieldData?.map((item: any) => item.key)
|
|
|
- switch (fieldData[0].type) {
|
|
|
- case 'D1~Dn':
|
|
|
- if (b?.['totalTrend']) {
|
|
|
- data = b?.['totalTrend']
|
|
|
- return <div className={style.dbox}>
|
|
|
- {keyS?.includes('regNum') && <span style={{ color: '#2f54eb', fontWeight: 600 }}>新用户人数:<span>{data?.regNum}</span></span>}
|
|
|
- {keyS?.includes('roleNum') && <span style={{ color: '#722ed1', fontWeight: 600 }}>创角人数:<span>{data?.roleNum}</span></span>}
|
|
|
- {keyS?.includes('activeNum') && <span style={{ color: '#eb2f96', fontWeight: 600 }}>活跃人数:<span>{data?.activeNum}</span></span>}
|
|
|
- {keyS?.includes('amountNum') && <span style={{ color: '#d81b60', fontWeight: 600 }}>付费人数:<span>{data?.amountNum}</span></span>}
|
|
|
- {keyS?.includes('amount') && <span style={{ color: '#0f538a', fontWeight: 600 }}>付费金额:<span><Statistic value={data?.amount || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
|
|
|
- </div>
|
|
|
- }
|
|
|
- return '--'
|
|
|
- }
|
|
|
+ let data: any = {}
|
|
|
+ if (b?.['totalTrend']) {
|
|
|
+ data = b?.['totalTrend']
|
|
|
+ return <div className={style.dbox}>
|
|
|
+ <span style={{ color: '#2f54eb', fontWeight: 600 }}>新用户人数:<span>{data?.regNum}</span></span>
|
|
|
+ <span style={{ color: '#722ed1', fontWeight: 600 }}>创角人数:<span>{data?.roleNum}</span></span>
|
|
|
+ <span style={{ color: '#eb2f96', fontWeight: 600 }}>活跃人数:<span>{data?.activeNum}</span></span>
|
|
|
+ <span style={{ color: '#d81b60', fontWeight: 600 }}>付费人数:<span>{data?.amountNum}</span></span>
|
|
|
+ <span style={{ color: '#0f538a', fontWeight: 600 }}>付费金额:<span><Statistic value={data?.amount || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>
|
|
|
+ </div>
|
|
|
}
|
|
|
return '--'
|
|
|
},
|
|
@@ -498,23 +445,15 @@ function columns12(): { label: string, fieldSHow?: { label: string, saveField: s
|
|
|
align: "center",
|
|
|
width: 150,
|
|
|
render: (a: any, b: any) => {
|
|
|
- let fieldData = getFieldDta()
|
|
|
- if (fieldData?.length > 0) {
|
|
|
- let data: any = {}
|
|
|
- let keyS: string[] = fieldData?.map((item: any) => item.key)
|
|
|
- switch (fieldData[0].type) {
|
|
|
- case 'D1~Dn':
|
|
|
- if (b?.['totalTrend']) {
|
|
|
- data = b?.['totalTrend']
|
|
|
- return <div className={style.dbox}>
|
|
|
- {keyS?.includes('rollServerNum') && <span style={{ color: '#13c2c2', fontWeight: 600 }}>滚服人数:<span>{data?.rollServerNum}</span></span>}
|
|
|
- {keyS?.includes('rollServerAmountNum') && <span style={{ color: '#faad14', fontWeight: 600 }}>滚服付费人数:<span>{data?.rollServerAmountNum}</span></span>}
|
|
|
- {keyS?.includes('rollServerAmount') && <span style={{ color: '#0f538a', fontWeight: 600 }}>滚服付费金额:<span><Statistic value={data?.rollServerAmount || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
|
|
|
- {keyS?.includes('rollServerAmountRate') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>滚服占比:<span>{(data?.rollServerAmountRate * 100)?.toFixed(2)}%</span></span>}
|
|
|
- </div>
|
|
|
- }
|
|
|
- return '--'
|
|
|
- }
|
|
|
+ let data: any = {}
|
|
|
+ if (b?.['totalTrend']) {
|
|
|
+ data = b?.['totalTrend']
|
|
|
+ return <div className={style.dbox}>
|
|
|
+ <span style={{ color: '#13c2c2', fontWeight: 600 }}>滚服人数:<span>{data?.rollServerNum}</span></span>
|
|
|
+ <span style={{ color: '#faad14', fontWeight: 600 }}>滚服付费人数:<span>{data?.rollServerAmountNum}</span></span>
|
|
|
+ <span style={{ color: '#0f538a', fontWeight: 600 }}>滚服付费金额:<span><Statistic value={data?.rollServerAmount || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>
|
|
|
+ <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>滚服占比:<span>{(data?.rollServerAmountRate * 100)?.toFixed(2)}%</span></span>
|
|
|
+ </div>
|
|
|
}
|
|
|
return '--'
|
|
|
},
|