sonTableConfig.tsx 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import { Badge, Button, Popconfirm } from 'antd';
  2. import React from 'react'
  3. import './table.less'
  4. export const expandedRowRender = () => {
  5. let status = { '-2': 'error', '-1': 'error', '0': 'success', '1': 'processing' }
  6. let texts = { '-2': '删除', '-1': '失败', '0': '发送中', '1': '成功' }
  7. let columns: any = [
  8. {
  9. title: '消息状态',
  10. dataIndex: 'executionStatus',
  11. key: 'executionStatus',
  12. align: 'center',
  13. render: (a: number, b: { failMsg: string }) => {
  14. return <div style={{ display: 'flex', flexFlow: 'column' }}>
  15. <Badge status={status[a]} text={texts[a]} />
  16. {(a === -1) && <span>描述:{b.failMsg}</span>}
  17. </div >
  18. }
  19. },
  20. {
  21. title: '执行时间',
  22. dataIndex: 'createTime',
  23. key: 'createTime',
  24. align: 'center',
  25. render: (a: string) => {
  26. return <div>{a}</div>
  27. }
  28. },
  29. {
  30. title: '预期送达人数',
  31. dataIndex: 'totalCount',
  32. key: 'totalCount',
  33. align: 'center',
  34. render: (a: string) => {
  35. return <span>{a}</span>
  36. }
  37. },
  38. {
  39. title: '发送成功人数',
  40. dataIndex: 'sendCount',
  41. key: 'sendCount',
  42. align: 'center',
  43. render: (a: string) => {
  44. return <span>{a}</span>
  45. }
  46. },
  47. {
  48. title: '发送失败人数',
  49. dataIndex: 'errCount',
  50. key: 'errCount',
  51. align: 'center',
  52. render: (a: string) => {
  53. return <span>{a}</span>
  54. }
  55. },
  56. ];
  57. return columns
  58. };