define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'user/authentication/education/index' + location.search, // add_url: 'user/authentication/education/add', // edit_url: 'user/authentication/education/edit', // del_url: 'user/authentication/education/del', multi_url: 'user/authentication/education/multi', import_url: 'user/authentication/education/import', table: 'education_authentication', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', fixedColumns: true, fixedRightNumber: 1, columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, {field: 'uid', title: __('Uid')}, {field: 'category.name', title: __('学历'), operate: 'LIKE'}, {field: 'school', title: __('School'), operate: 'LIKE'}, {field: 'authentication_method', title: __('Authentication_method'), operate: 'LIKE'}, {field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'audittime', title: __('Audittime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'refuse_cause', title: __('原因'), operate: 'LIKE'}, // {field: 'status', title: __('Status')}, { field: 'status', title: __('Status'), searchList: {"1": '通过', "2": '驳回',"0": '待审核'}, // custom: {"1": 'success', "2": 'danger'}, formatter: Table.api.formatter.status }, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, buttons:[ { name:'audit', text: '审核', classname: 'btn btn-xs btn-primary btn-dialog', icon: 'fa fa-list', url: 'user/authentication/education/audit', visible:function (row){ if(row.status == 0){ return true; } return false; } } ], formatter: Table.api.formatter.operate } ] ] }); // 为表格绑定事件 Table.api.bindevent(table); }, add: function () { Controller.api.bindevent(); }, audit: function () { Controller.api.bindevent(); }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); } } }; return Controller; });