userconsumecurrencysum.js 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
  2. var Controller = {
  3. index: function () {
  4. Table.api.init({
  5. extend: {
  6. index_url: 'auth/userconsumecurrencysum/index/ids/' + Config.id + '/state/' + Config.state
  7. },
  8. searchFormVisible: true,
  9. search: false,
  10. });
  11. var table = $("#table");
  12. if (Config.state == 1) {
  13. // 初始化表格
  14. table.bootstrapTable({
  15. url: $.fn.bootstrapTable.defaults.extend.index_url,
  16. pk: 'id',
  17. sortName: 'id',
  18. columns: [
  19. [
  20. {checkbox: true, visible: false},
  21. {field: 'book_id', title: __('书籍ID'), operate: '='},
  22. {field: 'book_name', title: __('小说'), operate: 'LIKE'},
  23. {field: 'total_chapter', title: __('消费章节'), operate: false},
  24. {field: 'total_kandian', title: __('书币总消费'), operate: false}
  25. ]
  26. ]
  27. });
  28. } else {
  29. // 初始化表格
  30. table.bootstrapTable({
  31. url: $.fn.bootstrapTable.defaults.extend.index_url,
  32. pk: 'id',
  33. sortName: 'id',
  34. columns: [
  35. [
  36. {checkbox: true, visible: false},
  37. {field: 'createtime', title: __('时间'),operate: 'BETWEEN', type: 'datetime', addclass: 'datetimepicker'},
  38. {field: 'book_id', title: __('书籍ID'), operate: '='},
  39. {field: 'book_name', title: __('小说'), operate: 'LIKE'},
  40. {field: 'chapter_id', title: __('章节ID'), operate: 'LIKE'},
  41. {field: 'chapter_name', title: __('章节'), operate: false},
  42. {field: 'kandian', title: __('消费书币'), operate: false}
  43. ]
  44. ]
  45. });
  46. }
  47. Table.api.bindevent(table);
  48. },
  49. api: {
  50. bindevent: function () {
  51. Form.api.bindevent($("form[role=form]"));
  52. },
  53. formatter: {
  54. // IncomeLink: function (value, row, index) {
  55. // return '<a target="_blank" href="' + row['inComeUrl'] + '">进入</a>';
  56. // }
  57. }
  58. }
  59. };
  60. return Controller;
  61. });