h5NatureUser.tsx 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. import WidthEllipsis from "@/components/widthEllipsis"
  2. import { Button, Modal, Statistic, Table } from "antd"
  3. import { ColumnsType } from "antd/lib/table"
  4. import React, { useState } from "react"
  5. const columns: ColumnsType<any> = [
  6. {
  7. title: '游戏名称', dataIndex: `natureGameName`, align: 'center', width: 85,
  8. render: (a: string, b: any) => {
  9. return <WidthEllipsis isCopy value={a} />
  10. }
  11. },
  12. {
  13. title: '游戏ID', dataIndex: `natureGameId`, align: 'center', width: 85,
  14. render: (a: string, b: any) => {
  15. return <WidthEllipsis value={a} />
  16. }
  17. },
  18. {
  19. title: '游戏应用类型', dataIndex: `natureClassify`, align: 'center', width: 100,
  20. render: (a: string, b: any) => {
  21. return <Statistic value={a || 0} />
  22. }
  23. },
  24. {
  25. title: '新用户充值金额', dataIndex: `newUserRechargeMoney`, align: 'center', width: 105,
  26. render: (a: string, b: any) => {
  27. return <Statistic value={a || 0} />
  28. }
  29. },
  30. {
  31. title: '新用户充值人数', dataIndex: `newUserRechargeNum`, align: 'center', width: 105,
  32. render: (a: string, b: any) => {
  33. return <Statistic value={a || 0} />
  34. }
  35. },
  36. {
  37. title: '累计充值金额', dataIndex: `h5LeadNatureNewUserTotalAmount`, align: 'center', width: 90,
  38. render: (a: string, b: any) => {
  39. return <Statistic value={a || 0} />
  40. }
  41. },
  42. {
  43. title: '累计充值人数', dataIndex: `h5LeadNatureNewUserTotalAmountNum`, align: 'center', width: 90,
  44. render: (a: string, b: any) => {
  45. return <Statistic value={a || 0} />
  46. }
  47. },
  48. {
  49. title: '账面充值金额', dataIndex: `h5LeadNatureAmount`, align: 'center', width: 90,
  50. render: (a: string, b: any) => {
  51. return <Statistic value={a || 0} />
  52. }
  53. },
  54. {
  55. title: '账面充值人数', dataIndex: `h5LeadNatureAmountNum`, align: 'center', width: 90,
  56. render: (a: string, b: any) => {
  57. return <Statistic value={a || 0} />
  58. }
  59. },
  60. ]
  61. interface Props {
  62. gameName: string
  63. h5NatureUserVOList: any[]
  64. }
  65. /**
  66. * 游戏官方导量用户数据
  67. * @returns
  68. */
  69. const H5NatureUser: React.FC<Props> = ({ gameName, h5NatureUserVOList }) => {
  70. /**************************************/
  71. const [visible, setVisible] = useState<boolean>(false)
  72. /**************************************/
  73. return <>
  74. <Button type="link" style={{ padding: 0 }} onClick={() => setVisible(true)}>官方导量</Button>
  75. {visible && <Modal title={`${gameName} 游戏官方导量用户数据`} width={900} visible={visible} onCancel={() => setVisible(false)} footer={null}>
  76. <Table size="small" dataSource={h5NatureUserVOList?.map((item: any, index: number) => ({ ...item, id: index + 1 }))} columns={columns} />
  77. </Modal>}
  78. </>
  79. }
  80. export default React.memo(H5NatureUser)