1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'imloggroup/index' + location.search,
- add_url: 'imloggroup/add',
- // edit_url: 'imloggroup/edit',
- // del_url: 'imloggroup/del',
- multi_url: 'imloggroup/multi',
- import_url: 'imloggroup/import',
- table: 'imlog_group',
- }
- });
- 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: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
- {field: 'GroupId', title: __('Groupid')},
- {field: 'party.party_name', title: __('Party.party_name'), operate: 'LIKE'},
- // {field: 'MsgBody', title: __('Msgbody')},
- {field: 'MsgFromPlatform', title: __('Msgfromplatform'), operate: 'LIKE'},
- // {field: 'MsgSeq', title: __('Msgseq'), operate: 'LIKE'},
- {field: 'MsgTimestamp', title: __('Msgtimestamp'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'MsgType', title: __('Msgtype'), operate: 'LIKE'},
- {field: 'MsgInfo', title: __('Msginfo'), operate: 'LIKE'},
- // {field: 'party.room_type', title: __('Party.room_type')},
- {field: 'operate', title: __('Operate'),
- buttons:[
- {
- name:'showbody',
- text:'消息体',
- title:'消息体',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-info btn-dialog',
- url:'imloggroup/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;
- });
|