12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'imlogc2c/index' + location.search,
- add_url: 'imlogc2c/add',
- // edit_url: 'imlogc2c/edit',
- // del_url: 'imlogc2c/del',
- multi_url: 'imlogc2c/multi',
- import_url: 'imlogc2c/import',
- table: 'imlog_c2c',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'ClientIP', title: __('Clientip'), operate: 'LIKE'},
- {field: 'From_Account', title: __('From_account')},
- {field: 'fromuser.nickname', title: __('fromuser.nickname'), operate: 'LIKE'},
- {field: 'MsgFromPlatform', title: __('Msgfromplatform'), operate: 'LIKE'},
- // {field: 'MsgRandom', title: __('Msgrandom'), operate: 'LIKE'},
- // {field: 'MsgSeq', title: __('Msgseq'), operate: 'LIKE'},
- {field: 'MsgTimestamp', title: __('Msgtimestamp'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'To_Account', title: __('To_account')},
- {field: 'touser.nickname', title: __('touser.nickname'), operate: 'LIKE'},
- {field: 'MsgType', title: '类型'},
- {field: 'operate', title: __('Operate'),
- buttons:[
- {
- name:'showbody',
- text:'消息体',
- title:'消息体',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-info btn-dialog',
- url:'imlogc2c/showbody/id/{ids}?dialog=1',
- target:'_self',
- extend: 'data-area=["90%","90%"]'
- },
- ],
- 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();
- },
- showbody: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
|