define(["jquery", "easy-admin"], function ($, ea) {

    var init = {
        table_elem: '#currentTable',
        table_render_id: 'currentTableRenderId',
        index_url: 'data.recharge_retain/index',
        add_url: 'data.recharge_retain/add',
        edit_url: 'data.recharge_retain/edit',
        delete_url: 'data.recharge_retain/delete',
        export_url: 'data.recharge_retain/export',
        modify_url: 'data.recharge_retain/modify',
    };

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                toolbar: ['refresh'],
                cols: [[
                    {type: 'checkbox'},
                    {field: 'day_time', width: 100, title: '日期',search: 'rangeDay'},
                    {field: 'ver_code', width: 100, title: '渠道号'},
                    {field: 'appid', width: 100, title: '注册游戏'},
                    {field: 'reg_num', width: 100, title: '注册人数',search:false},
                    {field: 'pay_num', width: 100, title: '充值人数',search:false},
                    {field: 'day1', width: 100, title: '次日留存',search:false},
                    {field: 'day2', width: 100, title: '3日留存',search:false},
                    {field: 'day3', width: 100, title: '4日留存',search:false},
                    {field: 'day4', width: 100, title: '5日留存',search:false},
                    {field: 'day5', width: 100, title: '6日留存',search:false},
                    {field: 'day6', width: 100, title: '7日留存',search:false},
                    {field: 'day14', width: 100, title: '15日留存',search:false},
                    {field: 'day29', width: 100, title: '30日留存',search:false},
                    {field: 'day44', width: 100, title: '45日留存',search:false},
                    {field: 'day59', width: 100, title: '60日留存',search:false},
                    {field: 'day74', width: 100, title: '75日留存',search:false},
                    {field: 'day89', width: 100, title: '90日留存',search:false},
                    {field: 'day119', width: 100, title: '120日留存',search:false},
                    {field: 'day149', width: 100, title: '150日留存',search:false},
                    {field: 'day179', width: 100, title: '180日留存',search:false},
                ]],
            });

            ea.listen();
        },
        add: function () {
            ea.listen();
        },
        edit: function () {
            ea.listen();
        },
    };
    return Controller;
});
