getvalue.js 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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: 'party/getvalue/index' + location.search,
  8. table: 'gift_user_party',
  9. }
  10. });
  11. var table = $("#table");
  12. // 初始化表格
  13. table.bootstrapTable({
  14. url: $.fn.bootstrapTable.defaults.extend.index_url,
  15. pk: 'id',
  16. sortName: 'id',
  17. columns: [
  18. [
  19. {checkbox: true},
  20. {field: 'u_id', title: __('房主ID'),operate: false},
  21. {field: 'party_id', title: __('Party_id')},
  22. {field: 'party_name', title: __('派对名称')},
  23. {field: 'live_type', title: __('个播组'),searchList:$.getJSON('party/livetype/source'), formatter: Table.api.formatter.normal},
  24. {field: 'room_type', title: __('Room_type'), searchList: {"1":__('派对'),"2":__('个播')}, formatter: Table.api.formatter.normal},
  25. {field: 'value', title: __('Value'),operate: false},
  26. {field: 'createtime', title: __('时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  27. ]
  28. ]
  29. });
  30. // 为表格绑定事件
  31. Table.api.bindevent(table);
  32. },
  33. add: function () {
  34. Controller.api.bindevent();
  35. },
  36. edit: function () {
  37. Controller.api.bindevent();
  38. },
  39. api: {
  40. bindevent: function () {
  41. Form.api.bindevent($("form[role=form]"));
  42. }
  43. }
  44. };
  45. return Controller;
  46. });