define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'booklistch/collect/index', add_url: 'booklistch/collect/add', edit_url: 'booklistch/collect/edit', del_url: 'booklistch/collect/del', multi_url: 'booklistch/collect/multi', analysis: 'booklistch/collect/analysis', table: 'booklist_collect', }, showToggle: false, showColumns: false, showExport: false, operate: false, search:false, searchFormVisible: true }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'booklist_collect.id', sortName: 'booklist_collect.id', columns: [ [ {field: 'id', title: __('Id'), operate: false}, {field: 'admin_id', title: __('渠道ID'), operate: false}, {field: 'booklist_id', title: __('书单ID')}, {field: 'book_list_ch.title', title: __('书单名称'), operate: 'LIKE %...%'}, {field: 'booklist_collect.idx', title: __('书籍ID')}, {field: 'book.name', title: __('书籍名称'), operate: 'LIKE %...%'}, {field: 'uv', title: __('UV'),operate:false}, {field: 'orders_num', title: __('充值订单数'), operate: false}, {field: 'recharge_money', title: __('充值金额'),operate:false}, {field: 'createtime', title: __('创建时间'), operate:false, formatter: Table.api.formatter.datetime}, ] ] }); // 为表格绑定事件 Table.api.bindevent(table); $(document).on('click', '.flush', function () { window.location.reload(); }); }, add: function () { Controller.api.bindevent(); }, edit: function () { Controller.api.bindevent(); }, analysis: function () { // 初始化表格参数配置 Table.api.init({ extend: { analysis: 'booklistch/collect/analysis?ids='+Config.ids, table: 'booklist_collect', }, showToggle: false, showColumns: false, showExport: false, operate: false, search:false, searchFormVisible: false, commonSearch: false, pagination: false, }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.analysis, pk: 'book_list_ch.id', sortName: 'book_list_ch.id', columns: [ [ {field: 'admin_id', title: __('渠道ID'), operate: false}, {field: 'id', title: __('书单ID'), operate: false}, {field: 'title', title: __('书单名称'), operate: false}, {field: 'book_id', title: __('书籍ID'), operate: false}, {field: 'book_name', title: __('书籍名称'), operate: false}, {field: 'uv', title: __('UV'),operate:false}, {field: 'orders_num', title: __('充值订单数'), operate: false}, {field: 'recharge_money', title: __('充值金额'),operate:false}, {field: 'createtime', title: __('创建时间'), operate:false, formatter: Table.api.formatter.datetime}, ] ] }); // 为表格绑定事件 Table.api.bindevent(table); Controller.api.bindevent(); }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); } } }; return Controller; });