define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'tt_ex/index' + location.search, add_url: 'tt_ex/add', edit_url: 'tt_ex/edit', del_url: 'tt_ex/del', multi_url: 'tt_ex/multi', import_url: 'tt_ex/import', table: 'tt_ex', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, {field: 'order_id', title: __('Order_id')}, {field: 'enddate', title: __('Enddate')}, {field: 'create_time', title: __('Create_time')}, {field: 'pay_time', title: __('Pay_time')}, {field: 'refund_time', title: __('Refund_time')}, {field: 'channel_id', title: __('Channel_id')}, {field: 'channel_name', title: __('Channel_name')}, {field: 'code_id', title: __('Code_id')}, {field: 'real_money', title: __('Real_money')}, {field: 'shop_id', title: __('Shop_id')}, {field: 'shop_name', title: __('Shop_name')}, {field: 'shop_price', title: __('Shop_price')}, {field: 'shop_quantity', title: __('Shop_quantity')}, {field: 'class_three_name', title: __('Class_three_name')}, {field: 'class_two_name', title: __('Class_two_name')}, {field: 'class_name', title: __('Class_name')}, {field: 'name', title: __('Name')}, // {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; });