tableConfig.tsx 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import { FundStatusEnum, } from '@/services/launchAdq/enum'
  2. import React from 'react'
  3. import { Badge, Space } from 'antd'
  4. import { copy } from '@/utils/utils'
  5. import { CopyOutlined } from '@ant-design/icons'
  6. function tableConfig(tableIdClick: any): any {
  7. return [
  8. {
  9. title: 'ID',
  10. dataIndex: 'id',
  11. key: 'id',
  12. align: 'center',
  13. width: 50
  14. },
  15. {
  16. title: '账号ID',
  17. dataIndex: 'accountId',
  18. key: 'accountId',
  19. align: 'center',
  20. width: 90,
  21. render: (a: string) => {
  22. return <Space>
  23. <a onClick={() => copy(a)} style={{ color: '#00bcd4' }}><CopyOutlined /></a>
  24. <a onClick={() => tableIdClick({ activeKey: '1', parma: { accountId: a } })}>{a}</a>
  25. </Space>
  26. }
  27. },
  28. {
  29. title: '腾讯备注',
  30. dataIndex: 'memo',
  31. key: 'memo',
  32. align: 'center',
  33. width: 100,
  34. fixed: 'left',
  35. ellipsis: true,
  36. },
  37. {
  38. title: '本地备注',
  39. dataIndex: 'remark',
  40. key: 'remark',
  41. align: 'center',
  42. width: 100,
  43. fixed: 'left',
  44. ellipsis: true,
  45. },
  46. {
  47. title: '账户余额(分)',
  48. dataIndex: 'balance',
  49. key: 'balance',
  50. align: 'center',
  51. width: 150,
  52. },
  53. {
  54. title: '资金状态',
  55. dataIndex: 'fundStatus',
  56. key: 'fundStatus',
  57. align: 'center',
  58. width: 130,
  59. render: (a: string | number) => {
  60. return FundStatusEnum[a]
  61. }
  62. },
  63. {
  64. title: '是否有效',
  65. dataIndex: 'enabled',
  66. key: 'enabled',
  67. align: 'center',
  68. width: 130,
  69. render: (a: any, b: any) => {
  70. return <Badge status={a ? "processing" : "error"} text={a ? '是' : '否'} />
  71. }
  72. },
  73. ]
  74. }
  75. export default tableConfig