1
This commit is contained in:
@@ -0,0 +1,83 @@
|
||||
define(['table', 'upload','form'], function (Table,Upload,Form) {
|
||||
var investment_record = {
|
||||
//Do setup work hereAction
|
||||
index: function () {
|
||||
window.statuskOption= Config.statusList;
|
||||
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: '/app/admin/robotrecord/select',
|
||||
add_url: '/app/admin/robotrecord/insert',
|
||||
edit_url: '/app/admin/robotrecord/update',
|
||||
del_url: '/app/admin/robotrecord/delete',
|
||||
multi_url: '/app/admin/robotrecord/multi',
|
||||
//dragsort_url: '/app/admin/robotrecord/weigh',
|
||||
table: 'robotrecord',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
var tableOptions = {
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
commonSearch: false,
|
||||
search: false,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{
|
||||
field: 'id',
|
||||
title: 'ID',
|
||||
filter: "number",
|
||||
sortable: true // 是否排序
|
||||
},
|
||||
{
|
||||
title: "名称",
|
||||
field: "robot.title",
|
||||
filter: "string",
|
||||
},
|
||||
{
|
||||
title: "金额",
|
||||
field: "amount",
|
||||
formatter:Table.api.formatter.number,
|
||||
filter: "string"
|
||||
},
|
||||
{
|
||||
title: "用户",
|
||||
field: "user.username",
|
||||
filter: "string"
|
||||
},
|
||||
{
|
||||
title: "状态",
|
||||
field: "status",
|
||||
sortable: true,
|
||||
formatter:Table.api.formatter.status,
|
||||
searchList:window.statuskOption,
|
||||
operate:false,
|
||||
filter: "select",
|
||||
filterOption:"statuskOption",
|
||||
visible: false,
|
||||
},
|
||||
{
|
||||
title: "时间",
|
||||
field: "created_at",
|
||||
filter: "datetime"
|
||||
},
|
||||
{
|
||||
title: "更新时间",
|
||||
field: "updated_at",
|
||||
visible: false,
|
||||
},
|
||||
{field: 'operate', title: '操作', table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
};
|
||||
// 初始化表格
|
||||
table.bootstrapTable(tableOptions);
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
};
|
||||
return investment_record
|
||||
});
|
||||
Reference in New Issue
Block a user