新建
This commit is contained in:
54
public/assets/js/backend/junka_code.js
Normal file
54
public/assets/js/backend/junka_code.js
Normal file
@@ -0,0 +1,54 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'junka_code/index' + location.search,
|
||||
add_url: 'junka_code/add',
|
||||
edit_url: 'junka_code/edit',
|
||||
del_url: 'junka_code/del',
|
||||
multi_url: 'junka_code/multi',
|
||||
import_url: 'junka_code/import',
|
||||
table: 'junka_code',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
// {checkbox: true},
|
||||
{field: 'list.junka_name', title: __('junka_name'), operate: 'LIKE', table: table},
|
||||
{field: 'name', title: __('name'), operate: 'LIKE', table: table},
|
||||
{field: 'code', title: __('Code'), operate: 'LIKE', table: table},
|
||||
{field: 'par_value', title: __('Par_value'), operate: 'LIKE', table: table},
|
||||
{field: 'price', title: __('price'), operate: 'LIKE', table: table},
|
||||
{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;
|
||||
});
|
||||
Reference in New Issue
Block a user