12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'noble/level/index' + location.search,
- add_url: 'noble/level/add',
- edit_url: 'noble/level/edit',
- multi_url: 'noble/level/multi',
- import_url: 'noble/level/import',
- table: 'noble_level',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'name', title: __('Name'), operate: 'LIKE'},
- {field: 'level_no', title: __('Level_no'), operate: 'LIKE'},
- {field: 'back_image', title: __('Back_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
- {field: 'first', title: __('First')},
- {field: 'firstgive', title: __('Firstgive')},
- {field: 'renew', title: __('Renew')},
- {field: 'give', title: __('Give')},
- {field: 'explain', title: __('额外增加经验值(%)')},
- {field: 'icon_image', title: __('Icon_image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
- {field: 'info_image', title: __('个人资料框'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
- // {field: 'jctx', title: __('Jctx'), operate: 'LIKE'},
- {field: 'tqgq', title: __('Tqgq'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
- //{field: 'lxrys', title: __('Lxrys'), operate: 'LIKE'},
- // {field: 'qfdh', title: __('Qfdh'), operate: 'LIKE'},
- /*{field: 'qftz', title: __('Qftz'), searchList: {"0":__('Qftz 0'),"1":__('Qftz 1')}, formatter: Table.api.formatter.normal},
- {field: 'gptz', title: __('Gptz'), searchList: {"0":__('Gptz 0'),"1":__('Gptz 1')}, formatter: Table.api.formatter.normal},*/
- // {field: 'zszj', title: __('Zszj'), operate: 'LIKE'},
- {field: 'zlys', title: __('Zlys'), operate: 'LIKE'},
- // {field: 'diylw', title: __('Diylw'), searchList: {"0":__('Diylw 0'),"1":__('Diylw 1')}, formatter: Table.api.formatter.normal},
- {field: 'fjft', title: __('Fjft'), searchList: {"0":__('Fjft 0'),"1":__('Fjft 1')}, formatter: Table.api.formatter.normal},
- // {field: 'zdych', title: __('Zdych'), searchList: {"0":__('Zdych 0'),"1":__('Zdych 1')}, formatter: Table.api.formatter.normal},
- {field: 'is_show', title: __('Is_show'), searchList: {"1":__('Is_show 1'),"0":__('Is_show 0')}, formatter: Table.api.formatter.normal},
- {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'createtime', title: __('Createtime'), 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;
- });
|