define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'user/rechargelog/index' + location.search, table: 'user_recharge_log', } }); var table = $("#table"); //当表格数据加载完成时 table.on('load-success.bs.table', function (e, data) { //这里可以获取从服务端获取的JSON数据 //这里我们手动设置底部的值 $("#total-money").text(data.extend.total_money); }); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, // {field: 'user_id', title: __('User_id')}, {field: 'user.u_id', title: __('User.u_id')}, {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, {field: 'jewel', title: __('Jewel')}, {field: 'money', title: __('Money'), operate:'BETWEEN'}, {field: 'jewelafter', title: __('Jewelafter')}, // {field: 'moneyafter', title: __('Moneyafter'), operate:'BETWEEN'}, {field: 'away', title: __('Away'), searchList: {"1":__('Away 1'),"2":__('Away 2'),"3":__('Away 3'),"4":__('Away 4')}, formatter: Table.api.formatter.normal}, {field: 'platform', title: __('Platform'), searchList: {"1":__('Platform 1'),"2":__('Platform 2'),"3":__('Platform 3')}, formatter: Table.api.formatter.normal}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, // {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; });