define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'user/teacs/index' + location.search+'&ids='+Config.ids, table: 'user_teac', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', fixedColumns: true, fixedRightNumber: 1, columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, {field: 'users.address', title: __('User_id')}, {field: 'type_id', title: __('Type_id'), searchList: { "1": __('出售'), "2": __('求购') }, formatter: Table.api.formatter.status }, {field: 'price', title: __('Price'), operate:'BETWEEN'}, {field: 'num', title: __('Num')}, {field: 'total_price', title: __('Total_price'), operate:'BETWEEN'}, {field: 'fee', title: __('Fee'), operate:'BETWEEN'}, {field: 'create_time', title: __('Create_time'), 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; });