tableConfig.tsx 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  1. import WidthEllipsis from "@/components/widthEllipsis"
  2. import { Progress, Statistic } from "antd"
  3. import React from "react"
  4. import { AdUnitType_Enum, PRODUCT_TYPE_ENUM } from "../../../const"
  5. import { APPTYPE } from "@/pages/iaaSystem/manage/const"
  6. function columns12(): { label: string, fieldSHow?: { label: string, saveField: string, defaultValue: any[], data: any[] }, data: any[] }[] {
  7. return [
  8. {
  9. label: '基本信息',
  10. data: [
  11. {
  12. title: '日期', dataIndex: 'dt', label: '基本信息', align: 'center', width: 80, default: 1,
  13. render: (a: string) => (<WidthEllipsis value={a} />)
  14. },
  15. {
  16. title: '应用', dataIndex: 'appName', label: '基本信息', align: 'center', width: 120, default: 2,
  17. render: (a: string) => (<WidthEllipsis value={a} />)
  18. },
  19. {
  20. title: '应用ID', dataIndex: 'iaaAppId', label: '基本信息', align: 'center', width: 80,
  21. render: (a: string) => (<WidthEllipsis value={a} />)
  22. },
  23. {
  24. title: '小程序名称', dataIndex: 'mpName', label: '基本信息', align: 'center', width: 85, default: 3,
  25. render: (a: string) => (<WidthEllipsis value={a} />)
  26. },
  27. {
  28. title: '小程序ID', dataIndex: 'mpId', label: '基本信息', align: 'center', width: 80,
  29. render: (a: string) => (<WidthEllipsis value={a} />)
  30. },
  31. {
  32. title: '账号归属', dataIndex: 'adUnitType', label: '基本信息', align: 'center', width: 80,
  33. render: (a: string) => (<WidthEllipsis value={AdUnitType_Enum[a as keyof typeof AdUnitType_Enum]} />)
  34. },
  35. {
  36. title: '业务类型', dataIndex: 'productType', label: '基本信息', align: 'center', width: 80, default: 4,
  37. render: (a: string) => (<WidthEllipsis value={PRODUCT_TYPE_ENUM[a as keyof typeof PRODUCT_TYPE_ENUM]} />)
  38. },
  39. {
  40. title: '应用类型', dataIndex: 'appType', label: '基本信息', align: 'center', width: 80, default: 5,
  41. render: (a: string) => (<WidthEllipsis value={APPTYPE[a as keyof typeof APPTYPE]?.text} />)
  42. },
  43. {
  44. title: '投手名称', dataIndex: 'pitcherName', label: '基本信息', align: 'center', width: 80, default: 6,
  45. render: (a: string) => (<WidthEllipsis value={a} />)
  46. },
  47. {
  48. title: '消耗', dataIndex: 'cost', label: '基本信息', align: 'right', width: 125, default: 7, sorter: true,
  49. className: 'padding_0',
  50. render: (a: number) => <div style={{ height: 30, position: 'relative' }}>
  51. <Progress
  52. strokeColor={{
  53. from: '#ff5900',
  54. to: '#ffd380',
  55. }}
  56. status="active"
  57. showInfo={false}
  58. percent={a ? a / 20000 * 100 : 0}
  59. />
  60. <span style={{ position: 'absolute', left: '50%', top: '50%', width: '100%', padding: '0 5px', transform: 'translate(-50%, -50%)' }}><Statistic value={a || 0} precision={2} valueStyle={a >= 20000 ? { color: '#000', fontWeight: 'bold' } : { fontWeight: 'bold' }} /></span>
  61. </div>
  62. },
  63. {
  64. title: '广告变现成本', dataIndex: 'adMonetizationCost', label: '基本信息', align: 'right', width: 110, default: 8, sorter: true,
  65. render: (a: number) => <Statistic value={a || 0} precision={2} />
  66. },
  67. {
  68. title: '广告变现人数', dataIndex: 'appAdPayingUsers', label: '基本信息', align: 'center', width: 110, default: 9, sorter: true,
  69. render: (a: number) => <Statistic value={a || 0} />
  70. },
  71. {
  72. title: '广告变现arpu', dataIndex: 'arpu', label: '基本信息', align: 'center', width: 110, default: 10, sorter: true,
  73. render: (a: number) => <Statistic value={a || 0} precision={2} />
  74. },
  75. {
  76. title: '广告变现arppu', dataIndex: 'arppu', label: '基本信息', align: 'center', width: 120, default: 11, sorter: true,
  77. render: (a: number) => <Statistic value={a || 0} precision={2} />
  78. },
  79. {
  80. title: '广告变现金额', dataIndex: 'appAdPayingAmount', label: '基本信息', align: 'center', width: 110, default: 12, sorter: true,
  81. render: (a: number) => <Statistic value={a || 0} precision={2} />
  82. },
  83. {
  84. title: '广告变现roi', dataIndex: 'appAdPayingRoi', label: '基本信息', align: 'center', width: 105, default: 13, sorter: true,
  85. render: (a: number) => <Statistic value={a ? a * 100 : 0} precision={2} valueStyle={!a ? {} : a >= 0.5 ? { color: 'red' } : { color: '#0f990f' }} suffix="%" />
  86. },
  87. {
  88. title: '注册人数', dataIndex: 'reg_dedup_pv', label: '基本信息', align: 'center', width: 80, default: 14, sorter: true,
  89. render: (a: number, b: any) => <Statistic value={a || 0} precision={2} />
  90. },
  91. {
  92. title: 'D1', dataIndex: 'reg_dedup_pv', label: '基本信息', align: 'center', width: 80, default: 14, sorter: true,
  93. render: (a: number, b: any) => <Statistic value={a || 0} precision={2} />
  94. },
  95. {
  96. title: 'D2', dataIndex: 'reg_dedup_pv', label: '基本信息', align: 'center', width: 80, default: 15, sorter: true,
  97. render: (a: number, b: any) => <Statistic value={a || 0} precision={2} />
  98. },
  99. {
  100. title: 'D3', dataIndex: 'reg_dedup_pv', label: '基本信息', align: 'center', width: 80, default: 16, sorter: true,
  101. render: (a: number, b: any) => <Statistic value={a || 0} precision={2} />
  102. },
  103. {
  104. title: 'D4', dataIndex: 'reg_dedup_pv', label: '基本信息', align: 'center', width: 80, default: 17, sorter: true,
  105. render: (a: number, b: any) => <Statistic value={a || 0} precision={2} />
  106. },
  107. {
  108. title: 'D5', dataIndex: 'reg_dedup_pv', label: '基本信息', align: 'center', width: 80, default: 18, sorter: true,
  109. render: (a: number, b: any) => <Statistic value={a || 0} precision={2} />
  110. },
  111. {
  112. title: 'D6', dataIndex: 'reg_dedup_pv', label: '基本信息', align: 'center', width: 80, default: 19, sorter: true,
  113. render: (a: number, b: any) => <Statistic value={a || 0} precision={2} />
  114. },
  115. {
  116. title: 'D7', dataIndex: 'reg_dedup_pv', label: '基本信息', align: 'center', width: 80, default: 20, sorter: true,
  117. render: (a: number, b: any) => <Statistic value={a || 0} precision={2} />
  118. },
  119. ]
  120. }
  121. ]
  122. }
  123. export default columns12