tableConfig.tsx 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import { PromotedObjectType } from "@/services/launchAdq/enum"
  2. import { copy } from "@/utils/utils"
  3. import { Image, Space } from "antd"
  4. import React from "react"
  5. function tableConfig(tableIdClick: (props: {
  6. activeKey: string, 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: '所属账号',
  18. dataIndex: 'accountId',
  19. key: 'accountId',
  20. align: 'center',
  21. width: 80,
  22. ellipsis: true,
  23. render: (a: string) => {
  24. return <Space>
  25. <a onClick={() => copy(a)} >{a}</a>
  26. </Space>
  27. }
  28. },
  29. {
  30. title: '推广目标ID',
  31. dataIndex: 'promotedObjectId',
  32. key: 'promotedObjectId',
  33. align: 'center',
  34. width: 100,
  35. fixed: 'left',
  36. ellipsis: true,
  37. render: (a: string) => {
  38. return <Space>
  39. <a onClick={() => copy(a)} >{a}</a>
  40. </Space>
  41. }
  42. },
  43. {
  44. title: '推广目标名称',
  45. dataIndex: 'promotedObjectName',
  46. key: 'promotedObjectName',
  47. align: 'center',
  48. width: 100,
  49. ellipsis: true,
  50. render: (a: string) => {
  51. return <a style={{ wordBreak: 'break-all' }} onClick={() => { copy(a) }}>{a}</a>
  52. }
  53. },
  54. {
  55. title: '品牌形象',
  56. dataIndex: 'promotedObjectSpec',
  57. key: 'promotedObjectSpec',
  58. align: 'center',
  59. width: 50,
  60. ellipsis: true,
  61. render: (a: any) => {
  62. return <Image src={a?.wechatOfficialAccountSpec?.icon} style={{width:20}}/>
  63. }
  64. },
  65. {
  66. title: '推广目标类型',
  67. dataIndex: 'promotedObjectType',
  68. key: 'promotedObjectType',
  69. width: 140,
  70. align: 'center',
  71. render:(a:any)=>{
  72. return <span>{PromotedObjectType[a]}</span>
  73. }
  74. },
  75. {
  76. title: '创建时间',
  77. dataIndex: 'createdTime',
  78. key: 'createdTime',
  79. width: 200,
  80. align: 'center'
  81. },
  82. {
  83. title: '更新时间',
  84. dataIndex: 'lastModifiedTime',
  85. key: 'lastModifiedTime',
  86. width: 200,
  87. align: 'center'
  88. },
  89. ]
  90. }
  91. export default tableConfig