dredgelog.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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: 'noble/dredgelog/index' + location.search,
  8. multi_url: 'noble/dredgelog/multi',
  9. import_url: 'noble/dredgelog/import',
  10. table: 'noble_dredge_log',
  11. }
  12. });
  13. var table = $("#table");
  14. // 初始化表格
  15. table.bootstrapTable({
  16. url: $.fn.bootstrapTable.defaults.extend.index_url,
  17. pk: 'id',
  18. sortName: 'id',
  19. columns: [
  20. [
  21. {checkbox: true},
  22. {field: 'id', title: __('Id')},
  23. {field: 'user_id', title: __('User_id')},
  24. {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
  25. {field: 'level_no', title: __('Level_no'), operate: 'LIKE'},
  26. {field: 'noblelevel.name', title: __('Noblelevel.name'), operate: 'LIKE'},
  27. {field: 'dredge_num', title: __('Dredge_num')},
  28. {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}
  29. ]
  30. ]
  31. });
  32. // 为表格绑定事件
  33. Table.api.bindevent(table);
  34. },
  35. add: function () {
  36. Controller.api.bindevent();
  37. },
  38. edit: function () {
  39. Controller.api.bindevent();
  40. },
  41. api: {
  42. bindevent: function () {
  43. Form.api.bindevent($("form[role=form]"));
  44. }
  45. }
  46. };
  47. return Controller;
  48. });