define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'send/coupon/log/index' + location.search, add_url: 'send/coupon/log/add', edit_url: 'send/coupon/log/edit', del_url: 'send/coupon/log/del', multi_url: 'send/coupon/log/multi', import_url: 'send/coupon/log/import', table: 'send_coupon_log', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true}, {field: 'id', title: __('Id'), operate:false}, {field: 'message_id', title: __('Message_id'),operate:false}, {field: 'user_id', title: __('User_id')}, {field: 'coupon', title: __('Coupon'),operate:false}, {field: 'url', title: __('Url'), formatter: Table.api.formatter.url}, {field: 'code', title: __('Code'),operate:false}, {field: 'addtime', title: __('Addtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, ] ] }); // 为表格绑定事件 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; });