tableConfig.tsx 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import { FundStatusEnum, } from '@/services/launchAdq/enum'
  2. import React from 'react'
  3. import { Badge } from 'antd'
  4. function tableConfig(tableIdClick: (props: {
  5. activeKey: string,
  6. parma: {
  7. accountId?: string,//账户ID
  8. campaignId?: string,//计划ID
  9. adgroupId?: string,//广告ID
  10. adcreativeId?: string,//创意ID
  11. pageId?: string,//落地页ID
  12. targetingId?: string,//定向ID
  13. }
  14. }) => void):any{
  15. return [
  16. {
  17. title: 'ID',
  18. dataIndex: 'id',
  19. key: 'id',
  20. align: 'center',
  21. width:50,
  22. render:(a:string)=>{
  23. return <a>{a}</a>
  24. }
  25. },
  26. {
  27. title: '账号ID',
  28. dataIndex: 'accountId',
  29. key: 'accountId',
  30. align: 'center',
  31. width:90,
  32. render:(a:string)=>{
  33. return <a onClick={() => {
  34. tableIdClick({ activeKey: '1', parma: { accountId: a } })
  35. }}>{a}</a>
  36. }
  37. },
  38. {
  39. title: '腾讯备注',
  40. dataIndex: 'memo',
  41. key: 'memo',
  42. align: 'center',
  43. width: 100,
  44. fixed: 'left',
  45. ellipsis: true,
  46. },
  47. {
  48. title: '本地备注',
  49. dataIndex: 'remark',
  50. key: 'remark',
  51. align: 'center',
  52. width: 100,
  53. fixed: 'left',
  54. ellipsis: true,
  55. },
  56. {
  57. title: '账户余额(分)',
  58. dataIndex: 'balance',
  59. key: 'balance',
  60. align: 'center',
  61. width:150,
  62. },
  63. {
  64. title: '资金状态',
  65. dataIndex: 'fundStatus',
  66. key: 'fundStatus',
  67. align: 'center',
  68. width:130,
  69. render:(a: string | number)=>{
  70. return FundStatusEnum[a]
  71. }
  72. },
  73. {
  74. title: '是否有效',
  75. dataIndex: 'enabled',
  76. key: 'enabled',
  77. align: 'center',
  78. width:130,
  79. render: (a: any, b: any) => {
  80. return <Badge status={a ? "processing" :"error" } text={a? '是' : '否'} />
  81. }
  82. },
  83. ]
  84. }
  85. export default tableConfig