define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'donate/index' + location.search, add_url: 'donate/add', edit_url: 'donate/edit', del_url: 'donate/del', multi_url: 'donate/multi', import_url: 'donate/import', table: 'donate', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, {field: 'cid', title: __('Cid')}, {field: 'user_id', title: __('User_id')}, {field: 'full_name', title: __('Full_name'), operate: 'LIKE'}, {field: 'sex', title: __('Sex'), searchList: {"0":__('Sex 0'),"1":__('Sex 1')}, formatter: Table.api.formatter.normal}, {field: 'birthday', title: __('Birthday'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'id_card', title: __('Id_card'), operate: 'LIKE'}, {field: 'vocation', title: __('Vocation'), operate: 'LIKE'}, {field: 'education', title: __('Education'), searchList: {"0":__('Education 0'),"1":__('Education 1'),"2":__('Education 2'),"3":__('Education 3'),"4":__('Education 4'),"5":__('Education 5'),"6":__('Education 6'),"7":__('Education 7'),"8":__('Education 8'),"9":__('Education 9')}, formatter: Table.api.formatter.normal}, {field: 'category_id', title: __('Category_id'), operate: 'LIKE'}, {field: 'tel', title: __('Tel'), operate: 'LIKE'}, {field: 'mobile', title: __('Mobile'), operate: 'LIKE'}, {field: 'executor', title: __('Executor'), operate: 'LIKE'}, {field: 'executor_id_card', title: __('Executor_id_card'), operate: 'LIKE'}, {field: 'executor_tel', title: __('Executor_tel'), operate: 'LIKE'}, {field: 'executor_mobile', title: __('Executor_mobile'), operate: 'LIKE'}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'status', title: __('Status'), searchList: {"-1":__('Status -1'),"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status}, {field: 'SN', title: __('Sn'), operate: 'LIKE'}, {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; });