define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { Table.api.init({ extend: { index_url: 'auth/userconsumecurrencysum/index/ids/' + Config.id + '/state/' + Config.state }, searchFormVisible: true, search: false, }); var table = $("#table"); if (Config.state == 1) { // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true, visible: false}, {field: 'book_id', title: __('书籍ID'), operate: '='}, {field: 'book_name', title: __('小说'), operate: 'LIKE'}, {field: 'total_chapter', title: __('消费章节'), operate: false}, {field: 'total_kandian', title: __('书币总消费'), operate: false} ] ] }); } else { // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true, visible: false}, {field: 'createtime', title: __('时间'),operate: 'BETWEEN', type: 'datetime', addclass: 'datetimepicker'}, {field: 'book_id', title: __('书籍ID'), operate: '='}, {field: 'book_name', title: __('小说'), operate: 'LIKE'}, {field: 'chapter_id', title: __('章节ID'), operate: 'LIKE'}, {field: 'chapter_name', title: __('章节'), operate: false}, {field: 'kandian', title: __('消费书币'), operate: false} ] ] }); } Table.api.bindevent(table); }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); }, formatter: { // IncomeLink: function (value, row, index) { // return '进入'; // } } } }; return Controller; });