tableConfig.tsx 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757
  1. import ProgressTable from "@/components/ProgressTable"
  2. import WidthEllipsis from "@/components/widthEllipsis"
  3. import { Badge, Popconfirm, Space, Statistic, Tag } from "antd"
  4. import React from "react"
  5. import SendEmailDetails from "./sendEmailDetails"
  6. import './index.less'
  7. import SendPackDetails from "./sendPackDetails"
  8. // import IsTrue from "./isTrue"
  9. // import InputUpdate from "./inputUpdate"
  10. function columns12(
  11. sendEmail: (data: any[]) => void,
  12. sendPack: (data: any[]) => void,
  13. handleIsTrue: (value: string, data: any, type: string) => void,
  14. handleSave: (data: any) => void,
  15. roleHandle: (data: any[]) => void,
  16. assignHandle: (data: any[]) => void,
  17. changeLog: (data: any[]) => void
  18. ) {
  19. let newArr: { label: string, data: any[] }[] = [
  20. {
  21. label: '角色信息',
  22. data: [
  23. { title: '游戏', dataIndex: 'role_reg_parent_game_name', label: '角色信息', align: 'center', width: 70, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  24. { title: '原始区服名', dataIndex: 'source_server_name', label: '玩家信息', align: 'center', width: 90, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  25. { title: '游戏区服', dataIndex: 'server_name', label: '玩家信息', align: 'center', width: 90, default: 4, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  26. { title: '区服ID', dataIndex: 'server_id', label: '角色信息', align: 'center', width: 70, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  27. { title: '角色名称', dataIndex: 'role_name', label: '角色信息', align: 'center', width: 90, default: 2, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  28. { title: '角色ID', dataIndex: 'role_id', label: '角色信息', align: 'center', width: 90, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  29. { title: '角色创建时间', dataIndex: 'role_create_time', label: '角色信息', align: 'center', width: 140, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  30. { title: '角色VIP等级', dataIndex: 'vip_level', label: '角色信息', align: 'center', width: 60, default: 3, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  31. { title: '角色等级', dataIndex: 'role_level', label: '角色信息', align: 'center', width: 65, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  32. { title: '角色攻击力', dataIndex: 'combat_num', label: '角色信息', width: 95, align: 'right', sorter: true, render: (a: string, b: any) => (<Statistic value={a || 0} />) },
  33. { title: '国家', dataIndex: 'country', label: '角色信息', align: 'center', width: 70, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  34. ],
  35. },
  36. {
  37. label: '玩家信息',
  38. data: [
  39. { title: '玩家ID', dataIndex: 'association_user_id', label: '玩家信息', align: 'center', width: 70 },
  40. { title: '玩家账号', dataIndex: 'username', label: '玩家信息', align: 'center', width: 120, default: 1, render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />) },
  41. { title: '玩家注册渠道', dataIndex: 'agent_name', label: '玩家信息', align: 'center', width: 80, default: 5, render: (a: string, b: any) => (<WidthEllipsis isCopy value={a} />) },
  42. { title: '玩家注册渠道ID', dataIndex: 'agent_id', label: '玩家信息', align: 'center', width: 80 },
  43. { title: '玩家注册时间', dataIndex: 'user_create_time', label: '玩家信息', align: 'center', width: 140, default: 6, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  44. { title: '玩家注册游戏', dataIndex: 'user_reg_game_name', label: '玩家信息', align: 'center', width: 70, default: 7, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  45. { title: '玩家操作系统', dataIndex: 'os', label: '玩家信息', align: 'center', width: 70, default: 8 },
  46. // { title: '玩家等级标签', dataIndex: '13', label: '玩家信息', align: 'center', width: 70, default: 14 },
  47. { title: '玩家最近充值游戏', dataIndex: 'user_last_recharge_game_name', label: '玩家信息', align: 'center', width: 70, default: 15, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  48. { title: '玩家最近充值时间', dataIndex: 'user_pay_time', label: '玩家信息', align: 'center', width: 140, default: 16, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  49. { title: '玩家最近活跃时间', dataIndex: 'user_active_time', label: '玩家信息', align: 'center', width: 140, default: 17, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  50. {
  51. title: '玩家注册充值时间差',
  52. dataIndex: 'regPayTimeDiff',
  53. align: 'center',
  54. width: 140,
  55. label: '玩家信息',
  56. default: 18,
  57. render: (a: string, b: any) => {
  58. let diff = 0
  59. if (b?.user_pay_time) {
  60. diff = new Date(b.user_pay_time).getTime() - new Date(b.user_create_time).getTime()
  61. }
  62. function secondsToDhms(seconds: any) {
  63. const days = Math.floor(seconds / (3600 * 24));
  64. const hours = Math.floor((seconds % (3600 * 24)) / 3600);
  65. const minutes = Math.floor((seconds % 3600) / 60);
  66. const remainingSeconds = seconds % 60;
  67. return `${days ? days + "天" : ''}${hours ? hours + "小时" : ''}${minutes ? minutes + "分" : ''}${remainingSeconds ? remainingSeconds + "秒" : ''}`
  68. }
  69. return diff ? <WidthEllipsis value={secondsToDhms(diff / 1000)} /> : '--'
  70. }
  71. },
  72. {
  73. title: '玩家最近充值时间距今',
  74. dataIndex: 'nowPayTimeDiff',
  75. align: 'center',
  76. width: 130,
  77. label: '玩家信息',
  78. default: 19,
  79. render: (a: string, b: any) => {
  80. let diff = 0
  81. if (b.user_pay_time) {
  82. diff = new Date().getTime() - new Date(b.user_pay_time).getTime()
  83. }
  84. function secondsToDhms(seconds: any) {
  85. const days = Math.floor(seconds / (3600 * 24));
  86. const hours = Math.floor((seconds % (3600 * 24)) / 3600);
  87. const minutes = Math.floor((seconds % 3600) / 60);
  88. const remainingSeconds = seconds % 60;
  89. return `${days ? days + "天" : ''}${hours ? hours + "小时" : ''}${minutes ? minutes + "分" : ''}${remainingSeconds ? remainingSeconds.toFixed(0) + "秒" : ''}`
  90. }
  91. return diff ? <span style={Math.floor((diff / 1000) / (3600 * 24)) > 1 ? { color: 'red' } : {}}><WidthEllipsis value={secondsToDhms(diff / 1000)} /></span> : '--'
  92. }
  93. },
  94. ]
  95. },
  96. {
  97. label: '角色充值信息',
  98. data: [
  99. { title: '角色注册游戏', dataIndex: 'role_reg_game_name', label: '角色充值信息', align: 'center', width: 70, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  100. {
  101. title: '角色当天充值金额', dataIndex: 'today_amount', label: '角色充值信息', align: 'center', width: 70, default: 9, sorter: true,
  102. className: 'progress',
  103. render: (a: number) => {
  104. return <ProgressTable
  105. strokeColor={{
  106. from: '#108ee9',
  107. to: '#87d068',
  108. }}
  109. percent={a ? a / 2000 * 100 : 0}
  110. value={a || 0}
  111. valueStyle={a >= 1000 ? { color: '#000', fontWeight: 500 } : { fontWeight: 500 }}
  112. />
  113. },
  114. },
  115. { title: '角色首充金额', dataIndex: 'role_first_amount', label: '角色充值信息', align: 'center', width: 70, default: 10, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  116. { title: '角色最近充值金额', dataIndex: 'role_last_amount', label: '角色充值信息', align: 'center', width: 70, default: 11, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  117. {
  118. title: '角色累计充值金额', dataIndex: 'amount', label: '角色充值信息', align: 'center', width: 100, default: 12, sorter: true, className: 'progress',
  119. render: (a: number) => {
  120. return <ProgressTable
  121. strokeColor={{
  122. from: '#ff5900',
  123. to: '#ffd380',
  124. }}
  125. percent={a ? a / 10000 * 100 : 0}
  126. value={a || 0}
  127. valueStyle={a >= 5000 ? { color: '#000', fontWeight: 500 } : { fontWeight: 500 }}
  128. />
  129. },
  130. },
  131. { title: '角色平均单价', dataIndex: 'avg_amount', label: '角色充值信息', align: 'center', width: 70, default: 13, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  132. { title: '角色累计充值次数', dataIndex: 'amount_count', label: '角色充值信息', align: 'center', width: 70, default: 14, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  133. { title: '24小时内单笔充值金额', dataIndex: 'role_amount', label: '角色充值信息', align: 'center', width: 80, render: (a: string) => <WidthEllipsis value={a?.toString()} /> },
  134. { title: '24小时内累计充值总金额', dataIndex: 'role_total_amount', label: '角色充值信息', align: 'center', width: 85, sorter: true, render: (a: string) => <Statistic value={a || 0} /> },
  135. { title: '角色最近充值时间', dataIndex: 'role_last_pay_time', label: '角色充值信息', align: 'center', width: 140, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  136. { title: '角色最近活跃时间', dataIndex: 'role_active_time', label: '角色充值信息', align: 'center', width: 140, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  137. {
  138. title: '角色注册充值时间差',
  139. dataIndex: 'roleRegPayTimeDiff',
  140. align: 'center',
  141. width: 140,
  142. label: '角色充值信息',
  143. render: (a: string, b: any) => {
  144. let diff = 0
  145. if (b?.role_last_pay_time) {
  146. diff = new Date(b.role_last_pay_time).getTime() - new Date(b.user_create_time).getTime()
  147. }
  148. function secondsToDhms(seconds: any) {
  149. const days = Math.floor(seconds / (3600 * 24));
  150. const hours = Math.floor((seconds % (3600 * 24)) / 3600);
  151. const minutes = Math.floor((seconds % 3600) / 60);
  152. const remainingSeconds = seconds % 60;
  153. return `${days ? days + "天" : ''}${hours ? hours + "小时" : ''}${minutes ? minutes + "分" : ''}${remainingSeconds ? remainingSeconds + "秒" : ''}`
  154. }
  155. return diff ? <WidthEllipsis value={secondsToDhms(diff / 1000)} /> : '--'
  156. }
  157. },
  158. {
  159. title: '角色最近充值时间距今',
  160. dataIndex: 'roleNowPayTimeDiff',
  161. align: 'center',
  162. label: '角色充值信息',
  163. width: 130,
  164. render: (a: string, b: any) => {
  165. let diff = 0
  166. if (b.role_last_pay_time) {
  167. diff = new Date().getTime() - new Date(b.role_last_pay_time).getTime()
  168. }
  169. function secondsToDhms(seconds: any) {
  170. const days = Math.floor(seconds / (3600 * 24));
  171. const hours = Math.floor((seconds % (3600 * 24)) / 3600);
  172. const minutes = Math.floor((seconds % 3600) / 60);
  173. const remainingSeconds = seconds % 60;
  174. return `${days ? days + "天" : ''}${hours ? hours + "小时" : ''}${minutes ? minutes + "分" : ''}${remainingSeconds ? remainingSeconds.toFixed(0) + "秒" : ''}`
  175. }
  176. return diff ? <span style={Math.floor((diff / 1000) / (3600 * 24)) > 1 ? { color: 'red' } : {}}><WidthEllipsis value={secondsToDhms(diff / 1000)} /></span> : '--'
  177. }
  178. },
  179. {
  180. title: '角色最近活跃距今',
  181. dataIndex: 'roleActiveTimeDiff',
  182. align: 'center',
  183. label: '角色充值信息',
  184. width: 130,
  185. render: (a: string, b: any) => {
  186. let diff = 0
  187. if (b.role_active_time) {
  188. diff = new Date().getTime() - new Date(b.role_active_time).getTime()
  189. }
  190. function secondsToDhms(seconds: any) {
  191. const days = Math.floor(seconds / (3600 * 24));
  192. const hours = Math.floor((seconds % (3600 * 24)) / 3600);
  193. const minutes = Math.floor((seconds % 3600) / 60);
  194. const remainingSeconds = seconds % 60;
  195. return `${days ? days + "天" : ''}${hours ? hours + "小时" : ''}${minutes ? minutes + "分" : ''}${remainingSeconds ? remainingSeconds.toFixed(0) + "秒" : ''}`
  196. }
  197. return diff ? <span style={Math.floor((diff / 1000) / (3600 * 24)) > 1 ? { color: 'red' } : {}}><WidthEllipsis value={secondsToDhms(diff / 1000)} /></span> : '--'
  198. }
  199. },
  200. ],
  201. },
  202. {
  203. label: '客户运营操作',
  204. data: [
  205. {
  206. title: '邮件是否发送', dataIndex: 'is_send_mail', label: '客户运营操作', width: 130, align: 'center',
  207. render: (a: any, b: any) => {
  208. return <Space>
  209. {a ? <Badge className="badge" status="success" text="已发送" /> : <Badge className="badge" status="warning" text="未发送" />}
  210. <a style={{ fontSize: 12 }} onClick={() => sendEmail([b])}>发送</a>
  211. <SendEmailDetails data={b} />
  212. </Space>
  213. },
  214. },
  215. {
  216. title: '最新发送礼包', dataIndex: 'send_gift_id', label: '客户运营操作', align: 'center', width: 138,
  217. render: (a: any, b: any) => {
  218. return <Space>
  219. <div style={{ width: 50, textAlign: 'left' }}><WidthEllipsis value={b?.gift_name} /></div>
  220. <a style={{ fontSize: 12 }} onClick={() => sendPack([b])}>发送</a>
  221. <SendPackDetails data={b} />
  222. </Space>
  223. },
  224. },
  225. {
  226. title: '是否转端', dataIndex: 'is_change_game_type', label: '客户运营操作', align: 'center', width: 60,
  227. render: (a: any, b: any) => {
  228. // return <IsTrue value={a ? '1' : '0'} onChange={(value) => handleIsTrue(value, b, 'isChangeGameType')} />
  229. return a ? <Badge status="success" text="是" /> : a === 0 ? <Badge status="default" text="否" /> : '--'
  230. },
  231. },
  232. {
  233. title: '是否添加企微', dataIndex: 'is_add_corp_wechat', label: '客户运营操作', align: 'center', width: 60,
  234. render: (a: any, b: any) => {
  235. // return <IsTrue value={a ? '1' : '0'} onChange={(value) => handleIsTrue(value, b, 'isAddCorpWechat')} />
  236. return a ? <Badge status="success" text="是" /> : a === 0 ? <Badge status="default" text="否" /> : '--'
  237. },
  238. },
  239. {
  240. title: '企微号', dataIndex: 'add_corp_user_id', label: '客户运营操作', align: 'center', width: 80, className: 'padding0',
  241. render: (a: any, b: any) => {
  242. // return <InputUpdate title={a || ''} dataIndex={'add_corp_user_id'} record={b} handleSave={handleSave} />
  243. return <WidthEllipsis value={a} />
  244. },
  245. },
  246. {
  247. title: '客户微信号', dataIndex: 'user_wechat', label: '客户运营操作', align: 'center', width: 80,
  248. render: (a: any, b: any) => {
  249. // return <InputUpdate title={a || ''} dataIndex={'user_wechat'} record={b} handleSave={handleSave} />
  250. return <WidthEllipsis value={a} />
  251. },
  252. },
  253. {
  254. title: '客户手机号', dataIndex: 'user_phone', label: '客户运营操作', align: 'center', width: 80,
  255. render: (a: any, b: any) => {
  256. // return <InputUpdate title={a || ''} dataIndex={'user_phone'} record={b} handleSave={handleSave} />
  257. return <WidthEllipsis value={a} />
  258. },
  259. },
  260. {
  261. title: '是否退游(系统判定)', tips: '角色最近活跃时间距今”大于72小时且“角色最近充值时间距今”大于72小时,判定为“退游”,否则“未退游”。', dataIndex: 'is_remove_game_for_system', label: '客户运营操作', align: 'center', width: 80,
  262. render: (a: any, b: any) => {
  263. // return <IsTrue value={a ? '1' : '0'} onChange={(value) => handleIsTrue(value, b, 'isRemoveGame')} />
  264. return a ? <Badge status="error" text="是" /> : <Badge status="processing" text="否" />
  265. },
  266. },
  267. {
  268. title: '是否退游', dataIndex: 'is_remove_game', label: '客户运营操作', align: 'center', width: 50,
  269. render: (a: any, b: any) => {
  270. // return <IsTrue value={a ? '1' : '0'} onChange={(value) => handleIsTrue(value, b, 'isRemoveGame')} />
  271. return a ? <Badge status="error" text="是" /> : a === 0 ? <Badge status="processing" text="否" /> : '--'
  272. },
  273. },
  274. {
  275. title: '是否唤醒', dataIndex: 'is_wake_up', label: '客户运营操作', align: 'center', width: 50,
  276. render: (a: any, b: any) => {
  277. // return <IsTrue value={a ? '1' : '0'} onChange={(value) => handleIsTrue(value, b, 'isWakeUp')} />
  278. return a ? <Badge status="success" text="是" /> : a === 0 ? <Badge status="default" text="否" /> : '--'
  279. },
  280. },
  281. {
  282. title: '备注', dataIndex: 'remark', label: '客户运营操作', align: 'center', width: 80,
  283. render: (a: any, b: any) => {
  284. // return <InputUpdate title={a || ''} dataIndex={'remark'} record={b} handleSave={handleSave} />
  285. return <WidthEllipsis value={a} />
  286. },
  287. },
  288. // {
  289. // title: '角色操作',
  290. // dataIndex: 'rolecz',
  291. // label: '客户运营操作',
  292. // align: 'center',
  293. // width: 80,
  294. // render: (a: any, b: any) => {
  295. // return <a onClick={() => { roleHandle([b]) }}>角色操作</a>
  296. // }
  297. // }
  298. ]
  299. },
  300. {
  301. label: '客户管理操作',
  302. data: [
  303. { title: 'GS', dataIndex: 'gs_name', label: '客户管理操作', align: 'center', width: 80, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  304. { title: '客服', dataIndex: 'customer_service_name', label: '客户管理操作', align: 'center', width: 80, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  305. { title: '运营', dataIndex: 'oper_user_name', label: '客户管理操作', align: 'center', width: 80, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  306. { title: '投手', dataIndex: 'put_user_name', label: '客户管理操作', align: 'center', width: 80, render: (a: string, b: any) => (<WidthEllipsis value={a} />) },
  307. // {
  308. // title: '指派',
  309. // dataIndex: 'zp',
  310. // label: '客户管理操作',
  311. // align: 'center',
  312. // width: 110,
  313. // render: (a: any, b: any) => {
  314. // return <Space>
  315. // <a onClick={() => { assignHandle([b]) }}>指派</a>
  316. // <a onClick={() => { changeLog([b]) }}>变更记录</a>
  317. // </Space>
  318. // }
  319. // }
  320. ]
  321. },
  322. {
  323. label: '操作',
  324. data: [
  325. {
  326. title: '操作',
  327. dataIndex: 'cz',
  328. label: '操作',
  329. align: 'center',
  330. width: 160,
  331. default: 20,
  332. render: (a: any, b: any) => {
  333. return <Space>
  334. <a style={{ fontSize: 12 }} onClick={() => { roleHandle([b]) }}>角色操作</a>
  335. <a style={{ fontSize: 12 }} onClick={() => { assignHandle([b]) }}>指派</a>
  336. <a style={{ fontSize: 12 }} onClick={() => { changeLog([b]) }}>变更记录</a>
  337. </Space>
  338. }
  339. }
  340. ]
  341. }
  342. ]
  343. return newArr
  344. }
  345. export const columnsSendEmailLog = (update: (data: any) => void, del: (id: number[]) => void): any[] => {
  346. return [
  347. {
  348. title: '发送时间',
  349. dataIndex: 'sendTime',
  350. key: 'sendTime',
  351. width: 145,
  352. ellipsis: true,
  353. fixed: 'left'
  354. },
  355. {
  356. title: '操作人',
  357. dataIndex: 'createName',
  358. key: 'createName',
  359. width: 60,
  360. ellipsis: true
  361. },
  362. {
  363. title: '更新人',
  364. dataIndex: 'updateName',
  365. key: 'updateName',
  366. width: 60,
  367. ellipsis: true
  368. },
  369. {
  370. title: '创建时间',
  371. dataIndex: 'createTime',
  372. key: 'createTime',
  373. width: 145,
  374. ellipsis: true
  375. },
  376. {
  377. title: '更新时间',
  378. dataIndex: 'updateTime',
  379. key: 'updateTime',
  380. width: 145,
  381. ellipsis: true
  382. },
  383. {
  384. title: '操作',
  385. dataIndex: 'cz',
  386. key: 'cz',
  387. width: 70,
  388. fixed: 'right',
  389. render: (a: any, b: any) => {
  390. return <Space>
  391. <a style={{ fontSize: 12 }} onClick={() => update([b])}>更新</a>
  392. <Popconfirm
  393. title="确定删除?"
  394. onConfirm={() => del([b.id])}
  395. >
  396. <a style={{ color: 'red', fontSize: 12 }}>删除</a>
  397. </Popconfirm>
  398. </Space>
  399. }
  400. },
  401. ]
  402. };
  403. export const columnsSendPackLog = (update: (data: any) => void, del: (id: number[]) => void): any[] => {
  404. return [
  405. {
  406. title: '礼包',
  407. dataIndex: 'giftName',
  408. key: 'giftName',
  409. width: 100,
  410. ellipsis: true,
  411. fixed: 'left'
  412. },
  413. {
  414. title: '发送时间',
  415. dataIndex: 'sendTime',
  416. key: 'sendTime',
  417. width: 145,
  418. ellipsis: true
  419. },
  420. {
  421. title: '操作人',
  422. dataIndex: 'createName',
  423. key: 'createName',
  424. width: 60,
  425. ellipsis: true
  426. },
  427. {
  428. title: '更新人',
  429. dataIndex: 'updateName',
  430. key: 'updateName',
  431. width: 60,
  432. ellipsis: true
  433. },
  434. {
  435. title: '创建时间',
  436. dataIndex: 'createTime',
  437. key: 'createTime',
  438. width: 145,
  439. ellipsis: true
  440. },
  441. {
  442. title: '更新时间',
  443. dataIndex: 'updateTime',
  444. key: 'updateTime',
  445. width: 145,
  446. ellipsis: true
  447. },
  448. {
  449. title: '操作',
  450. dataIndex: 'cz',
  451. key: 'cz',
  452. width: 70,
  453. fixed: 'right',
  454. render: (a: any, b: any) => {
  455. return <Space>
  456. <a style={{ fontSize: 12 }} onClick={() => update([b])}>更新</a>
  457. <Popconfirm
  458. title="确定删除?"
  459. onConfirm={() => del([b.id])}
  460. >
  461. <a style={{ color: 'red', fontSize: 12 }}>删除</a>
  462. </Popconfirm>
  463. </Space>
  464. }
  465. },
  466. ]
  467. };
  468. /**
  469. * 变更记录
  470. * @param update
  471. * @param del
  472. * @returns
  473. */
  474. export const columnsChangeLog = (update: (data: any) => void, del: (id: number[]) => void): any[] => {
  475. return [
  476. {
  477. title: '开始时间',
  478. dataIndex: 'startTime',
  479. key: 'startTime',
  480. width: 145,
  481. ellipsis: true
  482. },
  483. {
  484. title: '结束时间',
  485. dataIndex: 'endTime',
  486. key: 'endTime',
  487. width: 145,
  488. ellipsis: true
  489. },
  490. {
  491. title: '游戏名称',
  492. dataIndex: 'gameName',
  493. key: 'gameName',
  494. width: 100,
  495. ellipsis: true,
  496. fixed: 'left'
  497. },
  498. {
  499. title: '角色名称',
  500. dataIndex: 'roleName',
  501. key: 'roleName',
  502. width: 100,
  503. ellipsis: true,
  504. fixed: 'left'
  505. },
  506. {
  507. title: '区服名称',
  508. dataIndex: 'serverName',
  509. key: 'serverName',
  510. width: 100,
  511. ellipsis: true,
  512. fixed: 'left'
  513. },
  514. {
  515. title: '客服',
  516. dataIndex: 'customerServiceName',
  517. key: 'customerServiceName',
  518. width: 100,
  519. ellipsis: true
  520. },
  521. {
  522. title: '运营',
  523. dataIndex: 'operUserName',
  524. key: 'operUserName',
  525. width: 100,
  526. ellipsis: true
  527. },
  528. {
  529. title: 'GS',
  530. dataIndex: 'gsName',
  531. key: 'gsName',
  532. width: 100,
  533. ellipsis: true
  534. },
  535. {
  536. title: '创建人',
  537. dataIndex: 'createName',
  538. key: 'createName',
  539. width: 60,
  540. ellipsis: true
  541. },
  542. {
  543. title: '创建时间',
  544. dataIndex: 'createTime',
  545. key: 'createTime',
  546. width: 145,
  547. ellipsis: true
  548. },
  549. {
  550. title: '更新人',
  551. dataIndex: 'updateName',
  552. key: 'updateName',
  553. width: 60,
  554. ellipsis: true
  555. },
  556. {
  557. title: '更新时间',
  558. dataIndex: 'updateTime',
  559. key: 'updateTime',
  560. width: 145,
  561. ellipsis: true
  562. },
  563. {
  564. title: '备注',
  565. dataIndex: 'remark',
  566. key: 'remark',
  567. width: 200,
  568. ellipsis: true
  569. },
  570. {
  571. title: '操作',
  572. dataIndex: 'cz',
  573. key: 'cz',
  574. width: 70,
  575. fixed: 'right',
  576. render: (a: any, b: any) => {
  577. return <Space>
  578. <a style={{ fontSize: 12 }} onClick={() => update(b)}>修改</a>
  579. <Popconfirm
  580. title="确定删除?"
  581. onConfirm={() => del([b.id])}
  582. >
  583. <a style={{ color: 'red', fontSize: 12 }}>删除</a>
  584. </Popconfirm>
  585. </Space>
  586. }
  587. },
  588. ]
  589. };
  590. /**
  591. * 任务列表
  592. * @param sendLog
  593. * @returns
  594. */
  595. export const columnsMsgTask = (sendLog: (data: any) => void) => {
  596. return [
  597. {
  598. title: '任务名称',
  599. dataIndex: 'taskName',
  600. key: 'taskName',
  601. width: 100,
  602. ellipsis: true,
  603. align: 'center'
  604. },
  605. {
  606. title: '游戏名称',
  607. dataIndex: 'gameName',
  608. key: 'gameName',
  609. width: 90,
  610. ellipsis: true,
  611. align: 'center'
  612. },
  613. {
  614. title: '消息内容',
  615. dataIndex: 'msg',
  616. key: 'msg',
  617. width: 120,
  618. ellipsis: true,
  619. align: 'center'
  620. },
  621. {
  622. title: '任务人数',
  623. dataIndex: 'roleIdCount',
  624. key: 'roleIdCount',
  625. width: 60,
  626. align: 'center'
  627. },
  628. {
  629. title: '任务状态',
  630. dataIndex: 'status',
  631. key: 'status',
  632. width: 90,
  633. align: 'center',
  634. render: (a: any) => {
  635. return { SUCCESS_SEND: <Badge status="success" text="已发送" />, WAIT_SEND: <Badge status="default" text="待发送" /> }[a]
  636. }
  637. },
  638. {
  639. title: '创建人',
  640. dataIndex: 'createByName',
  641. key: 'createByName',
  642. width: 60,
  643. align: 'center',
  644. ellipsis: true
  645. },
  646. {
  647. title: '创建时间',
  648. dataIndex: 'createTime',
  649. key: 'createTime',
  650. width: 145,
  651. ellipsis: true
  652. },
  653. {
  654. title: '更新时间',
  655. dataIndex: 'updateTime',
  656. key: 'updateTime',
  657. width: 145,
  658. ellipsis: true
  659. },
  660. {
  661. title: '操作',
  662. dataIndex: 'cz',
  663. key: 'cz',
  664. width: 70,
  665. fixed: 'right',
  666. align: 'center',
  667. render: (a: any, b: any) => {
  668. return <Space>
  669. <a style={{ fontSize: 12 }} onClick={() => sendLog(b)}>发送记录</a>
  670. </Space>
  671. }
  672. },
  673. ]
  674. }
  675. /**
  676. * 发送记录
  677. * @param sendLog
  678. * @returns
  679. */
  680. export const columnsMsgTaskLog = () => {
  681. return [
  682. {
  683. title: '角色名称',
  684. dataIndex: 'roleName',
  685. key: 'roleName',
  686. width: 100,
  687. ellipsis: true,
  688. align: 'center'
  689. },
  690. {
  691. title: '角色VIP',
  692. dataIndex: 'roleVip',
  693. key: 'roleVip',
  694. width: 60,
  695. ellipsis: true,
  696. align: 'center'
  697. },
  698. {
  699. title: '游戏名称',
  700. dataIndex: 'gameName',
  701. key: 'gameName',
  702. width: 100,
  703. ellipsis: true,
  704. align: 'center'
  705. },
  706. {
  707. title: '区服名称',
  708. dataIndex: 'serverName',
  709. key: 'serverName',
  710. width: 100,
  711. ellipsis: true,
  712. align: 'center'
  713. },
  714. {
  715. title: '发送状态',
  716. dataIndex: 'sendStatus',
  717. key: 'sendStatus',
  718. width: 90,
  719. align: 'center',
  720. render: (a: any) => {
  721. return { CP_SEND_ROLE_RESULT_SUCCESS: <Badge status="success" text="发送成功" />, CP_SEND_ROLE_RESULT_FAIL: <Badge status="error" text="发送失败" /> }[a]
  722. }
  723. },
  724. {
  725. title: '创角时间',
  726. dataIndex: 'roleCreateTime',
  727. key: 'roleCreateTime',
  728. width: 145,
  729. ellipsis: true
  730. },
  731. {
  732. title: '发送时间',
  733. dataIndex: 'createTime',
  734. key: 'createTime',
  735. width: 145,
  736. ellipsis: true
  737. }
  738. ]
  739. }
  740. export default columns12