tableConfig.tsx 71 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120
  1. import React from "react"
  2. import style from './index.less'
  3. import { Statistic } from "antd"
  4. import { gameClassifyEnum } from "@/components/QueryForm/const"
  5. import { version } from "../../components/TableData"
  6. import moment from "moment"
  7. function columnsNature12(rechargeTrendHandle: (data: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
  8. const getFieldDta = () => {
  9. let defaultValue = [ // 默认展示字段
  10. { label: '充值人数', key: 'rechargeUserCount', type: '付费趋势' },
  11. { label: '充值金额', key: 'rechargeMoney', type: '付费趋势' },
  12. { label: '增', key: 'increase', type: '付费趋势' },
  13. { label: '回', key: 'back', type: '付费趋势' },
  14. { label: '倍', key: 'multiples', type: '付费趋势' },
  15. ]
  16. let mySelectFieldData = localStorage.getItem(`myAdFieldConfig${version}_游戏每日数据`)
  17. let newSelectFieldData: any = {}
  18. if (mySelectFieldData) {
  19. newSelectFieldData = JSON.parse(mySelectFieldData).date_field
  20. } else {
  21. newSelectFieldData = defaultValue
  22. }
  23. return newSelectFieldData
  24. }
  25. // 买量付费趋势
  26. const buyC = Array(29).fill('').map((_item: string, index: number) => {
  27. let field = `buyAmountD${index + 1}Trend`
  28. let data = {
  29. title: `D${index + 1}(买)`,
  30. dataIndex: `D${index + 1}Buy`,
  31. label: "买量付费趋势",
  32. align: "center",
  33. width: 110,
  34. render: (a: any, b: any) => {
  35. let date1 = moment()
  36. if (b?.costDate === '总计') {
  37. if (b?.beginDay) {
  38. date1 = moment(b?.beginDay)
  39. } else {
  40. date1 = moment()
  41. }
  42. } else {
  43. date1 = moment(b.costDate)
  44. }
  45. let dt = moment()
  46. let day = dt.diff(date1, 'day');
  47. let fieldData = getFieldDta()
  48. if (fieldData?.length > 0 && index <= day) {
  49. let data: any = {}
  50. let keyS: string[] = fieldData?.map((item: any) => item.key)
  51. switch (fieldData[0].type) {
  52. case '付费趋势':
  53. if (b?.[field]) {
  54. data = b?.[field]
  55. return <div className={style.dbox}>
  56. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  57. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  58. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  59. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  60. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  61. </div>
  62. }
  63. return '--'
  64. }
  65. }
  66. return '--'
  67. },
  68. }
  69. return data
  70. })
  71. // 自然量
  72. const natureC = Array(29).fill('').map((_item: string, index: number) => {
  73. let field = `natureAmountD${index + 1}Trend`
  74. let data = {
  75. title: `D${index + 1}(自)`,
  76. dataIndex: `D${index + 1}Nature`,
  77. label: "自然量付费趋势",
  78. align: "center",
  79. width: 110,
  80. render: (a: any, b: any) => {
  81. let date1 = moment()
  82. if (b?.costDate === '总计') {
  83. if (b?.beginDay) {
  84. date1 = moment(b?.beginDay)
  85. } else {
  86. date1 = moment()
  87. }
  88. } else {
  89. date1 = moment(b.costDate)
  90. }
  91. let dt = moment()
  92. let day = dt.diff(date1, 'day');
  93. let fieldData = getFieldDta()
  94. if (fieldData?.length > 0 && index <= day) {
  95. let data: any = {}
  96. let keyS: string[] = fieldData?.map((item: any) => item.key)
  97. switch (fieldData[0].type) {
  98. case '付费趋势':
  99. if (b?.[field]) {
  100. data = b?.[field]
  101. return <div className={style.dbox}>
  102. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  103. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  104. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  105. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  106. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  107. </div>
  108. }
  109. return '--'
  110. }
  111. }
  112. return '--'
  113. },
  114. }
  115. return data
  116. })
  117. let defaultStart = 14
  118. // 总付费趋势
  119. const zC = Array(29).fill('').map((_item: string, index: number) => {
  120. let field = `amountD${index + 1}Trend`
  121. let data = {
  122. title: `D${index + 1}(总)`,
  123. dataIndex: `D${index + 1}`,
  124. label: "总付费趋势",
  125. align: "center",
  126. width: 110,
  127. render: (a: any, b: any) => {
  128. let date1 = moment()
  129. if (b?.costDate === '总计') {
  130. if (b?.beginDay) {
  131. date1 = moment(b?.beginDay)
  132. } else {
  133. date1 = moment()
  134. }
  135. } else {
  136. date1 = moment(b.costDate)
  137. }
  138. let dt = moment()
  139. let day = dt.diff(date1, 'day');
  140. let fieldData = getFieldDta()
  141. if (fieldData?.length > 0 && index <= day) {
  142. let data: any = {}
  143. let keyS: string[] = fieldData?.map((item: any) => item.key)
  144. switch (fieldData[0].type) {
  145. case '付费趋势':
  146. if (b?.[field]) {
  147. data = b?.[field]
  148. return <div className={style.dbox}>
  149. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  150. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  151. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  152. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  153. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  154. </div>
  155. }
  156. return '--'
  157. }
  158. }
  159. return '--'
  160. },
  161. }
  162. if (index < 29) {
  163. data['default'] = defaultStart + index
  164. }
  165. return data
  166. })
  167. return [
  168. {
  169. label: '游戏信息',
  170. data: [
  171. { title: '推广游戏名称', dataIndex: 'gameName', label: '游戏信息', align: 'center', width: 70, default: 2 },
  172. {
  173. title: '推广游戏应用类型', dataIndex: 'gameClassify', label: '游戏信息', align: 'center', width: 80,
  174. render: (a: string) => (<span>{gameClassifyEnum[a]}</span>)
  175. }
  176. ]
  177. },
  178. {
  179. label: '时间',
  180. data: [
  181. { title: '日期', dataIndex: 'costDate', label: '时间', align: 'center', width: 90, default: 1 },
  182. ]
  183. },
  184. {
  185. label: '消耗',
  186. data: [
  187. {
  188. title: '消耗', dataIndex: 'cost', label: '消耗', align: 'center', width: 90, sorter: true, default: 3,
  189. render: (a: string) => <Statistic value={a || 0} />
  190. }
  191. ]
  192. },
  193. {
  194. label: '买量用户数据',
  195. data: [
  196. { title: '买量注册人数', dataIndex: 'buyRegNum', label: '买量用户数据', align: 'center', width: 70, sorter: true },
  197. { title: '买量注册成本', dataIndex: 'buyRegCost', label: '买量用户数据', align: 'center', width: 70, sorter: true }
  198. ]
  199. },
  200. {
  201. label: '自然量用户数据',
  202. data: [
  203. { title: '自然量注册人数', dataIndex: 'natureRegNum', label: '自然量用户数据', align: 'center', width: 70, sorter: true },
  204. { title: '自然量注册成本', dataIndex: 'natureRegCost', label: '自然量用户数据', align: 'center', width: 70, sorter: true }
  205. ]
  206. },
  207. {
  208. label: '总用户数据',
  209. data: [
  210. { title: '注册人数', dataIndex: 'regNum', label: '总用户数据', align: 'center', width: 70, default: 4, sorter: true },
  211. { title: '注册成本', dataIndex: 'regCost', label: '总用户数据', align: 'center', width: 70, default: 5, sorter: true }
  212. ]
  213. },
  214. {
  215. label: '买量付费数据',
  216. data: [
  217. { title: '买量首日新用户充值次数', dataIndex: 'buyFirstNewUserAmountCount', label: '买量付费数据', align: 'center', width: 70, sorter: true },
  218. { title: '买量首日新用户充值人数', dataIndex: 'buyFirstNewUserAmountNum', label: '买量付费数据', align: 'center', width: 70, sorter: true },
  219. {
  220. title: '买量首日新用户充值金额', dataIndex: 'buyFirstNewUserAmount', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  221. render: (a: string) => <Statistic value={a || 0} />
  222. },
  223. { title: '买量老用户充值次数', dataIndex: 'buyOldUserCount', label: '买量付费数据', align: 'center', width: 70, sorter: true },
  224. { title: '买量老用户充值人数', dataIndex: 'buyOldUserNum', label: '买量付费数据', align: 'center', width: 70, sorter: true },
  225. {
  226. title: '买量老用户充值金额', dataIndex: 'buyOldUserAmount', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  227. render: (a: string) => <Statistic value={a || 0} />
  228. },
  229. { title: '买量账面充值次数', dataIndex: 'buyAmountCount', label: '买量付费数据', align: 'center', width: 70, sorter: true },
  230. { title: '买量账面充值人数', dataIndex: 'buyAmountNum', label: '买量付费数据', align: 'center', width: 70, sorter: true },
  231. {
  232. title: '买量账面充值金额', dataIndex: 'buyAmount', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  233. render: (a: string) => <Statistic value={a || 0} />
  234. },
  235. { title: '买量新用户累计充值次数', dataIndex: 'buyNewUserTotalAmountCount', label: '买量付费数据', align: 'center', width: 70, sorter: true },
  236. { title: '买量新用户累计充值人数', dataIndex: 'buyNewUserTotalAmountNum', label: '买量付费数据', align: 'center', width: 70, sorter: true },
  237. {
  238. title: '买量新用户累计充值金额', dataIndex: 'buyNewUserTotalAmount', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  239. render: (a: string) => <Statistic value={a || 0} />
  240. },
  241. {
  242. title: '买量首日ROI', dataIndex: 'buyFirstRoi', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  243. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  244. },
  245. {
  246. title: '买量总ROI', dataIndex: 'buyTotalRoi', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  247. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  248. },
  249. {
  250. title: '买量首日付费率', dataIndex: 'buyFirstAmountRate', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  251. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  252. },
  253. {
  254. title: '买量当天付费率', dataIndex: 'buyTodayAmountRate', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  255. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  256. },
  257. {
  258. title: '买量新用户付费比', dataIndex: 'buyNewUserRate', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  259. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  260. },
  261. {
  262. title: '买量首日客单价', dataIndex: 'buyFirstAvgAmount', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  263. render: (a: string) => <Statistic value={a || 0} />
  264. },
  265. {
  266. title: '买量首日充值成本', dataIndex: 'buyFirstNewUserRechargeCost', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  267. render: (a: string) => <Statistic value={a || 0} />
  268. },
  269. {
  270. title: '买量总充值成本', dataIndex: 'buyTotalRechargeCost', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  271. render: (a: string) => <Statistic value={a || 0} />
  272. },
  273. {
  274. title: '买量当天客单价', dataIndex: 'buyTodayAvgAmount', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  275. render: (a: string) => <Statistic value={a || 0} />
  276. },
  277. {
  278. title: '买量账面客单价', dataIndex: 'buyAvgAmount', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  279. render: (a: string) => <Statistic value={a || 0} />
  280. },
  281. {
  282. title: '买量复充率', dataIndex: 'buyUserAgainRate', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  283. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  284. },
  285. {
  286. title: '买量新增注册ARPPU', dataIndex: 'buyRegUserArpu', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  287. render: (a: string) => <Statistic value={a || 0} />
  288. },
  289. {
  290. title: '买量首日付费ARPPU', dataIndex: 'buyFirstAmountArpu', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  291. render: (a: string) => <Statistic value={a || 0} />
  292. },
  293. {
  294. title: '买量当天付费ARPPU', dataIndex: 'buyTodayAmountArpu', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  295. render: (a: string) => <Statistic value={a || 0} />
  296. },
  297. {
  298. title: '买量账面ARPPU', dataIndex: 'buyAmountArpu', label: '买量付费数据', align: 'center', width: 70, sorter: true,
  299. render: (a: string) => <Statistic value={a || 0} />
  300. },
  301. ]
  302. },
  303. {
  304. label: '自然量付费数据',
  305. data: [
  306. { title: '自然量首日新用户充值次数', dataIndex: 'natureFirstNewUserAmountCount', label: '自然量付费数据', align: 'center', width: 70, sorter: true },
  307. { title: '自然量首日新用户充值人数', dataIndex: 'natureFirstNewUserAmountNum', label: '自然量付费数据', align: 'center', width: 70, sorter: true },
  308. {
  309. title: '自然量首日新用户充值金额', dataIndex: 'natureFirstNewUserAmount', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  310. render: (a: string) => <Statistic value={a || 0} />
  311. },
  312. { title: '自然量老用户充值次数', dataIndex: 'natureOldUserCount', label: '自然量付费数据', align: 'center', width: 70, sorter: true },
  313. { title: '自然量老用户充值人数', dataIndex: 'natureOldUserNum', label: '自然量付费数据', align: 'center', width: 70, sorter: true },
  314. {
  315. title: '自然量老用户充值金额', dataIndex: 'natureOldUserAmount', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  316. render: (a: string) => <Statistic value={a || 0} />
  317. },
  318. { title: '自然量账面充值次数', dataIndex: 'natureAmountCount', label: '自然量付费数据', align: 'center', width: 70, sorter: true },
  319. { title: '自然量账面充值人数', dataIndex: 'natureAmountNum', label: '自然量付费数据', align: 'center', width: 70, sorter: true },
  320. {
  321. title: '自然量账面充值金额', dataIndex: 'natureAmount', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  322. render: (a: string) => <Statistic value={a || 0} />
  323. },
  324. { title: '自然量新用户累计充值次数', dataIndex: 'natureNewUserTotalAmountCount', label: '自然量付费数据', align: 'center', width: 70, sorter: true },
  325. { title: '自然量新用户累计充值人数', dataIndex: 'natureNewUserTotalAmountNum', label: '自然量付费数据', align: 'center', width: 70, sorter: true },
  326. {
  327. title: '自然量新用户累计充值金额', dataIndex: 'natureNewUserTotalAmount', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  328. render: (a: string) => <Statistic value={a || 0} />
  329. },
  330. {
  331. title: '自然量首日ROI', dataIndex: 'natureFirstRoi', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  332. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  333. },
  334. {
  335. title: '自然量总ROI', dataIndex: 'natureTotalRoi', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  336. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  337. },
  338. {
  339. title: '自然量首日付费率', dataIndex: 'natureFirstAmountRate', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  340. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  341. },
  342. {
  343. title: '自然量当天付费率', dataIndex: 'natureTodayAmountRate', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  344. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  345. },
  346. {
  347. title: '自然量新用户付费比', dataIndex: 'natureNewUserRate', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  348. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  349. },
  350. {
  351. title: '自然量首日客单价', dataIndex: 'natureFirstAvgAmount', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  352. render: (a: string) => <Statistic value={a || 0} />
  353. },
  354. {
  355. title: '自然量首日充值成本', dataIndex: 'natureFirstNewUserRechargeCost', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  356. render: (a: string) => <Statistic value={a || 0} />
  357. },
  358. {
  359. title: '自然量总充值成本', dataIndex: 'natureTotalRechargeCost', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  360. render: (a: string) => <Statistic value={a || 0} />
  361. },
  362. {
  363. title: '自然量当天客单价', dataIndex: 'natureTodayAvgAmount', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  364. render: (a: string) => <Statistic value={a || 0} />
  365. },
  366. {
  367. title: '自然量账面客单价', dataIndex: 'natureAvgAmount', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  368. render: (a: string) => <Statistic value={a || 0} />
  369. },
  370. {
  371. title: '自然量复充率', dataIndex: 'natureUserAgainRate', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  372. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  373. },
  374. {
  375. title: '自然量新增注册ARPPU', dataIndex: 'natureRegUserArpu', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  376. render: (a: string) => <Statistic value={a || 0} />
  377. },
  378. {
  379. title: '自然量首日付费ARPPU', dataIndex: 'natureFirstAmountArpu', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  380. render: (a: string) => <Statistic value={a || 0} />
  381. },
  382. {
  383. title: '自然量当天付费ARPPU', dataIndex: 'natureTodayAmountArpu', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  384. render: (a: string) => <Statistic value={a || 0} />
  385. },
  386. {
  387. title: '自然量账面ARPPU', dataIndex: 'natureAmountArpu', label: '自然量付费数据', align: 'center', width: 70, sorter: true,
  388. render: (a: string) => <Statistic value={a || 0} />
  389. }
  390. ]
  391. },
  392. {
  393. label: '总付费数据',
  394. data: [
  395. { title: '总首日新用户充值次数', dataIndex: 'firstNewUserAmountCount', label: '总付费数据', align: 'center', width: 70, sorter: true },
  396. { title: '总首日新用户充值人数', dataIndex: 'firstNewUserAmountNum', label: '总付费数据', align: 'center', width: 70, default: 6, sorter: true },
  397. {
  398. title: '总首日新用户充值金额', dataIndex: 'firstNewUserAmount', label: '总付费数据', align: 'center', width: 70, default: 7, sorter: true,
  399. render: (a: string) => <Statistic value={a || 0} />
  400. },
  401. { title: '总老用户充值次数', dataIndex: 'oldUserCount', label: '总付费数据', align: 'center', width: 70, sorter: true },
  402. { title: '总老用户充值人数', dataIndex: 'oldUserNum', label: '总付费数据', align: 'center', width: 70, sorter: true },
  403. {
  404. title: '总老用户充值金额', dataIndex: 'oldUserAmount', label: '总付费数据', align: 'center', width: 70, sorter: true,
  405. render: (a: string) => <Statistic value={a || 0} />
  406. },
  407. { title: '总账面充值次数', dataIndex: 'amountCount', label: '总付费数据', align: 'center', width: 70, sorter: true },
  408. { title: '总账面充值人数', dataIndex: 'amountNum', label: '总付费数据', align: 'center', width: 70, sorter: true },
  409. {
  410. title: '总账面充值金额', dataIndex: 'amount', label: '总付费数据', align: 'center', width: 70, sorter: true,
  411. render: (a: string) => <Statistic value={a || 0} />
  412. },
  413. { title: '总新用户累计充值次数', dataIndex: 'newUserTotalAmountCount', label: '总付费数据', align: 'center', width: 70, sorter: true },
  414. { title: '总新用户累计充值人数', dataIndex: 'newUserTotalAmountNum', label: '总付费数据', align: 'center', width: 70, default: 8, sorter: true },
  415. {
  416. title: '总新用户累计充值金额', dataIndex: 'newUserTotalAmount', label: '总付费数据', align: 'center', width: 70, default: 9, sorter: true,
  417. render: (a: string) => <Statistic value={a || 0} />
  418. },
  419. {
  420. title: '总首日ROI', dataIndex: 'firstRoi', label: '总付费数据', align: 'center', width: 70, sorter: true, default: 10,
  421. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  422. },
  423. {
  424. title: '总总ROI', dataIndex: 'totalRoi', label: '总付费数据', align: 'center', width: 70, sorter: true, default: 11,
  425. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  426. },
  427. {
  428. title: '总首日付费率', dataIndex: 'firstAmountRate', label: '总付费数据', align: 'center', width: 70, sorter: true,
  429. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  430. },
  431. {
  432. title: '总当天付费率', dataIndex: 'todayAmountRate', label: '总付费数据', align: 'center', width: 70, sorter: true,
  433. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  434. },
  435. {
  436. title: '总新用户付费比', dataIndex: 'newUserRate', label: '总付费数据', align: 'center', width: 70, sorter: true,
  437. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  438. },
  439. {
  440. title: '总首日客单价', dataIndex: 'firstAvgAmount', label: '总付费数据', align: 'center', width: 70, sorter: true,
  441. render: (a: string) => <Statistic value={a || 0} />
  442. },
  443. {
  444. title: '总首日充值成本', dataIndex: 'firstNewUserRechargeCost', label: '总付费数据', align: 'center', width: 70, default: 12, sorter: true,
  445. render: (a: string) => <Statistic value={a || 0} />
  446. },
  447. {
  448. title: '总总充值成本', dataIndex: 'totalRechargeCost', label: '总付费数据', align: 'center', width: 70, default: 13, sorter: true,
  449. render: (a: string) => <Statistic value={a || 0} />
  450. },
  451. {
  452. title: '总当天客单价', dataIndex: 'todayAvgAmount', label: '总付费数据', align: 'center', width: 70, sorter: true,
  453. render: (a: string) => <Statistic value={a || 0} />
  454. },
  455. {
  456. title: '总账面客单价', dataIndex: 'avgAmount', label: '总付费数据', align: 'center', width: 70, sorter: true,
  457. render: (a: string) => <Statistic value={a || 0} />
  458. },
  459. {
  460. title: '总复充率', dataIndex: 'userAgainRate', label: '总付费数据', align: 'center', width: 70, sorter: true,
  461. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  462. },
  463. {
  464. title: '总新增注册ARPPU', dataIndex: 'regUserArpu', label: '总付费数据', align: 'center', width: 70, sorter: true,
  465. render: (a: string) => <Statistic value={a || 0} />
  466. },
  467. {
  468. title: '总首日付费ARPPU', dataIndex: 'firstAmountArpu', label: '总付费数据', align: 'center', width: 70, sorter: true,
  469. render: (a: string) => <Statistic value={a || 0} />
  470. },
  471. {
  472. title: '总当天付费ARPPU', dataIndex: 'todayAmountArpu', label: '总付费数据', align: 'center', width: 70, sorter: true,
  473. render: (a: string) => <Statistic value={a || 0} />
  474. },
  475. {
  476. title: '总账面ARPPU', dataIndex: 'amountArpu', label: '总付费数据', align: 'center', width: 70, sorter: true,
  477. render: (a: string) => <Statistic value={a || 0} />
  478. }
  479. ]
  480. },
  481. {
  482. fieldSHow: {
  483. label: '付费趋势区间字段展示',
  484. saveField: 'date_field',
  485. defaultValue: [ // 默认展示字段
  486. { label: '充值人数', key: 'rechargeUserCount', type: '付费趋势' },
  487. { label: '充值金额', key: 'rechargeMoney', type: '付费趋势' },
  488. { label: '增', key: 'increase', type: '付费趋势' },
  489. { label: '回', key: 'back', type: '付费趋势' },
  490. { label: '倍', key: 'multiples', type: '付费趋势' },
  491. ],
  492. data: [
  493. {
  494. label: '付费趋势',
  495. data: [
  496. { label: '充值人数', key: 'rechargeUserCount', type: '付费趋势' },
  497. { label: '充值金额', key: 'rechargeMoney', type: '付费趋势' },
  498. { label: '增', key: 'increase', type: '付费趋势' },
  499. { label: '回', key: 'back', type: '付费趋势' },
  500. { label: '倍', key: 'multiples', type: '付费趋势' },
  501. ]
  502. }
  503. ]
  504. },
  505. label: '买量付费趋势',
  506. data: [
  507. ...buyC
  508. ,
  509. {
  510. title: "D30(买)",
  511. dataIndex: "D30Buy",
  512. label: "买量付费趋势",
  513. align: "center",
  514. width: 110,
  515. render: (a: any, b: any) => {
  516. let date1 = moment()
  517. if (b?.costDate === '总计') {
  518. if (b?.beginDay) {
  519. date1 = moment(b?.beginDay)
  520. } else {
  521. date1 = moment()
  522. }
  523. } else {
  524. date1 = moment(b.costDate)
  525. }
  526. let dt = moment()
  527. let day = dt.diff(date1, 'day');
  528. let fieldData = getFieldDta()
  529. if (fieldData?.length > 0 && 30 <= day) {
  530. let data: any = {}
  531. let keyS: string[] = fieldData?.map((item: any) => item.key)
  532. switch (fieldData[0].type) {
  533. case '付费趋势':
  534. if (b?.buyAmountM1Trend) {
  535. data = b?.buyAmountM1Trend
  536. return <div className={style.dbox}>
  537. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  538. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  539. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  540. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  541. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  542. </div>
  543. }
  544. return '--'
  545. }
  546. }
  547. return '--'
  548. },
  549. }, {
  550. title: "M2(买)",
  551. dataIndex: "M2Buy",
  552. label: "买量付费趋势",
  553. align: "center",
  554. width: 110,
  555. render: (a: any, b: any) => {
  556. let date1 = moment()
  557. if (b?.costDate === '总计') {
  558. if (b?.beginDay) {
  559. date1 = moment(b?.beginDay)
  560. } else {
  561. date1 = moment()
  562. }
  563. } else {
  564. date1 = moment(b.costDate)
  565. }
  566. let dt = moment()
  567. let day = dt.diff(date1, 'day');
  568. let fieldData = getFieldDta()
  569. if (fieldData?.length > 0 && 60 <= day) {
  570. let data: any = {}
  571. let keyS: string[] = fieldData?.map((item: any) => item.key)
  572. switch (fieldData[0].type) {
  573. case '付费趋势':
  574. if (b?.buyAmountM2Trend) {
  575. data = b?.buyAmountM2Trend
  576. return <div className={style.dbox}>
  577. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  578. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  579. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  580. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  581. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  582. </div>
  583. }
  584. return '--'
  585. }
  586. }
  587. return '--'
  588. },
  589. }, {
  590. title: "M3(买)",
  591. dataIndex: "M3Buy",
  592. label: "买量付费趋势",
  593. align: "center",
  594. width: 110,
  595. render: (a: any, b: any) => {
  596. let date1 = moment()
  597. if (b?.costDate === '总计') {
  598. if (b?.beginDay) {
  599. date1 = moment(b?.beginDay)
  600. } else {
  601. date1 = moment()
  602. }
  603. } else {
  604. date1 = moment(b.costDate)
  605. }
  606. let dt = moment()
  607. let day = dt.diff(date1, 'day');
  608. let fieldData = getFieldDta()
  609. if (fieldData?.length > 0 && 90 <= day) {
  610. let data: any = {}
  611. let keyS: string[] = fieldData?.map((item: any) => item.key)
  612. switch (fieldData[0].type) {
  613. case '付费趋势':
  614. if (b?.buyAmountM3Trend) {
  615. data = b?.buyAmountM3Trend
  616. return <div className={style.dbox}>
  617. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  618. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  619. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  620. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  621. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  622. </div>
  623. }
  624. return '--'
  625. }
  626. }
  627. return '--'
  628. },
  629. }, {
  630. title: "M6(买)",
  631. dataIndex: "M6Buy",
  632. label: "买量付费趋势",
  633. align: "center",
  634. width: 110,
  635. render: (a: any, b: any) => {
  636. let date1 = moment()
  637. if (b?.costDate === '总计') {
  638. if (b?.beginDay) {
  639. date1 = moment(b?.beginDay)
  640. } else {
  641. date1 = moment()
  642. }
  643. } else {
  644. date1 = moment(b.costDate)
  645. }
  646. let dt = moment()
  647. let day = dt.diff(date1, 'day');
  648. let fieldData = getFieldDta()
  649. if (fieldData?.length > 0 && 180 <= day) {
  650. let data: any = {}
  651. let keyS: string[] = fieldData?.map((item: any) => item.key)
  652. switch (fieldData[0].type) {
  653. case '付费趋势':
  654. if (b?.buyAmountM6Trend) {
  655. data = b?.buyAmountM6Trend
  656. return <div className={style.dbox}>
  657. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  658. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  659. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  660. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  661. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  662. </div>
  663. }
  664. return '--'
  665. }
  666. }
  667. return '--'
  668. },
  669. }, {
  670. title: "总(买)",
  671. dataIndex: "totalBuy",
  672. label: "买量付费趋势",
  673. align: "center",
  674. width: 110,
  675. render: (a: any, b: any) => {
  676. let fieldData = getFieldDta()
  677. if (fieldData?.length > 0) {
  678. let data: any = {}
  679. let keyS: string[] = fieldData?.map((item: any) => item.key)
  680. switch (fieldData[0].type) {
  681. case '付费趋势':
  682. if (b?.buyAmountSumTrend) {
  683. data = b?.buyAmountSumTrend
  684. return <div className={style.dbox}>
  685. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  686. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  687. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  688. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  689. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  690. </div>
  691. }
  692. return '--'
  693. }
  694. }
  695. return '--'
  696. },
  697. }]
  698. },
  699. {
  700. label: '自然量付费趋势',
  701. data: [
  702. ...natureC,
  703. {
  704. title: "D30(自)",
  705. dataIndex: "D30Nature",
  706. label: "自然量付费趋势",
  707. align: "center",
  708. default: 43,
  709. width: 110,
  710. render: (a: any, b: any) => {
  711. let date1 = moment()
  712. if (b?.costDate === '总计') {
  713. if (b?.beginDay) {
  714. date1 = moment(b?.beginDay)
  715. } else {
  716. date1 = moment()
  717. }
  718. } else {
  719. date1 = moment(b.costDate)
  720. }
  721. let dt = moment()
  722. let day = dt.diff(date1, 'day');
  723. let fieldData = getFieldDta()
  724. if (fieldData?.length > 0 && 30 <= day) {
  725. let data: any = {}
  726. let keyS: string[] = fieldData?.map((item: any) => item.key)
  727. switch (fieldData[0].type) {
  728. case '付费趋势':
  729. if (b?.natureAmountM1Trend) {
  730. data = b?.natureAmountM1Trend
  731. return <div className={style.dbox}>
  732. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  733. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  734. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  735. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  736. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  737. </div>
  738. }
  739. return '--'
  740. }
  741. }
  742. return '--'
  743. },
  744. }, {
  745. title: "M2(自)",
  746. dataIndex: "M2Nature",
  747. label: "自然量付费趋势",
  748. align: "center",
  749. width: 110,
  750. render: (a: any, b: any) => {
  751. let date1 = moment()
  752. if (b?.costDate === '总计') {
  753. if (b?.beginDay) {
  754. date1 = moment(b?.beginDay)
  755. } else {
  756. date1 = moment()
  757. }
  758. } else {
  759. date1 = moment(b.costDate)
  760. }
  761. let dt = moment()
  762. let day = dt.diff(date1, 'day');
  763. let fieldData = getFieldDta()
  764. if (fieldData?.length > 0 && 60 <= day) {
  765. let data: any = {}
  766. let keyS: string[] = fieldData?.map((item: any) => item.key)
  767. switch (fieldData[0].type) {
  768. case '付费趋势':
  769. if (b?.natureAmountM2Trend) {
  770. data = b?.natureAmountM2Trend
  771. return <div className={style.dbox}>
  772. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  773. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  774. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  775. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  776. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  777. </div>
  778. }
  779. return '--'
  780. }
  781. }
  782. return '--'
  783. },
  784. }, {
  785. title: "M3(自)",
  786. dataIndex: "M3Nature",
  787. label: "自然量付费趋势",
  788. align: "center",
  789. width: 110,
  790. render: (a: any, b: any) => {
  791. let date1 = moment()
  792. if (b?.costDate === '总计') {
  793. if (b?.beginDay) {
  794. date1 = moment(b?.beginDay)
  795. } else {
  796. date1 = moment()
  797. }
  798. } else {
  799. date1 = moment(b.costDate)
  800. }
  801. let dt = moment()
  802. let day = dt.diff(date1, 'day');
  803. let fieldData = getFieldDta()
  804. if (fieldData?.length > 0 && 90 <= day) {
  805. let data: any = {}
  806. let keyS: string[] = fieldData?.map((item: any) => item.key)
  807. switch (fieldData[0].type) {
  808. case '付费趋势':
  809. if (b?.natureAmountM3Trend) {
  810. data = b?.natureAmountM3Trend
  811. return <div className={style.dbox}>
  812. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  813. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  814. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  815. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  816. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  817. </div>
  818. }
  819. return '--'
  820. }
  821. }
  822. return '--'
  823. },
  824. }, {
  825. title: "M6(自)",
  826. dataIndex: "M6Nature",
  827. label: "自然量付费趋势",
  828. align: "center",
  829. width: 110,
  830. render: (a: any, b: any) => {
  831. let date1 = moment()
  832. if (b?.costDate === '总计') {
  833. if (b?.beginDay) {
  834. date1 = moment(b?.beginDay)
  835. } else {
  836. date1 = moment()
  837. }
  838. } else {
  839. date1 = moment(b.costDate)
  840. }
  841. let dt = moment()
  842. let day = dt.diff(date1, 'day');
  843. let fieldData = getFieldDta()
  844. if (fieldData?.length > 0 && 180 <= day) {
  845. let data: any = {}
  846. let keyS: string[] = fieldData?.map((item: any) => item.key)
  847. switch (fieldData[0].type) {
  848. case '付费趋势':
  849. if (b?.natureAmountM6Trend) {
  850. data = b?.natureAmountM6Trend
  851. return <div className={style.dbox}>
  852. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  853. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  854. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  855. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  856. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  857. </div>
  858. }
  859. return '--'
  860. }
  861. }
  862. return '--'
  863. },
  864. }, {
  865. title: "总(自)",
  866. dataIndex: "totalNature",
  867. label: "自然量付费趋势",
  868. align: "center",
  869. width: 110,
  870. render: (a: any, b: any) => {
  871. let fieldData = getFieldDta()
  872. if (fieldData?.length > 0) {
  873. let data: any = {}
  874. let keyS: string[] = fieldData?.map((item: any) => item.key)
  875. switch (fieldData[0].type) {
  876. case '付费趋势':
  877. if (b?.natureAmountSumTrend) {
  878. data = b?.natureAmountSumTrend
  879. return <div className={style.dbox}>
  880. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  881. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  882. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  883. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  884. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  885. </div>
  886. }
  887. return '--'
  888. }
  889. }
  890. return '--'
  891. },
  892. }]
  893. },
  894. {
  895. label: '总付费趋势',
  896. data: [
  897. ...zC
  898. , {
  899. title: "D30(总)",
  900. dataIndex: "D30",
  901. label: "总付费趋势",
  902. align: "center",
  903. width: 110,
  904. default: 43,
  905. render: (a: any, b: any) => {
  906. let date1 = moment()
  907. if (b?.costDate === '总计') {
  908. if (b?.beginDay) {
  909. date1 = moment(b?.beginDay)
  910. } else {
  911. date1 = moment()
  912. }
  913. } else {
  914. date1 = moment(b.costDate)
  915. }
  916. let dt = moment()
  917. let day = dt.diff(date1, 'day');
  918. let fieldData = getFieldDta()
  919. if (fieldData?.length > 0 && 30 <= day) {
  920. let data: any = {}
  921. let keyS: string[] = fieldData?.map((item: any) => item.key)
  922. switch (fieldData[0].type) {
  923. case '付费趋势':
  924. if (b?.amountM1Trend) {
  925. data = b?.amountM1Trend
  926. return <div className={style.dbox}>
  927. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  928. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  929. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  930. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  931. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  932. </div>
  933. }
  934. return '--'
  935. }
  936. }
  937. return '--'
  938. },
  939. }, {
  940. title: "M2(总)",
  941. dataIndex: "M2",
  942. label: "总付费趋势",
  943. align: "center",
  944. width: 110,
  945. render: (a: any, b: any) => {
  946. let date1 = moment()
  947. if (b?.costDate === '总计') {
  948. if (b?.beginDay) {
  949. date1 = moment(b?.beginDay)
  950. } else {
  951. date1 = moment()
  952. }
  953. } else {
  954. date1 = moment(b.costDate)
  955. }
  956. let dt = moment()
  957. let day = dt.diff(date1, 'day');
  958. let fieldData = getFieldDta()
  959. if (fieldData?.length > 0 && 60 <= day) {
  960. let data: any = {}
  961. let keyS: string[] = fieldData?.map((item: any) => item.key)
  962. switch (fieldData[0].type) {
  963. case '付费趋势':
  964. if (b?.amountM2Trend) {
  965. data = b?.amountM2Trend
  966. return <div className={style.dbox}>
  967. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  968. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  969. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  970. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  971. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  972. </div>
  973. }
  974. return '--'
  975. }
  976. }
  977. return '--'
  978. },
  979. }, {
  980. title: "M3(总)",
  981. dataIndex: "M3",
  982. label: "总付费趋势",
  983. align: "center",
  984. width: 110,
  985. render: (a: any, b: any) => {
  986. let date1 = moment()
  987. if (b?.costDate === '总计') {
  988. if (b?.beginDay) {
  989. date1 = moment(b?.beginDay)
  990. } else {
  991. date1 = moment()
  992. }
  993. } else {
  994. date1 = moment(b.costDate)
  995. }
  996. let dt = moment()
  997. let day = dt.diff(date1, 'day');
  998. let fieldData = getFieldDta()
  999. if (fieldData?.length > 0 && 90 <= day) {
  1000. let data: any = {}
  1001. let keyS: string[] = fieldData?.map((item: any) => item.key)
  1002. switch (fieldData[0].type) {
  1003. case '付费趋势':
  1004. if (b?.amountM3Trend) {
  1005. data = b?.amountM3Trend
  1006. return <div className={style.dbox}>
  1007. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  1008. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  1009. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  1010. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  1011. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  1012. </div>
  1013. }
  1014. return '--'
  1015. }
  1016. }
  1017. return '--'
  1018. },
  1019. }, {
  1020. title: "M6(总)",
  1021. dataIndex: "M6",
  1022. label: "总付费趋势",
  1023. align: "center",
  1024. width: 110,
  1025. render: (a: any, b: any) => {
  1026. let date1 = moment()
  1027. if (b?.costDate === '总计') {
  1028. if (b?.beginDay) {
  1029. date1 = moment(b?.beginDay)
  1030. } else {
  1031. date1 = moment()
  1032. }
  1033. } else {
  1034. date1 = moment(b.costDate)
  1035. }
  1036. let dt = moment()
  1037. let day = dt.diff(date1, 'day');
  1038. let fieldData = getFieldDta()
  1039. if (fieldData?.length > 0 && 180 <= day) {
  1040. let data: any = {}
  1041. let keyS: string[] = fieldData?.map((item: any) => item.key)
  1042. switch (fieldData[0].type) {
  1043. case '付费趋势':
  1044. if (b?.amountM6Trend) {
  1045. data = b?.amountM6Trend
  1046. return <div className={style.dbox}>
  1047. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  1048. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  1049. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  1050. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  1051. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  1052. </div>
  1053. }
  1054. return '--'
  1055. }
  1056. }
  1057. return '--'
  1058. },
  1059. }, {
  1060. title: "总(总)",
  1061. dataIndex: "total",
  1062. label: "总付费趋势",
  1063. align: "center",
  1064. width: 110,
  1065. render: (a: any, b: any) => {
  1066. let fieldData = getFieldDta()
  1067. if (fieldData?.length > 0) {
  1068. let data: any = {}
  1069. let keyS: string[] = fieldData?.map((item: any) => item.key)
  1070. switch (fieldData[0].type) {
  1071. case '付费趋势':
  1072. if (b?.amountSumTrend) {
  1073. data = b?.amountSumTrend
  1074. return <div className={style.dbox}>
  1075. {keyS?.includes('rechargeUserCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  1076. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  1077. {keyS?.includes('increase') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  1078. {keyS?.includes('back') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  1079. {keyS?.includes('multiples') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples?.toFixed(2)}</span></span>}
  1080. </div>
  1081. }
  1082. return '--'
  1083. }
  1084. }
  1085. return '--'
  1086. },
  1087. }]
  1088. },
  1089. {
  1090. label: '操作',
  1091. data: [
  1092. {
  1093. title: '操作',
  1094. dataIndex: 'cz',
  1095. label: '操作',
  1096. default: 44,
  1097. align: 'center',
  1098. width: 75,
  1099. render: (a: number, b: any) => {
  1100. if (b?.costDate === '总计') {
  1101. return '--'
  1102. }
  1103. return <a onClick={() => rechargeTrendHandle(b)}>复充趋势</a>
  1104. },
  1105. }
  1106. ]
  1107. }
  1108. ]
  1109. }
  1110. export default columnsNature12