tableConfig.tsx 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372
  1. import WidthEllipsis from "@/components/widthEllipsis"
  2. import { Statistic } from "antd"
  3. import classNames from "classnames"
  4. import React from "react"
  5. function columns12() {
  6. const roiC = Array(29).fill('').map((_item: string, index: number) => {
  7. let data = {
  8. title: `${index + 2}日ROI`,
  9. dataIndex: `roi${index + 2}`,
  10. label: '付费数据',
  11. align: 'center',
  12. width: 80,
  13. sorter: true,
  14. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  15. }
  16. index++;
  17. return data
  18. })
  19. let newArr: { label: string, data: any[] }[] = [
  20. {
  21. label: '基本信息',
  22. data: [
  23. {
  24. title: '投手', dataIndex: 'pitcher', label: '基本信息', align: 'center', width: 95, default: 1,
  25. render: (a: string, b: any) => (<WidthEllipsis value={a} />)
  26. },
  27. {
  28. title: '消耗', dataIndex: 'cost', label: '基本信息', align: 'center', width: 70, default: 2, sorter: true,
  29. render: (a: string) => <Statistic value={a || 0} />
  30. },
  31. {
  32. title: '推广账号数量', dataIndex: 'accountCount', label: '基本信息', align: 'center', width: 80, sorter: true,
  33. render: (a: string) => <Statistic value={a || 0} />
  34. },
  35. {
  36. title: '推广渠道数量', dataIndex: 'agentCount', label: '基本信息', align: 'center', width: 70, sorter: true,
  37. render: (a: string) => <Statistic value={a || 0} />
  38. },
  39. // {
  40. // title: '推广游戏数量', dataIndex: 'cost', label: '基本信息', align: 'center', width: 90, sorter: true,
  41. // },
  42. {
  43. title: '推广计划数量', dataIndex: 'planCount', label: '基本信息', align: 'center', width: 70, sorter: true,
  44. render: (a: string) => <Statistic value={a || 0} />
  45. }
  46. ]
  47. },
  48. {
  49. label: '用户数据',
  50. data: [
  51. {
  52. title: '注册人数', dataIndex: 'registerNum', label: '用户数据', align: 'center', width: 70, sorter: true, default: 3,
  53. render: (a: string) => <Statistic value={a || 0} />
  54. },
  55. {
  56. title: '注册成本', dataIndex: 'registerCost', label: '用户数据', align: 'center', width: 70, sorter: true, default: 4,
  57. render: (a: string) => <Statistic value={a || 0} />
  58. },
  59. // {
  60. // title: '活跃用户人数', dataIndex: 'clickRate', label: '用户数据', align: 'center', width: 80, sorter: true,
  61. // render: (a: number) => <Statistic value={a || 0} valueStyle={a >= 100 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  62. // },
  63. {
  64. title: '创角人数', dataIndex: 'roleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
  65. render: (a: string) => <Statistic value={a || 0} />
  66. },
  67. {
  68. title: '首日创角人数', dataIndex: 'firstRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
  69. render: (a: string) => <Statistic value={a || 0} />
  70. },
  71. {
  72. title: '新用户累计创角人数', dataIndex: 'newUserTotalRoleNum', label: '用户数据', align: 'center', width: 100, sorter: true,
  73. render: (a: string) => <Statistic value={a || 0} />
  74. },
  75. {
  76. title: '首日创角成本', dataIndex: 'firstRoleCost', label: '用户数据', align: 'center', width: 70, sorter: true,
  77. render: (a: string) => <Statistic value={a || 0} />
  78. },
  79. {
  80. title: '新用户累计创角成本', dataIndex: 'newUserTotalRoleCost', label: '用户数据', align: 'center', width: 70, sorter: true,
  81. render: (a: string) => <Statistic value={a || 0} />
  82. },
  83. // {
  84. // title: '创角量', dataIndex: 'roleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
  85. // render: (a: string) => <Statistic value={a || 0} />
  86. // },
  87. // {
  88. // title: '首日创角量', dataIndex: 'firstRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
  89. // render: (a: string) => <Statistic value={a || 0} />
  90. // },
  91. // {
  92. // title: '新用户累计创角量', dataIndex: 'newUserTotalRoleNum', label: '用户数据', align: 'center', width: 70, sorter: true,
  93. // render: (a: string) => <Statistic value={a || 0} />
  94. // },
  95. // {
  96. // title: '新用户累计有效创角量', dataIndex: 'totalAmount', label: '用户数据', align: 'center', width: 70, sorter: true,
  97. // },
  98. {
  99. title: '首日创角率', dataIndex: 'firstRoleRate', label: '用户数据', align: 'center', width: 70, sorter: true,
  100. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  101. },
  102. {
  103. title: '新用户创角率', dataIndex: 'newUserTotalRoleRate', label: '用户数据', align: 'center', width: 70, sorter: true,
  104. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 50 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  105. }
  106. ]
  107. },
  108. {
  109. label: '付费数据',
  110. data: [
  111. {
  112. title: '新用户充值次数', dataIndex: 'newUserAmountCount', label: '付费数据', align: 'center', width: 90,
  113. render: (a: string) => <Statistic value={a || 0} />
  114. },
  115. {
  116. title: '新用户充值人数', dataIndex: 'newUserAmountNum', label: '付费数据', align: 'center', width: 100, sorter: true, default: 5,
  117. render: (a: string) => <Statistic value={a || 0} />
  118. },
  119. {
  120. title: '新用户充值金额', dataIndex: 'newUserAmount', label: '付费数据', align: 'center', default: 6,
  121. children: [
  122. {
  123. title: '总',
  124. dataIndex: 'newUserAmount',
  125. key: 'newUserAmount',
  126. align: 'right',
  127. width: 70,
  128. className: 'adDataBackColorClass',
  129. render: (a: string) => <Statistic value={a || 0} />
  130. },
  131. {
  132. title: '支付宝',
  133. dataIndex: 'alipayAmount',
  134. key: 'alipayAmount',
  135. align: 'right',
  136. width: 80,
  137. className: 'payDataBackColorClass',
  138. render: (a: string) => <Statistic value={a || 0} />
  139. },
  140. {
  141. title: '微信',
  142. dataIndex: 'wxAmount',
  143. key: 'wxAmount',
  144. align: 'right',
  145. width: 70,
  146. className: 'payDataBackColorClass',
  147. render: (a: string) => <Statistic value={a || 0} />
  148. },
  149. {
  150. title: '米大师',
  151. dataIndex: 'miMasterAmount',
  152. key: 'miMasterAmount',
  153. align: 'right',
  154. width: 80,
  155. className: 'payDataBackColorClass',
  156. render: (a: string) => <Statistic value={a || 0} />
  157. }
  158. ]
  159. },
  160. {
  161. title: '首日新用户充值次数', dataIndex: 'firstNewUserAmountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
  162. render: (a: string) => <Statistic value={a || 0} />
  163. },
  164. {
  165. title: '首日新用户充值人数', dataIndex: 'firstNewUserAmountNum', label: '付费数据', align: 'center', width: 70, sorter: true, default: 7,
  166. render: (a: string) => <Statistic value={a || 0} />
  167. },
  168. {
  169. title: '首日新用户充值金额', dataIndex: 'firstNewUserAmount', label: '付费数据', align: 'center', width: 70, sorter: true, default: 8,
  170. render: (a: string) => <Statistic value={a || 0} />
  171. },
  172. {
  173. title: '老用户充值次数', dataIndex: 'oldAmountCount', label: '付费数据', align: 'center', width: 70,
  174. render: (a: string) => <Statistic value={a || 0} />
  175. },
  176. {
  177. title: '老用户充值人数', dataIndex: 'oldAmountNum', label: '付费数据', align: 'center', width: 70,
  178. render: (a: string) => <Statistic value={a || 0} />
  179. },
  180. {
  181. title: '老用户充值金额', dataIndex: 'oldAmount', label: '付费数据', align: 'center', width: 70,
  182. render: (a: string) => <Statistic value={a || 0} />
  183. },
  184. {
  185. title: '账面充值次数', dataIndex: 'amountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
  186. render: (a: string) => <Statistic value={a || 0} />
  187. },
  188. {
  189. title: '账面充值人数', dataIndex: 'amountNum', label: '付费数据', align: 'center', width: 70, sorter: true,
  190. render: (a: string) => <Statistic value={a || 0} />
  191. },
  192. {
  193. title: '账面充值金额', dataIndex: 'amount', label: '付费数据', align: 'center', width: 70, sorter: true,
  194. render: (a: string) => <Statistic value={a || 0} />
  195. },
  196. {
  197. title: '新用户累计充值次数', dataIndex: 'buyNewUserTotalAmountCount', label: '付费数据', align: 'center', width: 70, sorter: true,
  198. render: (a: string) => <Statistic value={a || 0} />
  199. },
  200. {
  201. title: '新用户累计充值人数', dataIndex: 'buyNewUserTotalAmountNum', label: '付费数据', align: 'center', width: 70, sorter: true, default: 9,
  202. render: (a: string) => <Statistic value={a || 0} />
  203. },
  204. {
  205. title: '新用户累计充值金额', dataIndex: 'buyNewUserTotalAmount', label: '付费数据', align: 'center', default: 10,
  206. children: [
  207. {
  208. title: '总',
  209. dataIndex: 'buyNewUserTotalAmount',
  210. key: 'buyNewUserTotalAmount',
  211. align: 'right',
  212. width: 70,
  213. className: 'adDataBackColorClass',
  214. render: (a: string) => <Statistic value={a || 0} />
  215. },
  216. {
  217. title: '支付宝累计',
  218. dataIndex: 'newUserTotalZfbAmount',
  219. key: 'newUserTotalZfbAmount',
  220. align: 'right',
  221. width: 80,
  222. className: 'payDataBackColorClass',
  223. render: (a: string) => <Statistic value={a || 0} />
  224. },
  225. {
  226. title: '微信累计',
  227. dataIndex: 'newUserTotalWxAmount',
  228. key: 'newUserTotalWxAmount',
  229. align: 'right',
  230. width: 70,
  231. className: 'payDataBackColorClass',
  232. render: (a: string) => <Statistic value={a || 0} />
  233. },
  234. {
  235. title: '米大师累计',
  236. dataIndex: 'newUserTotalMdsAmount',
  237. key: 'newUserTotalMdsAmount',
  238. align: 'right',
  239. width: 80,
  240. className: 'payDataBackColorClass',
  241. render: (a: string) => <Statistic value={a || 0} />
  242. }
  243. ]
  244. },
  245. {
  246. title: '首日ROI', dataIndex: 'firstRoi', label: '付费数据', align: 'center', width: 70, sorter: true, default: 12,
  247. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  248. },
  249. {
  250. title: '新用户回收率', dataIndex: 'newUserRoi', label: '付费数据', align: 'center', width: 70, default: 11,
  251. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  252. },
  253. {
  254. title: '至今回收率', dataIndex: 'todayRoi', label: '付费数据', align: 'center', width: 70, sorter: true,
  255. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  256. },
  257. {
  258. title: '毛利额', dataIndex: 'grossProfit', label: '付费数据', align: 'center', width: 70, sorter: true,
  259. render: (a: number) => <Statistic value={a} precision={2} valueStyle={a < 0 ? { color: 'red' } : {}} />
  260. },
  261. ...roiC,
  262. {
  263. title: '60日ROI', dataIndex: 'roi60', label: '付费数据', align: 'center', width: 80, sorter: true,
  264. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 0.9 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  265. },
  266. {
  267. title: '90日ROI', dataIndex: 'roi90', label: '付费数据', align: 'center', width: 80, sorter: true,
  268. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  269. },
  270. {
  271. title: '180日ROI', dataIndex: 'roi180', label: '付费数据', align: 'center', width: 80, sorter: true,
  272. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  273. },
  274. {
  275. title: '1年ROI', dataIndex: 'roi1yaer', label: '付费数据', align: 'center', width: 80, sorter: true,
  276. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  277. },
  278. {
  279. title: '总ROI', dataIndex: 'todayRoi', label: '付费数据', align: 'center', width: 80, default: 13, sorter: true,
  280. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  281. },
  282. {
  283. title: '首日付费率', dataIndex: 'firstRate', label: '付费数据', align: 'center', width: 70, sorter: true,
  284. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  285. },
  286. {
  287. title: '新用户付费率', dataIndex: 'newUserAmountRate', label: '付费数据', align: 'center', width: 70, sorter: true,
  288. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  289. },
  290. {
  291. title: '至今付费率', tips: '至今付费率=新用户累计充值人数/注册人数', dataIndex: 'todayRate', label: '付费数据', align: 'center', width: 80, sorter: true,
  292. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  293. },
  294. {
  295. title: '新用户付费比', dataIndex: 'newUserAmountRatio', label: '付费数据', align: 'center', width: 70, sorter: true,
  296. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  297. },
  298. // {
  299. // title: '活跃用户付费率', dataIndex: 'newUserRate1', label: '付费数据', align: 'center', width: 70, sorter: true,
  300. // render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  301. // },
  302. {
  303. title: '首日客单价', dataIndex: 'firstAvg', label: '付费数据', align: 'center', width: 70, sorter: true,
  304. render: (a: string) => <Statistic value={a || 0} />
  305. },
  306. {
  307. title: '新用户客单价', dataIndex: 'newUserAvg', label: '付费数据', align: 'center', width: 70,
  308. render: (a: string) => <Statistic value={a || 0} />
  309. },
  310. {
  311. title: '账面客单价', dataIndex: 'paperAvg', label: '付费数据', align: 'center', width: 70, sorter: true,
  312. render: (a: string) => <Statistic value={a || 0} />
  313. },
  314. {
  315. title: '首日充值成本', dataIndex: 'firstAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 15,
  316. render: (a: string) => <Statistic value={a || 0} />
  317. },
  318. {
  319. title: '新用户充值成本', dataIndex: 'newUserAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 14,
  320. render: (a: string) => <Statistic value={a || 0} />
  321. },
  322. {
  323. title: '至今充值成本', dataIndex: 'todayAmountCost', label: '付费数据', align: 'center', width: 70, sorter: true, default: 16,
  324. render: (a: string) => <Statistic value={a || 0} />
  325. },
  326. {
  327. title: '新用户复充率', dataIndex: 'newUserAgainRate', label: '付费数据', align: 'center', width: 70, sorter: true, default: 17,
  328. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  329. },
  330. {
  331. title: '至今复充率', dataIndex: 'todayAgainRate', label: '付费数据', align: 'center', width: 70, sorter: true,
  332. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  333. },
  334. // {
  335. // title: '平均活跃付费率', dataIndex: 'newUserRate4', label: '付费数据', align: 'center', width: 70, sorter: true,
  336. // render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 1 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  337. // },
  338. {
  339. title: '新增注册ARPPU', dataIndex: 'newRegArpu', label: '付费数据', align: 'center', width: 70, sorter: true, default: 18,
  340. render: (a: string) => <Statistic value={a || 0} />
  341. },
  342. // {
  343. // title: '活跃ARPPU', dataIndex: 'regUserArpu1', label: '付费数据', align: 'center', width: 70, sorter: true,
  344. // render: (a: string) => <Statistic value={a || 0} />
  345. // },
  346. {
  347. title: '首日付费ARPPU', dataIndex: 'firstArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
  348. render: (a: string) => <Statistic value={a || 0} />
  349. },
  350. {
  351. title: '新用户付费ARPPU', dataIndex: 'newUserArpu', label: '付费数据', align: 'center', width: 70,
  352. render: (a: string) => <Statistic value={a || 0} />
  353. },
  354. {
  355. title: '至今付费ARPPU', dataIndex: 'todayArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
  356. render: (a: string) => <Statistic value={a || 0} />
  357. },
  358. {
  359. title: '账面ARPPU', dataIndex: 'paperArpu', label: '付费数据', align: 'center', width: 70, sorter: true,
  360. render: (a: string) => <Statistic value={a || 0} />
  361. }
  362. ]
  363. }
  364. ]
  365. return newArr
  366. }
  367. export default columns12