123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554 |
- import { Statistic, Tooltip } from 'antd'
- import React from 'react'
- import './index.less'
- import { ReactComponent as RocketSvg } from '@/assets/rocket.svg'
- import { TUIGUANGMUBIAO, YOUHUAMUBIAO, CHUJIAFANGSHI } from './enum'
- import Box from './components/box'
- import { GGStateData } from './data'
- import { copy } from '@/utils/utils'
- function columnsMonitor(details: (id: number) => void) {
- return function columns() {
- let newArr: any = [
- {
- title: '数据日期',
- dataIndex: 'beginToEnd',
- key: 'beginToEnd',
- align: 'center',
- width: 100,
- fixed: 'left',
- className: 'padding2',
- render: (str: any, b: any) => {
- return <div style={{ lineHeight: 'normal', fontSize: 10 }}>{str}</div>
- }
- },
- {
- title: '广告名称/ID',
- dataIndex: 'adgroupName',
- key: 'adgroupName',
- align: 'left',
- width: 210,
- className: 'padding2',
- ellipsis: true,
- render: (str: any, b: any) => {
- return <div style={{ display: 'flex', flexFlow: 'column nowrap', transform: 'scale(0.95)' }}>
- <div style={{ color: '#459ae9', fontSize: 10 }} className='oneText' onClick={() => copy(b.adgroupName)}>{b.adgroupName}</div>
- <div style={{ color: '#888', fontSize: 10 }}> 广告ID:{b?.adgroupId}</div>
- </div>
- }
- },
- {
- title: '投放计划名称/ID',
- dataIndex: 'campaignName/campaignId',
- key: 'campaignName/campaignId',
- align: 'left',
- width: 180,
- className: 'padding2',
- ellipsis: true,
- render: (str: any, b: any) => {
- return <div style={{ display: 'flex', flexFlow: 'column nowrap', transform: 'scale(0.95)' }}>
- <div style={{ color: '#459ae9', fontSize: 10 }} className='oneText' onClick={() => copy(b.campaignName)}>{b.campaignName}</div>
- <div style={{ color: '#888', fontSize: 10 }}> 计划ID:{b?.campaignId}</div>
- </div>
- }
- },
- {
- title: '创意名称/ID',
- dataIndex: 'creativeName/creativeId',
- key: 'creativeName/creativeId',
- align: 'left',
- className: 'padding2',
- width: 210,
- render: (str: any, b: any) => {
- return <div style={{ display: 'flex', flexFlow: 'column nowrap', transform: 'scale(0.95)' }}>
- <div style={{ color: '#459ae9', fontSize: 10 }} className='oneText' onClick={() => copy(b.creativeName)}>{b.creativeName}</div>
- <div style={{ color: '#888', fontSize: 10 }}> 创意ID:{b?.creativeId}</div>
- </div>
- }
- },
- {
- title: '创意预览',
- dataIndex: 'creativePreview',
- key: 'creativePreview',
- width: 110,
- align: 'center',
- render: (a: any, b: any) => {
- // return a && a?.length > 0 ? <a href={a[0]} target='_blank'>预览</a> : '--'
- return <Box b={b} />
- }
- },
- {
- title: '广告账户',
- dataIndex: 'accountId',
- key: 'accountId',
- width: 70,
- align: 'center'
- },
- {
- title: '投手',
- dataIndex: 'putUserName',
- key: 'putUserName',
- width: 70,
- align: 'center',
- render: (a: any) => {
- return a || '--'
- }
- },
- {
- title: '创建日期',
- dataIndex: 'adCreateTime',
- key: 'adCreateTime',
- align: 'center',
- width: 110,
- className: 'padding2',
- render: (str: any, b: any) => {
- return <div style={{ lineHeight: 'normal', fontSize: 10 }}>{str}</div>
- }
- },
- {
- title: '广告状态',
- dataIndex: 'adStatus',
- key: 'adStatus',
- align: 'center',
- width: 105,
- ellipsis: true,
- render: (a: any) => {
- return GGStateData[a] || '--'
- }
- },
- // {
- // title: '创意状态',
- // dataIndex: "adCreativeStatus",
- // key: "adCreativeStatus",
- // align: 'center',
- // width: 105,
- // render: (a: any) => {
- // return CHUANGYIZHUANGTAI[a] || '--'
- // }
- // },
- // {
- // title: '购买类型',
- // dataIndex: 'adBuyType',
- // key: 'adBuyType',
- // align: 'center',
- // width: 110,
- // render: (a: any) => {
- // return GOUMAILEIXING[a] || '--'
- // }
- // },
- // {
- // title: '自动扩量',
- // dataIndex: 'autoExpand',
- // key: 'autoExpand',
- // width: 110,
- // align: 'center',
- // render: (a: any) => {
- // return a
- // }
- // },
- // {
- // title: '曝光评估',
- // dataIndex: 'impressionAppraise',
- // key: 'impressionAppraise',
- // align: 'center',
- // width: 115,
- // render: (a: any) => {
- // return a || '--'
- // }
- // },
- {
- title: '投放时间',
- dataIndex: 'adBeginTime',
- key: 'adBeginTime',
- align: 'center',
- width: 120,
- className: 'padding2',
- render: (a: any, b: any) => {
- return a ? <div style={{ display: 'flex', flexFlow: 'column nowrap', lineHeight: 'normal', fontSize: 10 }}>
- <span>{a}</span>
- {/* <span>{b?.adEndDate}</span> */}
- </div> : '--'
- }
- },
- // {
- // title: '当日成本偏差',
- // dataIndex: 'dayCostOffset',
- // key: 'dayCostOffset',
- // align: 'center',
- // width: 90,
- // render: (a: any) => {
- // return a || '--'
- // }
- // },
- {
- title: '推广目标',
- dataIndex: 'promotedObjectType',
- key: 'promotedObjectType',
- align: 'center',
- width: 80,
- ellipsis: true,
- render: (a: any) => {
- return TUIGUANGMUBIAO[a] || '推广公众号'
- }
- },
- // {
- // title: '深度优化目标',
- // dataIndex: 'depthOptimizeTarget',
- // key: 'depthOptimizeTarget',
- // width: 110,
- // align: 'center',
- // render: (a: any) => {
- // return a
- // }
- // },
- {
- title: '广告预算',
- dataIndex: 'adBudget',
- key: 'adBudget',
- align: 'center',
- width: 110,
- render: (a: any) => {
- return a ? <Statistic value={a | 0} /> : '--'
- }
- },
- {
- title: '出价方式',
- dataIndex: 'bidMode',
- key: 'bidMode',
- align: 'center',
- width: 80,
- render: (a: any) => {
- return CHUJIAFANGSHI[a] || '--'
- }
- },
- {
- title: '当前出价',
- dataIndex: 'bidAmount',
- key: 'bidAmount',
- align: 'center',
- width: 80,
- render: (a: any) => {
- return a ? <Statistic value={a | 0} /> : '--'
- }
- },
- // {
- // title: '计划预算',
- // dataIndex: 'planBudget',
- // key: 'planBudget',
- // align: 'center',
- // width: 80,
- // render: (a: any) => {
- // return a ? <Statistic value={a | 0} /> : '--'
- // }
- // },
- {
- title: '广告总消耗',
- dataIndex: 'cost',
- key: 'cost',
- align: 'center',
- width: 100,
- sorter: true,
- render: (a: any) => {
- return <Statistic value={a || 0} />
- }
- },
- // {
- // title: '今日消耗',
- // dataIndex: 'todayCostTotal',
- // key: 'todayCostTotal',
- // align: 'center',
- // width: 105,
- // render: (a: any) => {
- // return <Statistic value={a || 0} />
- // }
- // },
- {
- title: '单位时间消耗速度',
- dataIndex: 'costSpeed',
- key: 'costSpeed',
- align: 'center',
- width: 120,
- className: 'padding2',
- render: (a: any, b: any) => {
- return <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', lineHeight: 'normal', fontSize: 10 }}>
- {/* <div>当前:<span></span></div>
- <div>前第一小时:<span></span></div> */}
- <RocketSvg /> <a onClick={() => details(b)} style={{ marginLeft: 10 }}>详情</a>
- </div>
- }
- },
- {
- title: '曝光量',
- dataIndex: 'viewCount',
- key: 'viewCount',
- align: 'center',
- width: 70,
- sorter: true,
- render: (a: number) => {
- return <span style={a <= 8 ? { color: '#0f990f', fontWeight: 600 } : a >= 100 ? { color: 'red', fontWeight: 600 } : {}}> {a || '--'}</span >
- },
- },
- {
- title: '千次曝光成本',
- dataIndex: 'thousandDisplayPrice',
- key: 'thousandDisplayPrice',
- align: 'center',
- width: 115,
- // sorter: true,
- render: (a: any) => {
- return <Statistic value={a ? a?.toFixed(2) : 0} />
- }
- },
- {
- title: '点击量',
- dataIndex: 'clickCount',
- key: 'clickCount',
- align: 'center',
- width: 70,
- sorter: true,
- render: (a: number) => {
- return <span style={a <= 8 ? { color: '#0f990f', fontWeight: 600 } : a >= 100 ? { color: 'red', fontWeight: 600 } : {}}> {a || '--'}</span >
- },
- },
- {
- title: '点击均价',
- dataIndex: 'avgClickAmount',
- key: 'avgClickAmount',
- align: 'center',
- width: 115,
- // sorter: true,
- render: (a: any) => {
- return <Statistic value={a ? a?.toFixed(2) : 0} />
- }
- },
- {
- title: '点击率',
- dataIndex: 'clickRate',
- key: 'clickRate',
- align: 'center',
- width: 115,
- // sorter: true,
- render: (a: any) => {
- a = a ? parseFloat((a * 100).toFixed(2)) : 0
- return a + '%'
- }
- },
- {
- title: '不感兴趣点击次数',
- dataIndex: 'noInterestCount',
- key: 'noInterestCount',
- align: 'center',
- width: 70,
- sorter: true,
- render: (a: number) => {
- return <span style={a <= 8 ? { color: '#0f990f', fontWeight: 600 } : a >= 100 ? { color: 'red', fontWeight: 600 } : {}}> {a || '--'}</span >
- },
- },
- {
- title: '优化目标',
- dataIndex: 'optimizationGoal',
- key: 'optimizationGoal',
- align: 'center',
- width: 115,
- render: (a: any) => {
- return <Tooltip title={YOUHUAMUBIAO[a]}>
- <div className='oneText'>{YOUHUAMUBIAO[a] || '--'}</div>
- </Tooltip>
- }
- },
- {
- title: '转化目标量',
- dataIndex: 'conversionsCount',
- key: 'conversionsCount',
- align: 'center',
- width: 115,
- sorter: true,
- render: (a: any) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '转化目标成本',
- dataIndex: 'conversionsCost',
- key: 'conversionsCost',
- align: 'center',
- width: 115,
- // sorter: true,
- render: (a: any) => {
- return <Statistic value={a ? a?.toFixed(2) : 0} />
- }
- },
- {
- title: '目标转化率',
- dataIndex: 'conversionsRate',
- key: 'conversionsRate',
- align: 'center',
- width: 115,
- // sorter: true,
- render: (a: any) => {
- a = a ? parseFloat((a * 100).toFixed(2)) : 0
- return a + '%'
- }
- },
- {
- title: '深度转化量',
- dataIndex: 'deepConversionsCount',
- key: 'deepConversionsCount',
- align: 'center',
- width: 115,
- sorter: true,
- render: (a: any) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '下单量',
- dataIndex: 'orderCount',
- key: 'orderCount',
- align: 'center',
- width: 115,
- sorter: true,
- render: (a: any) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '首日新增下单量',
- dataIndex: 'firstDayOrderCount',
- key: 'firstDayOrderCount',
- align: 'center',
- width: 115,
- sorter: true,
- render: (a: any) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '下单成本',
- dataIndex: 'orderCost',
- key: 'orderCost',
- align: 'center',
- width: 115,
- // sorter: true,
- render: (a: any) => {
- return <Statistic value={a ? a?.toFixed(2) : 0} />
- }
- },
- {
- title: '下单率',
- dataIndex: 'orderRate',
- key: 'orderRate',
- align: 'center',
- width: 115,
- // sorter: true,
- render: (a: any) => {
- a = a ? parseFloat((a * 100).toFixed(2)) : 0
- return a + '%'
- }
- },
- {
- title: '下单金额',
- dataIndex: 'orderAmount',
- key: 'orderAmount',
- align: 'center',
- width: 115,
- sorter: true,
- render: (a: any) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '首日新增下单金额',
- dataIndex: 'firstDayOrderAmount',
- key: 'firstDayOrderAmount',
- align: 'center',
- width: 115,
- sorter: true,
- render: (a: any) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '下单客单价',
- dataIndex: 'atvAmount',
- key: 'atvAmount',
- align: 'center',
- width: 115,
- // sorter: true,
- render: (a: any) => {
- return <Statistic value={a ? a?.toFixed(2) : 0} />
- }
- },
- {
- title: '下单ROI',
- dataIndex: 'orderROI',
- key: 'orderROI',
- align: 'center',
- width: 115,
- // sorter: true,
- render: (a: any) => {
- a = a ? parseFloat((a * 100).toFixed(2)) : 0
- return a + '%'
- }
- },
- {
- title: '首日新增下单ROI',
- dataIndex: 'firstDayOrderRoi',
- key: 'firstDayOrderRoi',
- align: 'center',
- width: 115,
- // sorter: true,
- render: (a: any) => {
- a = a ? parseFloat((a * 100).toFixed(2)) : 0
- return a + '%'
- }
- },
- {
- title: '公众号关注人数',
- dataIndex: 'mpFollowUser',
- key: 'mpFollowUser',
- align: 'center',
- width: 115,
- sorter: true,
- render: (a: any) => {
- return a || '--'
- }
- },
- {
- title: '公众号关注率',
- dataIndex: 'mpFollowRate',
- key: 'mpFollowRate',
- align: 'center',
- width: 115,
- // sorter: true,
- render: (a: any) => {
- a = a ? parseFloat((a * 100).toFixed(2)) : 0
- return a + '%'
- }
- },
- {
- title: '公众号关注成本',
- dataIndex: 'mpFollowCost',
- key: 'mpFollowCost',
- align: 'center',
- width: 115,
- // sorter: true,
- render: (a: any) => {
- return <Statistic value={a ? a?.toFixed(2) : 0} />
- }
- },
- {
- title: '操作',
- dataIndex: 'event',
- key: 'event',
- align: 'center',
- width: 90,
- render: (a: any, b: any) => {
- return <a style={{ color: '#1890ff' }} onClick={() => window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/adgroup?query={%22operation_status%22:[%22CALCULATE_STATUS_EXCLUDE_DEL%22],%22system_status%22:[],%22search_name%22:%2${b.adgroupId}%22}`)} target="_blank">腾讯广告</a>
- }
- }
- ]
- return newArr
- }
- }
- export default columnsMonitor
|