define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'csminvite/notify/index' + location.search, add_url: 'csminvite/notify/add', edit_url: 'csminvite/notify/edit', del_url: 'csminvite/notify/del', multi_url: 'csminvite/notify/multi', table: 'csminvite_notify', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true}, {field: 'id', title: __('Id')}, // {field: 'notifyway', title: __('Notifyway'), searchList: {"mobile":__('Notifyway mobile'),"email":__('Notifyway email')}, formatter: Table.api.formatter.normal}, {field: 'name', title: __('Name')}, {field: 'emailtitle', title: __('Emailtitle')}, {field: 'effectbegintime', title: __('Effectbegintime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, {field: 'effectendtime', title: __('Effectendtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, {field: 'status', title: __('Status'), searchList: {"normal":__('Normal'),"hidden":__('Hidden')}, formatter: Table.api.formatter.status}, // {field: 'invitekey', title: __('Invitekey')}, // {field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, // {field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime}, // {field: 'b1', title: __('B1')}, // {field: 'b2', title: __('B2')}, // {field: 'b3', title: __('B3')}, // {field: 'b4', title: __('B4')}, // {field: 'b5', title: __('B5')}, // {field: 'b6', title: __('B6')}, // {field: 'b7', title: __('B7')}, // {field: 'b8', title: __('B8')}, // {field: 'b9', title: __('B9')}, { field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate, //formatter: Table.api.formatter.buttons, buttons: [ { name: 'confinfos', text: __('邀请人列表'), classname: 'btn btn-xs btn-success btn-click', icon: 'fa fa-file', click: function (res, row) { window.open("../csminvite/notifyuser?parentid=" + row.id); }, }, { name: 'confusers', text: __('发送邀请邮件'), classname: 'btn btn-xs btn-danger btn-ajax', icon: 'fa fa-file', url: 'csminvite/notify/notifyUserajax?ids={ids}', refresh: true, visible: function (row) { return true; zzzzzzzzd } } ] } ] ] }); // 为表格绑定事件 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; });