eggjackpotchanchu.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  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: 'eggjackpotchanchu/index' + location.search,
  8. add_url: 'eggjackpotchanchu/add',
  9. edit_url: 'eggjackpotchanchu/edit',
  10. del_url: 'eggjackpotchanchu/del',
  11. multi_url: 'eggjackpotchanchu/multi',
  12. import_url: 'eggjackpotchanchu/import',
  13. table: 'egg_jackpot_chanchu',
  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: 'jackpot_id', title: __('Jackpot_id')},
  27. {field: 'eggjackpot.name', title: __('Eggjackpot.name'), operate: 'LIKE'},
  28. {field: 'starttime', title: __('Starttime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  29. {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  30. {field: 'jp_giftnum', title: __('Jp_giftnum')},
  31. {field: 'jp_giftprice', title: __('Jp_giftprice')},
  32. {field: 'do_payfee', title: __('Do_payfee')},
  33. {field: 'do_usercount', title: __('Do_usercount')},
  34. {field: 'do_usertimes', title: __('Do_usertimes')},
  35. {field: 'do_giftnum', title: __('Do_giftnum')},
  36. {field: 'do_giftprice', title: __('Do_giftprice')},
  37. {field: 'chanchubi', title: __('Chanchubi'), operate:'BETWEEN'},
  38. // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  39. ]
  40. ]
  41. });
  42. // 为表格绑定事件
  43. Table.api.bindevent(table);
  44. },
  45. chanchu: function () {
  46. // 初始化表格参数配置
  47. Table.api.init({
  48. extend: {
  49. index_url: 'eggjackpotchanchu/chanchu' + location.search,
  50. table: 'egg_jackpot_chanchu',
  51. }
  52. });
  53. var table = $("#table");
  54. // 初始化表格
  55. table.bootstrapTable({
  56. url: $.fn.bootstrapTable.defaults.extend.index_url,
  57. pk: 'id',
  58. sortName: 'id',
  59. searchFormVisible: false,
  60. search: false, //搜索id
  61. showToggle: false,//修改列表方式
  62. commonSearch:false,
  63. exportTypes: ['excel'], //只导出excel
  64. columns: [
  65. [
  66. {field: 'id', title: __('Jackpot_id')},
  67. {field: 'name', title: __('Eggjackpot.name'), operate: false},
  68. {field: 'type', title: __('Eggjackpot.type'), operate: false},
  69. {field: 'starttime', title: __('Eggjackpot.starttime'), operate:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  70. {field: 'jp_giftnum', title: __('Jp_giftnum')},
  71. {field: 'jp_giftprice', title: __('Jp_giftprice')},
  72. {field: 'do_payfee', title: __('Do_payfee')},
  73. {field: 'do_usercount', title: __('Do_usercount')},
  74. {field: 'do_usertimes', title: __('Do_usertimes')},
  75. {field: 'do_giftnum', title: __('Do_giftnum')},
  76. {field: 'do_giftprice', title: __('Do_giftprice')},
  77. {field: 'chanchubi', title: __('Chanchubi'), operate:'BETWEEN'},
  78. // {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  79. ]
  80. ]
  81. });
  82. // 为表格绑定事件
  83. Table.api.bindevent(table);
  84. },
  85. add: function () {
  86. Controller.api.bindevent();
  87. },
  88. edit: function () {
  89. Controller.api.bindevent();
  90. },
  91. api: {
  92. bindevent: function () {
  93. Form.api.bindevent($("form[role=form]"));
  94. }
  95. }
  96. };
  97. return Controller;
  98. });