tableConfig.tsx 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import { PageStatusEnum, PageTypeEnum, SourceTypeEnum } from '@/services/launchAdq/enum'
  2. import React from 'react'
  3. import { Badge } from 'antd'
  4. import { copy } from '@/utils/utils'
  5. function tableConfig(tableIdClick: any): any {
  6. return [
  7. {
  8. title: '所属账号',
  9. dataIndex: 'accountId',
  10. key: 'accountId',
  11. align: 'center',
  12. width:100,
  13. render:(a:string)=>{
  14. return <a onClick={() => tableIdClick({ activeKey: '1', parma: { accountId: a } })}>{a}</a>
  15. }
  16. },
  17. {
  18. title: '落地页ID',
  19. dataIndex: 'pageId',
  20. key: 'pageId',
  21. align: 'center',
  22. width:100,
  23. render:(a:string)=>{
  24. return <a onClick={() => copy(a)}>{a}</a>
  25. }
  26. },
  27. {
  28. title: '落地页名称',
  29. dataIndex: 'pageName',
  30. key: 'pageName',
  31. align: 'center',
  32. },
  33. // {
  34. // title: '原生页类型',
  35. // dataIndex: 'canvasType',
  36. // key: 'canvasType',
  37. // align: 'center',
  38. // width:110,
  39. // render: (a: string | number) => {
  40. // return CanvasTypeEnum[a]
  41. // }
  42. // },
  43. {
  44. title: '落地页类型',
  45. dataIndex: 'pageType',
  46. key: 'pageType',
  47. align: 'center',
  48. width:110,
  49. render: (a: string) => {
  50. return PageTypeEnum[a]
  51. }
  52. },
  53. {
  54. title: '落地页状态',
  55. dataIndex: 'pageStatus',
  56. key: 'pageStatus',
  57. align: 'center',
  58. width:90,
  59. render:(a: string | number)=>{
  60. return <Badge status={a === 'NORMAL' ? "processing" :"error" } text={PageStatusEnum[a]} />
  61. }
  62. },
  63. {
  64. title: '配置来源',
  65. dataIndex: 'sourceType',
  66. key: 'sourceType',
  67. align: 'center',
  68. width:110,
  69. render: (a: any, b: any) => {
  70. return SourceTypeEnum[a]
  71. }
  72. },
  73. // {
  74. // title: '微信原生页视频资源状态',
  75. // dataIndex: 'videoResourceStatus',
  76. // key: 'videoResourceStatus',
  77. // align: 'center',
  78. // width:160,
  79. // render: (a: any, b: any) => {
  80. // return <Badge status={a === 'VIDEO_RESOURCE_STATUS_VALID' ? "processing" :a === 'VIDEO_RESOURCE_STATUS_PENDING'? "warning" :"error" } text={VideoResourceStatusEnum[a]} />
  81. // }
  82. // },
  83. {
  84. title: '创建时间',
  85. dataIndex: 'createdTime',
  86. key: 'createdTime',
  87. align: 'center',
  88. width:160,
  89. },
  90. ]
  91. }
  92. export default tableConfig