tablePlanListConfig.tsx 27 KB

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