12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'cash/cashlog/index' + location.search,
- add_url: 'cash/cashlog/add',
- // edit_url: 'cash/cashlog/edit',
- del_url: 'cash/cashlog/del',
- multi_url: 'cash/cashlog/multi',
- table: 'cash_log',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 't_id',
- sortName: 't_id',
- columns: [
- [
- {checkbox: true},
- {field: 't_id', title: __('T_id')},
- {field: 'users.user_nickname', title: __('Users.user_nickname')},
- {field: 'users.user_tel', title: __('Users.user_tel')},
- {field: 'users.user_avatar', title: __('Users.user_avatar'), events: Table.api.events.image, formatter: Table.api.formatter.image},
- {field: 'money', title: __('提现金额'), operate:'BETWEEN'},
- {field: 'state', title: __('状态')},
- {field: 'create_time', title: __('Create_time')},
- {field: 'number', title: __('Number')},
- {field: 'reason', title: __('Reason')},
- {field: 'admin_look', title: __('Admin_look')},
- {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;
- });
|