tablePlanListConfig.tsx 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783
  1. import { BidModeEnum, BidStrategyEnum, OptimizationGoalEnum } from '@/services/launchAdq/enum'
  2. import React from 'react'
  3. import { Badge, Dropdown, Menu, Space, Statistic } from 'antd'
  4. import { ReactComponent as RocketSvg } from '@/assets/rocket.svg'
  5. import '../../launchSystemNew/adq/index.less'
  6. import { copy } from '@/utils/utils'
  7. import { ColumnsType } from 'antd/lib/table'
  8. import StatisticNull from '@/components/StatisticNull'
  9. import { DownOutlined } from '@ant-design/icons'
  10. import TimeSeriesLook from '../../launchSystemNew/adq/ad/timeSeriesLook'
  11. import SwitchStatus from '../adqv3/ad/switchStatus'
  12. import CreativePreview from './CreativePreview'
  13. import { ADGROUP_STATUS } from '@/pages/adMonitor/adMonitorList/data'
  14. function tablePlanConfig(
  15. onChange: () => void,
  16. details: (data: any) => void,
  17. log: (data: any) => void,
  18. handleTag: (data: any) => void,
  19. delTag: (data: any) => void,
  20. ): ColumnsType<any> {
  21. let adArr: ColumnsType<any> = [
  22. {
  23. title: '启停',
  24. dataIndex: 'configured_status',
  25. key: 'configured_status',
  26. align: 'center',
  27. width: 40,
  28. fixed: 'left',
  29. render: (a: string, b: any) => {
  30. if (b?.account_id === '总计') {
  31. return '--'
  32. }
  33. return <SwitchStatus configuredStatus={a} isDeleted={b?.is_deleted} adgroupId={b?.adgroup_id} accountId={b?.account_id} onChange={onChange} />
  34. }
  35. },
  36. {
  37. title: '所属账号',
  38. dataIndex: 'account_id',
  39. key: 'account_id',
  40. align: 'center',
  41. width: 80,
  42. ellipsis: true,
  43. render: (a: string) => {
  44. return <Space>
  45. <a onClick={() => copy(a)} >{a}</a>
  46. </Space>
  47. }
  48. },
  49. {
  50. title: '腾讯备注',
  51. dataIndex: 'memo',
  52. key: 'memo',
  53. align: 'center',
  54. width: 80,
  55. ellipsis: true,
  56. render(value, record) {
  57. if (record?.account_id === '总计') {
  58. return '--'
  59. }
  60. return value
  61. },
  62. },
  63. {
  64. title: '本地备注',
  65. dataIndex: 'remark',
  66. key: 'remark',
  67. align: 'center',
  68. width: 80,
  69. ellipsis: true,
  70. render(value, record) {
  71. if (record?.account_id === '总计') {
  72. return '--'
  73. }
  74. return value
  75. },
  76. },
  77. {
  78. title: '广告ID',
  79. dataIndex: 'adgroup_id',
  80. key: 'adgroup_id',
  81. align: 'center',
  82. width: 100,
  83. ellipsis: true,
  84. render: (a: string, b: any) => {
  85. if (b?.account_id === '总计') {
  86. return '--'
  87. }
  88. return <Space>
  89. <a onClick={() => copy(a)} >{a}</a>
  90. </Space>
  91. }
  92. },
  93. {
  94. title: '投手',
  95. dataIndex: 'put_user_name',
  96. key: 'put_user_name',
  97. align: 'center',
  98. width: 70,
  99. ellipsis: true,
  100. render(value, record) {
  101. if (record?.account_id === '总计') return '--';
  102. return value
  103. },
  104. },
  105. {
  106. title: '广告名称',
  107. dataIndex: 'adgroup_name',
  108. key: 'adgroup_name',
  109. width: 280,
  110. ellipsis: true,
  111. render: (a: string, b: any) => {
  112. if (b?.account_id === '总计') return '--';
  113. return a
  114. }
  115. },
  116. {
  117. title: '投放日期',
  118. dataIndex: 'begin_date',
  119. key: 'begin_date',
  120. align: 'center',
  121. width: 150,
  122. ellipsis: true,
  123. sorter: true,
  124. render: (a: string, b: { end_date: string, account_id: any }) => {
  125. if (b?.account_id === '总计') return '--';
  126. return b?.end_date && b?.end_date !== '1970-01-01' ? a + '~' + b.end_date : a + '~' + '长期投放'
  127. }
  128. },
  129. {
  130. title: '投放时间',
  131. dataIndex: 'time_series',
  132. key: 'time_series',
  133. align: 'center',
  134. width: 55,
  135. render: (a: string, b: { endDate: string, account_id: string }) => {
  136. if (b?.account_id === '总计') return '--';
  137. return <TimeSeriesLook timeSeries={a} />
  138. }
  139. },
  140. {
  141. title: '首日开始投放时间',
  142. dataIndex: 'first_day_begin_time',
  143. key: 'first_day_begin_time',
  144. align: 'center',
  145. width: 70,
  146. render(value, record) {
  147. if (record?.account_id === '总计') return '--';
  148. return value
  149. },
  150. },
  151. {
  152. title: '出价',
  153. dataIndex: 'bid_amount',
  154. key: 'bid_amount',
  155. width: 140,
  156. ellipsis: true,
  157. sorter: true,
  158. render: (a: string, b: { bid_mode: string, optimization_goal: string, account_id: any }) => {
  159. if (b?.account_id === '总计') return '--';
  160. return `${b?.bid_mode ? BidModeEnum[b?.bid_mode as keyof typeof BidModeEnum] : ''} ${a}元/${b?.bid_mode === 'BID_MODE_CPM' ? '千次曝光' : b?.bid_mode === 'BID_MODE_CPC' ? '点击' : OptimizationGoalEnum[b?.optimization_goal as keyof typeof OptimizationGoalEnum]}`
  161. }
  162. },
  163. {
  164. title: '深度优化行为出价',
  165. dataIndex: 'deep_conversion_behavior_bid',
  166. key: 'deep_conversion_behavior_bid',
  167. width: 70,
  168. align: 'center',
  169. render: (a: string, b: { deep_conversion_spec_json: any, account_id: any }) => {
  170. if (b?.account_id === '总计') return '--';
  171. if (b?.deep_conversion_spec_json) {
  172. return a
  173. } else {
  174. return '--'
  175. }
  176. }
  177. },
  178. {
  179. title: '出价类型',
  180. dataIndex: 'smart_bid_type',
  181. key: 'smart_bid_type',
  182. align: 'center',
  183. width: 80,
  184. ellipsis: true,
  185. render: (a: string, b) => {
  186. if (b?.account_id === '总计') return '--';
  187. return a === 'SMART_BID_TYPE_CUSTOM' ? '手动出价' : '自动出价'
  188. }
  189. },
  190. {
  191. title: '出价策略',
  192. dataIndex: 'bid_strategy',
  193. key: 'bid_strategy',
  194. align: 'center',
  195. width: 70,
  196. ellipsis: true,
  197. render: (a: string, b) => {
  198. if (b?.account_id === '总计') return '--';
  199. return BidStrategyEnum[a as keyof typeof BidStrategyEnum]
  200. }
  201. },
  202. {
  203. title: '广告组日预算(元)',
  204. dataIndex: 'daily_budget',
  205. key: 'daily_budget',
  206. align: 'center',
  207. width: 70,
  208. sorter: true,
  209. render: (a: string, b: any) => {
  210. if (b?.account_id === '总计') return '--';
  211. return a
  212. }
  213. },
  214. {
  215. title: '是否开启自动版位功能',
  216. dataIndex: 'automatic_site_enabled',
  217. key: 'automatic_site_enabled',
  218. align: 'center',
  219. width: 80,
  220. render: (a: any, b: any) => {
  221. if (b?.account_id === '总计') return '--';
  222. return a ? '开' : '关'
  223. }
  224. },
  225. {
  226. title: '定向条件描述',
  227. dataIndex: 'targeting_translation',
  228. key: 'targeting_translation',
  229. align: 'center',
  230. width: 80,
  231. ellipsis: true,
  232. render: (a: any) => {
  233. return a || '--'
  234. }
  235. },
  236. {
  237. title: '创建时间',
  238. dataIndex: 'created_time',
  239. key: 'created_time',
  240. align: 'center',
  241. width: 140,
  242. ellipsis: true,
  243. render(value, record) {
  244. if (record?.account_id === '总计') return '--';
  245. return value
  246. },
  247. },
  248. {
  249. title: '是否已删除',
  250. dataIndex: 'is_deleted',
  251. key: 'is_deleted',
  252. align: 'center',
  253. width: 60,
  254. render: (a: any, b: any) => {
  255. if (b?.account_id === '总计') return '--';
  256. return <Badge status={!a ? "processing" : "error"} text={a ? '是' : '否'} />
  257. }
  258. },
  259. {
  260. title: '广告状态',
  261. dataIndex: 'system_status',
  262. key: 'system_status',
  263. align: 'center',
  264. width: 100,
  265. ellipsis: true,
  266. render: (a: string) => {
  267. return ADGROUP_STATUS[a as keyof typeof ADGROUP_STATUS]
  268. }
  269. },
  270. {
  271. title: '标记备注',
  272. dataIndex: 'tag_remark',
  273. key: 'tag_remark',
  274. align: 'center',
  275. width: 100,
  276. ellipsis: true,
  277. render(value, b) {
  278. if (b?.account_id === '总计') return '--';
  279. return value || '--'
  280. },
  281. },
  282. {
  283. title: '广告详情',
  284. dataIndex: 'cost_speed',
  285. key: 'cost_speed',
  286. align: 'center',
  287. width: 80,
  288. className: 'padding2',
  289. render: (a: any, b: any) => {
  290. if (b?.account_id === '总计') return '--';
  291. return <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', lineHeight: 'normal', fontSize: 14 }}>
  292. <RocketSvg /> <a onClick={() => details(b)} style={{ marginLeft: 10 }}>详情</a>
  293. </div>
  294. }
  295. },
  296. {
  297. title: '创意预览',
  298. dataIndex: 'creative_ids',
  299. key: 'creative_ids',
  300. width: 140,
  301. ellipsis: true,
  302. render: (_: any, b: any) => {
  303. // return <BoxOther creativeComponents={b?.creative_preview?.[0] || {}} />
  304. return <CreativePreview creativePreview={b?.creative_preview || []} deliveryMode={b?.delivery_mode} />
  305. }
  306. },
  307. {
  308. title: '操作',
  309. dataIndex: 'cz',
  310. key: 'cz',
  311. width: 130,
  312. align: 'center',
  313. render: (a: any, b: any) => {
  314. if (b?.account_id === '总计') return '--';
  315. let items = [
  316. { label: <a style={{ fontSize: 12 }} onClick={() => log(b)}>告警日志</a>, key: '1' },
  317. { label: <a style={{ fontSize: 12 }} onClick={() => handleTag(b)}>打标记</a>, key: '2' }
  318. ]
  319. if (b?.tag_value) {
  320. items.push({ label: <a style={{ color: 'red', fontSize: 12 }} onClick={() => delTag(b)}>删除标记</a>, key: '3' })
  321. }
  322. return <Space>
  323. <Dropdown menu={{ items }}>
  324. <a><Space size={2}>更多 <DownOutlined /></Space></a>
  325. </Dropdown>
  326. <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.account_id}/admanage/index?tab=adgroup&query={%22operation_status%22:[%22CALCULATE_STATUS_EXCLUDE_DEL%22],%22system_status%22:[],%22search_name%22:%22${b.adgroup_id}%22}`)} target="_blank">腾讯广告</a>
  327. </Space>
  328. }
  329. }
  330. ]
  331. let adDataArr: ColumnsType<any> = [
  332. {
  333. title: '消耗',
  334. dataIndex: 'cost_total',
  335. key: 'cost_total',
  336. align: 'center',
  337. width: 110,
  338. sorter: true,
  339. render: (a: any, b: any) => {
  340. return <StatisticNull data={b} field='cost_total' />
  341. }
  342. },
  343. {
  344. title: '曝光量',
  345. dataIndex: 'view_total',
  346. key: 'view_total',
  347. align: 'center',
  348. width: 100,
  349. sorter: true,
  350. render: (a: any, b: any) => {
  351. return <StatisticNull data={b} field='view_total' />
  352. }
  353. },
  354. {
  355. title: '千次曝光成本',
  356. dataIndex: 'thousand_display_price_total',
  357. key: 'thousand_display_price_total',
  358. align: 'center',
  359. width: 110,
  360. sorter: true,
  361. render: (a: any, b: any) => {
  362. return <StatisticNull data={b} field='thousand_display_price_total' precision={2} />
  363. }
  364. },
  365. {
  366. title: '点击量',
  367. dataIndex: 'click_total',
  368. key: 'click_total',
  369. align: 'center',
  370. width: 110,
  371. sorter: true,
  372. render: (a: any, b: any) => {
  373. return <StatisticNull data={b} field='click_total' />
  374. }
  375. },
  376. {
  377. title: '点击率',
  378. dataIndex: 'ctr_total',
  379. key: 'ctr_total',
  380. align: 'center',
  381. width: 110,
  382. sorter: true,
  383. render: (a: any, b: any) => {
  384. if (b?.ctr_total !== undefined && b?.ctr_total !== null) {
  385. return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  386. } else {
  387. return '--'
  388. }
  389. }
  390. },
  391. {
  392. title: '点击均价',
  393. dataIndex: 'cpc_total',
  394. key: 'cpc_total',
  395. align: 'center',
  396. width: 110,
  397. sorter: true,
  398. render: (a: any, b: any) => {
  399. return <StatisticNull data={b} field='cpc_total' />
  400. }
  401. },
  402. {
  403. title: '不感兴趣点击次数',
  404. dataIndex: 'no_interest_count_total',
  405. key: 'no_interest_count_total',
  406. align: 'center',
  407. width: 110,
  408. sorter: true,
  409. render: (a: any, b: any) => {
  410. return <StatisticNull data={b} field='no_interest_count_total' />
  411. }
  412. },
  413. // {
  414. // title: '朋友圈视频播放次数',
  415. // dataIndex: 'video_play_count_total',
  416. // key: 'video_play_count_total',
  417. // align: 'center',
  418. // width: 110,
  419. // sorter: true,
  420. // render: (a: any, b: any) => {
  421. // return <StatisticNull data={b} field='video_play_count_total' />
  422. // }
  423. // },
  424. {
  425. title: '下载次数',
  426. dataIndex: 'download_count_total',
  427. key: 'download_count_total',
  428. align: 'center',
  429. width: 110,
  430. sorter: true,
  431. render: (a: any, b: any) => {
  432. return <StatisticNull data={b} field='download_count_total' />
  433. }
  434. },
  435. {
  436. title: '安装次数',
  437. dataIndex: 'install_count_total',
  438. key: 'install_count_total',
  439. align: 'center',
  440. width: 110,
  441. sorter: true,
  442. render: (a: any, b: any) => {
  443. return <StatisticNull data={b} field='install_count_total' />
  444. }
  445. },
  446. {
  447. title: '激活次数',
  448. dataIndex: 'activated_count_total',
  449. key: 'activated_count_total',
  450. align: 'center',
  451. width: 110,
  452. sorter: true,
  453. render: (a: any, b: any) => {
  454. return <StatisticNull data={b} field='activated_count_total' />
  455. }
  456. },
  457. {
  458. title: '公众号关注人数',
  459. dataIndex: 'mp_follow_uv_total',
  460. key: 'mp_follow_uv_total',
  461. align: 'center',
  462. width: 110,
  463. sorter: true,
  464. render: (a: any, b: any) => {
  465. return <StatisticNull data={b} field='mp_follow_uv_total' />
  466. }
  467. },
  468. {
  469. title: '公众号关注成本',
  470. dataIndex: 'mp_follow_cost_total',
  471. key: 'mp_follow_cost_total',
  472. align: 'center',
  473. width: 110,
  474. sorter: true,
  475. render: (a: any, b: any) => {
  476. return <StatisticNull data={b} field='mp_follow_cost_total' />
  477. }
  478. },
  479. {
  480. title: '公众号关注率',
  481. dataIndex: 'mp_follow_rate_total',
  482. key: 'mp_follow_rate_total',
  483. align: 'center',
  484. width: 110,
  485. sorter: true,
  486. render: (a: any, b: any) => {
  487. if (b?.mp_follow_rate_total !== undefined && b?.mp_follow_rate_total !== null) {
  488. return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  489. } else {
  490. return '--'
  491. }
  492. }
  493. },
  494. {
  495. title: '公众号关注次数',
  496. dataIndex: 'mp_follow_pv_total',
  497. key: 'mp_follow_pv_total',
  498. align: 'center',
  499. width: 110,
  500. sorter: true,
  501. render: (a: any, b: any) => {
  502. return <StatisticNull data={b} field='mp_follow_pv_total' />
  503. }
  504. },
  505. {
  506. title: '公众号关注次数成本',
  507. dataIndex: 'mp_follow_pv_cost_total',
  508. key: 'mp_follow_pv_cost_total',
  509. align: 'center',
  510. width: 120,
  511. sorter: true,
  512. render: (a: any, b: any) => {
  513. return <StatisticNull data={b} field='mp_follow_pv_cost_total' precision={2} />
  514. }
  515. },
  516. {
  517. title: '快应用添加次数',
  518. dataIndex: 'add_quick_app_pv_total',
  519. key: 'add_quick_app_pv_total',
  520. align: 'center',
  521. width: 110,
  522. sorter: true,
  523. render: (a: any, b: any) => {
  524. return <StatisticNull data={b} field='add_quick_app_pv_total' />
  525. }
  526. },
  527. {
  528. title: '快应用添加成本',
  529. dataIndex: 'add_quick_app_cost_total',
  530. key: 'add_quick_app_cost_total',
  531. align: 'center',
  532. width: 110,
  533. sorter: true,
  534. render: (a: any, b: any) => {
  535. return <StatisticNull data={b} field='add_quick_app_cost_total' />
  536. }
  537. },
  538. {
  539. title: '快应用添加率',
  540. dataIndex: 'add_quick_app_rate_total',
  541. key: 'add_quick_app_rate_total',
  542. align: 'center',
  543. width: 110,
  544. sorter: true,
  545. render: (a: any, b: any) => {
  546. if (b?.add_quick_app_rate_total !== undefined && b?.add_quick_app_rate_total !== null) {
  547. return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  548. } else {
  549. return '--'
  550. }
  551. }
  552. },
  553. {
  554. title: '加企业微信客服人数',
  555. dataIndex: 'scan_follow_uv_total',
  556. key: 'scan_follow_uv_total',
  557. align: 'center',
  558. width: 120,
  559. sorter: true,
  560. render: (a: any, b: any) => {
  561. return <StatisticNull data={b} field='scan_follow_uv_total' />
  562. }
  563. },
  564. {
  565. title: '加企业微信客服成本',
  566. dataIndex: 'scan_follow_cost_total',
  567. key: 'scan_follow_cost_total',
  568. align: 'center',
  569. width: 120,
  570. sorter: true,
  571. render: (a: any, b: any) => {
  572. return <StatisticNull data={b} field='scan_follow_cost_total' precision={2} />
  573. }
  574. },
  575. {
  576. title: '加企业微信客服率',
  577. dataIndex: 'scan_follow_rate_total',
  578. key: 'scan_follow_rate_total',
  579. align: 'center',
  580. width: 120,
  581. sorter: true,
  582. render: (a: any, b: any) => {
  583. if (b?.scan_follow_rate_total !== undefined && b?.scan_follow_rate_total !== null) {
  584. return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  585. } else {
  586. return '--'
  587. }
  588. }
  589. },
  590. {
  591. title: '首日新增下单量',
  592. dataIndex: 'first_day_order_count_total',
  593. key: 'first_day_order_count_total',
  594. align: 'center',
  595. width: 110,
  596. sorter: true,
  597. render: (a: any, b: any) => {
  598. return <StatisticNull data={b} field='first_day_order_count_total' />
  599. }
  600. },
  601. {
  602. title: '首日新增下单金额',
  603. dataIndex: 'first_day_order_amount_total',
  604. key: 'first_day_order_amount_total',
  605. align: 'center',
  606. width: 110,
  607. sorter: true,
  608. render: (a: any, b: any) => {
  609. return <StatisticNull data={b} field='first_day_order_amount_total' />
  610. }
  611. },
  612. {
  613. title: '首日新增下单ROI',
  614. dataIndex: 'first_day_order_roi_total',
  615. key: 'first_day_order_roi_total',
  616. align: 'center',
  617. width: 110,
  618. sorter: true,
  619. render: (a: any, b: any) => {
  620. if (b?.first_day_order_roi_total !== undefined && b?.first_day_order_roi_total !== null) {
  621. return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  622. } else {
  623. return '--'
  624. }
  625. }
  626. },
  627. {
  628. title: '订单量',
  629. dataIndex: 'order_count_total',
  630. key: 'order_count_total',
  631. align: 'center',
  632. width: 110,
  633. sorter: true,
  634. render: (a: any, b: any) => {
  635. return <StatisticNull data={b} field='order_count_total' />
  636. }
  637. },
  638. {
  639. title: '订单金额',
  640. dataIndex: 'order_amount_total',
  641. key: 'order_amount_total',
  642. align: 'center',
  643. width: 110,
  644. sorter: true,
  645. render: (a: any, b: any) => {
  646. return <StatisticNull data={b} field='order_amount_total' />
  647. }
  648. },
  649. {
  650. title: '下单成本',
  651. dataIndex: 'order_cost_total',
  652. key: 'order_cost_total',
  653. align: 'center',
  654. width: 110,
  655. sorter: true,
  656. render: (a: any, b: any) => {
  657. return <StatisticNull data={b} field='order_cost_total' precision={2} />
  658. }
  659. },
  660. {
  661. title: '下单率',
  662. dataIndex: 'order_rate_total',
  663. key: 'order_rate_total',
  664. align: 'center',
  665. width: 110,
  666. sorter: true,
  667. render: (a: any, b: any) => {
  668. if (b?.order_rate_total !== undefined && b?.order_rate_total !== null) {
  669. return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  670. } else {
  671. return '--'
  672. }
  673. }
  674. },
  675. {
  676. title: '下单ROI',
  677. dataIndex: 'order_roi_total',
  678. key: 'order_roi_total',
  679. align: 'center',
  680. width: 110,
  681. sorter: true,
  682. render: (a: any, b: any) => {
  683. if (b?.order_roi_total !== undefined && b?.order_roi_total !== null) {
  684. return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  685. } else {
  686. return '--'
  687. }
  688. }
  689. },
  690. {
  691. title: '客单价',
  692. dataIndex: 'atv_total',
  693. key: 'atv_total',
  694. align: 'center',
  695. width: 110,
  696. sorter: true,
  697. render: (a: any, b: any) => {
  698. return <StatisticNull data={b} field='atv_total' precision={2} />
  699. }
  700. },
  701. {
  702. title: '转化量',
  703. dataIndex: 'conversions_count_total',
  704. key: 'conversions_count_total',
  705. align: 'center',
  706. width: 110,
  707. sorter: true,
  708. render: (a: any, b: any) => {
  709. return <StatisticNull data={b} field='conversions_count_total' />
  710. }
  711. },
  712. {
  713. title: '转化成本',
  714. dataIndex: 'conversions_cost_total',
  715. key: 'conversions_cost_total',
  716. align: 'center',
  717. width: 110,
  718. sorter: true,
  719. render: (a: any, b: any) => {
  720. return <StatisticNull data={b} field='conversions_cost_total' precision={2} />
  721. }
  722. },
  723. {
  724. title: '深度转化',
  725. dataIndex: 'deep_conversions_count_total',
  726. key: 'deep_conversions_count_total',
  727. align: 'center',
  728. width: 110,
  729. sorter: true,
  730. render: (a: any, b: any) => {
  731. return <StatisticNull data={b} field='deep_conversions_count_total' />
  732. }
  733. },
  734. {
  735. title: '转化率',
  736. dataIndex: 'conversions_rate_total',
  737. key: 'conversions_rate_total',
  738. align: 'center',
  739. width: 110,
  740. sorter: true,
  741. render: (a: any, b: any) => {
  742. if (b?.conversions_rate_total !== undefined && b?.conversions_rate_total !== null) {
  743. return <Statistic value={a ? (a * 100) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  744. } else {
  745. return '--'
  746. }
  747. }
  748. },
  749. {
  750. title: '加粉数',
  751. dataIndex: 'add_fans_count_total',
  752. key: 'add_fans_count_total',
  753. align: 'center',
  754. width: 110,
  755. sorter: true,
  756. render: (a: any, b: any) => {
  757. return <StatisticNull data={b} field='add_fans_count_total' />
  758. }
  759. },
  760. {
  761. title: '加粉成本',
  762. dataIndex: 'add_fans_cost_total',
  763. key: 'add_fans_cost_total',
  764. align: 'center',
  765. width: 110,
  766. sorter: true,
  767. render: (a: any, b: any) => {
  768. return <StatisticNull data={b} field='add_fans_cost_total' precision={2} />
  769. }
  770. },
  771. ]
  772. return [
  773. ...adArr,
  774. ...adDataArr
  775. ]
  776. }
  777. export default tablePlanConfig