init
This commit is contained in:
61
public/assets/js/backend/yq/base_config/cargo.js
Normal file
61
public/assets/js/backend/yq/base_config/cargo.js
Normal file
@@ -0,0 +1,61 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'yq/base_config/cargo/index' + location.search,
|
||||
add_url: 'yq/base_config/cargo/add',
|
||||
edit_url: 'yq/base_config/cargo/edit',
|
||||
del_url: 'yq/base_config/cargo/del',
|
||||
multi_url: 'yq/base_config/cargo/multi',
|
||||
import_url: 'yq/base_config/cargo/import',
|
||||
table: 'cargo_category',
|
||||
}
|
||||
});
|
||||
|
||||
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: 'pid', title: __('Pid')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'sds_url', title: __('Sds_url'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
|
||||
{field: 'label_url', title: __('Label_url'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
|
||||
{field: 'label_name', title: __('Label_name'), operate: 'LIKE'},
|
||||
{field: 'sds_name', title: __('Sds_name'), operate: 'LIKE'},
|
||||
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'update_time', title: __('Update_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'status', title: __('Status'), searchList: {"1":__('Status 1'),"2":__('Status 2'),"-1":__('Status -1')}, formatter: Table.api.formatter.status},
|
||||
{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