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

    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'school/classes/classes_lib/index' + location.search,
                    add_url: 'school/classes/classes_lib/addnew'+ location.search,
                    addnew_url: 'school/classes/classes_lib/addnew'+ location.search,
                    edit_url: 'school/classes/classes_lib/edit'+ location.search,
                    copy_url: 'school/classes/classes_lib/copy'+ location.search,
                    url_url: 'school/classes/classes_lib/url',

                    lookminiqrcode_url: 'school/classes/classes_lib/lookminiqrcode',
                    miniqrcode_url: 'school/classes/classes_lib/miniqrcode',

                    del_url: 'school/classes/classes_lib/del',
                    multi_url: 'school/classes/classes_lib/multi',
                    import_url: 'school/classes/classes_lib/import',
                    table: 'school_classes_lib',
                }
            });

            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'weigh',
                fixedColumns: true,
                fixedRightNumber: 2,
                asyndownload: true,
                columns: [
                    [

                        {checkbox: true},

                        {field: 'id', title: __('Id')},
                        {field: 'title', title: __('Title'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                        {field: 'headimage', title: __('Headimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
                        {field: 'has_expire', title: __('Has_expire'), searchList: {"1":__('Has_expire 1'),"2":__('Has_expire 2')}, formatter: Table.api.formatter.normal},


                        {field: 'auth_status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status},


                        {field: 'feel', title: __('是否免费'), searchList: {"0":__('付费课程'),"1":__('免费课程')}, formatter: Table.api.formatter.normal},
                        {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status},

                        // {field: 'classes_type_name', title: __('类型'), operate: false},
                        {field: 'classes_type', title: __('类型'), searchList: classesTypeListJson, formatter: Table.api.formatter.normal},


                        {field: 'classes_cate_title', title: __('Classes_cate_ids'), operate: false, formatter: Table.api.formatter.flag},
                        {field: 'classes_label_title', title: __('Classes_label_ids'), operate: false, formatter: Table.api.formatter.flag},
                        {field: 'classes_cate_ids', title: __('Classes_cate_ids'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content,visible:false},
                        {field: 'classes_label_ids', title: __('Classes_label_ids'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content,visible:false},
                        {field: 'self_label_tag', title: __('Self_label_tag'), operate: 'LIKE', formatter: Table.api.formatter.flag},

                        {field: 'images', title: __('Images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},

                        {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                        {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},


                        {field: 'reason', title: __('Reason'), operate: 'LIKE' },
                        {field: 'auth_time', title: __('Auth_time'), operate:'RANGE',visible:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},

                        {field: 'type', title: __('Type'), searchList: {"out":__('Type out'),"in":__('Type in')}, formatter: Table.api.formatter.normal},
                        {field: 'classes_num', title: __('Classes_num'),sortable:true},

                        {field: 'limit_num', title: __('Limit_num'),sortable:true},
                        {field: 'sign_num', title: __('Sign_num'),sortable:true},
                        {field: 'verification_num', title: __('Verification_num'),sortable:true},

                         {field: 'collect', title: __('实际收藏量'),sortable:true},
                        {field: 'views', title: __('浏览量'),sortable:true},

                        {field: 'classes_star', title: __('课程评分'),sortable:true},
                        {field: 'star_number', title: __('评价数'),sortable:true},


                        {field: 'address_type', title: __('Address_type'), searchList: {"1":__('Address_type 1'),"2":__('Address_type 2')}, formatter: Table.api.formatter.normal},
                        {field: 'sale', title: __('Sale'),sortable:true},
                        {field: 'price', title: __('Price'),sortable:true, operate:'BETWEEN'},
                        {field: 'underline_price', title: __('Underline_price'),sortable:true, operate:'BETWEEN'},
                        {field: 'admin_id', title: __('Admin_id'),visible:false},
                        {field: 'teacher_id', title: __('老师id'),visible:false},
                        {field: 'weigh', title: __('Weigh'),sortable:true, operate: false},
                        {field: 'recommend', title: __('Recommend'),sortable:true, searchList: {"0":__('Recommend 0'),"1":__('Recommend 1')}, formatter: Table.api.formatter.normal},
                        {field: 'hot', title: __('Hot'),sortable:true, searchList: {"0":__('Hot 0'),"1":__('Hot 1')}, formatter: Table.api.formatter.normal},
                        {field: 'new', title: __('New'),sortable:true, searchList: {"0":__('New 0'),"1":__('New 1')}, formatter: Table.api.formatter.normal},
                        {field: 'selfhot', title: __('Selfhot'),sortable:true, searchList: {"0":__('Selfhot 0'),"1":__('Selfhot 1')}, formatter: Table.api.formatter.normal},

                        {field: 'manystore_id', title: __('Manystore_id'),visible:false},
                        {field: 'shop_id', title: __('Shop_id'),visible:false},
                        {field: 'user_id', title: __('User_id'),visible:false},
                        {field: 'add_type', title: __('Add_type'), searchList: {"1":__('Add_type 1'),"2":__('Add_type 2')}, formatter: Table.api.formatter.normal,visible:false},
                        {field: 'add_id', title: __('Add_id'),visible:false},
                        {field: 'address_city', title: __('Address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content,visible:false},
                        {field: 'province', title: __('Province'),visible:false},
                        {field: 'city', title: __('City'),visible:false},
                        {field: 'district', title: __('District'),visible:false},
                        {field: 'address', title: __('Address'), operate: 'LIKE',visible:false},
                        {field: 'address_detail', title: __('Address_detail'), operate: 'LIKE',visible:false},
                        {field: 'longitude', title: __('Longitude'), operate: 'LIKE',visible:false},
                        {field: 'latitude', title: __('Latitude'), operate: 'LIKE',visible:false},
                        {field: 'classes_date_text', title: __('Classes_date_text'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                        {field: 'classes_time_text', title: __('Classes_time_text'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                        {field: 'virtual_num', title: __('Virtual_num')},


                        {field: 'virtual_collect', title: __('Virtual_collect')},
                        {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                        {field: 'updatetime', title: __('Updatetime'),visible:false, operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
                        {field: 'manystore.nickname', title: __('Manystore.nickname'), operate: 'LIKE'},
                        {field: 'shop.name', title: __('Shop.name'), operate: 'LIKE'},
                        {field: 'shop.image', title: __('Shop.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
                        {field: 'shop.address_city', title: __('Shop.address_city'),visible:false, operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
                        {field: 'shop.province', title: __('Shop.province'),visible:false},
                        {field: 'shop.city', title: __('Shop.city'),visible:false},
                        {field: 'shop.district', title: __('Shop.district'),visible:false},
                        {field: 'shop.address', title: __('Shop.address'),visible:false, operate: 'LIKE'},
                        {field: 'shop.address_detail', title: __('Shop.address_detail'),visible:false, operate: 'LIKE'},
                        {field: 'user.nickname', title: __('User.nickname'),visible:false, operate: 'LIKE'},
                        {field: 'user.realname', title: __('User.realname'),visible:false, operate: 'LIKE'},
                        {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
                        {field: 'user.avatar', title: __('User.avatar'),visible:false, operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
                        {field: 'admin.nickname', title: __('Admin.nickname'),visible:false, operate: 'LIKE'},

                        {field: 'miniqrcode_link', title: __('微信小程序端展示'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
                        {field: 'operate', title: __('Operate'), table: table , buttons: [
                                {name: 'url',
                                    text: '查看小程序链接',
                                    icon: 'fa fa-chain',
                                    classname: 'btn btn-ajax',
                                    url: $.fn.bootstrapTable.defaults.extend.url_url,
                                    confirm: '查看小程序链接',
                                    dropdown : '更多',
                                    success: function (data, ret) {
                                        //JS将内容放入复制板
                                        try {
                                            navigator.clipboard.writeText(ret.msg);
                                            console.log('Text copied to clipboard');
                                            Layer.alert("已自动复制内容 : " + ret.msg );
                                        } catch (err) {
                                            console.error('Failed to copy: ', err);
                                            Layer.alert("浏览器不支持复制，请自行复制 : " + ret.msg );
                                        }

                                        $(".btn-refresh").trigger("click");
                                    },
                                    error: function (data, ret) {
                                        Layer.alert(ret.msg);
                                        return false;
                                    },
                                    // visible: function (row) {
                                    //     //显示条件 只能待入住订单
                                    //     if(row.status == '3'){
                                    //         return true;
                                    //     }
                                    //     return false;
                                    // }
                                },
                                {
                                    name: 'classes_spec',
                                    text: __('复制并创建课程'),
                                    title: __('复制课程信息并创建成新课程'),
                                    classname: 'btn btn-dialog',
                                    icon: 'fa fa-files-o',
                                    dropdown : '更多',
                                    url: $.fn.bootstrapTable.defaults.extend.copy_url,
                                    callback: function (data) {

                                    },
                                    // visible: function (row) {
                                    //     return row.status == '2'||row.status == '3';
                                    // }
                                },
                                {
                                    name: 'classes_spec',
                                    text: __('课时查看'),
                                    title: __('课时查看'),
                                    classname: 'btn   btn-dialog',
                                    icon: 'fa fa-calendar-check-o',
                                    dropdown : '更多',
                                    url: classes_spec_url,
                                    callback: function (data) {

                                    },
                                    // visible: function (row) {
                                    //     return row.status == '2'||row.status == '3';
                                    // }
                                },
                                {
                                    name: 'virtual_user',
                                    text: __('设置虚拟参与者'),
                                    title: __('设置虚拟参与者'),
                                    classname: 'btn  btn-dialog',
                                    icon: 'fa fa-user',
                                    dropdown : '更多',
                                    url: virtual_user_url,
                                    callback: function (data) {

                                    },
                                    // visible: function (row) {
                                    //     return row.status == '2'||row.status == '3';
                                    // }
                                },



                                {
                                    name: 'teacher',
                                    text: __('主讲老师信息'),
                                    title: __('主讲老师信息'),
                                    classname: 'btn  btn-dialog',
                                    icon: 'fa fa-user',
                                    dropdown : '更多',
                                    url: teacher_url,
                                    callback: function (data) {

                                    },
                                    // visible: function (row) {
                                    //     return row.status == '2'||row.status == '3';
                                    // }
                                },
                                {
                                    name: 'order',
                                    text: __('课程订单查看'),
                                    title: __('课程订单查看'),
                                    classname: 'btn  btn-dialog',
                                    icon: 'fa fa-cart-arrow-down',
                                    dropdown : '更多',
                                    url: order_url,
                                    callback: function (data) {

                                    },
                                    // visible: function (row) {
                                    //     return row.status == '2'||row.status == '3';
                                    // }
                                },
                                {
                                    name: 'classes_hourorder',
                                    text: __('课时预约记录'),
                                    title: __('课时预约记录'),
                                    classname: 'btn btn-dialog',
                                    icon: 'fa fa-calendar',
                                    dropdown : '更多',
                                    url: classes_hourorder_url,
                                    callback: function (data) {

                                    },
                                    // visible: function (row) {
                                    //     return row.status == '2'||row.status == '3';
                                    // }
                                },
                                {
                                    name: 'evaluate',
                                    text: __('查看用户评价'),
                                    title: __('查看用户评价'),
                                    classname: 'btn btn-dialog',
                                    icon: 'fa fa-handshake-o',
                                    dropdown : '更多',
                                    url: evaluate_url,
                                    callback: function (data) {

                                    },
                                    // visible: function (row) {
                                    //     return row.classes_evaluate_id;
                                    // }
                                },

                                {
                                    name: 'visit',
                                    text: __('查看用户访问记录'),
                                    title: __('查看用户访问记录'),
                                    classname: 'btn btn-dialog',
                                    icon: 'fa fa-handshake-o',
                                    dropdown : '更多',
                                    url: visit_url,
                                    callback: function (data) {

                                    },
                                    // visible: function (row) {
                                    //     return row.classes_evaluate_id;
                                    // }
                                },

                                {
                                    name: 'manystore',
                                    text: __('查看机构'),
                                    title: __('查看机构'),
                                    classname: 'btn btn-dialog',
                                    icon: 'fa fa-home',
                                    dropdown : '更多',
                                    url: manystore_url,
                                    callback: function (data) {

                                    },
                                    // visible: function (row) {
                                    //     return row.classes_evaluate_id;
                                    // }
                                },


                                //
                                // {name: 'unsetmockauth',
                                //     text: '取消加圈资格',
                                //     icon: 'fa fa-sign-in',
                                //     classname: 'btn btn-xs btn-danger btn-magic btn-ajax',
                                //     url: $.fn.bootstrapTable.defaults.extend.unsetmockauth_url,
                                //     confirm: '（分车版本）确认取消用户加圈资格！',
                                //     success: function (data, ret) {
                                //         Layer.alert(ret.msg );
                                //         $(".btn-refresh").trigger("click");
                                //     },
                                //     error: function (data, ret) {
                                //         Layer.alert(ret.msg);
                                //         return false;
                                //     },
                                //     visible: function (row) {
                                //         //显示条件 只能待入住订单
                                //         if((row.status == 2 || row.status == 3) && row.mock_type == "base" &&  row.add_mock_status == "2"){
                                //             return true;
                                //         }
                                //         return false;
                                //     }},

                            ], events: Table.api.events.operate, formatter: Table.api.formatter.operate},



                        // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
                    ]
                ]
            });
             $(document).on('click', '.btn-changeuser', function (event) {
                    var url = $(this).attr('data-url');
                    if(!url) return false;
                    var title = $(this).attr('title');
                    var width = $(this).attr('data-width');
                    var height = $(this).attr('data-height');
                    // var ids = $(this).attr('data-id');
                    var area = ['98%','98%'];
                    var options = {
                        shadeClose: false,
                        shade: [0.3, '#393D49'],
                        area: area,
                        callback:function(ret){//回调方法，需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果;
                            Fast.api.close(ret);
                        }
                    };
                    Fast.api.open(url,title,options);
           });

          Form.api.bindevent($("form[role=form]"));

            // 为表格绑定事件
            Table.api.bindevent(table);
        },
        recyclebin: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    'dragsort_url': ''
                }
            });

            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: 'school/classes/classes_lib/recyclebin' + location.search,
                pk: 'id',
                sortName: 'id',
                columns: [
                    [
                        {checkbox: true},
                        {field: 'id', title: __('Id')},
                        {field: 'title', title: __('Title'), align: 'left'},
                        {
                            field: 'deletetime',
                            title: __('Deletetime'),
                            operate: 'RANGE',
                            addclass: 'datetimerange',
                            formatter: Table.api.formatter.datetime
                        },
                        {
                            field: 'operate',
                            width: '140px',
                            title: __('Operate'),
                            table: table,
                            events: Table.api.events.operate,
                            buttons: [
                                {
                                    name: 'Restore',
                                    text: __('Restore'),
                                    classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
                                    icon: 'fa fa-rotate-left',
                                    url: 'school/classes/classes_lib/restore',
                                    refresh: true
                                },
                                {
                                    name: 'Destroy',
                                    text: __('Destroy'),
                                    classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
                                    icon: 'fa fa-times',
                                    url: 'school/classes/classes_lib/destroy',
                                    refresh: true
                                }
                            ],
                            formatter: Table.api.formatter.operate
                        }
                    ]
                ]
            });

            // 为表格绑定事件
            Table.api.bindevent(table);


        },

        add: function () {
            Controller.api.bindevent();
            generrate.setOfflineType($("input:radio[name='row[address_type]']").val());
        },
        addnew: function () {


 //因为日期选择框不会触发change事件，导致无法刷新textarea，所以加上判断
            $(document).on("dp.change", "#add-form .datetimerange", function () {
                $(this).parent().prev().find("input").trigger("change");
            });

            $(document).on("dp.change", "#add-form .datetimepicker", function () {
                $(this).parent().prev().find("input").trigger("change");
            });

            $(document).on("fa.event.appendfieldlist", "#add-form .btn-append", function (e, obj) {
                 // Form.api.bindevent($("form[role=form]"));
                // // //绑定动态下拉组件
                 Form.events.selectpage(obj);
                // // //绑定日期组件
                 Form.events.daterangepicker(obj);
                 Form.events.datetimepicker(obj);
                // // Form.events.datetimerange(obj);
                // Form.api.bindevent(this);
                // //绑定上传组件
                // Form.events.faupload(obj);

                // //上传成功回调事件，变更按钮的背景
                // $(".upload-image", obj).data("upload-success", function (data) {
                //     $(this).css("background-image", "url('" + Fast.api.cdnurl(data.url) + "')");
                // })
            });

            generrate.setOfflineType($("input:radio[name='row[address_type]']").val());
             Controller.api.bindevent();
        },
        edit: function () {

             //因为日期选择框不会触发change事件，导致无法刷新textarea，所以加上判断
            $(document).on("dp.change", "#edit-form .datetimerange", function () {
                $(this).parent().prev().find("input").trigger("change");
            });

            $(document).on("dp.change", "#edit-form .datetimepicker", function () {
                $(this).parent().prev().find("input").trigger("change");
            });

            $(document).on("fa.event.appendfieldlist", "#edit-form .btn-append", function (e, obj) {
                 // Form.api.bindevent($("form[role=form]"));
                // // //绑定动态下拉组件
                Form.events.selectpage(obj);
                // // //绑定日期组件
                 Form.events.daterangepicker(obj);
                 Form.events.datetimepicker(obj);
                 Form.events.selectpicker(obj);
                 // Form.events.switcher(obj);

                // // Form.events.datetimerange(obj);
                // Form.api.bindevent(this);
                // //绑定上传组件
                // Form.events.faupload(obj);

                // //上传成功回调事件，变更按钮的背景
                // $(".upload-image", obj).data("upload-success", function (data) {
                //     $(this).css("background-image", "url('" + Fast.api.cdnurl(data.url) + "')");
                // })
            });


            Controller.api.bindevent();
        },
        copy: function () {

            //因为日期选择框不会触发change事件，导致无法刷新textarea，所以加上判断
            $(document).on("dp.change", "#edit-form .datetimerange", function () {
                $(this).parent().prev().find("input").trigger("change");
            });

            $(document).on("dp.change", "#edit-form .datetimepicker", function () {
                $(this).parent().prev().find("input").trigger("change");
            });

            $(document).on("fa.event.appendfieldlist", "#edit-form .btn-append", function (e, obj) {
                // Form.api.bindevent($("form[role=form]"));
                // // //绑定动态下拉组件
                Form.events.selectpage(obj);
                // // //绑定日期组件
                Form.events.daterangepicker(obj);
                Form.events.datetimepicker(obj);
                Form.events.selectpicker(obj);
                // Form.events.switcher(obj);

                // // Form.events.datetimerange(obj);
                // Form.api.bindevent(this);
                // //绑定上传组件
                // Form.events.faupload(obj);

                // //上传成功回调事件，变更按钮的背景
                // $(".upload-image", obj).data("upload-success", function (data) {
                //     $(this).css("background-image", "url('" + Fast.api.cdnurl(data.url) + "')");
                // })
            });


            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                $("#c-address_city").on("cp:updated", function() {
                    var citypicker = $(this).data("citypicker");
                    var province = citypicker.getCode("province");
                    var city = citypicker.getCode("city");
                    var district = citypicker.getCode("district");
                    if(province){
                        $("#province").val(province);
                    }
                    if(city){
                        $("#city").val(city);
                    }
                    if(district){
                        $("#district").val(district);
                    }
                    $(this).blur();
                });

                generrate.listen();


                //老师必须是上面机构中的
                $("#c-teacher_id").data("params", function (obj) {
                    //obj为SelectPage对象
                     return {custom: {shop_id: $("#c-shop_id").val()}};
                });
                //机构清除老师也要清除
                $("#c-shop_id").change(function () {
                    $("#c-teacher_id").selectPageClear();
                });




                $(document).on('click', '.btn-changeuser', function (event) {
                    var url = $(this).attr('data-url');
                    if(!url) return false;
                    var title = $(this).attr('title');
                    var width = $(this).attr('data-width');
                    var height = $(this).attr('data-height');
                    // var ids = $(this).attr('data-id');
                   var area = ['98%','98%'];
                    var options = {
                        shadeClose: false,
                        shade: [0.3, '#393D49'],
                        area: area,
                        callback:function(ret){//回调方法，需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果;
                            Fast.api.close(ret);
                        }
                    };
                    Fast.api.open(url,title,options);
                });



                Form.api.bindevent($("form[role=form]"));
            }
        }
    };



    var generrate = {
        listen:function () {
            this.offlineListen();
            this.priceListen();
        },
        offlineListen:function () {
            var that = this;
            // console.log($("input:radio[name='row[address_type]']").val())
            // this.setOfflineType($("input:radio[name='row[address_type]']").val());
            $("input:radio[name='row[address_type]']").change(function (){
                that.setOfflineType($(this).val());
            });
        },
        setOfflineType:function (val) {
            switch (val) {
                case '1':
                    $('#c_position').hide();
                    break;
                case '2':
                    $('#c_position').show();
                    break;
            }
        },
          priceListen:function () {
            $('#spec').bind('input propertychange', function(){
                var length = $("#spec").val().length;
                console.log(length);
            });
        }
    }


    var classes_spec_url = function (row,dom) {
        return 'school/classes/classes_spec/index?classes_lib_id='+row.id;
    }

    var virtual_user_url = function (row,dom) {
        return 'school/classes/virtual_user/index?classes_lib_id='+row.id;
    }
    var teacher_url = function (row,dom) {
        return 'school/classes/teacher/index?id='+row.teacher_id +'&shop_id='+row.shop_id;
    }
    var order_url = function (row,dom) {
        return 'school/classes/order/order/index?classes_lib_id='+row.id +'&shop_id='+row.shop_id;
    }


    var classes_hourorder_url = function (row,dom) {
        return 'school/classes/hourorder/order/index?classes_lib_id='+row.id;
    }


    var evaluate_url= function (row,dom) {
        return 'school/classes/evaluate/index?classes_lib_id='+row.id+ '&shop_id='+row.shop_id+ '&teacher_id='+row.teacher_id;
    }

    var manystore_url = function (row,dom) {
        return 'manystore/index/index?shop_id='+row.shop_id;
    }

    var visit_url = function (row,dom) {
        return 'school/classes/visit/index?classes_lib_id='+row.id;
    }


    return Controller;
});
