tablePlanListConfig.tsx 26 KB

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