tableConfig.tsx 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import React from "react"
  2. let columns = () => [
  3. {
  4. title: '商品名称',
  5. dataIndex: 'productName',
  6. key: 'productName',
  7. align: 'center',
  8. ellipsis: true,
  9. render: (a: any, b: any) => {
  10. return <span style={{ fontSize: "12px" }}>{a}</span>
  11. }
  12. },
  13. {
  14. title: '商品封面',
  15. dataIndex: 'productImageUrl',
  16. key: 'productImageUrl',
  17. ellipsis: true,
  18. align: 'center',
  19. render: (a: any, b: any) => {
  20. return <img src={a} style={{ height: 50 }} />
  21. }
  22. },
  23. {
  24. title: '描述',
  25. dataIndex: 'description',
  26. key: 'description',
  27. align: 'center',
  28. ellipsis: true,
  29. render: (a: any, b: any) => {
  30. return <span style={{ fontSize: "12px" }}>{a}</span>
  31. }
  32. },
  33. {
  34. title: '商品库名称',
  35. dataIndex: 'productCatalog',
  36. key: 'productCatalog',
  37. align: 'center',
  38. ellipsis: true,
  39. render: (a: any, b: any) => {
  40. return <span style={{ fontSize: "12px" }}>{a?.productCatalogName}</span>
  41. }
  42. },
  43. {
  44. title: '分类',
  45. dataIndex: 'secondCatalogName',
  46. key: 'secondCatalogName',
  47. align: 'center',
  48. ellipsis: true,
  49. render: (a: any, b: any) => {
  50. return <span style={{ fontSize: "12px" }}>{b.firstCatalogName}-{b.secondCatalogName}-{b.thirdCatalogName}</span>
  51. }
  52. },
  53. ]
  54. export default columns