index.js 2.82 KB
/**
 * on shop page store
 * @author: Gexuhui
 * @date: 2017/08/11
 */
import moment from 'moment';
let curDay = moment().format('YYYY-MM-DD');

export default function() {
    return {
        day: curDay,
        date: curDay,
        dateRange: [curDay, curDay],
        beginDate: curDay,
        endDate: curDay,
        today: moment().format('YYYY-MM-DD'),
        yesterday: moment().add(-1, 'days').format('YYYY-MM-DD'),
        day7: moment().add(-6, 'days').format('YYYY-MM-DD'),
        day30: moment().add(-29, 'days').format('YYYY-MM-DD'),

        // curTarget: 'uv',
        curTarget: 'orderCount',
        timeLimit: true,
        overviewParams: {},
        overviewData: {},
        getDataFlag: false,
        overviewName: 'overviewChart',

        // overviewChartData: {uv: [], pv: [], orderCount: [], orderAmount: [], xAxis: []},
        overviewChartData: {orderCount: [], orderAmount: [], xAxis: []},
        targetList: [
            // {
            //     label: '访客数(UV)',
            //     name: 'uv',
            //     chatOpt: {}
            // },
            // {
            //     label: '浏览数(PV)',
            //     name: 'pv',
            //     chatOpt: {}
            // },
            {
                label: '下单数',
                name: 'orderCount',
                chatOpt: {}
            },
            {
                label: '下单金额',
                name: 'orderAmount',
                chatOpt: {}
            },
            {
                label: '支付订单数',
                name: 'paymentOrderCount',
                chatOpt: {}
            },
            {
                label: '支付金额',
                name: 'paymentOrderAmount',
                chatOpt: {}
            }
        ],
        filters: {
            targetColumns: [
                {
                    title: '访客数(UV)',
                    name: 'uv',
                },
                {
                    title: '浏览数(PV)',
                    name: 'pv'
                },
                {
                    title: '下单数',
                    name: 'orderCount'
                },
                {
                    title: '下单金额',
                    name: 'orderAmount'
                },
                {
                    title: '支付订单数',
                    name: 'shipmentOrderCount'
                },
                {
                    title: '支付金额',
                    name: 'shipmentOrderAmount'
                },
                {
                    title: '转化率',
                    name: 'uvOrderRate'
                }
            ],
            dateRange: {
                model: ''
            },
            begin: {
                model: ''
            },
            end: {
                model: ''
            }
        }
    };
}