tablePlanListConfig.tsx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  1. import { Statistic, Tooltip } from 'antd'
  2. import React from 'react'
  3. import './index.less'
  4. import { ReactComponent as RocketSvg } from '@/assets/rocket.svg'
  5. import { GOUMAILEIXING, GUANGGAOZHUANGTAI, TUIGUANGMUBIAO, CHUANGYIZHUANGTAI, YOUHUAMUBIAO } from './enum'
  6. import Box from './components/box'
  7. import { GGStateData } from './data'
  8. function columnsMonitor(details: (id: number) => void) {
  9. return function columns() {
  10. let newArr: any = [
  11. {
  12. title: '数据日期',
  13. dataIndex: 'beginToEnd',
  14. key: 'beginToEnd',
  15. align: 'center',
  16. width: 100,
  17. fixed: 'left'
  18. },
  19. {
  20. title: '广告名称/ID',
  21. dataIndex: 'adgroupName',
  22. key: 'adgroupName',
  23. align: 'left',
  24. width: 210,
  25. ellipsis: true,
  26. render: (str: any, b: any) => {
  27. return <div style={{ display: 'flex', flexFlow: 'column nowrap', fontSize: 12 }}>
  28. <div style={{ color: '#459ae9', fontSize: 10 }} className='oneText'>{b.adgroupName}</div>
  29. <div style={{ color: '#888' }}>广告ID:{b?.adgroupId}</div>
  30. </div>
  31. }
  32. },
  33. {
  34. title: '投放计划名称/ID',
  35. dataIndex: 'campaignName/campaignId',
  36. key: 'campaignName/campaignId',
  37. align: 'left',
  38. width: 180,
  39. ellipsis: true,
  40. render: (str: any, b: any) => {
  41. return <div style={{ display: 'flex', flexFlow: 'column nowrap', fontSize: 12 }}>
  42. <div style={{ color: '#459ae9', fontSize: 10 }} className='oneText'>{b.campaignName}</div>
  43. <div style={{ color: '#888' }}>计划ID:{b?.campaignId}</div>
  44. </div>
  45. }
  46. },
  47. {
  48. title: '创意名称/ID',
  49. dataIndex: 'creativeName/creativeId',
  50. key: 'creativeName/creativeId',
  51. align: 'left',
  52. width: 210,
  53. render: (str: any, b: any) => {
  54. return <div style={{ display: 'flex', flexFlow: 'column nowrap', fontSize: 12 }}>
  55. <div style={{ color: '#459ae9', fontSize: 10 }} className='oneText'>{b.creativeName}</div>
  56. <div style={{ color: '#888' }}>创意ID:{b?.creativeId}</div>
  57. </div>
  58. }
  59. },
  60. {
  61. title: '创意预览',
  62. dataIndex: 'creativePreview',
  63. key: 'creativePreview',
  64. width: 110,
  65. align: 'center',
  66. render: (a: any, b: any) => {
  67. // return a && a?.length > 0 ? <a href={a[0]} target='_blank'>预览</a> : '--'
  68. return <Box b={b} />
  69. }
  70. },
  71. {
  72. title: '广告账户',
  73. dataIndex: 'accountId',
  74. key: 'accountId',
  75. width: 70,
  76. align: 'center'
  77. },
  78. {
  79. title: '投手',
  80. dataIndex: 'putUserName',
  81. key: 'putUserName',
  82. width: 70,
  83. align: 'center',
  84. render: (a: any) => {
  85. return a || '--'
  86. }
  87. },
  88. {
  89. title: '创建日期',
  90. dataIndex: 'adCreateTime',
  91. key: 'adCreateTime',
  92. align: 'center',
  93. width: 110
  94. },
  95. {
  96. title: '广告状态',
  97. dataIndex: 'adStatus',
  98. key: 'adStatus',
  99. align: 'center',
  100. width: 105,
  101. render: (a: any) => {
  102. return GGStateData[a] || '--'
  103. }
  104. },
  105. // {
  106. // title: '创意状态',
  107. // dataIndex: "adCreativeStatus",
  108. // key: "adCreativeStatus",
  109. // align: 'center',
  110. // width: 105,
  111. // render: (a: any) => {
  112. // return CHUANGYIZHUANGTAI[a] || '--'
  113. // }
  114. // },
  115. // {
  116. // title: '购买类型',
  117. // dataIndex: 'adBuyType',
  118. // key: 'adBuyType',
  119. // align: 'center',
  120. // width: 110,
  121. // render: (a: any) => {
  122. // return GOUMAILEIXING[a] || '--'
  123. // }
  124. // },
  125. // {
  126. // title: '自动扩量',
  127. // dataIndex: 'autoExpand',
  128. // key: 'autoExpand',
  129. // width: 110,
  130. // align: 'center',
  131. // render: (a: any) => {
  132. // return a
  133. // }
  134. // },
  135. // {
  136. // title: '曝光评估',
  137. // dataIndex: 'impressionAppraise',
  138. // key: 'impressionAppraise',
  139. // align: 'center',
  140. // width: 115,
  141. // render: (a: any) => {
  142. // return a || '--'
  143. // }
  144. // },
  145. {
  146. title: '投放时间',
  147. dataIndex: 'adBeginTime',
  148. key: 'adBeginTime',
  149. align: 'center',
  150. width: 120,
  151. render: (a: any, b: any) => {
  152. return a ? <div style={{ display: 'flex', flexFlow: 'column nowrap' }}>
  153. <span>{a}</span>
  154. {/* <span>{b?.adEndDate}</span> */}
  155. </div> : '--'
  156. }
  157. },
  158. // {
  159. // title: '当日成本偏差',
  160. // dataIndex: 'dayCostOffset',
  161. // key: 'dayCostOffset',
  162. // align: 'center',
  163. // width: 90,
  164. // render: (a: any) => {
  165. // return a || '--'
  166. // }
  167. // },
  168. {
  169. title: '推广目标',
  170. dataIndex: 'promotedObjectType',
  171. key: 'promotedObjectType',
  172. align: 'center',
  173. width: 80,
  174. ellipsis: true,
  175. render: (a: any) => {
  176. return TUIGUANGMUBIAO[a] || '推广公众号'
  177. }
  178. },
  179. // {
  180. // title: '深度优化目标',
  181. // dataIndex: 'depthOptimizeTarget',
  182. // key: 'depthOptimizeTarget',
  183. // width: 110,
  184. // align: 'center',
  185. // render: (a: any) => {
  186. // return a
  187. // }
  188. // },
  189. {
  190. title: '广告预算',
  191. dataIndex: 'adBudget',
  192. key: 'adBudget',
  193. align: 'center',
  194. width: 110,
  195. render: (a: any) => {
  196. return a ? <Statistic value={a | 0} /> : '--'
  197. }
  198. },
  199. {
  200. title: '出价方式',
  201. dataIndex: 'bidMode',
  202. key: 'bidMode',
  203. align: 'center',
  204. width: 80,
  205. render: (a: any) => {
  206. return a || '--'
  207. }
  208. },
  209. {
  210. title: '当前出价',
  211. dataIndex: 'bidAmount',
  212. key: 'bidAmount',
  213. align: 'center',
  214. width: 80,
  215. render: (a: any) => {
  216. return a ? <Statistic value={a | 0} /> : '--'
  217. }
  218. },
  219. // {
  220. // title: '计划预算',
  221. // dataIndex: 'planBudget',
  222. // key: 'planBudget',
  223. // align: 'center',
  224. // width: 80,
  225. // render: (a: any) => {
  226. // return a ? <Statistic value={a | 0} /> : '--'
  227. // }
  228. // },
  229. {
  230. title: '广告总消耗',
  231. dataIndex: 'cost',
  232. key: 'cost',
  233. align: 'center',
  234. width: 100,
  235. sorter: true,
  236. render: (a: any) => {
  237. return <Statistic value={a || 0} />
  238. }
  239. },
  240. // {
  241. // title: '今日消耗',
  242. // dataIndex: 'todayCostTotal',
  243. // key: 'todayCostTotal',
  244. // align: 'center',
  245. // width: 105,
  246. // render: (a: any) => {
  247. // return <Statistic value={a || 0} />
  248. // }
  249. // },
  250. {
  251. title: '单位时间消耗速度',
  252. dataIndex: 'costSpeed',
  253. key: 'costSpeed',
  254. align: 'center',
  255. width: 120,
  256. render: (a: any, b: any) => {
  257. return <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center' }}>
  258. {/* <div>当前:<span></span></div>
  259. <div>前第一小时:<span></span></div> */}
  260. <RocketSvg /> <a onClick={() => details(b)} style={{ marginLeft: 10 }}>详情</a>
  261. </div>
  262. }
  263. },
  264. {
  265. title: '曝光量',
  266. dataIndex: 'viewCount',
  267. key: 'viewCount',
  268. align: 'center',
  269. width: 70,
  270. sorter: true,
  271. render: (a: number) => {
  272. return <span style={a <= 8 ? { color: '#0f990f', fontWeight: 600 } : a >= 100 ? { color: 'red', fontWeight: 600 } : {}}> {a || '--'}</span >
  273. },
  274. },
  275. {
  276. title: '千次曝光成本',
  277. dataIndex: 'thousandDisplayPrice',
  278. key: 'thousandDisplayPrice',
  279. align: 'center',
  280. width: 115,
  281. // sorter: true,
  282. render: (a: any) => {
  283. return <Statistic value={a ? a?.toFixed(2) : 0} />
  284. }
  285. },
  286. {
  287. title: '点击量',
  288. dataIndex: 'clickCount',
  289. key: 'clickCount',
  290. align: 'center',
  291. width: 70,
  292. sorter: true,
  293. render: (a: number) => {
  294. return <span style={a <= 8 ? { color: '#0f990f', fontWeight: 600 } : a >= 100 ? { color: 'red', fontWeight: 600 } : {}}> {a || '--'}</span >
  295. },
  296. },
  297. {
  298. title: '点击均价',
  299. dataIndex: 'avgClickAmount',
  300. key: 'avgClickAmount',
  301. align: 'center',
  302. width: 115,
  303. // sorter: true,
  304. render: (a: any) => {
  305. return <Statistic value={a ? a?.toFixed(2) : 0} />
  306. }
  307. },
  308. {
  309. title: '点击率',
  310. dataIndex: 'clickRate',
  311. key: 'clickRate',
  312. align: 'center',
  313. width: 115,
  314. // sorter: true,
  315. render: (a: any) => {
  316. a = a ? parseFloat((a * 100).toFixed(2)) : 0
  317. return a + '%'
  318. }
  319. },
  320. {
  321. title: '不感兴趣点击次数',
  322. dataIndex: 'noInterestCount',
  323. key: 'noInterestCount',
  324. align: 'center',
  325. width: 70,
  326. sorter: true,
  327. render: (a: number) => {
  328. return <span style={a <= 8 ? { color: '#0f990f', fontWeight: 600 } : a >= 100 ? { color: 'red', fontWeight: 600 } : {}}> {a || '--'}</span >
  329. },
  330. },
  331. {
  332. title: '优化目标',
  333. dataIndex: 'optimizationGoal',
  334. key: 'optimizationGoal',
  335. align: 'center',
  336. width: 115,
  337. render: (a: any) => {
  338. return <Tooltip title={YOUHUAMUBIAO[a]}>
  339. <div className='oneText'>{YOUHUAMUBIAO[a] || '--'}</div>
  340. </Tooltip>
  341. }
  342. },
  343. {
  344. title: '转化目标量',
  345. dataIndex: 'conversionsCount',
  346. key: 'conversionsCount',
  347. align: 'center',
  348. width: 115,
  349. sorter: true,
  350. render: (a: any) => {
  351. return <Statistic value={a || 0} />
  352. }
  353. },
  354. {
  355. title: '转化目标成本',
  356. dataIndex: 'conversionsCost',
  357. key: 'conversionsCost',
  358. align: 'center',
  359. width: 115,
  360. // sorter: true,
  361. render: (a: any) => {
  362. return <Statistic value={a ? a?.toFixed(2) : 0} />
  363. }
  364. },
  365. {
  366. title: '目标转化率',
  367. dataIndex: 'conversionsRate',
  368. key: 'conversionsRate',
  369. align: 'center',
  370. width: 115,
  371. // sorter: true,
  372. render: (a: any) => {
  373. a = a ? parseFloat((a * 100).toFixed(2)) : 0
  374. return a + '%'
  375. }
  376. },
  377. {
  378. title: '深度转化量',
  379. dataIndex: 'deepConversionsCount',
  380. key: 'deepConversionsCount',
  381. align: 'center',
  382. width: 115,
  383. sorter: true,
  384. render: (a: any) => {
  385. return <Statistic value={a || 0} />
  386. }
  387. },
  388. {
  389. title: '下单量',
  390. dataIndex: 'orderCount',
  391. key: 'orderCount',
  392. align: 'center',
  393. width: 115,
  394. sorter: true,
  395. render: (a: any) => {
  396. return <Statistic value={a || 0} />
  397. }
  398. },
  399. {
  400. title: '首日新增下单量',
  401. dataIndex: 'firstDayOrderCount',
  402. key: 'firstDayOrderCount',
  403. align: 'center',
  404. width: 115,
  405. sorter: true,
  406. render: (a: any) => {
  407. return <Statistic value={a || 0} />
  408. }
  409. },
  410. {
  411. title: '下单成本',
  412. dataIndex: 'orderCost',
  413. key: 'orderCost',
  414. align: 'center',
  415. width: 115,
  416. // sorter: true,
  417. render: (a: any) => {
  418. return <Statistic value={a ? a?.toFixed(2) : 0} />
  419. }
  420. },
  421. {
  422. title: '下单率',
  423. dataIndex: 'orderRate',
  424. key: 'orderRate',
  425. align: 'center',
  426. width: 115,
  427. // sorter: true,
  428. render: (a: any) => {
  429. a = a ? parseFloat((a * 100).toFixed(2)) : 0
  430. return a + '%'
  431. }
  432. },
  433. {
  434. title: '下单金额',
  435. dataIndex: 'orderAmount',
  436. key: 'orderAmount',
  437. align: 'center',
  438. width: 115,
  439. sorter: true,
  440. render: (a: any) => {
  441. return <Statistic value={a || 0} />
  442. }
  443. },
  444. {
  445. title: '首日新增下单金额',
  446. dataIndex: 'firstDayOrderAmount',
  447. key: 'firstDayOrderAmount',
  448. align: 'center',
  449. width: 115,
  450. sorter: true,
  451. render: (a: any) => {
  452. return <Statistic value={a || 0} />
  453. }
  454. },
  455. {
  456. title: '下单客单价',
  457. dataIndex: 'atvAmount',
  458. key: 'atvAmount',
  459. align: 'center',
  460. width: 115,
  461. // sorter: true,
  462. render: (a: any) => {
  463. return <Statistic value={a ? a?.toFixed(2) : 0} />
  464. }
  465. },
  466. {
  467. title: '下单ROI',
  468. dataIndex: 'orderROI',
  469. key: 'orderROI',
  470. align: 'center',
  471. width: 115,
  472. // sorter: true,
  473. render: (a: any) => {
  474. a = a ? parseFloat((a * 100).toFixed(2)) : 0
  475. return a + '%'
  476. }
  477. },
  478. {
  479. title: '首日新增下单ROI',
  480. dataIndex: 'firstDayOrderRoi',
  481. key: 'firstDayOrderRoi',
  482. align: 'center',
  483. width: 115,
  484. // sorter: true,
  485. render: (a: any) => {
  486. a = a ? parseFloat((a * 100).toFixed(2)) : 0
  487. return a + '%'
  488. }
  489. },
  490. {
  491. title: '公众号关注人数',
  492. dataIndex: 'mpFollowUser',
  493. key: 'mpFollowUser',
  494. align: 'center',
  495. width: 115,
  496. sorter: true,
  497. render: (a: any) => {
  498. return a || '--'
  499. }
  500. },
  501. {
  502. title: '公众号关注率',
  503. dataIndex: 'mpFollowRate',
  504. key: 'mpFollowRate',
  505. align: 'center',
  506. width: 115,
  507. // sorter: true,
  508. render: (a: any) => {
  509. a = a ? parseFloat((a * 100).toFixed(2)) : 0
  510. return a + '%'
  511. }
  512. },
  513. {
  514. title: '公众号关注成本',
  515. dataIndex: 'mpFollowCost',
  516. key: 'mpFollowCost',
  517. align: 'center',
  518. width: 115,
  519. // sorter: true,
  520. render: (a: any) => {
  521. return <Statistic value={a ? a?.toFixed(2) : 0} />
  522. }
  523. },
  524. {
  525. title: '操作',
  526. dataIndex: 'event',
  527. key: 'event',
  528. align: 'center',
  529. width: 90,
  530. render: (a: any, b: any) => {
  531. return <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/adcreative?adgroupid=${b?.adgroupId}&query={%22configured_status%22:[%22AD_STATUS_EXCLUDE_DELETED%22],%22status%22:[]}`)} target="_blank">腾讯广告</a>
  532. }
  533. }
  534. ]
  535. return newArr
  536. }
  537. }
  538. export default columnsMonitor