import { AdStatusEnum, BidModeEnum, BidStrategyEnum, OptimizationGoalEnum, PromotedObjectType } from '@/services/launchAdq/enum'
import React from 'react'
import { Badge, Popover, Space } from 'antd'
import Box from '@/pages/adMonitor/adMonitorList/components/box'
import SwitchStatus from './switchStatus'
import TimeSeriesLook from './timeSeriesLook'
import { ReactComponent as RocketSvg } from '@/assets/rocket.svg'
import '../index.less'
import { copy } from '@/utils/utils'
import InputUpdate from './inputUpdate'
function tableConfig(
onChange: () => void,
details: (data: any) => void,
handleSave: (data: any) => void,
handleSaveDaily: (data: any) => void
): any {
return [
{
title: '启停',
dataIndex: 'configuredStatus',
key: 'configuredStatus',
align: 'center',
width: 40,
fixed: 'left',
render: (a: string, b: any) => {
return
}
},
{
title: '所属账号',
dataIndex: 'accountId',
key: 'accountId',
align: 'center',
width: 80,
ellipsis: true,
render: (a: string) => {
return
copy(a)} >{a}
}
},
{
title: '腾讯备注',
dataIndex: 'memo',
key: 'memo',
align: 'center',
width: 80,
ellipsis: true,
},
{
title: '本地备注',
dataIndex: 'remark',
key: 'remark',
align: 'center',
width: 80,
ellipsis: true,
},
{
title: '广告ID',
dataIndex: 'adgroupId',
key: 'adgroupId',
align: 'center',
width: 100,
ellipsis: true,
render: (a: string, b: any) => {
return
copy(a)} >{a}
}
},
{
title: '所属计划ID',
dataIndex: 'campaignId',
key: 'campaignId',
align: 'center',
width: 100,
ellipsis: true,
render: (a: string, b: any) => {
return
copy(a)} >{a}
}
},
{
title: '投手',
dataIndex: 'putUserName',
key: 'putUserName',
align: 'center',
width: 70,
ellipsis: true
},
{
title: '广告名称',
dataIndex: 'adgroupName',
key: 'adgroupName',
width: 280,
ellipsis: true,
render: (a: string, b: any) => {
return
}
},
{
title: '推广目标类型',
dataIndex: 'promotedObjectType',
key: 'promotedObjectType',
align: 'center',
width: 75,
ellipsis: true,
render: (a: string | number) => {
return PromotedObjectType[a]
}
},
{
title: '投放日期',
dataIndex: 'beginDate',
key: 'beginDate',
align: 'center',
width: 150,
ellipsis: true,
render: (a: string, b: { endDate: string }) => {
return b?.endDate ? a + '~' + b.endDate : a + '~' + '长期投放'
}
},
{
title: '投放时间',
dataIndex: 'timeSeries',
key: 'timeSeries',
align: 'center',
width: 55,
render: (a: string, b: { endDate: string }) => {
return
}
},
{
title: '首日开始投放时间',
dataIndex: 'firstDayBeginTime',
key: 'firstDayBeginTime',
align: 'center',
width: 70,
},
{
title: '出价',
dataIndex: 'bidAmount',
key: 'bidAmount',
width: 140,
ellipsis: true,
render: (a: string, b: { bidMode: string, optimizationGoal: string }) => {
return `${BidModeEnum[b?.bidMode]} ${a}元/${b?.bidMode === 'BID_MODE_CPM' ? '千次曝光' : b?.bidMode === 'BID_MODE_CPC' ? '点击' : OptimizationGoalEnum[b?.optimizationGoal]}`
}
},
{
title: '深度优化ROI',
dataIndex: 'expectedRoi',
key: 'expectedRoi',
width: 70,
align: 'center',
ellipsis: true,
render: (a: string, b: { deepConversionSpec: any }) => {
return b?.deepConversionSpec?.deepConversionWorthSpec?.expectedRoi || '--'
}
},
{
title: '出价类型',
dataIndex: 'smartBidType',
key: 'smartBidType',
align: 'center',
width: 80,
ellipsis: true,
render: (a: string, b: { endDate: string }) => {
return a === 'SMART_BID_TYPE_CUSTOM' ? '手动出价' : '自动出价'
}
},
{
title: '出价类型',
dataIndex: 'bidStrategy',
key: 'bidStrategy',
align: 'center',
width: 70,
ellipsis: true,
render: (a: string, b: { endDate: string }) => {
return BidStrategyEnum[a]
}
},
{
title: '广告组日预算(元)',
dataIndex: 'dailyBudget',
key: 'dailyBudget',
align: 'center',
width: 70,
render: (a: string, b: any) => {
return
}
},
{
title: '是否开启自动版位功能',
dataIndex: 'automaticSiteEnabled',
key: 'automaticSiteEnabled',
align: 'center',
width: 80,
render: (a: any, b: any) => {
return a ? '开' : '关'
}
},
{
title: '创建时间',
dataIndex: 'createdTime',
key: 'createdTime',
align: 'center',
width: 140,
ellipsis: true,
},
{
title: '是否已删除',
dataIndex: 'isDeleted',
key: 'isDeleted',
align: 'center',
width: 60,
render: (a: any, b: any) => {
return
}
},
{
title: '广告状态',
dataIndex: 'status',
key: 'status',
align: 'center',
width: 70,
fixed: 'right',
ellipsis: true,
render: (a: string, b: any) => {
return b?.rejectMessageList?.filter((str: any) => str)?.length > 0 ? {
return str ? <>{eq + 1}:{str}
> : ""
})}>
{AdStatusEnum[a]}
:
AdStatusEnum[a]
}
},
{
title: '创意预览',
dataIndex: 'creativePreview',
key: 'creativePreview',
width: 70,
align: 'center',
fixed: 'right',
render: (a: any, b: any) => {
return
}
},
{
title: '单位时间消耗速度',
dataIndex: 'costSpeed',
key: 'costSpeed',
align: 'center',
width: 80,
className: 'padding2',
fixed: 'right',
render: (a: any, b: any) => {
return
}
},
{
title: '操作',
dataIndex: 'cz',
key: 'cz',
width: 65,
align: 'center',
fixed: 'right',
render: (a: any, b: any) => {
return window.open(`https://ad.qq.com/atlas/${b?.accountId}/admanage/adgroup?tab=adgroup&query={%22operation_status%22:[%22CALCULATE_STATUS_EXCLUDE_DEL%22],%22system_status%22:[],%22search_name%22:%22${b.adgroupId}%22}`)} target="_blank">腾讯广告
}
},
]
}
export default tableConfig