define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) { var Controller = { index: function () { // 初始化表格参数配置 Table.api.init({ extend: { index_url: 'party/getvalue/index' + location.search, table: 'gift_user_party', } }); var table = $("#table"); // 初始化表格 table.bootstrapTable({ url: $.fn.bootstrapTable.defaults.extend.index_url, pk: 'id', sortName: 'id', columns: [ [ {checkbox: true}, {field: 'u_id', title: __('房主ID'),operate: false}, {field: 'party_id', title: __('Party_id')}, {field: 'party_name', title: __('派对名称')}, {field: 'live_type', title: __('个播组'),searchList:$.getJSON('party/livetype/source'), formatter: Table.api.formatter.normal}, {field: 'room_type', title: __('Room_type'), searchList: {"1":__('派对'),"2":__('个播')}, formatter: Table.api.formatter.normal}, {field: 'value', title: __('Value'),operate: false}, {field: 'createtime', title: __('时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime}, ] ] }); // 为表格绑定事件 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; });