define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'recharorder/index' + location.search, // add_url: 'recharorder/add', // edit_url: 'recharorder/edit', // del_url: 'recharorder/del', multi_url: 'recharorder/multi', import_url: 'recharorder/import', table: 'rechar_order', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', // fixedColumns: true, // fixedRightNumber: 1, columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, {field: 'user_id', title: __('User_id')}, {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, {field: 'order_no', title: __('Order_no'), operate: 'LIKE'}, {field: 'money', title: __('Money'), operate:'BETWEEN'}, {field: 'purpose', title: __('Purpose'), searchList: {"1":__('Purpose 1'),"2":__('Purpose 2'),"3":__('Purpose 3')}, formatter: Table.api.formatter.normal, operate: false}, {field: 'pay_type', title: __('Pay_type'), operate: false}, {field: 'relation_id', title: __('订单ID')}, // {field: 'refund_no', title: __('Refund_no'), operate: 'LIKE'}, {field: 'transaction_id', title: __('Transaction_id'), operate: 'LIKE'}, {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status}, {field: 'pay_status', title: __('Pay_status'), searchList: {"0":__('正常'),"1":__('Pay_status 1'),"2":__('Pay_status 2'),"3":__('Pay_status 3')}, formatter: Table.api.formatter.status, custom: {0: 'success', 1: 'danger', 2: 'danger', 3: 'danger'} }, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, // {field: 'diversionfst', title: __('Diversionfst'), operate: 'LIKE'}, // {field: 'diversioncsk', title: __('Diversioncsk'), operate: 'LIKE'}, // {field: 'trace_id', title: __('Trace_id'), operate: 'LIKE'}, {field: 'video_id', title: __('Video_id')}, {field: 'video.title', title: __('Video.title'), operate: 'LIKE'}, {field: 'video.image', title: __('Video.image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, // {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; });