notify.js 4.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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: 'csminvite/notify/index' + location.search,
  8. add_url: 'csminvite/notify/add',
  9. edit_url: 'csminvite/notify/edit',
  10. del_url: 'csminvite/notify/del',
  11. multi_url: 'csminvite/notify/multi',
  12. table: 'csminvite_notify',
  13. }
  14. });
  15. var table = $("#table");
  16. // 初始化表格
  17. table.bootstrapTable({
  18. url: $.fn.bootstrapTable.defaults.extend.index_url,
  19. pk: 'id',
  20. sortName: 'id',
  21. columns: [
  22. [
  23. {checkbox: true},
  24. {field: 'id', title: __('Id')},
  25. // {field: 'notifyway', title: __('Notifyway'), searchList: {"mobile":__('Notifyway mobile'),"email":__('Notifyway email')}, formatter: Table.api.formatter.normal},
  26. {field: 'name', title: __('Name')},
  27. {field: 'emailtitle', title: __('Emailtitle')},
  28. {field: 'effectbegintime', title: __('Effectbegintime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
  29. {field: 'effectendtime', title: __('Effectendtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
  30. {field: 'status', title: __('Status'), searchList: {"normal":__('Normal'),"hidden":__('Hidden')}, formatter: Table.api.formatter.status},
  31. // {field: 'invitekey', title: __('Invitekey')},
  32. // {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
  33. // {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
  34. // {field: 'b1', title: __('B1')},
  35. // {field: 'b2', title: __('B2')},
  36. // {field: 'b3', title: __('B3')},
  37. // {field: 'b4', title: __('B4')},
  38. // {field: 'b5', title: __('B5')},
  39. // {field: 'b6', title: __('B6')},
  40. // {field: 'b7', title: __('B7')},
  41. // {field: 'b8', title: __('B8')},
  42. // {field: 'b9', title: __('B9')},
  43. {
  44. field: 'operate',
  45. title: __('Operate'),
  46. table: table, events: Table.api.events.operate,
  47. formatter: Table.api.formatter.operate,
  48. //formatter: Table.api.formatter.buttons,
  49. buttons: [
  50. {
  51. name: 'confinfos',
  52. text: __('邀请人列表'),
  53. classname: 'btn btn-xs btn-success btn-click',
  54. icon: 'fa fa-file',
  55. click: function (res, row) {
  56. window.open("../csminvite/notifyuser?parentid=" + row.id);
  57. },
  58. },
  59. {
  60. name: 'confusers',
  61. text: __('发送邀请邮件'),
  62. classname: 'btn btn-xs btn-danger btn-ajax',
  63. icon: 'fa fa-file',
  64. url: 'csminvite/notify/notifyUserajax?ids={ids}',
  65. refresh: true,
  66. visible: function (row) {
  67. return true; zzzzzzzzd
  68. }
  69. }
  70. ]
  71. }
  72. ]
  73. ]
  74. });
  75. // 为表格绑定事件
  76. Table.api.bindevent(table);
  77. },
  78. add: function () {
  79. Controller.api.bindevent();
  80. },
  81. edit: function () {
  82. Controller.api.bindevent();
  83. },
  84. api: {
  85. bindevent: function () {
  86. Form.api.bindevent($("form[role=form]"));
  87. }
  88. }
  89. };
  90. return Controller;
  91. });