tableConfig.tsx 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. import { PromotedObjectType } from '@/services/launchAdq/enum'
  2. import React from 'react'
  3. import { Space } from 'antd'
  4. function tableConfig(callback:(data:any,type:'edit'|'look')=>void):any{
  5. return [
  6. {
  7. title: 'ID',
  8. dataIndex: 'id',
  9. key: 'id',
  10. align: 'center',
  11. width:70,
  12. },
  13. {
  14. title: '广告名称',
  15. dataIndex: 'adgroupName',
  16. key: 'adgroupName',
  17. align: 'center',
  18. },
  19. {
  20. title: '广告推广目标类型',
  21. dataIndex: 'promotedObjectType',
  22. key: 'promotedObjectType',
  23. align: 'center',
  24. render:(a: string | number)=>{
  25. return PromotedObjectType[a]
  26. }
  27. },
  28. {
  29. title: '投放日期',
  30. dataIndex: 'beginDate',
  31. key: 'beginDate',
  32. align: 'center',
  33. render:(a: string,b: { endDate: string })=>{
  34. return b?.endDate ? a+'~'+b.endDate : a+'~'+'长期投放'
  35. }
  36. },
  37. {
  38. title: '广告出价',
  39. dataIndex: 'bidAmount',
  40. key: 'bidAmount',
  41. align: 'center',
  42. },
  43. {
  44. title: '创建时间',
  45. dataIndex: 'createTime',
  46. key: 'createTime',
  47. align: 'center',
  48. },
  49. {
  50. title:'操作',
  51. dataIndex:'cz',
  52. key: 'cz',
  53. align: 'center',
  54. render:(a: any,b: any)=>{
  55. return <Space>
  56. <a onClick={()=>{
  57. callback(b,'look')
  58. }}>详情</a>
  59. </Space>
  60. }
  61. }
  62. ]
  63. }
  64. export default tableConfig