define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {

    var Controller = {
        index1: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'hobby/index1' + '/ids/'+ Config.ids +location.search,
                    edit_url: 'hobby/edit',
                    del_url: 'hobby/del',
                    table: 'hobby',
                },
            });

            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                columns: [
                    [
                        {checkbox: true},
                        {field: 'id', title: __('Id')},
                        {field: 'study_id', title: __('考试科目名称')},
                        {field: 'finish_class', title: __('课时完成进度(已完成/全部)')},
                        {field: 'required_num', title: __('必修课情况')},
                    ]
                ]
            });

            // 为表格绑定事件
            Table.api.bindevent(table);
        },
        add: function () {
            Controller.api.bindevent();
        },
        edit: function () {
            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;
});