123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148 |
- import { copy } from "@/utils/utils"
- import { Badge } from "antd"
- import React from "react"
- function tableConfig(tableIdClick: (props: {
- activeKey: string, parma: {
- accountId?: string,//账户ID
- campaignId?: string,//计划ID
- adgroupId?: string,//广告ID
- adcreativeId?: string,//创意ID
- pageId?: string,//落地页ID
- targetingId?: string,//定向ID
- }
- }) => void): any {
- return [
- {
- title: '所属账号',
- dataIndex: 'accountId',
- key: 'accountId',
- align: 'center',
- width: 70,
- fixed: 'left',
- ellipsis: true,
- render: (a: string) => {
- return <a onClick={() => {
- tableIdClick({ activeKey: '1', parma: { accountId: a } })
- }}>{a}</a>
- }
- },
- {
- title: '广告ID',
- dataIndex: 'adgroupId',
- key: 'adgroupId',
- align: 'center',
- width: 85,
- fixed: 'left',
- ellipsis: true,
- render: (a: string) => {
- return <a onClick={() => {
- tableIdClick({ activeKey: '3', parma: { adgroupId: a } })
- }}>{a}</a>
- }
- },
- {
- title: '推广计划ID',
- dataIndex: 'campaignId',
- key: 'campaignId',
- align: 'center',
- width: 85,
- fixed: 'left',
- ellipsis: true,
- render: (a: string) => {
- return <a onClick={() => {
- tableIdClick({ activeKey: '2', parma: { campaignId: a } })
- }}>{a}</a>
- }
- },
- {
- title: '广告名称',
- dataIndex: 'adgroupName',
- key: 'adgroupName',
- width: 280,
- ellipsis: true,
- render: (a: string) => {
- return <a style={{ wordBreak: 'break-all' }} onClick={() => { copy(a) }}>{a}</a>
- }
- },
- {
- title: '执行时间',
- dataIndex: 'createTime',
- key: 'createTime',
- width: 140,
- align: 'center'
- },
- {
- title: '操作者名字',
- dataIndex: 'operationByName',
- key: 'operationByName',
- width: 65,
- align: 'center'
- },
- {
- title: '操作类型名称',
- dataIndex: 'operationName',
- key: 'operationName',
- width: 60,
- align: 'center'
- },
- {
- title: '操作数',
- dataIndex: 'operationCount',
- key: 'operationCount',
- width: 60,
- align: 'center'
- },
- {
- title: '成功数',
- dataIndex: 'successCount',
- key: 'successCount',
- width: 60,
- align: 'center'
- },
- {
- title: '失败数',
- dataIndex: 'failCount',
- key: 'failCount',
- width: 60,
- align: 'center',
- render: (a: number) => {
- return <span style={a > 0 ? { color: 'red' } : {}}>{a}</span>
- }
- },
- {
- title: '状态',
- dataIndex: 'status',
- key: 'status',
- width: 70,
- align: 'center',
- render: (a:any) => {
- let obj={
- '成功':'success',
- '失败':'error',
- '执行中':'warning'
- }
- return <Badge status={obj[a]} text={a} />
- }
- },
- {
- title: '完成时间',
- dataIndex: 'updateTime',
- key: 'updateTime',
- width: 140,
- align: 'center'
- },
- {
- title: '错误消息',
- dataIndex: 'errorMsg',
- key: 'errorMsg',
- width: 400,
- ellipsis: true,
- },
- ]
- }
- export default tableConfig
|