tablesConfig.tsx 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. import { EditOutlined } from "@ant-design/icons"
  2. import { Button, Col, Row } from "antd"
  3. import React from "react"
  4. // 变更记录
  5. const columnsCrGdt = (editHandle: (data: any) => void) => {
  6. return [
  7. {
  8. title: '开始时间',
  9. dataIndex: 'beginTime',
  10. key: 'beginTime',
  11. align: 'center',
  12. width: 140,
  13. fixed: 'left',
  14. },
  15. {
  16. title: '结束时间',
  17. dataIndex: 'endTime',
  18. key: 'endTime',
  19. align: 'center',
  20. fixed: 'left',
  21. width: 140
  22. },
  23. {
  24. title: '操作人',
  25. dataIndex: 'createName',
  26. key: 'createName',
  27. align: 'center',
  28. width: 80,
  29. ellipsis: true,
  30. render: (a: any) => {
  31. return <span>{a || '<空>'}</span>
  32. }
  33. },
  34. {
  35. title: '资源名称',
  36. dataIndex: 'putResourceName',
  37. key: 'putResourceName',
  38. width: 140,
  39. ellipsis: true,
  40. align: 'center',
  41. render: (a: any, b: any) => {
  42. return <span>{a || '<空>'}</span>
  43. }
  44. },
  45. {
  46. title: '资源标识',
  47. dataIndex: 'putResourceKey',
  48. key: 'putResourceKey',
  49. ellipsis: true,
  50. width: 180,
  51. render: (a: any, b: any) => {
  52. return <span>{a || '<空>'}</span>
  53. }
  54. },
  55. {
  56. title: '授权者',
  57. dataIndex: 'putUserName',
  58. key: 'putUserName',
  59. ellipsis: true,
  60. width: 80
  61. },
  62. {
  63. title: '操作',
  64. dataIndex: 'cz',
  65. key: 'cz',
  66. render: (a: string, b: any) => (
  67. <Row gutter={[10, 0]}>
  68. <Col><Button type="link" size="small" style={{ fontSize: 12 }} icon={<EditOutlined />} onClick={() => { editHandle(b) }}>编辑</Button></Col>
  69. </Row>
  70. )
  71. }
  72. ]
  73. }
  74. export {
  75. columnsCrGdt
  76. }