123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596 |
- define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
- var Controller = {
- index: function () {
- // 初始化表格参数配置
- Table.api.init({
- extend: {
- index_url: 'useridconfirm/index' + location.search,
- add_url: 'useridconfirm/add',
- //edit_url: 'useridconfirm/edit',
- //del_url: 'useridconfirm/del',
- multi_url: 'useridconfirm/multi',
- import_url: 'useridconfirm/import',
- table: 'user_idconfirm',
- }
- });
- var table = $("#table");
- // 初始化表格
- table.bootstrapTable({
- url: $.fn.bootstrapTable.defaults.extend.index_url,
- pk: 'id',
- sortName: 'id',
- columns: [
- [
- {checkbox: true},
- {field: 'id', title: __('Id')},
- {field: 'user_id', title: __('User_id')},
- {field: 'user.username', title: __('User.username'), operate: 'LIKE'},
- {field: 'truename', title: __('Truename'), operate: 'LIKE'},
- {field: 'idcard', title: __('Idcard'), operate: 'LIKE'},
- {field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1'),"2":__('Status 2'),"3":__('Status 3')}, formatter: Table.api.formatter.status},
- {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- // {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
- {field: 'operate', title: __('Operate'), table: table,
- buttons:[
- {
- name:'audit',
- text:'取消实名',
- title:'取消实名',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-danger btn-ajax',
- url:'Useridconfirm/audit/id/{ids}/status/3',
- target:'_self',
- refresh:true,
- hidden:function($row){
- if($row.status == 1){
- return false;
- }
- return true;
- }
- },
- {
- name:'audit',
- text:'恢复实名',
- title:'恢复实名',
- icon:'fa fa-exclamation-circle',
- classname:'btn btn-xs btn-success btn-ajax',
- url:'Useridconfirm/audit/id/{ids}/status/1',
- target:'_self',
- refresh:true,
- hidden:function($row){
- if($row.status == 3){
- return false;
- }
- return true;
- }
- },
- ],
- events: Table.api.events.operate, formatter: Table.api.formatter.operate
- }
- ]
- ]
- });
- // 为表格绑定事件
- Table.api.bindevent(table);
- },
- add: function () {
- Controller.api.bindevent();
- },
- edit: function () {
- Controller.api.bindevent();
- },
- audit: function () {
- Controller.api.bindevent();
- },
- api: {
- bindevent: function () {
- Form.api.bindevent($("form[role=form]"));
- }
- }
- };
- return Controller;
- });
|