define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'operation/rechargebig/index' + location.search, table: 'operation_rechargebig', } }); 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: [ [ {field: 'id', title: __('Id'), operate: false}, {field: 'user.u_id', title: __('User.u_id')}, {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, {field: 'money', title: __('Money'), operate: false}, {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}, ] ] }); // 为表格绑定事件 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; });