define (['doT', 'text!temp/auth_template_tpl.html', 'css!style/home.css','pagination','bootstrapJs'], function (doT, template) {
    auth = {
        pageNo: 1, /*第几页*/
        pageSize: 10, /*每页显示多少条*/
        init: function () {
            //初始化dot
            $ ("body").append (template);
            auth.getList ();
            auth.event ();
        },
        event: function () {

        },
        getList: function (pageNo) {
            auth.pageNo   = pageNo;
            var params    = {};
            params.pageNo   = auth.pageNo;
            params.pageSize = auth.pageSize;

            $.ajax ({
                url: '/index/getAuth.html',
                type: 'GET',
                async: true, 
                data: params,
                dataType: 'json',
                success: function (data) {
                    var temp = document.getElementById ('auth_list_tpl').innerHTML;
                    var doTtmpl = doT.template (temp);
                    $ ("#auth_list").html (doTtmpl (data.data.list));

                    /*分页代码*/
                    $ ("#pagediv").pagination ({
                        length: data.data.total,
                        current: pageNo,
                        every: auth.pageSize,
                        onClick: function (el) {
                            auth.getList (el.num.current);
                        }
                    });
                }
            });
        }
    };
    return auth;
});