define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'mobile/index' + location.search, add_url: 'mobile/add', edit_url: 'mobile/edit', del_url: 'mobile/del', multi_url: 'mobile/multi', import_url: 'mobile/import', table: 'mobile', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, {field: 'name', title: __('Name')}, {field: 'no', title: __('No')}, {field: 'type', title: __('Type')}, {field: 'network', title: __('Network')}, {field: 'city', title: __('City')}, {field: 'province', title: __('Province')}, {field: 'amount_exists', title: __('Amount_exists'), operate:'BETWEEN'}, {field: 'amount_original', title: __('Amount_original'), operate:'BETWEEN'}, {field: 'amount_base', title: __('Amount_base'), operate:'BETWEEN'}, {field: 'amount_charge', title: __('Amount_charge'), operate:'BETWEEN'}, {field: 'amount', title: __('Amount'), operate:'BETWEEN'}, {field: 'update_time', title: __('Update_time')}, {field: 'top_time', title: __('Top_time')}, {field: 'rec_time', title: __('Rec_time')}, {field: 'summary', title: __('Summary')}, {field: 'saled', title: __('Saled')}, {field: 'is_activity', title: __('Is_activity')}, {field: 'is_hold', title: __('预占'),formatter: Table.api.formatter.toggle}, {field: 'activity_time_end', title: __('Activity_time_end'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'sort', title: __('Sort')}, //{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; });