userotherconfirm.js 5.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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: 'userotherconfirm/index' + location.search,
  8. add_url: 'userotherconfirm/add',
  9. edit_url: 'userotherconfirm/edit',
  10. del_url: 'userotherconfirm/del',
  11. multi_url: 'userotherconfirm/multi',
  12. import_url: 'userotherconfirm/import',
  13. table: 'user_other_confirm',
  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. fixedColumns: true,
  23. fixedRightNumber: 1,
  24. columns: [
  25. [
  26. {checkbox: true},
  27. {field: 'id', title: __('Id')},
  28. {field: 'user_id', title: __('User_id')},
  29. {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  30. {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  31. {field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
  32. {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2')}, formatter: Table.api.formatter.status},
  33. // {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  34. // {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  35. {field: 'passport_familyname', title: __('Passport_familyname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  36. {field: 'passport_givenname', title: __('Passport_givenname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  37. {field: 'passport_no', title: __('Passport_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  38. {field: 'passport_enddate', title: __('Passport_enddate'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  39. {field: 'passport_images', title: __('Passport_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
  40. {field: 'ga_familyname', title: __('Ga_familyname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  41. {field: 'ga_givenname', title: __('Ga_givenname'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  42. {field: 'ga_no', title: __('Ga_no'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  43. {field: 'ga_startdate', title: __('Ga_startdate'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  44. {field: 'ga_enddate', title: __('Ga_enddate'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
  45. {field: 'ga_juzhu_images', title: __('Ga_juzhu_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
  46. {field: 'ga_tongx_images', title: __('Ga_tongx_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
  47. {field: 'tw_juzhu_images', title: __('Tw_juzhu_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
  48. {field: 'tw_tongx_images', title: __('Tw_tongx_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
  49. {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  50. ]
  51. ]
  52. });
  53. // 为表格绑定事件
  54. Table.api.bindevent(table);
  55. },
  56. add: function () {
  57. Controller.api.bindevent();
  58. },
  59. edit: function () {
  60. Controller.api.bindevent();
  61. },
  62. api: {
  63. bindevent: function () {
  64. Form.api.bindevent($("form[role=form]"));
  65. }
  66. }
  67. };
  68. return Controller;
  69. });