|
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
|
|
|
var Controller = {
|
|
|
index: function () {
|
|
|
// 初始化表格参数配置
|
|
|
Table.api.init({
|
|
|
extend: {
|
|
|
index_url: 'user_gift/index' + location.search,
|
|
|
add_url: 'user_gift/add',
|
|
|
edit_url: 'user_gift/edit',
|
|
|
del_url: 'user_gift/del',
|
|
|
multi_url: 'user_gift/multi',
|
|
|
import_url: 'user_gift/import',
|
|
|
table: 'user_gift',
|
|
|
}
|
|
|
});
|
|
|
|
|
|
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: 'puser_id', title: __('Puser_id')},
|
|
|
{field: 'card_id', title: __('Card_id')},
|
|
|
{field: 'card_name', title: __('Card_name'), operate: 'LIKE'},
|
|
|
{field: 'money', title: __('Money'), operate:'BETWEEN'},
|
|
|
{field: 'get_status', title: __('Get_status'), searchList: {"expire":__('Get_status expire'),"already":__('Get_status already'),"unclaimed":__('Get_status unclaimed')}, formatter: Table.api.formatter.status},
|
|
|
{field: 'code', title: __('Code'), operate: 'LIKE'},
|
|
|
{field: 'type', title: __('Type'), searchList: {"pay":__('Type pay'),"send":__('Type send')}, formatter: Table.api.formatter.normal},
|
|
|
{field: 'active_time', title: __('Active_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
|
|
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
|
|
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
|
|
{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;
|
|
|
}); |
...
|
...
|
|