define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'eggjackpotchanchu/index' + location.search, add_url: 'eggjackpotchanchu/add', edit_url: 'eggjackpotchanchu/edit', del_url: 'eggjackpotchanchu/del', multi_url: 'eggjackpotchanchu/multi', import_url: 'eggjackpotchanchu/import', table: 'egg_jackpot_chanchu', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, {field: 'jackpot_id', title: __('Jackpot_id')}, {field: 'eggjackpot.name', title: __('Eggjackpot.name'), operate: 'LIKE'}, {field: 'starttime', title: __('Starttime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'jp_giftnum', title: __('Jp_giftnum')}, {field: 'jp_giftprice', title: __('Jp_giftprice')}, {field: 'do_payfee', title: __('Do_payfee')}, {field: 'do_usercount', title: __('Do_usercount')}, {field: 'do_usertimes', title: __('Do_usertimes')}, {field: 'do_giftnum', title: __('Do_giftnum')}, {field: 'do_giftprice', title: __('Do_giftprice')}, {field: 'chanchubi', title: __('Chanchubi'), operate:'BETWEEN'}, // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] }); // 为表格绑定事件 Table.api.bindevent(table); }, chanchu: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'eggjackpotchanchu/chanchu' + location.search, table: 'egg_jackpot_chanchu', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', searchFormVisible: false, search: false, //搜索id showToggle: false,//修改列表方式 commonSearch:false, exportTypes: ['excel'], //只导出excel columns: [ [ {field: 'id', title: __('Jackpot_id')}, {field: 'name', title: __('Eggjackpot.name'), operate: false}, {field: 'type', title: __('Eggjackpot.type'), operate: false}, {field: 'starttime', title: __('Eggjackpot.starttime'), operate:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'jp_giftnum', title: __('Jp_giftnum')}, {field: 'jp_giftprice', title: __('Jp_giftprice')}, {field: 'do_payfee', title: __('Do_payfee')}, {field: 'do_usercount', title: __('Do_usercount')}, {field: 'do_usertimes', title: __('Do_usertimes')}, {field: 'do_giftnum', title: __('Do_giftnum')}, {field: 'do_giftprice', title: __('Do_giftprice')}, {field: 'chanchubi', title: __('Chanchubi'), operate:'BETWEEN'}, // {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; });