define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'userorder/index' + location.search, add_url: 'userorder/add', // edit_url: 'userorder/edit', del_url: 'userorder/del', multi_url: 'userorder/multi', import_url: 'userorder/import', table: 'acitivity_order', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', showExport:false, columns: [ [ {checkbox: true}, {field:'id', title: __('序号'),formatter: function(value, row, index){ return ++index; }, operate: false}, {field: 'number', title: __('Number')}, {field: 'address', title: __('Address'), operate: 'LIKE'}, {field: 'title', title: __('Title'), operate: 'LIKE'}, {field: 'start_time', title: __('Start_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'end_time', title: __('End_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'user.username', title: __('User.username'), operate: 'LIKE'}, {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, // {field: 'avcitity.title', title: __('Avcitity.title')}, // {field: 'avcitity.address', title: __('Avcitity.address')}, {field: 'avcitity.num', title: __('Avcitity.num')}, // {field: 'avcitity.phone', title: __('Avcitity.phone')}, {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; });