define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'user/user/index' + location.search, add_url: 'user/user/add', edit_url: 'user/user/edit', multi_url: 'user/user/multi', table: 'user', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, {field: 'nickname', title: __('Nickname'), operate: 'LIKE'}, {field: 'mobile', title: __('Mobile'), operate: 'LIKE'}, {field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image}, {field: 'gender', title: __('Gender'), searchList: {"1":__('Gender 1'),"-1":__('Gender -1'),"0":__('Gender 0')}, formatter: Table.api.formatter.normal}, {field: 'birthday', title: __('Birthday'), operate:'RANGE', addclass:'datetimerange', autocomplete:false}, {field: 'age', title: __('Age'), operate: 'LIKE'}, {field: 'province_name', title: __('Province_name'), operate: 'LIKE'}, {field: 'city_name', title: __('City_name'), operate: 'LIKE'}, {field: 'district_name', title: __('District_name'), operate: 'LIKE'}, {field: 'money', title: __('Money'), operate:'BETWEEN'}, {field: 'frozen', title: __('Frozen'), operate:'BETWEEN'}, {field: 'diamond', title: __('钻石余额'), operate:'BETWEEN'}, {field: 'constellation', title: __('Constellation'), operate: 'LIKE'}, {field: 'profession', title: __('Profession'), operate: 'LIKE'}, {field: 'wechat', title: __('Wechat'), operate: 'LIKE'}, {field: 'is_auth', title: __('Is_auth'), searchList: {"0":__('未申请'), "1":__('待审核'), "2": "通过","-1": "未通过"}, formatter: Table.api.formatter.normal, custom: {"2": 'success', '1': 'info', '-1': 'danger'} }, {field: 'is_auth_person', title: __('是否真人认证'), searchList: {"2": "通过", "1":__('待审核'),"0":__('未申请'), "-1": "未通过"}, formatter: Table.api.formatter.normal, custom: {"2": 'success', '1': 'info', '-1': 'danger'} }, {field: 'is_goddess', title: __('Is_goddess'), searchList: {"1":__('Is_goddess 1'),"0":__('Is_goddess 0')}, formatter: Table.api.formatter.normal}, {field: 'vip_duetime', title: __('Vip_duetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'income', title: __('Income'), operate: 'LIKE'}, {field: 'recharge_auth', title: __('Recharge_auth'), searchList: {"1":__('Recharge_auth 1'),"0":__('Recharge_auth 0')}, formatter: Table.api.formatter.normal}, {field: 'invite_no', title: __('Invite_no'), operate: 'LIKE'}, {field: 'pre_user_id', title: __('Pre_user_id')}, {field: 'copy_mobile', title: __('是否允许复制手机号'), searchList: {"1":__('允许'),"2":__('不允许')}, formatter: Table.api.formatter.normal, custom: {"1": 'success', "2": 'gray'} }, {field: 'declaration', title: __('Declaration'), operate: 'LIKE'}, {field: 'logintime', title: __('Logintime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, {field: 'status', title: __('Status'), operate: 'LIKE', searchList: {"normal":__('正常'),"hidden":__('隐藏'), "logout":"注销"}, formatter: Table.api.formatter.normal}, {field: 'online', title: __('是否在线'), operate: false, searchList: {"1":__('在线'),"0":__('离线')}, formatter: Table.api.formatter.normal}, {field: 'active', title: __('是否活跃'), operate: false, searchList: {"1":__('活跃'),"0":__('不活跃')}, formatter: Table.api.formatter.normal}, {field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate} ] ] }); // 为表格绑定事件 Table.api.bindevent(table); }, add: function () { Controller.api.bindevent(); }, edit: function () { Controller.api.bindevent(); }, api: { bindevent: function () { Form.api.bindevent($("form[role=form]")); } } }; return Controller; });