define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'user/withdrawal/userwithdrawal_log/index' + location.search, add_url: 'user/withdrawal/userwithdrawal_log/add', edit_url: 'user/withdrawal/userwithdrawal_log/edit', del_url: 'user/withdrawal/userwithdrawal_log/del', multi_url: 'user/withdrawal/userwithdrawal_log/multi', import_url: 'user/withdrawal/userwithdrawal_log/import', table: 'user_withdrawal_log', } }); 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: 'price', title: __('Price'), operate:'BETWEEN'}, {field: 'fee_price', title: __('Fee_price'), operate:'BETWEEN'}, {field: 'real_price', title: __('Real_price'), operate:'BETWEEN'}, {field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status}, {field: 'reason', title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'withdrawal_status', title: __('Withdrawal_status'), searchList: {"1":__('Withdrawal_status 1'),"2":__('Withdrawal_status 2'),"3":__('Withdrawal_status 3')}, formatter: Table.api.formatter.status}, {field: 'user_id', title: __('User_id')}, {field: 'type', title: __('Type'), searchList: {"bank":__('Type bank'),"wechat":__('Type wechat'),"alipay":__('Type alipay')}, formatter: Table.api.formatter.normal}, {field: 'name', title: __('Name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'bank_name', title: __('Bank_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'bank_user_name', title: __('Bank_user_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content}, {field: 'paytime', title: __('Paytime'), 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: 'examinetime', title: __('Examinetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'}, {field: 'user.realname', title: __('User.realname'), operate: 'LIKE'}, {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'}, {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', 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; });