import { BidStrategyEnum } from '@/services/launchAdq/enum'
import React from 'react'
import { Badge, Space, Tag } from 'antd'
import '../index.less'
import { copy } from '@/utils/utils'
import { ADGROUP_STATUS, AUTO_ACQUISTION_STATUS, GOAL_ENUM } from '../const'
import SwitchStatus from './switchStatus'
import TimeSeriesLook from '@/pages/launchSystemNew/adq/ad/timeSeriesLook'
import CreativePreview from '../../adMonitorListV3/CreativePreview'
import { BID_MODE_ENUM, BID_SCENE_NORMAL_ENUM, MARKETING_CARRIER_TYPE_ENUM, MARKETING_GOAL_ENUM, MARKETING_TARGET_TYPE_ENUM, MARKETING_TARGET_TYPE_GAME_ENUM, OPTIMIZATIONGOAL_ENUM, SITE_SET_ENUM } from '../../tencentAdPutIn/const'
function tableConfig(onChange: () => void, creativeHandle?: (id: number) => void, useType?: 1 | 2): 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,
render: (a: string) => {
return a || '--'
}
},
{
title: '本地备注',
dataIndex: 'remark',
key: 'remark',
align: 'center',
width: 80,
ellipsis: true,
render: (a: string) => {
return a || '--'
}
},
{
title: '广告ID',
dataIndex: 'adgroupId',
key: 'adgroupId',
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 { creativeHandle?.(b?.adgroupId) }}>{a}
// return
}
},
{
title: '投放日期',
dataIndex: 'beginDate',
key: 'beginDate',
align: 'center',
width: 150,
ellipsis: true,
sorter: 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,
align: 'right',
ellipsis: true,
render: (a: string, b: { bidMode: string, optimizationGoal: string }) => {
return `${BID_MODE_ENUM[b?.bidMode as keyof typeof BID_MODE_ENUM]} ${a}元/${b?.bidMode === 'BID_MODE_CPM' ? '千次曝光' : b?.bidMode === 'BID_MODE_CPC' ? '点击' : OPTIMIZATIONGOAL_ENUM[b?.optimizationGoal as keyof typeof OPTIMIZATIONGOAL_ENUM]}`
}
},
{
title: '深度优化行为出价',
dataIndex: 'deepConversionBehaviorBid',
key: 'deepConversionBehaviorBid',
width: 140,
align: 'right',
ellipsis: true,
render: (a: string, b: any) => {
return b?.deepConversionSpec?.deepConversionWorthSpec?.expectedRoi ? b?.deepConversionSpec?.deepConversionWorthSpec?.expectedRoi + '/' + GOAL_ENUM[b?.deepConversionSpec?.deepConversionWorthSpec?.goal as keyof typeof GOAL_ENUM] : '--'
}
},
{
title: '出价类型',
dataIndex: 'smartBidType',
key: 'smartBidType',
align: 'center',
width: 80,
ellipsis: true,
render: (a: string, b: { endDate: string }) => {
return a === 'SMART_BID_TYPE_CUSTOM' ? '手动出价' : '自动出价'
}
},
{
title: useType === 2 ? '出价场景' : '出价策略',
dataIndex: 'bidStrategy',
key: 'bidStrategy',
align: 'center',
width: 70,
ellipsis: true,
render: (a: string, b: { bidScene: string }) => {
if (useType === 2) {
return BID_SCENE_NORMAL_ENUM[b?.bidScene as keyof typeof BID_SCENE_NORMAL_ENUM] || '--'
}
return BidStrategyEnum[a as keyof typeof BidStrategyEnum]
}
},
{
title: '一键起量',
dataIndex: 'autoAcquisitionEnabled',
key: 'autoAcquisitionEnabled',
align: 'center',
width: 70,
render: (a: boolean) => {
return a ? 开启 : 关闭
}
},
{
title: '一键起量状态',
dataIndex: 'autoAcquisitionStatus',
key: 'autoAcquisitionStatus',
align: 'center',
width: 120,
ellipsis: true,
render: (a: string) => AUTO_ACQUISTION_STATUS[a as keyof typeof AUTO_ACQUISTION_STATUS]
},
{
title: '一键起量预算',
dataIndex: 'autoAcquisitionBudget',
key: 'autoAcquisitionBudget',
align: 'right',
width: 70
},
{
title: '广告组日预算(元)',
dataIndex: 'dailyBudget',
key: 'dailyBudget',
align: 'center',
width: 70
},
{
title: '营销目的',
dataIndex: 'marketingGoal',
key: 'marketingGoal',
align: 'center',
width: 80,
ellipsis: true,
render: (a: any) => {
return MARKETING_GOAL_ENUM[a as keyof typeof MARKETING_GOAL_ENUM]
}
},
{
title: '推广产品类型',
dataIndex: 'marketingTargetType',
key: 'marketingTargetType',
align: 'center',
width: 80,
ellipsis: true,
render: (a: any) => {
if (useType === 2) {
return MARKETING_TARGET_TYPE_GAME_ENUM[a as keyof typeof MARKETING_TARGET_TYPE_GAME_ENUM] || '--'
}
return MARKETING_TARGET_TYPE_ENUM[a as keyof typeof MARKETING_TARGET_TYPE_ENUM]
}
},
{
title: '营销载体类型',
dataIndex: 'marketingCarrierType',
key: 'marketingCarrierType',
align: 'center',
width: 80,
ellipsis: true,
render: (a: any) => {
return MARKETING_CARRIER_TYPE_ENUM[a as keyof typeof MARKETING_CARRIER_TYPE_ENUM]
}
},
{
title: '是否开启自动版位功能',
dataIndex: 'automaticSiteEnabled',
key: 'automaticSiteEnabled',
align: 'center',
width: 80,
render: (a: any, b: any) => {
return a ? '开' : '关'
}
},
{
title: '版位选择',
dataIndex: 'siteSet',
key: 'siteSet',
align: 'center',
width: 80,
ellipsis: true,
render: (a: any) => {
return a ? a.map((item: string | number) => SITE_SET_ENUM[item as keyof typeof SITE_SET_ENUM]).toString() : '--'
}
},
{
title: '定向条件描述',
dataIndex: 'targetingTranslation',
key: 'targetingTranslation',
align: 'center',
width: 80,
render: (a: 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: 'systemStatus',
key: 'systemStatus',
align: 'center',
width: 90,
fixed: 'right',
ellipsis: true,
render: (a: string, b: any) => {
return ADGROUP_STATUS[a as keyof typeof ADGROUP_STATUS]
}
},
{
title: '创意预览',
dataIndex: 'dynamicCreativeList',
key: 'dynamicCreativeList',
width: 150,
fixed: 'right',
render: (a: any, b: any) => {
if (a?.length) {
let deliveryMode: string[] = []
let creativePreview = a?.map((item: { creativeComponents: any, deliveryMode: string }) => {
deliveryMode.push(item.deliveryMode)
return { ...item?.creativeComponents }
})
return { creativeHandle?.(b?.adgroupId) }}>详情
}
return null
// return { creativeHandle?.(b?.adgroupId) }}>详情
}
},
{
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/index?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