tableDynamicConfig.tsx 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907
  1. import React from 'react'
  2. import { Badge, Space, Statistic, Switch, Tooltip } from 'antd'
  3. import '../../launchSystemNew/adq/index.less'
  4. import { copy } from '@/utils/utils'
  5. import { ColumnsType } from 'antd/lib/table'
  6. import StatisticNull from '@/components/StatisticNull'
  7. import { QuestionCircleOutlined } from '@ant-design/icons'
  8. import { DELIVERY_MODE, DYNAMIC_CREATIVE_TYPE } from '../adqv3/const'
  9. import { creativeTemplate } from '../tencentAdPutIn/const'
  10. import CreativePreview from './CreativePreview'
  11. function tableDynamicConfig(
  12. suspendHandle: (b: any, suspend: '启动' | '暂停') => void
  13. ): ColumnsType<any> {
  14. let adArr: ColumnsType<any> = [
  15. {
  16. title: '启停',
  17. dataIndex: 'configured_status',
  18. key: 'configured_status',
  19. align: 'center',
  20. width: 40,
  21. fixed: 'left',
  22. render: (a: string, b: any) => {
  23. if (b?.account_id === '总计') {
  24. return '--'
  25. }
  26. return <Switch size="small" checked={a === 'AD_STATUS_NORMAL'} onChange={(checked) => { suspendHandle(b, checked ? '启动' : '暂停') }} />
  27. }
  28. },
  29. {
  30. title: '所属账号',
  31. dataIndex: 'account_id',
  32. key: 'account_id',
  33. align: 'center',
  34. width: 80,
  35. ellipsis: true,
  36. render: (a: string) => {
  37. return <Space>
  38. <a onClick={() => copy(a)} >{a}</a>
  39. </Space>
  40. }
  41. },
  42. {
  43. title: '广告ID',
  44. dataIndex: 'adgroup_id',
  45. key: 'adgroup_id',
  46. align: 'center',
  47. width: 100,
  48. ellipsis: true,
  49. render: (a: string, b: any) => {
  50. if (b?.account_id === '总计') {
  51. return '--'
  52. }
  53. return <Space>
  54. <a onClick={() => copy(a)} >{a}</a>
  55. </Space>
  56. }
  57. },
  58. {
  59. title: '创意ID',
  60. dataIndex: 'dynamic_creative_id',
  61. key: 'dynamic_creative_id',
  62. align: 'center',
  63. width: 100,
  64. ellipsis: true,
  65. render: (a: string, b: any) => {
  66. if (b?.account_id === '总计') {
  67. return '--'
  68. }
  69. return <Space>
  70. <a onClick={() => copy(a)} >{a}</a>
  71. </Space>
  72. }
  73. },
  74. {
  75. title: '投手',
  76. dataIndex: 'put_user_name',
  77. key: 'put_user_name',
  78. align: 'center',
  79. width: 70,
  80. ellipsis: true,
  81. render(value, record) {
  82. if (record?.account_id === '总计') return '--';
  83. return value
  84. },
  85. },
  86. {
  87. title: '广告名称',
  88. dataIndex: 'adgroup_name',
  89. key: 'adgroup_name',
  90. width: 280,
  91. ellipsis: true,
  92. render: (a: string, b: any) => {
  93. if (b?.account_id === '总计') return '--';
  94. return a
  95. }
  96. },
  97. {
  98. title: '创意名称',
  99. dataIndex: 'dynamic_creative_name',
  100. key: 'dynamic_creative_name',
  101. width: 280,
  102. ellipsis: true,
  103. render: (a: string, b: any) => {
  104. if (b?.account_id === '总计') return '--'
  105. return a
  106. }
  107. },
  108. {
  109. title: '投放模式',
  110. dataIndex: 'delivery_mode',
  111. key: 'delivery_mode',
  112. align: 'center',
  113. width: 120,
  114. render: (a: string) => {
  115. return DELIVERY_MODE[a as keyof typeof DELIVERY_MODE]
  116. }
  117. },
  118. {
  119. title: '创意形式匹配方式',
  120. dataIndex: 'dynamic_creative_type',
  121. key: 'dynamic_creative_type',
  122. align: 'center',
  123. width: 120,
  124. render: (a: string) => {
  125. return DYNAMIC_CREATIVE_TYPE[a as keyof typeof DYNAMIC_CREATIVE_TYPE]
  126. }
  127. },
  128. {
  129. title: '是否已删除',
  130. dataIndex: 'is_deleted',
  131. key: 'is_deleted',
  132. align: 'center',
  133. width: 60,
  134. render: (a: any, b: any) => {
  135. if (b?.account_id === '总计') return '--';
  136. return <Badge status={!a ? "processing" : "error"} text={a ? '是' : '否'} />
  137. }
  138. },
  139. {
  140. title: '创意形式',
  141. dataIndex: 'creative_template_id',
  142. key: 'creative_template_id',
  143. align: 'center',
  144. width: 120,
  145. ellipsis: true,
  146. render: (a: string) => {
  147. return creativeTemplate[a as keyof typeof creativeTemplate] || '--'
  148. }
  149. },
  150. {
  151. title: '创建时间',
  152. dataIndex: 'created_time',
  153. key: 'created_time',
  154. align: 'center',
  155. width: 140,
  156. ellipsis: true,
  157. },
  158. {
  159. title: '创意预览',
  160. dataIndex: 'creative_components_json',
  161. key: 'creative_components_json',
  162. width: 140,
  163. ellipsis: true,
  164. render: (_: any, b: any) => {
  165. return <CreativePreview creativePreview={b?.creative_components ? [b?.creative_components] : []} deliveryMode={[b?.delivery_mode]} />
  166. }
  167. },
  168. {
  169. title: '操作',
  170. dataIndex: 'cz',
  171. key: 'cz',
  172. width: 130,
  173. align: 'center',
  174. render: (a: any, b: any) => {
  175. if (b?.account_id === '总计') return '--';
  176. return <Space>
  177. {/* <Dropdown overlay={<Menu>
  178. <Menu.Item><a onClick={() => log(b)}>告警日志</a></Menu.Item>
  179. <Menu.Item><a onClick={() => handleTag(b)}>打标记</a></Menu.Item>
  180. {b?.tag_value ? <Menu.Item><a style={{ color: 'red' }} onClick={() => delTag(b)}>删除标记</a></Menu.Item> : undefined}
  181. </Menu>}>
  182. <a><Space size={2}>更多 <DownOutlined /></Space></a>
  183. </Dropdown> */}
  184. <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>
  185. </Space>
  186. }
  187. }
  188. ]
  189. let adDataArr: ColumnsType<any> = [
  190. {
  191. title: '消耗',
  192. dataIndex: 'cost_day',
  193. key: 'cost_day',
  194. align: 'center',
  195. width: 110,
  196. sorter: true,
  197. render: (a: any, b: any) => {
  198. return <StatisticNull data={b} field='cost_day' />
  199. }
  200. },
  201. {
  202. title: '曝光量',
  203. dataIndex: 'view_count_day',
  204. key: 'view_count_day',
  205. align: 'center',
  206. width: 100,
  207. sorter: true,
  208. render: (a: any, b: any) => {
  209. return <StatisticNull data={b} field='view_count_day' />
  210. }
  211. },
  212. {
  213. title: '点击量',
  214. dataIndex: 'valid_click_count_day',
  215. key: 'valid_click_count_day',
  216. align: 'center',
  217. width: 100,
  218. sorter: true,
  219. render: (a: any, b: any) => {
  220. return <StatisticNull data={b} field='valid_click_count_day' />
  221. }
  222. },
  223. {
  224. title: '公众号关注人数(点击归因)',
  225. dataIndex: 'from_follow_by_click_uv_day',
  226. key: 'from_follow_by_click_uv_day',
  227. align: 'center',
  228. width: 120,
  229. sorter: true,
  230. render: (a: any, b: any) => {
  231. return <StatisticNull data={b} field='from_follow_by_click_uv_day' />
  232. }
  233. },
  234. {
  235. title: '公众号关注成本(点击归因)',
  236. dataIndex: 'from_follow_by_click_cost_day',
  237. key: 'from_follow_by_click_cost_day',
  238. align: 'center',
  239. width: 110,
  240. sorter: true,
  241. render: (a: any, b: any) => {
  242. return <StatisticNull data={b} field='from_follow_by_click_cost_day' precision={2} />
  243. }
  244. },
  245. {
  246. title: '公众号关注人数(平台上报)',
  247. dataIndex: 'biz_follow_uv_day',
  248. key: 'biz_follow_uv_day',
  249. align: 'center',
  250. width: 120,
  251. sorter: true,
  252. render: (a: any, b: any) => {
  253. return <StatisticNull data={b} field='biz_follow_uv_day' />
  254. }
  255. },
  256. {
  257. title: '目标转化量',
  258. dataIndex: 'conversions_count_day',
  259. key: 'conversions_count_day',
  260. align: 'center',
  261. width: 100,
  262. sorter: true,
  263. render: (a: any, b: any) => {
  264. return <StatisticNull data={b} field='conversions_count_day' />
  265. }
  266. },
  267. {
  268. title: '目标转化成本',
  269. dataIndex: 'conversions_cost_day',
  270. key: 'conversions_cost_day',
  271. align: 'center',
  272. width: 110,
  273. sorter: true,
  274. render: (a: any, b: any) => {
  275. return <StatisticNull data={b} field='conversions_cost_day' precision={2} />
  276. }
  277. },
  278. {
  279. title: '深度目标转化量',
  280. dataIndex: 'deep_conversions_count_day',
  281. key: 'deep_conversions_count_day',
  282. align: 'center',
  283. width: 100,
  284. sorter: true,
  285. render: (a: any, b: any) => {
  286. return <StatisticNull data={b} field='deep_conversions_count_day' />
  287. }
  288. },
  289. {
  290. title: '加企业微信客服次数',
  291. dataIndex: 'scan_follow_count_day',
  292. key: 'scan_follow_count_day',
  293. align: 'center',
  294. width: 100,
  295. sorter: true,
  296. render: (a: any, b: any) => {
  297. return <StatisticNull data={b} field='scan_follow_count_day' />
  298. }
  299. },
  300. {
  301. title: '加企业微信客服人数',
  302. dataIndex: 'scan_follow_user_count_day',
  303. key: 'scan_follow_user_count_day',
  304. align: 'center',
  305. width: 100,
  306. sorter: true,
  307. render: (a: any, b: any) => {
  308. return <StatisticNull data={b} field='scan_follow_user_count_day' />
  309. }
  310. },
  311. {
  312. title: '下单次数',
  313. dataIndex: 'order_pv_day',
  314. key: 'order_pv_day',
  315. align: 'center',
  316. width: 100,
  317. sorter: true,
  318. render: (a: any, b: any) => {
  319. return <StatisticNull data={b} field='order_pv_day' />
  320. }
  321. },
  322. {
  323. title: '下单人数',
  324. dataIndex: 'order_uv_day',
  325. key: 'order_uv_day',
  326. align: 'center',
  327. width: 100,
  328. sorter: true,
  329. render: (a: any, b: any) => {
  330. return <StatisticNull data={b} field='order_uv_day' />
  331. }
  332. },
  333. {
  334. title: '下单金额',
  335. dataIndex: 'order_amount_day',
  336. key: 'order_amount_day',
  337. align: 'center',
  338. width: 110,
  339. sorter: true,
  340. render: (a: any, b: any) => {
  341. return <StatisticNull data={b} field='order_amount_day' precision={2} />
  342. }
  343. },
  344. {
  345. title: '下单次数(点击归因)',
  346. dataIndex: 'order_by_click_count_day',
  347. key: 'order_by_click_count_day',
  348. align: 'center',
  349. width: 100,
  350. sorter: true,
  351. render: (a: any, b: any) => {
  352. return <StatisticNull data={b} field='order_by_click_count_day' />
  353. }
  354. },
  355. {
  356. title: '下单人数(点击归因)',
  357. dataIndex: 'order_by_click_amount_day',
  358. key: 'order_by_click_amount_day',
  359. align: 'center',
  360. width: 100,
  361. sorter: true,
  362. render: (a: any, b: any) => {
  363. return <StatisticNull data={b} field='order_by_click_amount_day' />
  364. }
  365. },
  366. {
  367. title: '点击首日下单次数(点击归因)',
  368. dataIndex: 'first_day_order_by_click_count_day',
  369. key: 'first_day_order_by_click_count_day',
  370. align: 'center',
  371. width: 120,
  372. sorter: true,
  373. render: (a: any, b: any) => {
  374. return <StatisticNull data={b} field='first_day_order_by_click_count_day' />
  375. }
  376. },
  377. {
  378. title: '点击首日付费次数',
  379. dataIndex: 'cheout_pv1d_day',
  380. key: 'cheout_pv1d_day',
  381. align: 'center',
  382. width: 100,
  383. sorter: true,
  384. render: (a: any, b: any) => {
  385. return <StatisticNull data={b} field='cheout_pv1d_day' />
  386. }
  387. },
  388. {
  389. title: '点击首日付费金额',
  390. dataIndex: 'cheout_fd_day',
  391. key: 'cheout_fd_day',
  392. align: 'center',
  393. width: 110,
  394. sorter: true,
  395. render: (a: any, b: any) => {
  396. return <StatisticNull data={b} field='cheout_fd_day' precision={2} />
  397. }
  398. },
  399. {
  400. title: '点击首日付费成本',
  401. dataIndex: 'cheout1d_cost_day',
  402. key: 'cheout1d_cost_day',
  403. align: 'center',
  404. width: 110,
  405. sorter: true,
  406. render: (a: any, b: any) => {
  407. return <StatisticNull data={b} field='cheout1d_cost_day' precision={2} />
  408. }
  409. },
  410. {
  411. title: '点击首日付费金额(平台上报)',
  412. dataIndex: 'purchase_pla_clk1d_amount_day',
  413. key: 'purchase_pla_clk1d_amount_day',
  414. align: 'center',
  415. width: 120,
  416. sorter: true,
  417. render: (a: any, b: any) => {
  418. return <StatisticNull data={b} field='purchase_pla_clk1d_amount_day' precision={2} />
  419. }
  420. },
  421. {
  422. title: '点击首日下单次数(首日新增下单量)',
  423. dataIndex: 'first_day_order_count_day',
  424. key: 'first_day_order_count_day',
  425. align: 'center',
  426. width: 120,
  427. sorter: true,
  428. render: (a: any, b: any) => {
  429. return <StatisticNull data={b} field='first_day_order_count_day' />
  430. }
  431. },
  432. {
  433. title: '首日新增下单金额(点击归因)',
  434. dataIndex: 'first_day_order_by_click_amount_day',
  435. key: 'first_day_order_by_click_amount_day',
  436. align: 'center',
  437. width: 120,
  438. sorter: true,
  439. render: (a: any, b: any) => {
  440. return <StatisticNull data={b} field='first_day_order_by_click_amount_day' precision={2} />
  441. }
  442. },
  443. {
  444. title: '点击首日下单金额(首日新增下单金额)',
  445. dataIndex: 'first_day_order_amount_day',
  446. key: 'first_day_order_amount_day',
  447. align: 'center',
  448. width: 120,
  449. sorter: true,
  450. render: (a: any, b: any) => {
  451. return <StatisticNull data={b} field='first_day_order_amount_day' precision={2} />
  452. }
  453. },
  454. {
  455. title: '点击7日下单次数',
  456. dataIndex: 'order_clk7d_pv_day',
  457. key: 'order_clk7d_pv_day',
  458. align: 'center',
  459. width: 100,
  460. sorter: true,
  461. render: (a: any, b: any) => {
  462. return <StatisticNull data={b} field='order_clk7d_pv_day' />
  463. }
  464. },
  465. {
  466. title: '点击7日下单金额',
  467. dataIndex: 'order_clk7d_amount_day',
  468. key: 'order_clk7d_amount_day',
  469. align: 'center',
  470. width: 100,
  471. sorter: true,
  472. render: (a: any, b: any) => {
  473. return <StatisticNull data={b} field='order_clk7d_amount_day' precision={2} />
  474. }
  475. },
  476. {
  477. title: '点击15日下单次数',
  478. dataIndex: 'order_clk15d_pv_day',
  479. key: 'order_clk15d_pv_day',
  480. align: 'center',
  481. width: 100,
  482. sorter: true,
  483. render: (a: any, b: any) => {
  484. return <StatisticNull data={b} field='order_clk15d_pv_day' />
  485. }
  486. },
  487. {
  488. title: '点击15日下单金额',
  489. dataIndex: 'order_clk15d_amount_day',
  490. key: 'order_clk15d_amount_day',
  491. align: 'center',
  492. width: 100,
  493. sorter: true,
  494. render: (a: any, b: any) => {
  495. return <StatisticNull data={b} field='order_clk15d_amount_day' precision={2} />
  496. }
  497. },
  498. {
  499. title: '点击30日下单次数',
  500. dataIndex: 'order_clk30d_pv_day',
  501. key: 'order_clk30d_pv_day',
  502. align: 'center',
  503. width: 100,
  504. sorter: true,
  505. render: (a: any, b: any) => {
  506. return <StatisticNull data={b} field='order_clk30d_pv_day' />
  507. }
  508. },
  509. {
  510. title: '点击30日下单金额',
  511. dataIndex: 'order_clk30d_amount_day',
  512. key: 'order_clk30d_amount_day',
  513. align: 'center',
  514. width: 100,
  515. sorter: true,
  516. render: (a: any, b: any) => {
  517. return <StatisticNull data={b} field='order_clk30d_amount_day' precision={2} />
  518. }
  519. },
  520. {
  521. title: '不感兴趣点击次数',
  522. dataIndex: 'no_interest_count_day',
  523. key: 'no_interest_count_day',
  524. align: 'center',
  525. width: 100,
  526. sorter: true,
  527. render: (a: any, b: any) => {
  528. return <StatisticNull data={b} field='no_interest_count_day' />
  529. }
  530. },
  531. {
  532. title: '千次曝光成本',
  533. dataIndex: 'thousand_display_price',
  534. key: 'thousand_display_price',
  535. align: 'center',
  536. width: 100,
  537. sorter: true,
  538. render: (a: any, b: any) => {
  539. return <StatisticNull data={b} field='thousand_display_price' precision={2} />
  540. }
  541. },
  542. {
  543. title: '点击均价',
  544. dataIndex: 'cpc',
  545. key: 'cpc',
  546. align: 'center',
  547. width: 100,
  548. sorter: true,
  549. render: (a: any, b: any) => {
  550. return <StatisticNull data={b} field='cpc' precision={2} />
  551. }
  552. },
  553. {
  554. title: '点击率',
  555. dataIndex: 'ctr',
  556. key: 'ctr',
  557. align: 'center',
  558. width: 110,
  559. sorter: true,
  560. render: (a: any, b: any) => {
  561. if (b?.ctr !== undefined && b?.ctr !== null) {
  562. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  563. } else {
  564. return '--'
  565. }
  566. }
  567. },
  568. {
  569. title: '公众号关注率(点击归因)',
  570. dataIndex: 'biz_follow_rate_click',
  571. key: 'biz_follow_rate_click',
  572. align: 'center',
  573. width: 110,
  574. sorter: true,
  575. render: (a: any, b: any) => {
  576. if (b?.biz_follow_rate_click !== undefined && b?.biz_follow_rate_click !== null) {
  577. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  578. } else {
  579. return '--'
  580. }
  581. }
  582. },
  583. {
  584. title: '公众号关注成本(平台上报)',
  585. dataIndex: 'biz_follow_cost',
  586. key: 'biz_follow_cost',
  587. align: 'center',
  588. width: 120,
  589. sorter: true,
  590. render: (a: any, b: any) => {
  591. return <StatisticNull data={b} field='biz_follow_cost' precision={2} />
  592. }
  593. },
  594. {
  595. title: '公众号关注率(平台上报)',
  596. dataIndex: 'biz_follow_rate',
  597. key: 'biz_follow_rate',
  598. align: 'center',
  599. width: 120,
  600. sorter: true,
  601. render: (a: any, b: any) => {
  602. if (b?.biz_follow_rate !== undefined && b?.biz_follow_rate !== null) {
  603. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  604. } else {
  605. return '--'
  606. }
  607. }
  608. },
  609. {
  610. title: '目标转化率',
  611. dataIndex: 'conversions_rate',
  612. key: 'conversions_rate',
  613. align: 'center',
  614. width: 110,
  615. sorter: true,
  616. render: (a: any, b: any) => {
  617. if (b?.conversions_rate !== undefined && b?.conversions_rate !== null) {
  618. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  619. } else {
  620. return '--'
  621. }
  622. }
  623. },
  624. {
  625. title: '深度目标转化率',
  626. dataIndex: 'deep_conversions_rate',
  627. key: 'deep_conversions_rate',
  628. align: 'center',
  629. width: 110,
  630. sorter: true,
  631. render: (a: any, b: any) => {
  632. if (b?.deep_conversions_rate !== undefined && b?.deep_conversions_rate !== null) {
  633. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  634. } else {
  635. return '--'
  636. }
  637. }
  638. },
  639. {
  640. title: '加企业微信客服成本(人数)',
  641. dataIndex: 'scan_follow_user_cost',
  642. key: 'scan_follow_user_cost',
  643. align: 'center',
  644. width: 110,
  645. sorter: true,
  646. render: (a: any, b: any) => {
  647. return <StatisticNull data={b} field='scan_follow_user_cost' precision={2} />
  648. }
  649. },
  650. {
  651. title: '加企业微信客服率(人数)',
  652. dataIndex: 'scan_follow_user_rate',
  653. key: 'scan_follow_user_rate',
  654. align: 'center',
  655. width: 120,
  656. sorter: true,
  657. render: (a: any, b: any) => {
  658. if (b?.scan_follow_user_rate !== undefined && b?.scan_follow_user_rate !== null) {
  659. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  660. } else {
  661. return '--'
  662. }
  663. }
  664. },
  665. {
  666. title: '下单单价',
  667. dataIndex: 'order_unit_price',
  668. key: 'order_unit_price',
  669. align: 'center',
  670. width: 80,
  671. sorter: true,
  672. render: (a: any, b: any) => {
  673. return <StatisticNull data={b} field='order_unit_price' precision={2} />
  674. }
  675. },
  676. {
  677. title: '下单率',
  678. dataIndex: 'order_rate',
  679. key: 'order_rate',
  680. align: 'center',
  681. width: 110,
  682. sorter: true,
  683. render: (a: any, b: any) => {
  684. if (b?.order_rate !== undefined && b?.order_rate !== null) {
  685. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  686. } else {
  687. return '--'
  688. }
  689. }
  690. },
  691. {
  692. title: '下单成本',
  693. dataIndex: 'order_by_display_cost',
  694. key: 'order_by_display_cost',
  695. align: 'center',
  696. width: 80,
  697. sorter: true,
  698. render: (a: any, b: any) => {
  699. return <StatisticNull data={b} field='order_by_display_cost' precision={2} />
  700. }
  701. },
  702. {
  703. title: '下单ROI',
  704. dataIndex: 'order_roi',
  705. key: 'order_roi',
  706. align: 'center',
  707. width: 110,
  708. sorter: true,
  709. render: (a: any, b: any) => {
  710. if (b?.order_roi !== undefined && b?.order_roi !== null) {
  711. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  712. } else {
  713. return '--'
  714. }
  715. }
  716. },
  717. {
  718. title: '客单价',
  719. dataIndex: 'unit_price',
  720. key: 'unit_price',
  721. align: 'center',
  722. width: 80,
  723. sorter: true,
  724. render: (a: any, b: any) => {
  725. return <StatisticNull data={b} field='unit_price' precision={2} />
  726. }
  727. },
  728. {
  729. title: '下单率(点击归因)',
  730. dataIndex: 'order_by_click_rate',
  731. key: 'order_by_click_rate',
  732. align: 'center',
  733. width: 110,
  734. sorter: true,
  735. render: (a: any, b: any) => {
  736. if (b?.order_by_click_rate !== undefined && b?.order_by_click_rate !== null) {
  737. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  738. } else {
  739. return '--'
  740. }
  741. }
  742. },
  743. {
  744. title: '下单成本(点击归因)',
  745. dataIndex: 'order_by_click_cost',
  746. key: 'order_by_click_cost',
  747. align: 'center',
  748. width: 80,
  749. sorter: true,
  750. render: (a: any, b: any) => {
  751. return <StatisticNull data={b} field='order_by_click_cost' precision={2} />
  752. }
  753. },
  754. {
  755. title: '下单ROI(点击归因)',
  756. dataIndex: 'order_by_click_roi',
  757. key: 'order_by_click_roi',
  758. align: 'center',
  759. width: 110,
  760. sorter: true,
  761. render: (a: any, b: any) => {
  762. if (b?.order_by_click_roi !== undefined && b?.order_by_click_roi !== null) {
  763. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  764. } else {
  765. return '--'
  766. }
  767. }
  768. },
  769. {
  770. title: '点击首日付费率',
  771. dataIndex: 'cheout_1d_rate',
  772. key: 'cheout_1d_rate',
  773. align: 'center',
  774. width: 110,
  775. sorter: true,
  776. render: (a: any, b: any) => {
  777. if (b?.cheout_1d_rate !== undefined && b?.cheout_1d_rate !== null) {
  778. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  779. } else {
  780. return '--'
  781. }
  782. }
  783. },
  784. {
  785. title: '点击首日付费ROI',
  786. dataIndex: 'cheout_fd_reward',
  787. key: 'cheout_fd_reward',
  788. align: 'center',
  789. width: 110,
  790. sorter: true,
  791. render: (a: any, b: any) => {
  792. if (b?.cheout_fd_reward !== undefined && b?.cheout_fd_reward !== null) {
  793. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  794. } else {
  795. return '--'
  796. }
  797. }
  798. },
  799. {
  800. title: '点击30日下单单价',
  801. dataIndex: 'order_clk_30d_unit_price',
  802. key: 'order_clk_30d_unit_price',
  803. align: 'center',
  804. width: 100,
  805. sorter: true,
  806. render: (a: any, b: any) => {
  807. return <StatisticNull data={b} field='order_clk_30d_unit_price' precision={2} />
  808. }
  809. },
  810. {
  811. title: '点击15日下单单价',
  812. dataIndex: 'order_clk_15d_unit_price',
  813. key: 'order_clk_15d_unit_price',
  814. align: 'center',
  815. width: 100,
  816. sorter: true,
  817. render: (a: any, b: any) => {
  818. return <StatisticNull data={b} field='order_clk_15d_unit_price' precision={2} />
  819. }
  820. },
  821. {
  822. title: '点击7日下单单价',
  823. dataIndex: 'order_clk_7d_unit_price',
  824. key: 'order_clk_7d_unit_price',
  825. align: 'center',
  826. width: 100,
  827. sorter: true,
  828. render: (a: any, b: any) => {
  829. return <StatisticNull data={b} field='order_clk_7d_unit_price' precision={2} />
  830. }
  831. },
  832. {
  833. title: '点击30日下单ROI',
  834. dataIndex: 'order_clk_30d_roi',
  835. key: 'order_clk_30d_roi',
  836. align: 'center',
  837. width: 110,
  838. sorter: true,
  839. render: (a: any, b: any) => {
  840. if (b?.order_clk_30d_roi !== undefined && b?.order_clk_30d_roi !== null) {
  841. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  842. } else {
  843. return '--'
  844. }
  845. }
  846. },
  847. {
  848. title: '点击15日下单ROI',
  849. dataIndex: 'order_clk_15d_roi',
  850. key: 'order_clk_15d_roi',
  851. align: 'center',
  852. width: 110,
  853. sorter: true,
  854. render: (a: any, b: any) => {
  855. if (b?.order_clk_15d_roi !== undefined && b?.order_clk_15d_roi !== null) {
  856. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  857. } else {
  858. return '--'
  859. }
  860. }
  861. },
  862. {
  863. title: '点击7日下单ROI',
  864. dataIndex: 'order_clk_7d_roi',
  865. key: 'order_clk_7d_roi',
  866. align: 'center',
  867. width: 110,
  868. sorter: true,
  869. render: (a: any, b: any) => {
  870. if (b?.order_clk_7d_roi !== undefined && b?.order_clk_7d_roi !== null) {
  871. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  872. } else {
  873. return '--'
  874. }
  875. }
  876. },
  877. {
  878. title: <Space>
  879. <span>点击首日下单ROI</span>
  880. <Tooltip title="首日新增下单ROI">
  881. <QuestionCircleOutlined />
  882. </Tooltip>
  883. </Space>,
  884. dataIndex: 'first_day_order_roi',
  885. key: 'first_day_order_roi',
  886. align: 'center',
  887. width: 110,
  888. sorter: true,
  889. render: (a: any, b: any) => {
  890. if (b?.first_day_order_roi !== undefined && b?.first_day_order_roi !== null) {
  891. return <Statistic value={a ? (a * 100).toFixed(2) : 0} precision={2} valueStyle={{ color: '#3f8600' }} suffix="%" />
  892. } else {
  893. return '--'
  894. }
  895. }
  896. },
  897. ]
  898. return [
  899. ...adArr,
  900. ...adDataArr
  901. ]
  902. }
  903. export default tableDynamicConfig