useridconfirm.js 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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: 'useridconfirm/index' + location.search,
  8. add_url: 'useridconfirm/add',
  9. //edit_url: 'useridconfirm/edit',
  10. //del_url: 'useridconfirm/del',
  11. multi_url: 'useridconfirm/multi',
  12. import_url: 'useridconfirm/import',
  13. table: 'user_idconfirm',
  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: 'user_id', title: __('User_id')},
  27. {field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
  28. {field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
  29. {field: 'truename', title: __('Truename'), operate: 'LIKE'},
  30. // {field: 'alipay_account', title: __('Alipay_account'), operate: 'LIKE'},
  31. {field: 'idcard', title: __('Idcard'), operate: 'LIKE'},
  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: 'audittime', title: __('Audittime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
  36. {field: 'auditremark', title: __('Auditremark'), operate: 'LIKE'},
  37. // {field: 'user.username', title: __('User.username'), operate: 'LIKE'},
  38. {field: 'operate', title: __('Operate'), table: table,
  39. buttons:[
  40. {
  41. name:'audit',
  42. text:'审核',
  43. title:'审核',
  44. icon:'fa fa-exclamation-circle',
  45. classname:'btn btn-xs btn-info btn-dialog',
  46. url:'Useridconfirm/audit/id/{ids}?dialog=1',
  47. hidden:function(row){
  48. if(row.status == 0){
  49. return false;
  50. }
  51. return true;
  52. },
  53. target:'_self',
  54. }
  55. ],
  56. events: Table.api.events.operate, formatter: Table.api.formatter.operate}
  57. ]
  58. ]
  59. });
  60. // 为表格绑定事件
  61. Table.api.bindevent(table);
  62. },
  63. add: function () {
  64. Controller.api.bindevent();
  65. },
  66. edit: function () {
  67. Controller.api.bindevent();
  68. },
  69. audit: function () {
  70. Controller.api.bindevent();
  71. },
  72. api: {
  73. bindevent: function () {
  74. Form.api.bindevent($("form[role=form]"));
  75. }
  76. }
  77. };
  78. return Controller;
  79. });