define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'auth/operator/index', add_url: 'auth/operator/add', edit_url: 'auth/operator/edit', // del_url: 'auth/operator/del', // multi_url: 'auth/operator/multi', }, showToggle: false, showColumns: false, visible: false, commonSearch: true, showExport: false, searchFormVisible: true }); var table = $("#table"); // 初始化表格 // if(Config.admin.id==1){ table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, columns: [ [ // {field: 'state', checkbox: true, }, // {field: 'id', title: 'ID'}, {field: 'username', title: __('Username'), operate:"LIKE"}, {field: 'nickname', title: __('Nickname'), operate:"LIKE"}, // {field: 'groups_text', title: __('Group'), operate:false, formatter: Table.api.formatter.label}, {field: 'mobile', title: __('Mobile'),operate:false}, {field: 'remark', title: __('备注'),operate:false}, {field: 'status', title: __("Status"), formatter: function(val,row,index){return val=="normal"?"正常":'停用';},searchList:{"normal":__('正常'),"hidden":__('停用')}}, // {field: 'logintime', title: __('Login time'), formatter: Table.api.formatter.datetime}, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] }); // }else{ // table.bootstrapTable({ // url: $.fn.bootstrapTable.defaults.extend.index_url, // columns: [ // [ // {field: 'state', checkbox: true, }, // {field: 'id', title: 'ID'}, // {field: 'username', title: __('Username')}, // {field: 'nickname', title: __('Nickname')}, // // {field: 'groups_text', title: __('Group'), operate:false, formatter: Table.api.formatter.label}, // {field: 'email', title: __('Email')}, // {field: 'mobile', title: __('Mobile')}, // {field: 'status', title: __("Status"), formatter: Table.api.formatter.status}, // // {field: 'logintime', title: __('Login time'), formatter: Table.api.formatter.datetime} // ] // ] // }); // // } // 为表格绑定事件 Table.api.bindevent(table); }, add: function () { Form.api.bindevent($("form[role=form]")); }, edit: function () { Form.api.bindevent($("form[role=form]")); } }; return Controller; });