| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207 |
- import { Statistic, Tooltip } from 'antd'
- import { ColumnsType } from 'antd/lib/table'
- import React from 'react'
- import { Link } from 'umi'
- function columns() {
- let newArr: ColumnsType<any> = [
- {
- title: '公众号名称',
- dataIndex: 'channel',
- key: 'channel',
- align: 'center',
- width: 75,
- fixed: 'left',
- },
- {
- title: '投手',
- dataIndex: 'pitcher',
- key: 'pitcher',
- align: 'center',
- width: 50,
- fixed: 'left',
- },
- {
- title: '期数',
- dataIndex: 'stage',
- key: 'stage',
- align: 'center',
- width: 60,
- fixed: 'left',
- },
- {
- title: '状态',
- dataIndex: 'state',
- key: 'state',
- align: 'center',
- width: 40,
- },
- {
- title: '投放位置',
- dataIndex: 'location',
- key: 'location',
- align: 'center',
- width: 40,
- },
- {
- title: '最早消耗日期',
- dataIndex: 'start',
- key: 'start',
- align: 'center',
- width: 70,
- sorter:true,
- },
- {
- title: '最晚消耗日期',
- dataIndex: 'end',
- key: 'end',
- align: 'center',
- width: 70,
- sorter:true,
- },
- {
- title: '累计消耗',
- dataIndex: 'total_cost',
- key: 'total_cost',
- align: 'center',
- width: 80,
- sorter:true,
- render: (a: string) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '累计充值',
- dataIndex: 'total_amount',
- key: 'total_amount',
- align: 'center',
- width: 80,
- sorter:true,
- render: (a: string) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '总毛利额',
- dataIndex: 'profit',
- key: 'profit',
- align: 'center',
- width: 80,
- sorter:true,
- render: (a: number) => {
- return <Statistic value={a || 0} valueStyle={a < 0 ? { color: '#0f990f', fontWeight: 600 } : {}} />
- }
- },
- {
- title: '回本率',
- dataIndex: 'roi',
- key: 'roi',
- align: 'center',
- width: 70,
- sorter:true,
- render: (a: number) => {
- a = a ? parseFloat((a * 100).toFixed(2)) : 0
- return <span style={a <= 8 ? { color: '#0f990f', fontWeight: 600 } : a >= 100 ? { color: 'red', fontWeight: 600 } : {}}> {a + '%'}</span >
- },
- },
- {
- title: '总关注人数',
- dataIndex: 'follow_user',
- key: 'follow_user',
- align: 'center',
- width: 70,
- sorter:true,
- render: (a: any) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '平均关注人数成本',
- dataIndex: 'follow_per_cost',
- key: 'follow_per_cost',
- align: 'center',
- width: 90,
- sorter:true,
- render: (a: string) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '总充值人数',
- dataIndex: 'order_user',
- key: 'order_user',
- align: 'center',
- width: 90,
- sorter:true,
- render: (a: any) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '充值转化比率',
- dataIndex: 'order_tran_rate',
- key: 'order_tran_rate',
- align: 'center',
- width: 90,
- sorter:true,
- render: (a: number) => {
- return a ? (a * 100)?.toFixed(2) + '%' : '0%'
- }
- },
- {
- title: '充值转化成本',
- dataIndex: 'order_tran_cost',
- key: 'order_tran_cost',
- align: 'center',
- width:90,
- sorter:true,
- render: (a: string) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '今日充值',
- dataIndex: 'td_amount',
- key: 'td_amount',
- align: 'center',
- width: 110,
- sorter: true,
- render: (a: any) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '昨日充值',
- dataIndex: 'yd_amount',
- key: 'yd_amount',
- align: 'center',
- width: 110,
- sorter: true,
- render: (a: any) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '前日充值',
- dataIndex: 'byd_amount',
- key: 'byd_amount',
- align: 'center',
- width: 110,
- sorter: true,
- render: (a: any) => {
- return <Statistic value={a || 0} />
- }
- },
- {
- title: '操作',
- dataIndex: 'action',
- key: 'action',
- align: 'center',
- width: 40,
- render: (a: any, b: { channel: string }) => {
- return <Link to={`/dataStatistics/weChat/advertising?channel=${b.channel}`}>进入</Link>
- }
- },
- ]
- return newArr
- }
- export { columns }
|