define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'user/apply/index' + location.search, add_url: 'user/apply/add', edit_url: 'user/apply/edit', del_url: 'user/apply/del', multi_url: 'user/apply/multi', import_url: 'user/apply/import', table: 'user_apply', } }); 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: 'vocation', title: __('Vocation'), operate: 'LIKE'}, {field: 'position', title: __('Position'), 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: 'tel', title: __('Tel'), operate: 'LIKE'}, {field: 'address', title: __('Address'), operate: 'LIKE'}, {field: 'company_name', title: __('Company_name'), operate: 'LIKE'}, {field: 'nature', title: __('Nature'), operate: 'LIKE'}, {field: 'legal_person', title: __('Legal_person'), operate: 'LIKE'}, {field: 'zip_code', title: __('Zip_code'), operate: 'LIKE'}, {field: 'compnay_address', title: __('Compnay_address'), operate: 'LIKE'}, {field: 'company_email', title: __('Company_email'), operate: 'LIKE'}, {field: 'certificateimage', title: __('Certificateimage'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'id_card', title: __('Id_card'), operate: 'LIKE'}, {field: 'nation', title: __('Nation'), operate: 'LIKE'}, {field: 'birthday', title: __('Birthday'), operate: 'LIKE'}, {field: 'user_type', title: __('User_type'), searchList: {"0":__('User_type 0'),"1":__('User_type 1'),"2":__('User_type 2')}, formatter: Table.api.formatter.normal}, {field: 'mobile', title: __('Mobile'), 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; });