tableConfig.tsx 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. import { Statistic } from "antd";
  2. import { AnyObject } from "antd/es/_util/type"
  3. import { ColumnsType } from "antd/es/table"
  4. export const CorpExternalUserColumns = (): ColumnsType<AnyObject> => {
  5. return [
  6. {
  7. title: '企业名称',
  8. dataIndex: 'corpName',
  9. key: 'corpName',
  10. ellipsis: true,
  11. width: 150,
  12. },
  13. {
  14. title: '粉丝总数',
  15. dataIndex: 'userCount',
  16. key: 'userCount',
  17. align: 'center',
  18. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  19. },
  20. {
  21. title: '未识别人数',
  22. dataIndex: 'wsbrsCount',
  23. key: 'wsbrsCount',
  24. align: 'center',
  25. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  26. },
  27. {
  28. title: '重复总人数',
  29. dataIndex: 'cfCount',
  30. key: 'cfCount',
  31. align: 'center',
  32. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  33. },
  34. {
  35. title: '非重人数',
  36. dataIndex: 'oneRepeatCount',
  37. key: 'oneRepeatCount',
  38. align: 'center',
  39. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  40. },
  41. {
  42. title: '非重人数比例',
  43. dataIndex: 'oneRepeatCountRate',
  44. key: 'oneRepeatCountRate',
  45. align: 'center',
  46. render: (text: any) => <Statistic
  47. value={text ? text * 100 : 0}
  48. valueStyle={text > 0.5 ? { color: '#cf1322', fontSize: 12 } : { color: '#3f8600', fontSize: 12 }}
  49. suffix="%"
  50. precision={4}
  51. />
  52. },
  53. {
  54. title: '添加2名客服人数',
  55. dataIndex: 'twoRepeatCount',
  56. key: 'twoRepeatCount',
  57. align: 'center',
  58. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  59. },
  60. {
  61. title: '添加2名客服人数比例',
  62. dataIndex: 'twoRepeatCountRate',
  63. key: 'twoRepeatCountRate',
  64. align: 'center',
  65. render: (text: any) => <Statistic
  66. value={text ? text * 100 : 0}
  67. valueStyle={text > 0.1 ? { color: '#cf1322', fontSize: 12 } : { color: '#3f8600', fontSize: 12 }}
  68. suffix="%"
  69. precision={4}
  70. />
  71. },
  72. {
  73. title: '添加3名客服人数',
  74. dataIndex: 'threeRepeatCount',
  75. key: 'threeRepeatCount',
  76. align: 'center',
  77. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  78. },
  79. {
  80. title: '添加3名客服人数比例',
  81. dataIndex: 'threeRepeatCountRate',
  82. key: 'threeRepeatCountRate',
  83. align: 'center',
  84. render: (text: any) => <Statistic
  85. value={text ? text * 100 : 0}
  86. valueStyle={text > 0.09 ? { color: '#cf1322', fontSize: 12 } : { color: '#3f8600', fontSize: 12 }}
  87. suffix="%"
  88. precision={4}
  89. />
  90. },
  91. {
  92. title: '添加4名客服人数',
  93. dataIndex: 'fourRepeatCount',
  94. key: 'fourRepeatCount',
  95. align: 'center',
  96. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  97. },
  98. {
  99. title: '添加4名客服人数比例',
  100. dataIndex: 'fourRepeatCountRate',
  101. key: 'fourRepeatCountRate',
  102. align: 'center',
  103. render: (text: any) => <Statistic
  104. value={text ? text * 100 : 0}
  105. valueStyle={text > 0.08 ? { color: '#cf1322', fontSize: 12 } : { color: '#3f8600', fontSize: 12 }}
  106. suffix="%"
  107. precision={4}
  108. />
  109. },
  110. {
  111. title: '添加5名客服人数',
  112. dataIndex: 'fiveRepeatCount',
  113. key: 'fiveRepeatCount',
  114. align: 'center',
  115. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  116. },
  117. {
  118. title: '添加5名客服人数比例',
  119. dataIndex: 'fiveRepeatCountRate',
  120. key: 'fiveRepeatCountRate',
  121. align: 'center',
  122. render: (text: any) => <Statistic
  123. value={text ? text * 100 : 0}
  124. valueStyle={text > 0.07 ? { color: '#cf1322', fontSize: 12 } : { color: '#3f8600', fontSize: 12 }}
  125. suffix="%"
  126. precision={4}
  127. />
  128. },
  129. {
  130. title: '添加5名客服以上人数',
  131. dataIndex: 'gtFiveRepeatCount',
  132. key: 'gtFiveRepeatCount',
  133. align: 'center',
  134. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  135. },
  136. {
  137. title: '添加5名客服以上人数比例',
  138. dataIndex: 'gtFiveRepeatCountRate',
  139. key: 'gtFiveRepeatCountRate',
  140. align: 'center',
  141. render: (text: any) => <Statistic
  142. value={text ? text * 100 : 0}
  143. valueStyle={text > 0.06 ? { color: '#cf1322', fontSize: 12 } : { color: '#3f8600', fontSize: 12 }}
  144. suffix="%"
  145. precision={4}
  146. />
  147. },
  148. ]
  149. }
  150. export const ExternalUserColumns = (): ColumnsType<AnyObject> => {
  151. return [
  152. {
  153. title: '企业名称',
  154. dataIndex: 'corpName',
  155. key: 'corpName',
  156. ellipsis: true,
  157. width: 150,
  158. },
  159. {
  160. title: '主体用户总数',
  161. dataIndex: 'corpExternalUserCount',
  162. key: 'corpExternalUserCount',
  163. align: 'center',
  164. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  165. },
  166. {
  167. title: '已识别用户数',
  168. dataIndex: 'ysbCount',
  169. key: 'ysbCount',
  170. align: 'center',
  171. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  172. },
  173. {
  174. title: '未识别用户数',
  175. dataIndex: 'nsbCount',
  176. key: 'nsbCount',
  177. align: 'center',
  178. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  179. },
  180. {
  181. title: '主体用户在集团占比',
  182. dataIndex: 'corpExternalUserRate',
  183. key: 'corpExternalUserRate',
  184. align: 'center',
  185. render: (text: any) => <Statistic
  186. value={text ? text * 100 : 0}
  187. valueStyle={text > 0.2 ? { color: '#cf1322', fontSize: 12 } : { color: '#3f8600', fontSize: 12 }}
  188. suffix="%"
  189. precision={4}
  190. />
  191. },
  192. {
  193. title: '主体客服号数量',
  194. dataIndex: 'corpUserCount',
  195. key: 'corpUserCount',
  196. align: 'center',
  197. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  198. },
  199. {
  200. title: '主体内重粉数',
  201. dataIndex: 'corpExternalUserRepeatCount',
  202. key: 'corpExternalUserRepeatCount',
  203. align: 'center',
  204. render: (text: any) => <Statistic value={text || 0} valueStyle={{ fontSize: 12 }} />
  205. },
  206. {
  207. title: '主体内重粉率',
  208. dataIndex: 'corpExternalUserRepeatRate',
  209. key: 'corpExternalUserRepeatRate',
  210. align: 'center',
  211. render: (text: any) => <Statistic
  212. value={text ? text * 100 : 0}
  213. valueStyle={text > 0.2 ? { color: '#cf1322', fontSize: 12 } : { color: '#3f8600', fontSize: 12 }}
  214. suffix="%"
  215. precision={4}
  216. />
  217. },
  218. ]
  219. }