/**
 * @file 盯盘基础展示数据
 * @author zhuxinbo(zhuxinbo@c-top.com.cn)
 */
import moment from 'moment'
class keepPersonServer {
    constructor() {}

    // 固定不可删除的列-账户
    setNoDeleteColumns() {
        return [
            {
                title: '账户名称',
                dataIndex: 'authName',
                scopedSlots: { customRender: 'authName' },
                align: 'center',
                key: 'date',
                width: 200,
                fixed: 'left',
            },
            {
                title: '运营人员',
                dataIndex: 'realname',
                align: 'center',
                width: 100,
                fixed: 'left',
            },
            {
                title: '消耗',
                dataIndex: 'cost',
                scopedSlots: { customRender: 'cost' },
                align: 'center',
                width: 100,
                fixed: 'left',
                sorter: () => {},
            },
            {
                title: '余额',
                dataIndex: 'totalBalance',
                align: 'center',
                width: 100,
                fixed: 'left',
                sorter: () => {},
            },
            {
                title: '预算',
                dataIndex: 'budget',
                width: 150,
                tip: '广告在投放期间的花费总额',
                align: 'center',
                customRender: function (text) {
                    if (text>0) {
                        return text
                    } else {
                        return '不限制预算'
                    }
                },
            }
        ]
    }

    // 固定不可删除的列-项目
    setNoDeleteProjectColumns() {
        return [
            {
                title: '项目名称',
                dataIndex: 'projectName',
                scopedSlots: { customRender: 'projectName' },
                align: 'center',
                key: 'date',
                width: 200,
                fixed: 'left',
            },
            {
                title: '账户数量',
                dataIndex: 'accountCount',
                align: 'center',
                width: 100,
                fixed: 'left',
            },
            {
                title: '运营人数',
                dataIndex: 'userCount',
                scopedSlots: { customRender: 'userCount' },
                align: 'center',
                width: 100,
                fixed: 'left',
            },
            {
                title: '花费',
                dataIndex: 'cost',
                align: 'center',
                width: 100,
                fixed: 'left',
                sorter: () => {},
            }
        ]
    }

    // 默认初始展示列
    setDefaultColumns() {
        return [
            {
                title: '封面曝光数',
                dataIndex: 'photoShow',
                tip: '广告在瀑布流被观看次数',
                align: 'center',
                scopedSlots: { customRender: 'photoShow' },
                sorter: () => {},
            },
            {
                title: '封面点击数',
                dataIndex: 'photoClick',
                tip: '用户点击封面进入视频播放页的次数(数据会进行反作弊去重)',
                align: 'center',
        
                scopedSlots: { customRender: 'photoClick' },
                sorter: () => {},
            },
            {
                title: '封面点击率',
                dataIndex: 'clickRate',
                tip: '封面点击数占封面展示数百分比',
                align: 'center',
                scopedSlots: { customRender: 'clickRate' },
                sorter: () => {},
            },
            {
                title: '素材曝光数',
                dataIndex: 'aClick',
                tip: '用户进入视频播放页观看的次数(数据会进行反作弊去重)',
                align: 'center',
        
                scopedSlots: { customRender: 'aClick' },
                sorter: () => {},
            },
            {
                title: '行为数',
                dataIndex: 'bClick',
                tip: '用户在视频播放页单击转化按钮的次数/展示数*100%',
                align: 'center',
        
                scopedSlots: { customRender: 'bClick' },
                sorter: () => {},
            },
        
            {
                title: '行为率',
                dataIndex: 'bClickRate',
                tip: '行为数占素材曝光数百分比',
                align: 'center',
                scopedSlots: { customRender: 'bClickRate' },
                sorter: () => {},
            },
            {
                title: '平均千次封面曝光花费（元）',
                dataIndex: 'cpm',
                tip: '花费/封面曝光数*1000',
                align: 'center',
                scopedSlots: { customRender: 'cpm' },
                sorter: () => {},
            },
            {
                title: '平均封面点击单价（元）',
                dataIndex: 'cpc',
                tip: '花费／封面点击数',
                align: 'center',
                scopedSlots: { customRender: 'cpc' },
                sorter: () => {},
            },
            {
                title: '平均行为单价（元）',
                dataIndex: 'cpb',
                tip: '总花费/行为数',
                align: 'center',
                scopedSlots: { customRender: 'cpb' },
                sorter: () => {},
            },
        ]
    }

    //时间段筛选
    setTimeRange() {
        return {
            昨天: [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
            // 今天: [moment(), moment()],
    
            近三天: [moment().subtract(3, 'days'), moment().subtract(1, 'days')],
            近一周: [moment().subtract(7, 'days'), moment().subtract(1, 'days')],
            近14天: [moment().subtract(14, 'days'), moment().subtract(1, 'days')],
            近一月: [moment().subtract(1, 'months'), moment().subtract(1, 'days')],
            近半年: [moment().subtract(6, 'months'), moment().subtract(1, 'days')],
            近一年: [moment().subtract(12, 'months'), moment().subtract(1, 'days')],
        }
    }

    //运营人员表格字段
    setOperateField() {
        return  [
            {
                title: '运营人员',
                dataIndex: 'realName',
                scopedSlots: { customRender: 'realName' },
                align: 'center',
                key: 'date',
                width: 100,
            },
            {
                title: '账户数量',
                dataIndex: 'accountCount',
                align: 'center',
                width: 100,
            },
            {
                title: '消耗',
                dataIndex: 'charge',
                scopedSlots: { customRender: 'charge' },
                align: 'center',
                width: 150,
            },
            {
                title: '本周消耗',
                dataIndex: 'weekCharge',
                align: 'center',
                width: 150,
            },
            {
                title: '消耗环比',
                dataIndex: 'grew',
                width: 150,
                tip: '广告在投放期间的花费总额',
                align: 'center',
            },
            {
                title: '有效素材数',
                dataIndex: 'effectiveCount',
                width: 150,
                tip: '广告在投放期间的花费总额',
                align: 'center',
            },
            {
                title: '新上计划数',
                dataIndex: 'campaignCount',
                width: 150,
                tip: '广告在投放期间的花费总额',
                align: 'center',
            },
            {
                title: '新上组数',
                dataIndex: 'unitCount',
                width: 150,
                tip: '广告在投放期间的花费总额',
                align: 'center',
            }
        ]
    }


}

export default new keepPersonServer();
