import React from "react"
import { Badge, Space } from "antd"
import { AdStatus, PromotedObjectType, SpeedMode } from "@/services/launchAdq/enum"
import TargetingPopover from "../../components/targetingPopover"
import AdPopover from "../../components/adPopover"
function tableConfig(callback: (data: any, type: 'log' | 'page' | 'copy', allData?: any) => void): any {
return [
{
title: '操作',
dataIndex: 'taskName',
key: 'taskName',
width: 80,
align: 'center',
render: (a: any, b: any) => {
return
{ callback({ taskId: b.id, campaignName: b.campaignName }, 'log', b) }}>日志
{ callback({ taskId: b.id, campaignName: b.campaignName }, 'copy') }}>复制
}
},
{
title: 'ID',
dataIndex: 'id',
key: 'id',
align: 'center',
width: 50,
},
{
title: '计划名称',
dataIndex: 'campaignName',
key: 'campaignName',
align: 'left',
width: 180,
ellipsis: true,
render: (a: any, b: any) => {
return {a || '--'}
}
},
{
title: '计划类型',
dataIndex: 'campaignType',
key: 'campaignType',
align: 'center',
width: 120,
render: (a: any, b: any) => {
if (a) {
return {a === 'CAMPAIGN_TYPE_NORMAL' ? '普通展示广告' : '微信朋友圈广告'}
} else {
return --
}
}
},
{
title: '广告状态',
dataIndex: 'configuredStatus',
key: 'configuredStatus',
align: 'center',
width: 80,
render: (a: any, b: any) => {
if (a) {
return {AdStatus[a]}
} else {
return --
}
}
},
{
title: '推广目标',
dataIndex: 'promotedObjectType',
key: 'promotedObjectType',
align: 'center',
width: 100,
render: (a: any, b: any) => {
if (a) {
return {PromotedObjectType[a]}
} else {
return --
}
}
},
{
title: '投放速度模式',
dataIndex: 'speedMode',
key: 'speedMode',
align: 'center',
width: 90,
render: (a: any, b: any) => {
if (a) {
return {SpeedMode[a]}
} else {
return --
}
}
},
{
title: '广告',
dataIndex: 'sysAdgroupId',
key: 'sysAdgroupId',
align: 'center',
width: 90,
ellipsis: true,
render: (a: any, b: any) => {
if (a) {
return
} else {
return --
}
}
},
{
title: '定向ID',
dataIndex: 'sysTargetingId',
key: 'sysTargetingId',
align: 'center',
width: 80,
render: (a: any, b: any) => {
if (a) {
return {a}
} else {
return --
}
}
},
{
title: '创建时间',
dataIndex: 'createTime',
key: 'createTime',
align: 'center',
width: 140,
render: (a: any, b: any) => {
return {a || '--'}
}
},
{
title: 任务反馈,
dataIndex: 'total',
key: 'total',
render: (a: any, b: any) => {
let errCount = a - (b?.successCount || 0)
return
总条数:{a}条
{成功数:{b?.successCount || 0}条 }
{/* {errCount ? 创建中:{errCount}条 : null} */}
}
}
]
}
export default tableConfig