tableConfig.tsx 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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: 'appName',
  30. key: 'appName',
  31. width: 120,
  32. align: 'center',
  33. ellipsis: true,
  34. render: (a, b) => {
  35. return b?.appInfo?.appName;
  36. },
  37. },
  38. {
  39. title: '分销商名称',
  40. dataIndex: 'companyName',
  41. key: 'companyName',
  42. width: 120,
  43. align: 'center',
  44. ellipsis: true,
  45. render: (a, b) => {
  46. return b?.distributorInfo?.companyName;
  47. },
  48. },
  49. {
  50. title: '订单号',
  51. dataIndex: 'orderId',
  52. width: 170,
  53. align: 'center',
  54. ellipsis: true,
  55. },
  56. {
  57. title: '商户订单号',
  58. dataIndex: 'merchantOrderId',
  59. width: 170,
  60. align: 'center',
  61. ellipsis: true,
  62. },
  63. {
  64. title: '订单类型',
  65. dataIndex: 'orderType',
  66. width: 170,
  67. align: 'center',
  68. ellipsis: true,
  69. valueEnum:getEnum("ORDER_TYPE","map")
  70. },
  71. {
  72. title: '充值金额',
  73. dataIndex: 'amount',
  74. width: 170,
  75. align: 'center',
  76. ellipsis: true,
  77. hideInSearch: true,
  78. },
  79. {
  80. title: '实际支付金额',
  81. dataIndex: 'payAmount',
  82. width: 170,
  83. align: 'center',
  84. ellipsis: true,
  85. hideInSearch: true,
  86. },
  87. {
  88. title: '支付渠道',
  89. dataIndex: 'payChannel',
  90. width: 170,
  91. align: 'center',
  92. ellipsis: true,
  93. hideInSearch: true,
  94. valueEnum:getEnum("PAY_CHANNEL","map")
  95. },
  96. {
  97. title: '支付状态',
  98. dataIndex: 'orderStatus',
  99. width: 170,
  100. align: 'center',
  101. ellipsis: true,
  102. valueEnum:getEnum("ORDER_STATUS","map")
  103. },
  104. {
  105. title: '支付场景',
  106. dataIndex: 'orderCondition',
  107. width: 170,
  108. align: 'center',
  109. ellipsis: true,
  110. },
  111. {
  112. title: '下单时间',
  113. dataIndex: 'orderTime',
  114. width: 170,
  115. align: 'center',
  116. ellipsis: true,
  117. hideInSearch: true,
  118. },
  119. {
  120. title: '支付时间',
  121. dataIndex: 'payTime',
  122. width: 170,
  123. align: 'center',
  124. ellipsis: true,
  125. hideInSearch: true,
  126. },
  127. {
  128. title: '归因渠道',
  129. dataIndex: 'userChannel',
  130. width: 170,
  131. align: 'center',
  132. ellipsis: true,
  133. valueType: 'select',
  134. valueEnum: getEnum("USER_CHANNEL", "map"),
  135. render: (_, row) => {
  136. let str = getEnum("USER_CHANNEL", "map").get(row?.wechatMiniappUser?.userChannel)
  137. return str
  138. }
  139. },
  140. // 搜索
  141. {
  142. title: '支付金额',
  143. dataIndex: 'amount',
  144. valueType: 'digitRange',
  145. width: 170,
  146. hideInTable: true,
  147. },
  148. {
  149. title: '下单时间',
  150. dataIndex: 'orderTime',
  151. valueType: 'dateRange',
  152. hideInTable: true,
  153. fieldProps: {
  154. style: { width: 250 },
  155. },
  156. },
  157. ];
  158. };