tableConfig.tsx 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279
  1. import { ColumnsType } from "antd/lib/table";
  2. import React from "react";
  3. import AstraSupportHour from "./astraSupport‌Hour";
  4. import { Space, Statistic } from "antd";
  5. import AstraGroupHourEle from "./astraGroupHourEle";
  6. import AstraGroupIndexEle from "./astraGroupIndexEle";
  7. import DoubleDelDetails from "./doubleDelDetails";
  8. /** 客服号加粉 */
  9. export const CorpUserDayListTableConfig = (): ColumnsType<never> => {
  10. return [
  11. {
  12. title: '日期',
  13. dataIndex: 'day',
  14. key: 'day',
  15. width: 80,
  16. ellipsis: true,
  17. align: 'center',
  18. render(value) {
  19. return <span style={{ fontSize: 12 }}>{value}</span>
  20. },
  21. },
  22. {
  23. title: '企业名称',
  24. dataIndex: 'corpName',
  25. key: 'corpName',
  26. width: 100,
  27. ellipsis: true,
  28. render(value) {
  29. return <span style={{ fontSize: 12 }}>{value || '--'}</span>
  30. },
  31. },
  32. {
  33. title: '企业ID',
  34. dataIndex: 'corpId',
  35. key: 'corpId',
  36. width: 180,
  37. ellipsis: true,
  38. render(value) {
  39. return <span style={{ fontSize: 12 }}>{value}</span>
  40. },
  41. },
  42. {
  43. title: '企业用户名称',
  44. dataIndex: 'corpUserName',
  45. key: 'corpUserName',
  46. width: 100,
  47. ellipsis: true,
  48. render(value) {
  49. return <span style={{ fontSize: 12 }}>{value || '--'}</span>
  50. },
  51. },
  52. {
  53. title: '企业用户ID',
  54. dataIndex: 'corpUserId',
  55. key: 'corpUserId',
  56. width: 100,
  57. ellipsis: true,
  58. render(value) {
  59. return <span style={{ fontSize: 12 }}>{value}</span>
  60. },
  61. },
  62. {
  63. title: '客服号当前所在部门名称',
  64. dataIndex: 'localCorpUserDepartment',
  65. key: 'localCorpUserDepartment',
  66. width: 120,
  67. ellipsis: true,
  68. render(value) {
  69. return <span style={{ fontSize: 12 }}>{value}</span>
  70. },
  71. },
  72. {
  73. title: '新增用户数',
  74. dataIndex: 'addUserCount',
  75. key: 'addUserCount',
  76. width: 100,
  77. align: 'right',
  78. sorter: true,
  79. render(value) {
  80. return <span style={{ fontSize: 12, color: (value >= 60 && value < 100) ? 'orange' : value > 100 ? 'red' : '#000000D9' }}>{value}</span>
  81. },
  82. },
  83. {
  84. title: '退出人数',
  85. dataIndex: 'outUserCount',
  86. key: 'outUserCount',
  87. width: 100,
  88. align: 'right',
  89. sorter: true,
  90. render(value) {
  91. return <span style={{ fontSize: 12 }}>{value}</span>
  92. },
  93. },
  94. {
  95. title: '当前粉丝总数',
  96. dataIndex: 'corpExternalUserCount',
  97. key: 'corpExternalUserCount',
  98. width: 100,
  99. align: 'right',
  100. sorter: true,
  101. render(value) {
  102. return <span style={{ fontSize: 12 }}>{value}</span>
  103. },
  104. },
  105. {
  106. title: 'dn双删详情',
  107. dataIndex: 'dnOutUserCount',
  108. key: 'dnOutUserCount',
  109. width: 100,
  110. align: 'center',
  111. render(value, record: any) {
  112. return value && Object.keys(value).length > 0 ? <DoubleDelDetails
  113. dnOutUserCount={value}
  114. day={record.day}
  115. corpName={record.corpName}
  116. corpUserName={record.corpUserName}
  117. /> : '--'
  118. },
  119. },
  120. {
  121. title: '数据更新时间',
  122. dataIndex: 'dataTime',
  123. key: 'dataTime',
  124. width: 140,
  125. ellipsis: true,
  126. align: 'center',
  127. render(value) {
  128. return <span style={{ fontSize: 12 }}>{value}</span>
  129. },
  130. },
  131. {
  132. title: '操作',
  133. dataIndex: 'cz',
  134. key: 'cz',
  135. width: 210,
  136. ellipsis: true,
  137. render(_, record: any) {
  138. return <AstraSupportHour
  139. corpName={record.corpName}
  140. corpUserName={record.corpUserName}
  141. data={{
  142. corpId: record.corpId,
  143. corpUserId: record.corpUserId,
  144. day: record.day
  145. }}
  146. />
  147. },
  148. }
  149. ]
  150. }
  151. /** 客服组加粉 */
  152. export const LocalCsgroupDayListTableConfig = (): ColumnsType<never> => {
  153. return [
  154. {
  155. title: '日期',
  156. dataIndex: 'day',
  157. key: 'day',
  158. width: 80,
  159. ellipsis: true,
  160. align: 'center',
  161. render(value) {
  162. return <span style={{ fontSize: 12 }}>{value}</span>
  163. },
  164. },
  165. {
  166. title: '企业名称',
  167. dataIndex: 'corpName',
  168. key: 'corpName',
  169. width: 100,
  170. ellipsis: true,
  171. render(value) {
  172. return <span style={{ fontSize: 12 }}>{value}</span>
  173. },
  174. },
  175. {
  176. title: '本地客服组名称',
  177. dataIndex: 'localCsgroupName',
  178. key: 'localCsgroupName',
  179. width: 100,
  180. ellipsis: true,
  181. render(value) {
  182. return <span style={{ fontSize: 12 }}>{value}</span>
  183. },
  184. },
  185. {
  186. title: '本地客服组ID',
  187. dataIndex: 'localCsgroupId',
  188. key: 'localCsgroupId',
  189. width: 75,
  190. ellipsis: true,
  191. align: 'center',
  192. render(value) {
  193. return <span style={{ fontSize: 12 }}>{value}</span>
  194. },
  195. },
  196. {
  197. title: '消耗',
  198. dataIndex: 'cost',
  199. key: 'cost',
  200. width: 100,
  201. align: 'right',
  202. render(value) {
  203. return <Statistic value={value || 0} />
  204. },
  205. },
  206. {
  207. title: '加粉次数(广告)',
  208. dataIndex: 'scanFollowCount',
  209. key: 'scanFollowCount',
  210. width: 100,
  211. align: 'right',
  212. render(value) {
  213. return <span style={{ fontSize: 12 }}>{value}</span>
  214. },
  215. },
  216. {
  217. title: '加粉人数(广告)',
  218. dataIndex: 'scanFollowUserCount',
  219. key: 'scanFollowUserCount',
  220. width: 100,
  221. align: 'right',
  222. render(value) {
  223. return <span style={{ fontSize: 12 }}>{value}</span>
  224. },
  225. },
  226. {
  227. title: '加粉人数',
  228. dataIndex: 'addUserCount',
  229. key: 'addUserCount',
  230. width: 100,
  231. align: 'right',
  232. render(value) {
  233. return <span style={{ fontSize: 12 }}>{value}</span>
  234. },
  235. },
  236. {
  237. title: '数据更新时间',
  238. dataIndex: 'dataTime',
  239. key: 'dataTime',
  240. width: 140,
  241. ellipsis: true,
  242. align: 'center',
  243. render(value) {
  244. return <span style={{ fontSize: 12 }}>{value}</span>
  245. },
  246. },
  247. {
  248. title: '操作',
  249. dataIndex: 'cz',
  250. key: 'cz',
  251. width: 250,
  252. ellipsis: true,
  253. render(_, record: any) {
  254. return <Space>
  255. <AstraGroupHourEle
  256. localCsgroupName={record.localCsgroupName}
  257. data={{
  258. day: record.day,
  259. localCsgroupId: record.localCsgroupId
  260. }}
  261. />
  262. <AstraGroupIndexEle
  263. localCsgroupName={record.localCsgroupName}
  264. data={{
  265. day: record.day,
  266. localCsgroupId: record.localCsgroupId
  267. }}
  268. />
  269. </Space>
  270. }
  271. }
  272. ]
  273. }