tableConfig.tsx 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import { copy } from "@/utils/utils"
  2. import { TableProps } from "antd"
  3. import React from "react"
  4. const columns = (edit: (data: any) => void): TableProps<any>['columns'] => {
  5. const data: TableProps<any>['columns'] = [
  6. {
  7. title: '操作',
  8. dataIndex: 'cz',
  9. key: 'cz',
  10. align: 'center',
  11. width: 70,
  12. render: (_, b) => {
  13. return <a style={{ fontSize: 12 }} onClick={() => edit(b)}>修改</a>
  14. }
  15. },
  16. {
  17. title: '企业微信名称',
  18. dataIndex: 'corpName',
  19. key: 'corpName',
  20. ellipsis: true,
  21. width: 180,
  22. render: (a) => {
  23. return <span style={{ fontSize: "12px" }}>{a}</span>
  24. }
  25. },
  26. {
  27. title: '投放端企业微信ID',
  28. dataIndex: 'tencentCorpId',
  29. key: 'tencentCorpId',
  30. ellipsis: true,
  31. render: (a) => {
  32. return <a style={{ fontSize: "12px" }} onClick={() => copy(a)}>{a}</a>
  33. }
  34. },
  35. {
  36. title: '企微端企业微信ID',
  37. dataIndex: 'localCorpId',
  38. key: 'localCorpId',
  39. ellipsis: true,
  40. render: (a) => {
  41. return <a style={{ fontSize: "12px" }} onClick={() => copy(a)}>{a}</a>
  42. }
  43. },
  44. {
  45. title: '腾讯广告第三方企微应用ID',
  46. dataIndex: 'agentId',
  47. key: 'agentId',
  48. ellipsis: true,
  49. render: (a) => {
  50. return <a style={{ fontSize: "12px" }} onClick={() => copy(a)}>{a}</a>
  51. }
  52. },
  53. {
  54. title: '创建时间',
  55. dataIndex: 'createTime',
  56. key: 'createTime',
  57. align: 'center',
  58. width: 140,
  59. ellipsis: true,
  60. render: (a) => {
  61. return <span style={{ fontSize: "12px" }}>{a}</span>
  62. }
  63. },
  64. {
  65. title: '更新时间',
  66. dataIndex: 'updateTime',
  67. key: 'updateTime',
  68. align: 'center',
  69. width: 140,
  70. ellipsis: true,
  71. render: (a) => {
  72. return <span style={{ fontSize: "12px" }}>{a}</span>
  73. }
  74. }
  75. ]
  76. return data
  77. }
  78. export default columns