123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329 |
- 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 <SwitchStatus configuredStatus={a} accountId={b?.accountId} isDeleted={b?.isDeleted} adgroupId={b?.adgroupId} onChange={onChange} />
- }
- },
- {
- title: '所属账号',
- dataIndex: 'accountId',
- key: 'accountId',
- align: 'center',
- width: 80,
- ellipsis: true,
- render: (a: string) => {
- return <Space>
- <a onClick={() => copy(a)} >{a}</a>
- </Space>
- }
- },
- {
- 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 <Space>
- <a onClick={() => copy(a)} >{a}</a>
- </Space>
- }
- },
- {
- 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 <a onClick={() => { creativeHandle?.(b?.adgroupId) }}>{a}</a>
- // return <InputUpdate title={a} dataIndex={'adgroupName'} record={b} handleSave={handleSave} />
- }
- },
- {
- 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 <TimeSeriesLook timeSeries={a} />
- }
- },
- {
- 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 ? <Tag color="success">开启</Tag> : <Tag color="error">关闭</Tag>
- }
- },
- {
- 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 <Badge status={!a ? "processing" : "error"} text={a ? '是' : '否'} />
- }
- },
- {
- 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 <Space><CreativePreview creativePreview={creativePreview} deliveryMode={deliveryMode} /><a onClick={() => { creativeHandle?.(b?.adgroupId) }}>详情</a></Space>
- }
- return null
- // return <Space><BoxOther creativeComponents={a?.[0]?.creativeComponents || {}} /><a onClick={() => { creativeHandle?.(b?.adgroupId) }}>详情</a></Space>
- }
- },
- {
- title: '操作',
- dataIndex: 'cz',
- key: 'cz',
- width: 65,
- align: 'center',
- fixed: 'right',
- render: (a: any, b: any) => {
- return <a style={{ color: '#1890ff' }} onClick={() => 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">腾讯广告</a>
- }
- },
- ]
- }
- export default tableConfig
|