{"size": 3280, "ext": "js", "max_stars_repo_path": "public/assets/js/backend/distribution/level.js", "max_stars_repo_name": "jad13657099943/php-fastadmin-msjt", "max_stars_repo_stars_event_min_datetime": "2022-01-15T06:16:34.000Z", "max_stars_repo_stars_event_max_datetime": "2022-01-15T06:16:34.000Z", "max_issues_repo_path": "public/assets/js/backend/distribution/level.js", "max_issues_repo_name": "jad13657099943/php-fastadmin-msjt", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "public/assets/js/backend/distribution/level.js", "max_forks_repo_name": "jad13657099943/php-fastadmin-msjt", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 37.2727272727, "max_line_length": 107, "alphanum_fraction": 0.3402439024}
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {

    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'distribution/level/index',
                    add_url: 'distribution/level/add',
                    edit_url: 'distribution/level/edit',
                    del_url: 'distribution/level/del',
                    multi_url: 'distribution/level/multi',
                    table: 'distributor_level',
                }
            });

            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                commonSearch: false,
                pagination: false,
                columns: [
                    [
                        // {checkbox: true},
                        {field: 'id', title: __('Id')},
                        {
                            field: 'level', title: __('Level'), operate: false,
                        },
                        {
                            field: 'commission_rate', title: __('Commission_rate'), operate: false,
                            formatter: function (value) {
                                return value + "%";
                            }
                        },
                        {
                            field: 'invite', title: 'VIP邀请人数', operate: false,
                        },
                        {
                            field: 'vip_commission_rate', title: 'VIP佣金比例', operate: false,
                            formatter: function (value) {
                                return value + "%";
                            }
                        },
                        /*{
                            field: 'create_time',
                            title: __('Create_time'),
                            operate: false,
                            // addclass: 'datetimerange',
                            formatter: Table.api.formatter.datetime
                        },*/
                        /*{
                            field: 'status',
                            title: __('Status'),
                            searchList: {'0': '禁用', '1': '正常'},
                            formatter: Table.api.formatter.status
                        },*/
                        {
                            field: 'operate',
                            title: __('Operate'),
                            table: table,
                            events: Table.api.events.operate,
                            formatter: Table.api.formatter.operate
                        }
                    ]
                ]
            });

            // 为表格绑定事件
            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;
});