tableConfig.tsx 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123
  1. import { ProColumns } from '@ant-design/pro-components';
  2. import { useModel } from '@umijs/max';
  3. export const columns = (): ProColumns<any>[] => {
  4. let { getEnum } = useModel('global')
  5. return [
  6. {
  7. title: 'openId',
  8. dataIndex: 'openId',
  9. align: 'center',
  10. width: 70,
  11. ellipsis: true,
  12. render: (_, row) => {
  13. return row?.wechatMiniappUser?.openId || "-"
  14. }
  15. },
  16. {
  17. title: '小说名称',
  18. dataIndex: 'bookName',
  19. key: 'bookName',
  20. align: 'center',
  21. width: 150,
  22. ellipsis: true,
  23. render: (a, b) => {
  24. return b?.bookInfo?.bookName || "-"
  25. },
  26. },
  27. {
  28. title: "作者笔名",
  29. dataIndex: 'authorName',
  30. key: "authorName",
  31. align: "center",
  32. render: (a, b) => {
  33. return b?.bookInfo?.authorInfo?.authorName || "-"
  34. },
  35. },
  36. {
  37. title: '章节名称',
  38. dataIndex: 'chapterId',
  39. align: 'center',
  40. width: 150,
  41. ellipsis: true,
  42. hideInSearch: true,
  43. render: (a, b) => {
  44. return b?.chapterInfo?.chapterName|| "-"
  45. },
  46. },
  47. {
  48. title: '应用名称',
  49. dataIndex: 'appName',
  50. key: 'appName',
  51. width: 120,
  52. align: 'center',
  53. ellipsis: true,
  54. render: (a, b) => {
  55. return b?.appInfo?.appName;
  56. },
  57. },
  58. {
  59. title: '分销商名称',
  60. dataIndex: 'companyName',
  61. key: 'companyName',
  62. width: 120,
  63. align: 'center',
  64. ellipsis: true,
  65. render: (a, b) => {
  66. return b?.distributorInfo?.companyName;
  67. },
  68. },
  69. {
  70. title: '变更类型',
  71. dataIndex: 'changeType',
  72. width: 120,
  73. align: 'center',
  74. ellipsis: true,
  75. valueEnum: getEnum("CHANGE_TYPE", "map")
  76. },
  77. {
  78. title: '变更数量',
  79. dataIndex: 'coinChangeNum',
  80. width: 120,
  81. align: 'center',
  82. ellipsis: true,
  83. hideInSearch: true,
  84. },
  85. {
  86. title: '剩余书币',
  87. dataIndex: 'coinRemainingNum',
  88. width: 120,
  89. align: 'center',
  90. ellipsis: true,
  91. hideInSearch: true,
  92. },
  93. {
  94. title: '变更时间',
  95. dataIndex: 'createTime',
  96. width: 120,
  97. align: 'center',
  98. ellipsis: true,
  99. hideInSearch: true,
  100. },
  101. {
  102. title: "用户注册时间",
  103. dataIndex: 'createTime',
  104. key: "createTime",
  105. hideInSearch: true,
  106. align: "center",
  107. render: (_, row) => {
  108. return row?.wechatMiniappUser?.createTime
  109. }
  110. },
  111. //搜索
  112. {
  113. title: '变更时间',
  114. dataIndex: 'time',
  115. valueType: 'dateRange',
  116. fieldProps: {
  117. style: { width: 250 },
  118. },
  119. hideInTable: true,
  120. },
  121. ];
  122. };