imlogc2c.js 3.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2. var Controller = {
  3. index: function () {
  4. // 初始化表格参数配置
  5. Table.api.init({
  6. extend: {
  7. index_url: 'imlogc2c/index' + location.search,
  8. add_url: 'imlogc2c/add',
  9. // edit_url: 'imlogc2c/edit',
  10. // del_url: 'imlogc2c/del',
  11. multi_url: 'imlogc2c/multi',
  12. import_url: 'imlogc2c/import',
  13. table: 'imlog_c2c',
  14. }
  15. });
  16. var table = $("#table");
  17. // 初始化表格
  18. table.bootstrapTable({
  19. url: $.fn.bootstrapTable.defaults.extend.index_url,
  20. pk: 'id',
  21. sortName: 'id',
  22. columns: [
  23. [
  24. {checkbox: true},
  25. {field: 'id', title: __('Id')},
  26. {field: 'ClientIP', title: __('Clientip'), operate: 'LIKE'},
  27. {field: 'From_Account', title: __('From_account')},
  28. {field: 'fromuser.nickname', title: __('fromuser.nickname'), operate: 'LIKE'},
  29. {field: 'MsgFromPlatform', title: __('Msgfromplatform'), operate: 'LIKE'},
  30. // {field: 'MsgRandom', title: __('Msgrandom'), operate: 'LIKE'},
  31. // {field: 'MsgSeq', title: __('Msgseq'), operate: 'LIKE'},
  32. {field: 'MsgTimestamp', title: __('Msgtimestamp'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  33. {field: 'To_Account', title: __('To_account')},
  34. {field: 'touser.nickname', title: __('touser.nickname'), operate: 'LIKE'},
  35. {field: 'MsgType', title: '类型'},
  36. {field: 'operate', title: __('Operate'),
  37. buttons:[
  38. {
  39. name:'showbody',
  40. text:'消息体',
  41. title:'消息体',
  42. icon:'fa fa-exclamation-circle',
  43. classname:'btn btn-xs btn-info btn-dialog',
  44. url:'imlogc2c/showbody/id/{ids}?dialog=1',
  45. target:'_self',
  46. extend: 'data-area=["90%","90%"]'
  47. },
  48. ],
  49. table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  50. ]
  51. ]
  52. });
  53. // 为表格绑定事件
  54. Table.api.bindevent(table);
  55. },
  56. add: function () {
  57. Controller.api.bindevent();
  58. },
  59. edit: function () {
  60. Controller.api.bindevent();
  61. },
  62. showbody: function () {
  63. Controller.api.bindevent();
  64. },
  65. api: {
  66. bindevent: function () {
  67. Form.api.bindevent($("form[role=form]"));
  68. }
  69. }
  70. };
  71. return Controller;
  72. });