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

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

    var Controller = {

        index: function () {
            ea.table.render({
                init: init,
                cols: [[
                    {type: 'checkbox'},
                    {field: 'product_id', title: '序号',search: false},
                    {field: 'product_name', title: '主游戏名称'},
                    {field: 'add_user', title: '创建人',search: false},
                    {field: 'add_time', title: '添加时间',search: false},
                    {width: 250, title: '操作', templet: ea.table.tool},
                ]],
            });

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