tableConfig.tsx 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. import { Statistic } from "antd"
  2. import React from "react"
  3. import style from './index.less'
  4. import { gameClassifyEnum } from "@/components/QueryForm/const"
  5. function columns12(gameType: any, rechargeTrendHandle: (data: any) => void): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
  6. let defaultValue = [ // 默认展示字段
  7. { label: '充值人数', key: 'rechargeCount', type: '付费趋势' },
  8. { label: '充值金额', key: 'rechargeMoney', type: '付费趋势' },
  9. { label: '增', key: 'addPayBack', type: '付费趋势' },
  10. { label: '回', key: 'payBack', type: '付费趋势' },
  11. { label: '倍', key: 'newUserRechargeRate', type: '付费趋势' },
  12. ]
  13. const getFieldDta = () => {
  14. let mySelectFieldData = localStorage.getItem('myAdFieldConfig1.0.0_推广每日数据')
  15. let newSelectFieldData: any = {}
  16. if (mySelectFieldData) {
  17. newSelectFieldData = JSON.parse(mySelectFieldData).date_field
  18. } else {
  19. newSelectFieldData = defaultValue
  20. }
  21. return newSelectFieldData
  22. }
  23. return [
  24. {
  25. label: '时间',
  26. data: [
  27. { title: '日期', dataIndex: 'dt', label: '时间', align: 'center', width: 90, default: 1 },
  28. ]
  29. },
  30. {
  31. label: '推广账号信息',
  32. data: [
  33. {
  34. title: '推广账号', dataIndex: 'accountId', key: 'accountId', label: '推广账号信息', align: 'center', width: 70, default: 2,
  35. render: (a: any) => (<span>{a || '--'}</span>)
  36. },
  37. {
  38. title: '投放渠道', dataIndex: 'agentName', key: 'agentName', label: '推广账号信息', align: 'center', width: 130, default: 3,
  39. render: (a: string, b: any) => (<span>{a || '--'}</span>)
  40. }
  41. ]
  42. },
  43. {
  44. label: '业务人员信息',
  45. data: [
  46. { title: '投手', dataIndex: 'sysUserName', key: 'sysUserName', label: '业务人员信息', align: 'center', width: 70, default: 4, render: (a: any) => (<span>{a || '--'}</span>) }
  47. ]
  48. },
  49. {
  50. label: '推广内容信息',
  51. data: [
  52. { title: '推广游戏CP名称', dataIndex: 'cpName', key: 'cpName', label: '推广内容信息', align: 'center', width: 70, default: 5, render: (a: any) => (<span>{a || '--'}</span>) },
  53. { title: '推广游戏名称', dataIndex: 'gameName', key: 'gameName', label: '推广内容信息', align: 'center', width: 70, default: 6, render: (a: any) => (<span>{a || '--'}</span>) },
  54. {
  55. title: '推广游戏应用类型', dataIndex: 'gameType', key: 'gameType', label: '推广内容信息', align: 'center', width: 80, default: 7,
  56. render: (a: string) => (<span>{gameClassifyEnum[a]}</span>)
  57. },
  58. ]
  59. },
  60. {
  61. label: '消耗',
  62. data: [
  63. { title: '消耗', dataIndex: 'cost', key: 'cost', label: '消耗', align: 'center', width: 100, default: 8, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  64. { title: '推广计划数量', dataIndex: 'adPlanCount', key: 'adPlanCount', label: '消耗', align: 'center', width: 70, default: 9, sorter: true, render: (a: any) => (<span>{a || '--'}</span>) }
  65. ]
  66. },
  67. {
  68. label: '广告曝光数据',
  69. data: [
  70. { title: '曝光量', dataIndex: 'viewCount', label: '广告曝光数据', align: 'center', width: 90, default: 10, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  71. { title: '点击量', dataIndex: 'clickCount', label: '广告曝光数据', align: 'center', width: 80, default: 11, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  72. { title: '转化量', dataIndex: 'convertCount', label: '广告曝光数据', align: 'center', width: 80, default: 12, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  73. {
  74. title: '转化率', dataIndex: 'convertRate', label: '广告曝光数据', align: 'center', width: 70, default: 13, sorter: true,
  75. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  76. },
  77. { title: '平均转化成本', dataIndex: 'avgConvertCost', label: '广告曝光数据', align: 'center', width: 70, default: 14, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  78. { title: '深度转化量', dataIndex: 'deepConvertCount', label: '广告曝光数据', align: 'center', width: 70, default: 15, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  79. { title: '深度转化成本', dataIndex: 'deepConvertCost', label: '广告曝光数据', align: 'center', width: 70, default: 16, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  80. {
  81. title: '深度转化率', dataIndex: 'deepConvertRate', label: '广告曝光数据', align: 'center', width: 70, default: 17, sorter: true,
  82. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  83. },
  84. { title: '千次曝光成本', dataIndex: 'thousandViewCost', label: '广告曝光数据', align: 'center', width: 70, default: 18, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  85. { title: '平均点击均价', dataIndex: 'avgClickCost', label: '广告曝光数据', align: 'center', width: 70, default: 19, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  86. { title: '应用下载开始量', dataIndex: 'appDownloadCount', label: '广告曝光数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  87. { title: '应用下载开始成本', dataIndex: 'appDownloadCost', label: '广告曝光数据', align: 'center', width: 90, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  88. {
  89. title: '应用下载开始率', dataIndex: 'appDownloadRate', label: '广告曝光数据', align: 'center', width: 70, sorter: true,
  90. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  91. },
  92. { title: '应用下载完成量', dataIndex: 'downloadFinish', label: '广告曝光数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  93. { title: '应用下载完成成本', dataIndex: 'downloadFinishCost', label: '广告曝光数据', align: 'center', width: 90, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  94. {
  95. title: '应用下载完成率', dataIndex: 'downloadFinishRate', label: '广告曝光数据', align: 'center', width: 70, sorter: true,
  96. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  97. },
  98. { title: '应用安装量', dataIndex: 'appInstallCount', label: '广告曝光数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  99. { title: '应用安装成本', dataIndex: 'appInstallCost', label: '广告曝光数据', align: 'center', width: 90, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  100. {
  101. title: '应用安装完成率', dataIndex: 'appInstallRate', label: '广告曝光数据', align: 'center', width: 70, sorter: true,
  102. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  103. },
  104. { title: '应用激活量', dataIndex: 'appActiveCount', label: '广告曝光数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  105. { title: '应用激活成本', dataIndex: 'appActiveCost', label: '广告曝光数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  106. {
  107. title: '应用激活率', dataIndex: 'appActiveRate', label: '广告曝光数据', align: 'center', width: 70, sorter: true,
  108. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  109. },
  110. ]
  111. },
  112. {
  113. label: '用户数据',
  114. data: [
  115. { title: '注册成本', dataIndex: 'regCost', label: '用户数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  116. ]
  117. },
  118. {
  119. label: '付费数据',
  120. data: [
  121. { title: '首日新用户充值次数', dataIndex: 'firstUserRechargeCount', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  122. { title: '首日新用户充值人数', dataIndex: 'firstUserRechargeUser', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  123. { title: '首日新用户充值金额', dataIndex: 'firstUserRechargeMoney', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  124. { title: '老用户充值次数', dataIndex: 'oldUserRechargeCount', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  125. { title: '老用户充值人数', dataIndex: 'oldUserRechargeUser', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  126. { title: '老用户充值金额', dataIndex: 'oldUserRechargeMoney', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  127. { title: '账面充值次数', dataIndex: 'showRechargeCount', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  128. { title: '账面充值人数', dataIndex: 'showRechargeUser', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  129. { title: '账面充值金额', dataIndex: 'showRechargeMoney', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  130. { title: '新用户累计充值次数', dataIndex: 'newUserRechargeCount', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  131. { title: '新用户累计充值人数', dataIndex: 'newUserRechargeUser', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  132. { title: '新用户累计充值金额', dataIndex: 'newUserRechargeMoney', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  133. {
  134. title: '首日回收率', dataIndex: 'todayRecoveryRate', label: '付费数据', align: 'center', width: 70, sorter: true,
  135. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  136. },
  137. {
  138. title: '买量回收率', dataIndex: 'buyRecoveryRate', label: '付费数据', align: 'center', width: 70, sorter: true,
  139. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  140. },
  141. { title: '毛利额', dataIndex: 'grossMargin', label: '付费数据', align: 'center', width: 90, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  142. {
  143. title: '3日ROI', dataIndex: 'roiDay3', label: '付费数据', align: 'center', width: 70, sorter: true,
  144. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  145. },
  146. {
  147. title: '5日ROI', dataIndex: 'roiDay5', label: '付费数据', align: 'center', width: 70, sorter: true,
  148. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  149. },
  150. {
  151. title: '7日ROI', dataIndex: 'roiDay7', label: '付费数据', align: 'center', width: 70, sorter: true,
  152. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  153. },
  154. {
  155. title: '30日ROI', dataIndex: 'roiDay30', label: '付费数据', align: 'center', width: 70, sorter: true,
  156. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  157. },
  158. {
  159. title: '60日ROI', dataIndex: 'roiDay60', label: '付费数据', align: 'center', width: 70, sorter: true,
  160. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  161. },
  162. {
  163. title: '180日ROI', dataIndex: 'roiDay180', label: '付费数据', align: 'center', width: 70, sorter: true,
  164. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  165. },
  166. {
  167. title: '1年ROI', dataIndex: 'roiYear1', label: '付费数据', align: 'center', width: 70, sorter: true,
  168. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  169. },
  170. {
  171. title: '首日付费率', dataIndex: 'firstRechargeRate', label: '付费数据', align: 'center', width: 70, sorter: true,
  172. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  173. },
  174. {
  175. title: '买量用户付费率', dataIndex: 'buyUserRechargeRate', label: '付费数据', align: 'center', width: 70, sorter: true,
  176. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  177. },
  178. { title: '新用户付费比', dataIndex: 'newUserRechargeRate', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  179. { title: '首日客单价', dataIndex: 'avgFirstUserRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  180. { title: '买量客单价', dataIndex: 'avgBuyUserRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  181. { title: '账面客单价', dataIndex: 'avgShowUserRecharge', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  182. { title: '首日充值成本', dataIndex: 'firstRechargeCost', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  183. { title: '买量充值成本', dataIndex: 'buyUserRechargeCost', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  184. {
  185. title: '复充率', dataIndex: 'repeatRechargeRate', label: '付费数据', align: 'center', width: 70, sorter: true,
  186. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  187. },
  188. { title: '新增注册ARPU', dataIndex: 'newRegARPU', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  189. { title: '首日付费ARPU', dataIndex: 'firstRechargeARPU', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  190. { title: '当天付费ARPU', dataIndex: 'todayRechargeArpu', label: '付费数据', align: 'center', width: 80, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  191. { title: '账面ARPU', dataIndex: 'showRechargeARPU', label: '付费数据', align: 'center', width: 70, sorter: true, render: (a: string) => <Statistic value={a || 0} /> }
  192. ]
  193. },
  194. {
  195. fieldSHow: {
  196. label: '日期区间字段展示',
  197. saveField: 'date_field',
  198. defaultValue,
  199. data: [
  200. {
  201. label: '付费趋势',
  202. data: [
  203. { label: '充值人数', key: 'rechargeCount', type: '付费趋势' },
  204. { label: '充值金额', key: 'rechargeMoney', type: '付费趋势' },
  205. { label: '增', key: 'addPayBack', type: '付费趋势' },
  206. { label: '回', key: 'payBack', type: '付费趋势' },
  207. { label: '倍', key: 'newUserRechargeRate', type: '付费趋势' },
  208. ]
  209. },
  210. ]
  211. },
  212. label: '时间区间跨度',
  213. data: [{
  214. title: "D1",
  215. dataIndex: "D1",
  216. label: "时间区间跨度",
  217. width: 110,
  218. default: 20,
  219. render: (a: any, b: any) => {
  220. let fieldData = getFieldDta()
  221. if (fieldData?.length > 0) {
  222. let data: any = {}
  223. let keyS: string[] = fieldData?.map((item: any) => item.key)
  224. switch (fieldData[0].type) {
  225. case '付费趋势':
  226. if (b?.rechargeTrendDay1) {
  227. data = b?.rechargeTrendDay1
  228. return <div className={style.dbox}>
  229. {keyS?.includes('rechargeCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  230. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  231. {keyS?.includes('addPayBack') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  232. {keyS?.includes('payBack') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  233. {keyS?.includes('payBack') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples}</span></span>}
  234. </div>
  235. }
  236. return '--'
  237. }
  238. }
  239. return '--'
  240. },
  241. }, {
  242. title: "D3",
  243. dataIndex: "D3",
  244. label: "时间区间跨度",
  245. width: 110,
  246. default: 21,
  247. render: (a: any, b: any) => {
  248. let fieldData = getFieldDta()
  249. if (fieldData?.length > 0) {
  250. let data: any = {}
  251. let keyS: string[] = fieldData?.map((item: any) => item.key)
  252. switch (fieldData[0].type) {
  253. case '付费趋势':
  254. if (b?.rechargeTrendDay3) {
  255. data = b?.rechargeTrendDay3
  256. return <div className={style.dbox}>
  257. {keyS?.includes('rechargeCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  258. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  259. {keyS?.includes('addPayBack') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  260. {keyS?.includes('payBack') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  261. {keyS?.includes('payBack') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples}</span></span>}
  262. </div>
  263. }
  264. return '--'
  265. }
  266. }
  267. return '--'
  268. },
  269. }, {
  270. title: "D7",
  271. dataIndex: "D7",
  272. label: "时间区间跨度",
  273. width: 110,
  274. default: 22,
  275. render: (a: any, b: any) => {
  276. let fieldData = getFieldDta()
  277. if (fieldData?.length > 0) {
  278. let data: any = {}
  279. let keyS: string[] = fieldData?.map((item: any) => item.key)
  280. switch (fieldData[0].type) {
  281. case '付费趋势':
  282. if (b?.rechargeTrendDay7) {
  283. data = b?.rechargeTrendDay7
  284. return <div className={style.dbox}>
  285. {keyS?.includes('rechargeCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  286. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  287. {keyS?.includes('addPayBack') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  288. {keyS?.includes('payBack') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  289. {keyS?.includes('payBack') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples}</span></span>}
  290. </div>
  291. }
  292. return '--'
  293. }
  294. }
  295. return '--'
  296. },
  297. }, {
  298. title: "D15",
  299. dataIndex: "D15",
  300. label: "时间区间跨度",
  301. width: 110,
  302. default: 23,
  303. render: (a: any, b: any) => {
  304. let fieldData = getFieldDta()
  305. if (fieldData?.length > 0) {
  306. let data: any = {}
  307. let keyS: string[] = fieldData?.map((item: any) => item.key)
  308. switch (fieldData[0].type) {
  309. case '付费趋势':
  310. if (b?.rechargeTrendDay15) {
  311. data = b?.rechargeTrendDay15
  312. return <div className={style.dbox}>
  313. {keyS?.includes('rechargeCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  314. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  315. {keyS?.includes('addPayBack') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  316. {keyS?.includes('payBack') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  317. {keyS?.includes('payBack') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples}</span></span>}
  318. </div>
  319. }
  320. return '--'
  321. }
  322. }
  323. return '--'
  324. },
  325. }, {
  326. title: "M1",
  327. dataIndex: "M1",
  328. label: "时间区间跨度",
  329. width: 110,
  330. default: 24,
  331. render: (a: any, b: any) => {
  332. let fieldData = getFieldDta()
  333. if (fieldData?.length > 0) {
  334. let data: any = {}
  335. let keyS: string[] = fieldData?.map((item: any) => item.key)
  336. switch (fieldData[0].type) {
  337. case '付费趋势':
  338. if (b?.rechargeTrendMonth1) {
  339. data = b?.rechargeTrendMonth1
  340. return <div className={style.dbox}>
  341. {keyS?.includes('rechargeCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  342. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  343. {keyS?.includes('addPayBack') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  344. {keyS?.includes('payBack') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  345. {keyS?.includes('payBack') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples}</span></span>}
  346. </div>
  347. }
  348. return '--'
  349. }
  350. }
  351. return '--'
  352. },
  353. }, {
  354. title: "M2",
  355. dataIndex: "M2",
  356. label: "时间区间跨度",
  357. width: 110,
  358. default: 25,
  359. render: (a: any, b: any) => {
  360. let fieldData = getFieldDta()
  361. if (fieldData?.length > 0) {
  362. let data: any = {}
  363. let keyS: string[] = fieldData?.map((item: any) => item.key)
  364. switch (fieldData[0].type) {
  365. case '付费趋势':
  366. if (b?.rechargeTrendMonth2) {
  367. data = b?.rechargeTrendMonth2
  368. return <div className={style.dbox}>
  369. {keyS?.includes('rechargeCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  370. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  371. {keyS?.includes('addPayBack') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  372. {keyS?.includes('payBack') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  373. {keyS?.includes('payBack') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples}</span></span>}
  374. </div>
  375. }
  376. return '--'
  377. }
  378. }
  379. return '--'
  380. },
  381. }, {
  382. title: "M3",
  383. dataIndex: "M3",
  384. label: "时间区间跨度",
  385. width: 110,
  386. default: 26,
  387. render: (a: any, b: any) => {
  388. let fieldData = getFieldDta()
  389. if (fieldData?.length > 0) {
  390. let data: any = {}
  391. let keyS: string[] = fieldData?.map((item: any) => item.key)
  392. switch (fieldData[0].type) {
  393. case '付费趋势':
  394. if (b?.rechargeTrendMonth3) {
  395. data = b?.rechargeTrendMonth3
  396. return <div className={style.dbox}>
  397. {keyS?.includes('rechargeCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  398. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  399. {keyS?.includes('addPayBack') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  400. {keyS?.includes('payBack') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  401. {keyS?.includes('payBack') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples}</span></span>}
  402. </div>
  403. }
  404. return '--'
  405. }
  406. }
  407. return '--'
  408. },
  409. }, {
  410. title: "总",
  411. default: 27,
  412. dataIndex: "total",
  413. label: "时间区间跨度",
  414. align: "center",
  415. width: 110,
  416. render: (a: any, b: any) => {
  417. let fieldData = getFieldDta()
  418. if (fieldData?.length > 0) {
  419. let data: any = {}
  420. let keyS: string[] = fieldData?.map((item: any) => item.key)
  421. switch (fieldData[0].type) {
  422. case '付费趋势':
  423. if (b?.rechargeTrendTotal) {
  424. data = b?.rechargeTrendTotal
  425. return <div className={style.dbox}>
  426. {keyS?.includes('rechargeCount') && <span style={{ color: '#d81b60', fontWeight: 600 }}>充人:<span>{data?.rechargeUserCount}</span></span>}
  427. {keyS?.includes('rechargeMoney') && <span style={{ color: '#0f538a', fontWeight: 600 }}>充金:<span><Statistic value={data?.rechargeMoney || 0} valueStyle={{ color: '#0f538a', fontWeight: 600 }} /></span></span>}
  428. {keyS?.includes('addPayBack') && <span style={{ color: 'rgb(12,130,16)', fontWeight: 600 }}>增:<span>{(data?.increase * 100)?.toFixed(2)}%</span></span>}
  429. {keyS?.includes('payBack') && <span style={{ color: '#ff5722', fontWeight: 600 }}>回:<span>{(data?.back * 100)?.toFixed(2)}%</span></span>}
  430. {keyS?.includes('payBack') && <span style={{ color: '#d81b60', fontWeight: 600 }}>倍:<span>{data?.multiples}</span></span>}
  431. </div>
  432. }
  433. return '--'
  434. }
  435. }
  436. return '--'
  437. },
  438. }]
  439. },
  440. // {
  441. // label: '操作',
  442. // data: [
  443. // {
  444. // default: 28,
  445. // title: '操作', dataIndex: 'cz', label: '操作', align: 'center', width: 70, render: (a: string, b: any) => {
  446. // return <a onClick={() => rechargeTrendHandle(b)}>复充趋势</a>
  447. // }
  448. // },
  449. // ]
  450. // },
  451. ]
  452. }
  453. export default columns12