tablePlanListConfig.tsx 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780
  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. return <Space>
  316. <Dropdown overlay={<Menu>
  317. <Menu.Item><a onClick={() => log(b)}>告警日志</a></Menu.Item>
  318. <Menu.Item><a onClick={() => handleTag(b)}>打标记</a></Menu.Item>
  319. {b?.tag_value ? <Menu.Item><a style={{ color: 'red' }} onClick={() => delTag(b)}>删除标记</a></Menu.Item> : undefined}
  320. </Menu>}>
  321. <a><Space size={2}>更多 <DownOutlined /></Space></a>
  322. </Dropdown>
  323. <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>
  324. </Space>
  325. }
  326. }
  327. ]
  328. let adDataArr: ColumnsType<any> = [
  329. {
  330. title: '消耗',
  331. dataIndex: 'cost_total',
  332. key: 'cost_total',
  333. align: 'center',
  334. width: 110,
  335. sorter: true,
  336. render: (a: any, b: any) => {
  337. return <StatisticNull data={b} field='cost_total' />
  338. }
  339. },
  340. {
  341. title: '曝光量',
  342. dataIndex: 'view_total',
  343. key: 'view_total',
  344. align: 'center',
  345. width: 100,
  346. sorter: true,
  347. render: (a: any, b: any) => {
  348. return <StatisticNull data={b} field='view_total' />
  349. }
  350. },
  351. {
  352. title: '千次曝光成本',
  353. dataIndex: 'thousand_display_price_total',
  354. key: 'thousand_display_price_total',
  355. align: 'center',
  356. width: 110,
  357. sorter: true,
  358. render: (a: any, b: any) => {
  359. return <StatisticNull data={b} field='thousand_display_price_total' precision={2} />
  360. }
  361. },
  362. {
  363. title: '点击量',
  364. dataIndex: 'click_total',
  365. key: 'click_total',
  366. align: 'center',
  367. width: 110,
  368. sorter: true,
  369. render: (a: any, b: any) => {
  370. return <StatisticNull data={b} field='click_total' />
  371. }
  372. },
  373. {
  374. title: '点击率',
  375. dataIndex: 'ctr_total',
  376. key: 'ctr_total',
  377. align: 'center',
  378. width: 110,
  379. sorter: true,
  380. render: (a: any, b: any) => {
  381. if (b?.ctr_total !== undefined && b?.ctr_total !== null) {
  382. return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  383. } else {
  384. return '--'
  385. }
  386. }
  387. },
  388. {
  389. title: '点击均价',
  390. dataIndex: 'cpc_total',
  391. key: 'cpc_total',
  392. align: 'center',
  393. width: 110,
  394. sorter: true,
  395. render: (a: any, b: any) => {
  396. return <StatisticNull data={b} field='cpc_total' />
  397. }
  398. },
  399. {
  400. title: '不感兴趣点击次数',
  401. dataIndex: 'no_interest_count_total',
  402. key: 'no_interest_count_total',
  403. align: 'center',
  404. width: 110,
  405. sorter: true,
  406. render: (a: any, b: any) => {
  407. return <StatisticNull data={b} field='no_interest_count_total' />
  408. }
  409. },
  410. // {
  411. // title: '朋友圈视频播放次数',
  412. // dataIndex: 'video_play_count_total',
  413. // key: 'video_play_count_total',
  414. // align: 'center',
  415. // width: 110,
  416. // sorter: true,
  417. // render: (a: any, b: any) => {
  418. // return <StatisticNull data={b} field='video_play_count_total' />
  419. // }
  420. // },
  421. {
  422. title: '下载次数',
  423. dataIndex: 'download_count_total',
  424. key: 'download_count_total',
  425. align: 'center',
  426. width: 110,
  427. sorter: true,
  428. render: (a: any, b: any) => {
  429. return <StatisticNull data={b} field='download_count_total' />
  430. }
  431. },
  432. {
  433. title: '安装次数',
  434. dataIndex: 'install_count_total',
  435. key: 'install_count_total',
  436. align: 'center',
  437. width: 110,
  438. sorter: true,
  439. render: (a: any, b: any) => {
  440. return <StatisticNull data={b} field='install_count_total' />
  441. }
  442. },
  443. {
  444. title: '激活次数',
  445. dataIndex: 'activated_count_total',
  446. key: 'activated_count_total',
  447. align: 'center',
  448. width: 110,
  449. sorter: true,
  450. render: (a: any, b: any) => {
  451. return <StatisticNull data={b} field='activated_count_total' />
  452. }
  453. },
  454. {
  455. title: '公众号关注人数',
  456. dataIndex: 'mp_follow_uv_total',
  457. key: 'mp_follow_uv_total',
  458. align: 'center',
  459. width: 110,
  460. sorter: true,
  461. render: (a: any, b: any) => {
  462. return <StatisticNull data={b} field='mp_follow_uv_total' />
  463. }
  464. },
  465. {
  466. title: '公众号关注成本',
  467. dataIndex: 'mp_follow_cost_total',
  468. key: 'mp_follow_cost_total',
  469. align: 'center',
  470. width: 110,
  471. sorter: true,
  472. render: (a: any, b: any) => {
  473. return <StatisticNull data={b} field='mp_follow_cost_total' />
  474. }
  475. },
  476. {
  477. title: '公众号关注率',
  478. dataIndex: 'mp_follow_rate_total',
  479. key: 'mp_follow_rate_total',
  480. align: 'center',
  481. width: 110,
  482. sorter: true,
  483. render: (a: any, b: any) => {
  484. if (b?.mp_follow_rate_total !== undefined && b?.mp_follow_rate_total !== null) {
  485. return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  486. } else {
  487. return '--'
  488. }
  489. }
  490. },
  491. {
  492. title: '公众号关注次数',
  493. dataIndex: 'mp_follow_pv_total',
  494. key: 'mp_follow_pv_total',
  495. align: 'center',
  496. width: 110,
  497. sorter: true,
  498. render: (a: any, b: any) => {
  499. return <StatisticNull data={b} field='mp_follow_pv_total' />
  500. }
  501. },
  502. {
  503. title: '公众号关注次数成本',
  504. dataIndex: 'mp_follow_pv_cost_total',
  505. key: 'mp_follow_pv_cost_total',
  506. align: 'center',
  507. width: 120,
  508. sorter: true,
  509. render: (a: any, b: any) => {
  510. return <StatisticNull data={b} field='mp_follow_pv_cost_total' precision={2}/>
  511. }
  512. },
  513. {
  514. title: '快应用添加次数',
  515. dataIndex: 'add_quick_app_pv_total',
  516. key: 'add_quick_app_pv_total',
  517. align: 'center',
  518. width: 110,
  519. sorter: true,
  520. render: (a: any, b: any) => {
  521. return <StatisticNull data={b} field='add_quick_app_pv_total' />
  522. }
  523. },
  524. {
  525. title: '快应用添加成本',
  526. dataIndex: 'add_quick_app_cost_total',
  527. key: 'add_quick_app_cost_total',
  528. align: 'center',
  529. width: 110,
  530. sorter: true,
  531. render: (a: any, b: any) => {
  532. return <StatisticNull data={b} field='add_quick_app_cost_total' />
  533. }
  534. },
  535. {
  536. title: '快应用添加率',
  537. dataIndex: 'add_quick_app_rate_total',
  538. key: 'add_quick_app_rate_total',
  539. align: 'center',
  540. width: 110,
  541. sorter: true,
  542. render: (a: any, b: any) => {
  543. if (b?.add_quick_app_rate_total !== undefined && b?.add_quick_app_rate_total !== null) {
  544. return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  545. } else {
  546. return '--'
  547. }
  548. }
  549. },
  550. {
  551. title: '加企业微信客服人数',
  552. dataIndex: 'scan_follow_uv_total',
  553. key: 'scan_follow_uv_total',
  554. align: 'center',
  555. width: 120,
  556. sorter: true,
  557. render: (a: any, b: any) => {
  558. return <StatisticNull data={b} field='scan_follow_uv_total' />
  559. }
  560. },
  561. {
  562. title: '加企业微信客服成本',
  563. dataIndex: 'scan_follow_cost_total',
  564. key: 'scan_follow_cost_total',
  565. align: 'center',
  566. width: 120,
  567. sorter: true,
  568. render: (a: any, b: any) => {
  569. return <StatisticNull data={b} field='scan_follow_cost_total' precision={2} />
  570. }
  571. },
  572. {
  573. title: '加企业微信客服率',
  574. dataIndex: 'scan_follow_rate_total',
  575. key: 'scan_follow_rate_total',
  576. align: 'center',
  577. width: 120,
  578. sorter: true,
  579. render: (a: any, b: any) => {
  580. if (b?.scan_follow_rate_total !== undefined && b?.scan_follow_rate_total !== null) {
  581. return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  582. } else {
  583. return '--'
  584. }
  585. }
  586. },
  587. {
  588. title: '首日新增下单量',
  589. dataIndex: 'first_day_order_count_total',
  590. key: 'first_day_order_count_total',
  591. align: 'center',
  592. width: 110,
  593. sorter: true,
  594. render: (a: any, b: any) => {
  595. return <StatisticNull data={b} field='first_day_order_count_total' />
  596. }
  597. },
  598. {
  599. title: '首日新增下单金额',
  600. dataIndex: 'first_day_order_amount_total',
  601. key: 'first_day_order_amount_total',
  602. align: 'center',
  603. width: 110,
  604. sorter: true,
  605. render: (a: any, b: any) => {
  606. return <StatisticNull data={b} field='first_day_order_amount_total' />
  607. }
  608. },
  609. {
  610. title: '首日新增下单ROI',
  611. dataIndex: 'first_day_order_roi_total',
  612. key: 'first_day_order_roi_total',
  613. align: 'center',
  614. width: 110,
  615. sorter: true,
  616. render: (a: any, b: any) => {
  617. if (b?.first_day_order_roi_total !== undefined && b?.first_day_order_roi_total !== null) {
  618. return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  619. } else {
  620. return '--'
  621. }
  622. }
  623. },
  624. {
  625. title: '订单量',
  626. dataIndex: 'order_count_total',
  627. key: 'order_count_total',
  628. align: 'center',
  629. width: 110,
  630. sorter: true,
  631. render: (a: any, b: any) => {
  632. return <StatisticNull data={b} field='order_count_total' />
  633. }
  634. },
  635. {
  636. title: '订单金额',
  637. dataIndex: 'order_amount_total',
  638. key: 'order_amount_total',
  639. align: 'center',
  640. width: 110,
  641. sorter: true,
  642. render: (a: any, b: any) => {
  643. return <StatisticNull data={b} field='order_amount_total' />
  644. }
  645. },
  646. {
  647. title: '下单成本',
  648. dataIndex: 'order_cost_total',
  649. key: 'order_cost_total',
  650. align: 'center',
  651. width: 110,
  652. sorter: true,
  653. render: (a: any, b: any) => {
  654. return <StatisticNull data={b} field='order_cost_total' precision={2} />
  655. }
  656. },
  657. {
  658. title: '下单率',
  659. dataIndex: 'order_rate_total',
  660. key: 'order_rate_total',
  661. align: 'center',
  662. width: 110,
  663. sorter: true,
  664. render: (a: any, b: any) => {
  665. if (b?.order_rate_total !== undefined && b?.order_rate_total !== null) {
  666. return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  667. } else {
  668. return '--'
  669. }
  670. }
  671. },
  672. {
  673. title: '下单ROI',
  674. dataIndex: 'order_roi_total',
  675. key: 'order_roi_total',
  676. align: 'center',
  677. width: 110,
  678. sorter: true,
  679. render: (a: any, b: any) => {
  680. if (b?.order_roi_total !== undefined && b?.order_roi_total !== null) {
  681. return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  682. } else {
  683. return '--'
  684. }
  685. }
  686. },
  687. {
  688. title: '客单价',
  689. dataIndex: 'atv_total',
  690. key: 'atv_total',
  691. align: 'center',
  692. width: 110,
  693. sorter: true,
  694. render: (a: any, b: any) => {
  695. return <StatisticNull data={b} field='atv_total' precision={2} />
  696. }
  697. },
  698. {
  699. title: '转化量',
  700. dataIndex: 'conversions_count_total',
  701. key: 'conversions_count_total',
  702. align: 'center',
  703. width: 110,
  704. sorter: true,
  705. render: (a: any, b: any) => {
  706. return <StatisticNull data={b} field='conversions_count_total' />
  707. }
  708. },
  709. {
  710. title: '转化成本',
  711. dataIndex: 'conversions_cost_total',
  712. key: 'conversions_cost_total',
  713. align: 'center',
  714. width: 110,
  715. sorter: true,
  716. render: (a: any, b: any) => {
  717. return <StatisticNull data={b} field='conversions_cost_total' precision={2} />
  718. }
  719. },
  720. {
  721. title: '深度转化',
  722. dataIndex: 'deep_conversions_count_total',
  723. key: 'deep_conversions_count_total',
  724. align: 'center',
  725. width: 110,
  726. sorter: true,
  727. render: (a: any, b: any) => {
  728. return <StatisticNull data={b} field='deep_conversions_count_total' />
  729. }
  730. },
  731. {
  732. title: '转化率',
  733. dataIndex: 'conversions_rate_total',
  734. key: 'conversions_rate_total',
  735. align: 'center',
  736. width: 110,
  737. sorter: true,
  738. render: (a: any, b: any) => {
  739. if (b?.conversions_rate_total !== undefined && b?.conversions_rate_total !== null) {
  740. return <Statistic value={a ? a.toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  741. } else {
  742. return '--'
  743. }
  744. }
  745. },
  746. {
  747. title: '加粉数',
  748. dataIndex: 'add_fans_count_total',
  749. key: 'add_fans_count_total',
  750. align: 'center',
  751. width: 110,
  752. sorter: true,
  753. render: (a: any, b: any) => {
  754. return <StatisticNull data={b} field='add_fans_count_total' />
  755. }
  756. },
  757. {
  758. title: '加粉成本',
  759. dataIndex: 'add_fans_cost_total',
  760. key: 'add_fans_cost_total',
  761. align: 'center',
  762. width: 110,
  763. sorter: true,
  764. render: (a: any, b: any) => {
  765. return <StatisticNull data={b} field='add_fans_cost_total' precision={2} />
  766. }
  767. },
  768. ]
  769. return [
  770. ...adArr,
  771. ...adDataArr
  772. ]
  773. }
  774. export default tablePlanConfig